LLMs-based Augmentation for Domain Adaptation in Long-tailed Food Datasets
Qing Wang, Chong-Wah Ngo, Ee-Peng Lim, Qianru Sun
TL;DR
We address domain shift, long-tailed distributions, and fine-grained distinctions in real-world food recognition by using large language models to generate title and ingredient texts for food images. These texts are embedded alongside visual features in a shared space via a ResNet-50 image encoder and a hierarchical Transformer text encoder, trained with a cross-modal alignment loss and a calibration-based loss to handle imbalance. The approach yields state-of-the-art performance on two imbalanced, cross-domain Food datasets, with notable gains for tail and fine-grained classes, and demonstrates robustness to different LLMs for text generation. The method offers a simple, scalable cross-modal augmentation that leverages semantic cues from generated text to bridge domain gaps and improve recognition in real-world dietary assessment scenarios.
Abstract
Training a model for food recognition is challenging because the training samples, which are typically crawled from the Internet, are visually different from the pictures captured by users in the free-living environment. In addition to this domain-shift problem, the real-world food datasets tend to be long-tailed distributed and some dishes of different categories exhibit subtle variations that are difficult to distinguish visually. In this paper, we present a framework empowered with large language models (LLMs) to address these challenges in food recognition. We first leverage LLMs to parse food images to generate food titles and ingredients. Then, we project the generated texts and food images from different domains to a shared embedding space to maximize the pair similarities. Finally, we take the aligned features of both modalities for recognition. With this simple framework, we show that our proposed approach can outperform the existing approaches tailored for long-tailed data distribution, domain adaptation, and fine-grained classification, respectively, on two food datasets.
