Research on an Intelligent Grading Method for Beef Freshness in Complex Backgrounds Based on the DEVA-ConvNeXt Model
Abstract
1. Introduction
2. Data Acquisition and Dataset Construction
2.1. Image Collection
2.2. Determination of TVB-N Content
2.3. Dataset Construction
2.3.1. Dataset Splitting
2.3.2. Enhanced Dataset with Background Replacement Based on ABG-Shift Technology
| Algorithm 1 Alpha-Background Generation Shift |
| 1: Input: Foreground image , mask generated by rembg, Background pool , Number of synthetic samples |
| 2: Output:Synthetic set {,…, } |
| 3: for = 1 to do |
| 4: ← Rembg () |
| 5: select background ~ |
| 6: resize to match |
| 7: apply random scale/rotation/flip on |
| 8: ← ReinhardColorTransfer () |
| 9: use alpha mask to blend with |
| 10: = AlphaBlending () |
| 11: ← RandomJPEG () |
| 12: apply random Gaussian/uniform noise 13: save metadata: |
| 14: {fg_id, bg_id, transforms, seed} |
| 15: end for |
| 16: return {,…, } |
3. Construction of Beef Freshness Grading Model Based on DEVA-ConvNeXt
3.1. ConvNeXt Model
3.2. DNLC Attention Mechanism
3.3. Enhanced Depthwise Convolution Module
3.4. Varifocal Loss
4. Experiments and Results Analysis
4.1. Experimental Setup and Evaluation Metrics
4.1.1. Experimental Setup
4.1.2. Model Evaluation Metrics
4.2. Performance Analysis of DNLC Attention Mechanism
4.3. Ablation Study for Evaluating Model Performance
4.4. Performance Comparison and Analysis of Different Models
4.5. Visualization Performance Comparison of the DEVA-ConvNeXt Model
4.6. Generalization Performance Evaluation
4.7. Performance Evaluation of the DEVA-ConvNeXt Model on Real Embedded Devices
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Khalid, W.; Maggiolino, A.; Kour, J.; Arshad, M.S.; Aslam, N.; Afzal, M.F.; Meghwar, P.; Zafar, K.-u.-W.; De Palo, P.; Korma, S.A. Dynamic alterations in protein, sensory, chemical, and oxidative properties occurring in meat during thermal and non-thermal processing techniques: A comprehensive review. Front. Nutr. 2023, 9, 1057457. [Google Scholar] [CrossRef] [PubMed]
- Bekhit, A.E.-D.A.; Holman, B.W.; Giteru, S.G.; Hopkins, D.L. Total volatile basic nitrogen (TVB-N) and its role in meat spoilage: A review. Trends Food Sci. Technol. 2021, 109, 280–302. [Google Scholar] [CrossRef]
- Wang, B.; Yang, H.; Yang, C.; Lu, F.; Wang, X.; Liu, D. Prediction of total volatile basic nitrogen (TVB-N) and 2-thiobarbituric acid (TBA) of smoked chicken thighs using computer vision during storage at 4 °C. Comput. Electron. Agric. 2022, 199, 107170. [Google Scholar] [CrossRef]
- Zuo, J.; Peng, Y.; Li, Y.; Yin, T.; Chao, K. Nondestructive intelligent detection of total viable count in pork based on miniaturized spectral sensor. Food Res. Int. 2024, 197, 115184. [Google Scholar] [CrossRef] [PubMed]
- Shtepliuk, I.; Domènech-Gil, G.; Almqvist, V.; Kautto, A.H.; Vågsholm, I.; Boqvist, S.; Eriksson, J.; Puglisi, D. Electronic nose and machine learning for modern meat inspection. J. Big Data 2025, 12, 96. [Google Scholar] [CrossRef]
- Jia, W.; Lv, H.; Liu, Y.; Zhou, W.; Qin, Y.; Ma, J. Automated detection of stale beef from electronic nose data. Food Sci. Nutr. 2024, 12, 9856–9865. [Google Scholar] [CrossRef] [PubMed]
- Shin, S.; Lee, Y.; Kim, S.; Choi, S.; Kim, J.G.; Lee, K. Rapid and non-destructive spectroscopic method for classifying beef freshness using a deep spectral network fused with myoglobin information. Food Chem. 2021, 352, 129329. [Google Scholar] [CrossRef] [PubMed]
- Arias, E.; Sierra, V.; Prado, N.; González, P.; Fiorentini, G.; Díaz, J.; Oliván, M. Development of a portable near-infrared spectroscopy tool for detecting freshness of commercial packaged pork. Foods 2022, 11, 3808. [Google Scholar] [CrossRef] [PubMed]
- Elangovan, P.; Dhurairajan, V.; Nath, M.K.; Yogarajah, P.; Condell, J. A novel approach for meat quality assessment using an ensemble of compact convolutional neural networks. Appl. Sci. 2024, 14, 5979. [Google Scholar] [CrossRef]
- Huang, H.; Zhan, W.; Du, Z.; Hong, S.; Dong, T.; She, J.; Min, C. Pork primal cuts recognition method via computer vision. Meat Sci. 2022, 192, 108898. [Google Scholar] [CrossRef] [PubMed]
- Song, S.; Guo, Q.; Duan, X.; Shi, X.; Liu, Z. Research on Pork Cut and Freshness Determination Method Based on Computer Vision. Foods 2024, 13, 3986. [Google Scholar] [CrossRef] [PubMed]
- Liu, C.; Zhang, J.; Chen, K.; Huang, J. BBSNet: An Intelligent Grading Method for Pork Freshness Based on Few-Shot Learning. Foods 2025, 14, 2480. [Google Scholar] [CrossRef] [PubMed]
- Syaukani, I.; Muji, S.Z.B.M.; Kan, C.U.E. Classification of Beef and Pork Using a Hybrid Model of ResNet-50 and Support Vector Machine (SVM). J. Sci. Technol. Innov. 2025, 4, 65–70. [Google Scholar] [CrossRef]
- Xi, R.; Lyu, X.; Yang, J.; Lu, P.; Duan, X.; Hopkins, D.L.; Zhang, Y. Non-Destructive and Real-Time Discrimination of Normal and Frozen-Thawed Beef Based on a Novel Deep Learning Model. Foods 2025, 14, 3344. [Google Scholar] [CrossRef] [PubMed]
- Singh, R.; Nickhil, C.; Nisha, R.; Upendar, K.; Jithender, B.; Deka, S.C. A comprehensive review of advanced deep learning approaches for food freshness detection. Food Eng. Rev. 2025, 17, 127–160. [Google Scholar] [CrossRef]
- Niu, L.; Cong, W.; Liu, L.; Hong, Y.; Zhang, B.; Liang, J.; Zhang, L. Making images real again: A comprehensive survey on deep image composition. arXiv 2021, arXiv:2106.14490. [Google Scholar]
- Gat, N.; Subramanian, S.; Barhen, J.; Toomarian, N. Spectral imaging applications: Remote sensing, environmental monitoring, medicine, military operations, factory automation, and manufacturing. In Proceedings of the 25th AIPR Workshop: Emerging Applications of Computer Vision, Washington, DC, USA, 16–18 October 1996; pp. 63–77. [Google Scholar]
- Holman, B.W.; Bekhit, A.E.-D.A.; Waller, M.; Bailes, K.L.; Kerr, M.J.; Hopkins, D.L. The association between total volatile basic nitrogen (TVB-N) concentration and other biomarkers of quality and spoilage for vacuum packaged beef. Meat Sci. 2021, 179, 108551. [Google Scholar] [CrossRef] [PubMed]
- GB 2707-2016; National Food Safety Standard for Fresh (Frozen) Meat and Poultry Products. China Standard Press: Beijing, China, 2016.
- GB 5009.228-2016; Determination of Total Volatile Basic Nitrogen in Foods. China Standard Press: Beijing, China, 2016.
- Tew, Y.; Lee, W.Y.; Tam, G.M. Parallel Computing Using CUDA and MultiThreading in Background Removal Process. In Proceedings of the 2024 3rd International Conference on Digital Transformation and Applications (ICDXA), Kuala Lumpur, Malaysia, 29–30 January 2024; pp. 237–242. [Google Scholar]
- Liu, Z.; Mao, H.; Wu, C.-Y.; Feichtenhofer, C.; Darrell, T.; Xie, S. A convnet for the 2020s. In Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 11976–11986. [Google Scholar]
- Zhang, H.; Wang, Y.; Dayoub, F.; Sunderhauf, N. Varifocalnet: An IoU-aware dense object detector. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 8514–8523. [Google Scholar]
- Mao, A.; Mohri, M.; Zhong, Y. Cross-entropy loss functions: Theoretical analysis and applications. In Proceedings of the 40th International Conference on Machine Learning, Honolulu, HI, USA, 23–29 July 2023; pp. 23803–23828. [Google Scholar]
- Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the 2021 IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 10–17 October 2021; pp. 10012–10022. [Google Scholar]
- Chollet, F. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 1251–1258. [Google Scholar]
- GB/T 29392-2022; Grading of Livestock and Poultry Meat Quality. China Standard Press: Beijing, China, 2022.
- Hua, B.-S.; Tran, M.-K.; Yeung, S.-K. Pointwise convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 984–993. [Google Scholar]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 7132–7141. [Google Scholar]
- Yang, L.; Zhang, R.-Y.; Li, L.; Xie, X. SimAM: A simple, parameter-free attention module for convolutional neural networks. In Proceedings of the International Conference on Machine Learning, Vienna, Austria, 18–24 July 2021; pp. 11863–11874. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. CBAM: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Hou, Q.; Zhou, D.; Feng, J. Coordinate attention for efficient mobile network design. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 13713–13722. [Google Scholar]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. Imagenet classification with deep convolutional neural networks. Neural Inf. Process. Syst. 2012, 25, 1097–1105. [Google Scholar] [CrossRef]
- Koonce, B. ResNet 50. In Convolutional Neural Networks with Swift for Tensorflow: Image Recognition and Dataset Categorization; Springer: Berlin/Heidelberg, Germany, 2021; pp. 63–72. [Google Scholar]
- Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V.; Rabinovich, A. Going deeper with convolutions. In Proceedings of the 2015 IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 1–9. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.-C. MobileNetV2: Inverted residuals and linear bottlenecks. In Proceedings of the 2018 IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 4510–4520. [Google Scholar]
- Howard, A.; Sandler, M.; Chu, G.; Chen, L.-C.; Chen, B.; Tan, M.; Wang, W.; Zhu, Y.; Pang, R.; Vasudevan, V. Searching for MobileNetV3. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1314–1324. [Google Scholar]
- Tan, M.; Le, Q. EfficientNet: Rethinking model scaling for convolutional neural networks. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; pp. 6105–6114. [Google Scholar]
- Tan, M.; Le, Q. EfficientNetV2: Smaller models and faster training. In Proceedings of the 38th International Conference on Machine Learning, Virtual, 18–24 July 2021; pp. 10096–10106. [Google Scholar]
- Ma, N.; Zhang, X.; Zheng, H.-T.; Sun, J. ShuffleNet V2: Practical guidelines for efficient CNN architecture design. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 116–131. [Google Scholar]

















| Meat Freshness Grading | Volatile Basic Nitrogen Content (mg/100 g) |
|---|---|
| Grade 1 Freshness (Fresh) | ≤15 |
| Grade 2 Freshness (Slightly Fresh) | 15–25 |
| Spoiled | ≥25 |
| Freshness Grade | Days | Quantity |
|---|---|---|
| Extremely fresh | 0 | 109 |
| Fresh | 1 | 123 |
| 2 | 120 | |
| Slightly fresh | 3 | 137 |
| 4 | 129 | |
| Spoiled | 5 | 118 |
| 6 | 125 | |
| 7 | 130 | |
| 8 | 110 | |
| 9 | 99 |
| Parameter | Value |
|---|---|
| Epochs | 200 |
| Batch size | 8 |
| Image size | 224 × 224 |
| Optimizer algorithm | Adam |
| Learning rate | 0.0006 |
| Weight decay | 0.01 |
| Model | Accuracy (%) | Precision (%) | Recall (%) | F1 Score (%) |
|---|---|---|---|---|
| SE | 89.6 | 90.7 | 89.2 | 89.9 |
| SimAM | 89.3 | 90.5 | 89.0 | 89.7 |
| CBAM | 89.9 | 91.0 | 89.4 | 90.1 |
| CA | 90.7 | 91.5 | 90.5 | 90.9 |
| DNLC | 92.8 | 92.8 | 92.8 | 92.8 |
| ConvNeXt | DNLC | EDW | VF Loss | Accuracy (%) | Precision (%) | Recall (%) | F1 Score (%) |
|---|---|---|---|---|---|---|---|
| √ | 88.6 | 89.6 | 88.9 | 88.9 | |||
| √ | √ | 92.8 | 92.8 | 92.8 | 92.8 | ||
| √ | √ | 90.2 | 90.6 | 90.3 | 90.6 | ||
| √ | √ | 88.4 | 89.3 | 88.8 | 89.0 | ||
| √ | √ | √ | 94.7 | 94.8 | 94.5 | 94.6 | |
| √ | √ | √ | √ | 94.8 | 94.8 | 94.6 | 94.7 |
| Model | Accuracy (%) | Precision (%) | Recall (%) | F1 Score (%) |
|---|---|---|---|---|
| AlexNet | 83.5 | 82.8 | 83.2 | 83.5 |
| ConvNeXt | 88.6 | 89.4 | 88.7 | 88.7 |
| GoogleNet | 86.7 | 87.4 | 86.4 | 86.7 |
| ResNet50 | 86.0 | 86.4 | 86.0 | 86.1 |
| ResNet101 | 87.6 | 88.1 | 87.4 | 87.7 |
| MobileNet V2 | 47.8 | 48.5 | 47.3 | 47.8 |
| MobileNet V3 | 59.1 | 59.5 | 58.8 | 59.1 |
| ShuffleNet V2 | 86.2 | 86.6 | 85.9 | 86.2 |
| EfficientNet | 76.7 | 77.1 | 76.7 | 76.8 |
| EfficientNet V2 | 61.8 | 62.3 | 61.8 | 62.0 |
| Swin Transformer | 88.1 | 88.4 | 88.1 | 88.2 |
| DEVA-ConvNeXt | 94.8 | 94.8 | 94.6 | 94.7 |
| Group | Train Set | Val Set | Test Set | Accuracy (%) | Precision (%) | Recall (%) | F1 Score (%) |
|---|---|---|---|---|---|---|---|
| 1 | 1, 2, 3, 4, 5, 6, 7, 8 | 10 | 9 | 95.2 | 95.5 | 95.0 | 95.2 |
| 2 | 2, 3, 4, 5, 6, 7, 8, 10 | 1 | 9 | 94.4 | 94.1 | 94.6 | 94.3 |
| 3 | 1, 3, 4, 5, 6, 7, 8, 10 | 2 | 9 | 94.9 | 95.3 | 94.1 | 94.7 |
| 4 | 1, 2, 4, 5, 6, 7, 8, 10 | 3 | 9 | 95.1 | 95.4 | 94.6 | 95.0 |
| 5 | 1, 2, 3, 5, 6, 7, 8, 10 | 4 | 9 | 94.5 | 94.8 | 94.0 | 94.4 |
| Model | Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1 Score (%) |
|---|---|---|---|---|---|
| DEVA-ConvNeXt | Beef Freshness | 99.8 | 99.9 | 99.6 | 99.7 |
| beef recognizion | 99.5 | 99.6 | 99.3 | 99.4 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Yu, X.; Xu, Y.; Qu, C.; Guo, S.; Jiang, S.; Chen, L.; Zhou, Y. Research on an Intelligent Grading Method for Beef Freshness in Complex Backgrounds Based on the DEVA-ConvNeXt Model. Foods 2025, 14, 4178. https://doi.org/10.3390/foods14244178
Yu X, Xu Y, Qu C, Guo S, Jiang S, Chen L, Zhou Y. Research on an Intelligent Grading Method for Beef Freshness in Complex Backgrounds Based on the DEVA-ConvNeXt Model. Foods. 2025; 14(24):4178. https://doi.org/10.3390/foods14244178
Chicago/Turabian StyleYu, Xiuling, Yifu Xu, Chenxiao Qu, Senyue Guo, Shuo Jiang, Linqiang Chen, and Yang Zhou. 2025. "Research on an Intelligent Grading Method for Beef Freshness in Complex Backgrounds Based on the DEVA-ConvNeXt Model" Foods 14, no. 24: 4178. https://doi.org/10.3390/foods14244178
APA StyleYu, X., Xu, Y., Qu, C., Guo, S., Jiang, S., Chen, L., & Zhou, Y. (2025). Research on an Intelligent Grading Method for Beef Freshness in Complex Backgrounds Based on the DEVA-ConvNeXt Model. Foods, 14(24), 4178. https://doi.org/10.3390/foods14244178

