Ingredient Prediction via Context Learning Network With Class-Adaptive Asymmetric Loss

Mengjiang Luoa,b, Weiqing Mina,b, Zhiling Wanga,b, Jiajun Songa,b, Shuqiang Jianga,b

aThe Key Laboratory of Intelligent Information Processing, Institute of Computing Technology, Chinese Academy of Sciences

bUniversity of Chinese Academy of Sciences

Food ingredient prediction model CACLNet explores the method to reduce the negative impact of complex background in food images and construct internal spatial connections among ingredient regions of food objects. Besides, it solves the imbalance of different classes among ingredients. Extensive evaluation on two popular benchmark datasets (Vireo Food-172, UEC Food- 100) demonstrates the effectiveness of the proposed method.

Download

The following files are provided:

|-CACLNet
  |---datasets
      |---dataset.py
  |---losses
      |---CAAL.py
  |---models
      |---pretrained
          |---resnet50-19c8e357.pth
          |---resnet101-5d3b4d8f.pth
  |---networks
          |---coord_predict.py
          |---icl_module.py
          |---model_twobranch_CL.py
          |---resnet.py 
  |---utils
          |---apmeter.py
          |---auto_load_resume.py
          |---calcoord.py
          |---eval_model.py
          |---read_dataset.py
          |---train_model.py
  |---config.py
  |---train.py
          

To download all files as a zip package, click here.

Usage

Train and Test

Firstly, you need to change the default config in config.py

setting = 'food172' # for Vireo Food-172

setting = 'UECFOOD100' # for UEC Food-100

Secondly, you can run with:

CUDA_VISIBLE_DEVICES=0,1 python train.py

Config dataset

Due to copyright issues, please go to the official website to download the dataset.

Reference

If you would like to use our paper, please cite it:

  @ARTICLE{10268369,
    author={Luo, Mengjiang and Min, Weiqing and Wang, Zhiling and Song, Jiajun and Jiang, Shuqiang},
    journal={IEEE Transactions on Image Processing}, 
    title={Ingredient Prediction via Context Learning Network With Class-Adaptive Asymmetric Loss}, 
    year={2023},
    volume={32},
    number={},
    pages={5509-5523},
    doi={10.1109/TIP.2023.3318958}
  }