바이트만으로 충분하다: 파일 바이트에서 직접 작동하는 트랜스포머
Bytes Are All You Need: Transformers Operating Directly On File Bytes
May 31, 2023
저자: Maxwell Horton, Sachin Mehta, Ali Farhadi, Mohammad Rastegari
cs.AI
초록
현대의 딥러닝 접근 방식은 일반적으로 입력을 특정 모달리티에 맞는 형태로 변환합니다. 예를 들어, 이미지 분류를 위한 가장 일반적인 딥러닝 접근 방식은 이미지 파일 바이트를 RGB 텐서로 디코딩한 후 이를 신경망에 전달하는 것입니다. 대신, 우리는 추론 시점에 파일을 디코딩할 필요 없이 파일 바이트에서 직접 분류를 수행하는 방법을 연구합니다. 파일 바이트를 모델 입력으로 사용하면 여러 입력 모달리티에서 작동할 수 있는 모델을 개발할 수 있습니다. 우리의 모델인 ByteFormer는 DeiT-Ti와 유사한 구성의 트랜스포머 백본을 사용하여 TIFF 파일 바이트에서 직접 학습하고 테스트할 때 ImageNet Top-1 분류 정확도 77.33%를 달성했습니다(RGB 이미지에서 작동할 때의 정확도는 72.2%). 수정이나 하이퍼파라미터 튜닝 없이도, ByteFormer는 Speech Commands v2 데이터셋의 WAV 파일에서 작동할 때 95.42%의 분류 정확도를 달성했습니다(최신 기술의 정확도 98.7%와 비교). 또한, ByteFormer가 프라이버시 보호 추론에 응용될 수 있음을 보여줍니다. ByteFormer는 특정한 난독화된 입력 표현에서도 정확도 손실 없이 추론을 수행할 수 있습니다. 또한, ByteFormer가 전체 이미지를 형성하지 않고 90%의 픽셀 채널을 지속적으로 마스킹하는 가상의 프라이버시 보호 카메라에서도 추론을 수행할 수 있음을 보여주며, 이 경우에도 ImageNet에서 71.35%의 정확도를 달성했습니다. 우리의 코드는 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.