Fraesormer: Learning Adaptive Sparse Transformer for Efficient Food Recognition

Shun Zou, Yi Zou, Mingya Zhang, Shipeng Luo, Zhihao Chen, Guangwei Gao

Introduction

Food recognition presents a unique challenge for computer vision due to the "unstructured" nature of food items. Unlike rigid objects, ingredients in a dish can be arranged randomly, and visual appearance varies significantly based on preparation methods. While Vision Transformers (ViTs) excel at capturing global context, their quadratic computational complexity and static representations often make them unsuitable for resource-constrained edge devices.

Proposed Method: Fraesormer

To address these limitations, we introduce Fraesormer, a lightweight Transformer architecture optimized for food recognition. Fraesormer incorporates two primary innovations:

  1. Adaptive Top-k Sparse Partial Attention (ATK-SPA): This module utilizes a Gated Dynamic Top-K Operator (GDTKO) to learn which attention scores are most influential for a given input. By filtering out redundant background noise and focusing on the most relevant tokens, the model achieves significant computational savings without sacrificing accuracy.
  2. Hierarchical Scale-Sensitive Feature Gating Network (HSSFGN): Replacing the standard Feed-Forward Network, this component uses a multi-scale gating mechanism with depth-wise convolutions of varying sizes (1x1 to 7x7). This allows the model to capture both fine-grained ingredient details and broader dish context simultaneously.
Attention heatmaps showing Fraesormer's focus on salient food features.

The architecture follows a four-stage hierarchical design, enabling efficient scaling from "Tiny" to "Large" variants.

Experimental Evaluation

Fraesormer was evaluated on four major food recognition benchmarks: ETHZ Food-101, Vireo Food-172, UEC Food-256, and SuShi-50. To ensure a fair assessment of architectural performance, all models were trained from scratch without external pre-training.

Key Results and Efficiency

Fraesormer demonstrates a superior balance between accuracy and efficiency, often referred to as the "Heptagon Warrior" due to its performance across seven key axes: accuracy on four datasets, average accuracy, parameter count, and computational cost (GMACs).

Radar plot comparing Fraesormer with other lightweight models.

Key performance highlights include:

  • Fraesormer-Tiny (2.56M parameters): Achieved a 76.74% average accuracy, outperforming EfficientFormerV2-S0 by 6.83% while utilizing 29% fewer parameters.
  • Computational Efficiency: Compared to MobileOne-S0, Fraesormer-Tiny improved accuracy by 9.54% while reducing GMACs by 62%.
  • Scalability: The "Large" variant (10.39M parameters) reached 85.46% Top-1 accuracy on ETHZ Food-101, surpassing significantly larger models like FasterNet-S.

Conclusion

Fraesormer represents a significant step forward in efficient food recognition. By combining adaptive sparsity with multi-scale feature gating, it provides a robust solution for mobile and edge-based dietary assessment. Future work will explore extending this adaptive logic to multi-modal tasks and 3D food volume estimation.

Summary updated

BibTeX
@inproceedings{zou2025fraesormer,
  author = {Shun Zou and Yi Zou and Mingya Zhang and Shipeng Luo and Zhihao Chen and Guangwei Gao},
  title = {{Fraesormer: Learning Adaptive Sparse Transformer for Efficient Food Recognition}},
  booktitle = {ICME},
  year = {2025},
  doi = {10.1109/icme59968.2025.11209119},
}
Figure