Nutrition Estimation for Dietary Management: A Transformer Approach with Depth Sensing

Zhengyi Kwan, Wei Zhang, Zhengkui Wang, Aik Beng Ng, Simon See · DOI

TL;DR

This paper introduces NuNet, a novel transformer-based deep learning model that leverages both RGB and depth information from food images to estimate nutritional content. By employing a multi-scale architecture and sophisticated feature fusion techniques, NuNet achieves state-of-the-art accuracy in nutrition estimation, offering a more precise and efficient solution for dietary management.

What Problem Does This Paper Address?

Accurate dietary management is essential for maintaining overall health and preventing chronic diseases. A key component of this is nutrition estimation – determining the caloric and macronutrient content of food. Traditional methods, such as food comparison tables or manual measurements, are often inaccurate, subjective, and time-consuming. While image-based approaches using RGB data have emerged, they still face limitations in accuracy and can struggle with complex food scenes. This paper addresses the need for a more robust, accurate, and automated system for nutrition estimation by integrating depth information with advanced deep learning architectures.

Methods

The core of NuNet is a transformer-based architecture designed to process both RGB and depth data simultaneously. Key components include:

  • Multi-Scale Encoder: This encoder uses two parallel Swin Transformer blocks, one for RGB and one for depth, operating at multiple scales. This allows for capturing both local and global features from each modality.
  • Feature Fusion Modules: Two novel fusion modules are introduced:
  • Lightweight Fusion (FL): A simple yet effective module that combines RGB and depth features at each encoder scale using addition and a window-based multi-head self-attention (W-MSA) mechanism.
  • Enhanced Fusion (FE): A more complex module applied at the final encoder scale. It employs three parallel paths (concatenation, multiplication, and addition) that leverage cross-attention mechanisms (W-MSA and SW-MSA) to deeply integrate RGB and depth features before a final MLP fusion.
  • Multi-Scale Decoder: This decoder aligns with the multi-scale encoder, incorporating "deep supervision" principles. It uses a U-Net-like structure and combines features from different scales to refine the final nutrition estimation. The decoder's output is a weighted sum of estimations from multiple scales, with the FE-based scale being the most dominant.

The model is trained using a modified Mean Absolute Percentage Error (MAPE) loss function, which accounts for varying magnitudes of nutritional factors.

Datasets

The primary dataset used in this research is Nutrition5k. This dataset provides approximately 3.5 thousand food samples, each with corresponding RGB and depth images, along with ground-truth values for five nutritional factors: calories, mass, fat, carbohydrates, and protein. The authors followed the training and testing splits specified in previous work [9] and performed data augmentation to enhance diversity.

Key Insights and Ideas

  • Depth Data is Crucial: The paper strongly demonstrates that incorporating depth information significantly improves nutrition estimation accuracy, outperforming RGB-only models. Depth provides essential spatial and structural cues that RGB alone cannot capture.
  • Transformer Architecture's Power: The use of Swin Transformers, with their window-based self-attention, proves effective for processing both RGB and depth modalities, capturing complex spatial relationships.
  • Multi-Scale Processing is Key: Both the multi-scale encoder and decoder contribute significantly to the model's performance. The decoder's multi-scale nature allows for progressive refinement of estimates, with earlier scales providing dominant estimates and later scales acting as calibrators.
  • Feature Fusion Matters: The proposed FL and FE modules are critical for effectively merging RGB and depth features. FE, with its diverse fusion paths and cross-attention, is particularly effective at the final stages of feature extraction.
  • Attention Mechanisms are Vital: The paper highlights the importance of attention mechanisms (W-MSA, SW-MSA) within the fusion modules for selectively focusing on relevant information from both RGB and depth streams.

Key Results

NuNet achieved a state-of-the-art error rate of 15.65% MAPE for nutrition estimation, outperforming all compared models, including those using RGB-only or RGB-D with different architectures.

  • NuNet outperformed its variants and existing solutions significantly.
  • The model achieved the lowest MAPE for calorie, mass, and carbs, and was the second-best for fat and protein.
  • Using both RGB and depth features provided an 11% average error rate improvement compared to a SwinT model using only RGB.
  • The FE module, particularly its concatenation path, was shown to be highly effective.
  • The multi-scale decoder significantly improved performance compared to single-scale implementations.

Limitations and Future Work

  • Computational Cost: While the paper emphasizes balancing efficiency and effectiveness, the FE module, with its multiple attention mechanisms and MLP, is more computationally intensive than FL.
  • Data Augmentation: While data augmentation was used, the paper doesn't extensively discuss the impact of specific augmentation techniques on the final performance.
  • Generalizability: The study focuses on food images. Future work could explore the model's applicability to other domains requiring multi-modal feature fusion and estimation.
  • Further Optimization: The authors suggest that further research could explore more advanced fusion strategies and attention mechanisms to potentially improve performance even further. The paper also hints at potential applications beyond dietary management, such as smart manufacturing and building management, suggesting avenues for future exploration.

Summary updated

Abstract

Nutrition estimation is crucial for effective dietary management and overall health and well-being. Existing methods often struggle with sub-optimal accuracy and can be time-consuming. In this paper, we propose NuNet, a transformer-based network designed for nutrition estimation that utilizes both RGB and depth information from food images. We have designed and implemented a multi-scale encoder and decoder, along with two types of feature fusion modules, specialized for estimating five nutritional factors. These modules effectively balance the efficiency and effectiveness of feature extraction with flexible usage of our customized attention mechanisms and fusion strategies. Our experimental study shows that NuNet outperforms its variants and existing solutions significantly for nutrition estimation. It achieves an error rate of 15.65%, the lowest known to us, largely due to our multi-scale architecture and fusion modules. This research holds practical values for dietary management with huge potential for transnational research and deployment and could inspire other applications involving multiple data types with varying degrees of importance.
BibTeX
@article{kwan2025nutrition,
  author = {Zhengyi Kwan and Wei Zhang and Zhengkui Wang and Aik Beng Ng and Simon See},
  title = {{Nutrition Estimation for Dietary Management: A Transformer Approach with Depth Sensing}},
  journal = {IEEE Trans. Multimedia},
  year = {2025},
  doi = {10.1109/tmm.2025.3565966},
}
Figure