Bytes Are All You Need: Transformers Operating Directly On File Bytes

05/31/2023
by   Maxwell Horton, et al.
0

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.

READ FULL TEXT

page 2

page 4

page 6

page 7

page 8

research
04/16/2022

Privacy-Preserving Image Classification Using Isotropic Network

In this paper, we propose a privacy-preserving image classification meth...
research
05/24/2022

Privacy-Preserving Image Classification Using Vision Transformer

In this paper, we propose a privacy-preserving image classification meth...
research
09/15/2023

Privacy-preserving Early Detection of Epileptic Seizures in Videos

In this work, we contribute towards the development of video-based epile...
research
08/12/2022

On deceiving malware classification with section injection

We investigate how to modify executable files to deceive malware classif...
research
07/03/2022

You Only Need One Detector: Unified Object Detector for Different Modalities based on Vision Transformers

Most systems use different models for different modalities, such as one ...
research
10/06/2020

InstaHide: Instance-hiding Schemes for Private Distributed Learning

How can multiple distributed entities collaboratively train a shared dee...

Please sign up or login with your details

Forgot password? Click here to reset