CTNet: learning local details and global context for food recognition
摘要
Food is an important part of daily life, and eating habits have a direct impact on health. Accurate food image recognition can help individuals develop healthier eating behaviors. yet most existing methods rely either on convolutional neural networks, which excel at capturing fine local details, or on Transformers, which are stronger at modeling global context; using only one of them often misses complementary cues. To address this, we propose Convolution Transformer Integration Network (CTNet), a hybrid architecture that couples a residual CNN branch for local detail mining with a Transformer branch for global dependency modeling. Specifically, CTNet adopts the fusion of sparse attention (global) and CNN(local). In the global branch, Due to the large number of tokens in the feature maps extracted by convolution, using standard self-attention would result in a significant amount of computation. Therefore, a sparse self-attention scheme is adopted to concentrate computation on category-relevant regions and suppress distracting interactions. In the local branch, the classic residual convolution architecture is applied. Features from the two branches are fused to form the final representation for food recognition. Experiments on ETH Food-101 and Vireo Food-172 show that CTNet achieves 88.50% Top-1/97.70% Top-5 on Food-101 and 89.90% Top-1/98.28% Top-5 on Vireo Food-172, demonstrating its effectiveness. The source code is available at: https://github.com/123clown/CTNet