Bytes Zijn Alles Wat Je Nodig Hebt: Transformers Die Rechtstreeks Op Bestandsbytes Werken
Bytes Are All You Need: Transformers Operating Directly On File Bytes
May 31, 2023
Auteurs: Maxwell Horton, Sachin Mehta, Ali Farhadi, Mohammad Rastegari
cs.AI
Samenvatting
Moderne deep learning-benaderingen transformeren invoergegevens meestal in een modaliteitsspecifieke vorm. De meest gebruikelijke deep learning-benadering voor beeldclassificatie decodeert bijvoorbeeld beeldbestandsbytes naar een RGB-tensor die vervolgens in een neuraal netwerk wordt ingevoerd. In plaats daarvan onderzoeken wij het uitvoeren van classificatie direct op bestandsbytes, zonder de noodzaak om bestanden te decoderen tijdens de inferentiefase. Het gebruik van bestandsbytes als modelinvoer maakt de ontwikkeling van modellen mogelijk die op meerdere invoermodaliteiten kunnen werken. Ons model, ByteFormer, behaalt een ImageNet Top-1 classificatie-accuraatheid van 77,33% wanneer het direct op TIFF-bestandsbytes wordt getraind en getest met een transformer-backbone met een configuratie vergelijkbaar met DeiT-Ti (72,2% accuraatheid bij gebruik van RGB-beelden). Zonder aanpassingen of hyperparameterafstemming behaalt ByteFormer een classificatie-accuraatheid van 95,42% bij het werken met WAV-bestanden uit de Speech Commands v2-dataset (vergeleken met de state-of-the-art accuraatheid van 98,7%). Daarnaast tonen wij aan dat ByteFormer toepassingen heeft in privacy-beschermende inferentie. ByteFormer is in staat om inferentie uit te voeren op bepaalde versluierde invoerrepresentaties zonder verlies van accuraatheid. Wij demonstreren ook de mogelijkheid van ByteFormer om inferentie uit te voeren met een hypothetische privacy-beschermende camera die het vormen van volledige beelden vermijdt door consequent 90% van de pixelkanalen te maskeren, terwijl nog steeds een accuraatheid van 71,35% op ImageNet wordt behaald. Onze code zal beschikbaar worden gesteld op https://github.com/apple/ml-cvnets/tree/main/examples/byteformer.
English
Modern deep learning approaches usually transform inputs into a
modality-specific form. For example, the most common deep learning approach to
image classification involves decoding image file bytes into an RGB tensor
which is passed into a neural network. Instead, we investigate performing
classification directly on file bytes, without the need for decoding files at
inference time. Using file bytes as model inputs enables the development of
models which can operate on multiple input modalities. Our model,
ByteFormer, achieves an ImageNet Top-1 classification accuracy of
77.33% when training and testing directly on TIFF file bytes using a
transformer backbone with configuration similar to DeiT-Ti (72.2% accuracy
when operating on RGB images). Without modifications or hyperparameter tuning,
ByteFormer achieves 95.42% classification accuracy when operating on WAV
files from the Speech Commands v2 dataset (compared to state-of-the-art
accuracy of 98.7%). Additionally, we demonstrate that ByteFormer has
applications in privacy-preserving inference. ByteFormer is capable of
performing inference on particular obfuscated input representations with no
loss of accuracy. We also demonstrate ByteFormer's ability to perform inference
with a hypothetical privacy-preserving camera which avoids forming full images
by consistently masking 90% of pixel channels, while still achieving
71.35% accuracy on ImageNet. Our code will be made available at
https://github.com/apple/ml-cvnets/tree/main/examples/byteformer.