Defect Detection in Food Using Multispectral and High-Definition Imaging Combined with a Newly Developed Deep Learning Model
Abstract
:1. Introduction
- (1)
- We achieved cortical fiber detection based on the segmentation of the physical features of food using deep learning. Most past studies have focused on food classification, calorie estimation, and quality detection. However, few papers have discussed the segmentation of the physical characteristics of food. Especially for complex and indistinct defects in foods, traditional methods have been found to be completely ineffective. Therefore, to contribute to this field, this dissertation took mustard as an example to realize the semantic segmentation of the physical features of food through deep learning.
- (2)
- An improved fusion method with guided filtering was used to fuse MS images and HD images. The Sigmoid function was introduced to normalize weights for the generation of suitable fusion images. The method was shown to be capable of integrating features from multiple source images, making less conspicuous defects in food images appear more distinct, thereby aiding in the identification of defects. The detailed structure of the proposed method will be discussed in Section 2.2.
- (3)
- A novel image segmentation model based on the semantic segmentation model of UNet++ and UNet3+ for the extraction of cortical fibers, named UNet4+, is proposed. The model employs a multiscale semantic connection and dense convolutional layers, enabling the extraction of fine-grained, intricate, and deep-level characteristics of the target object. This results in superior performance for the detection of complex objects compared to conventional models. This approach can therefore facilitate more effective detection of objects similar to cortical fibers in pickled mustard tubers. The detailed structure of the proposed technology will be discussed in Section 2.3.
- (4)
- We compared the performance of the proposed model based on MS, HD, and Fusion images. Detailed results and discussion can be found in Section 3.2.
- (5)
- We compared the recognition results of our model with those of relevant segmentation models (UNet++, UNet3+) based on the data in this paper. The detailed results and discussion can be found in Section 3.5.
2. Materials and Methods
2.1. Image Acquisition
2.2. Image Fusion
2.3. Defect Detection Based on UNet4+
- Encoder: Visual Geometry Group Network-16 (VGG-16) serves as the backbone of the entire network, namely, Xj,0 (j ∈ [0, 4]). Layers X0 and X1 are the model of two convolutional layers, while the rest is a model of three convolutional layers. Furthermore, the convolved data are upsampled and provided to the decoding layer from the X1 to X4 layer.
- Decoder: There are several decoding layers in the network, which can obtain extensive information from different scales. As shown in Figure 4, each model will fuse adjacent data and upsample data from the lower left model. Every two encoding models plus a decoding model can be considered as a small UNet network [36]. In addition, skip connections are used in the network when exceeding two decoding models to connect coarse-grained and fine-grained information, which can help the network model learn more useful knowledge.
- Skip connection: In this network, to capture more effective information, we drew inspiration from UNet3+ and added multiscale skip connections to the network. To make the training more efficient, skip connections were adopted in the network, which associated high-level information with low-level semantic information (like color, border, texture, etc.) in the whole process of the network encoding and decoding. Figure 5 shows the process of multi-scale skip connection and how to construct the feature maps of X0,3 and X1,2. Like with UNet, the feature map from same-scale decoder layer X0,2 and the upsampled result from higher-scaler layer X1,2 were instantly accepted in decoder layer X0,3, which delivered low-level information and high-level semantic information, respectively. Moreover, a series of multiple-scale skip connections passed the higher-level semantic information from encoder layer X3,1 and decoder-layer X2,1 by using bilinear interpolation, selecting different scale factors based on different expansion scales. Then, a 3 × 3 convolution operation was followed to update the number of channels and reduce the quantity of unnecessary information.
- Deep supervision [37,38]: Similar to UNet++, deep supervision that concurrently minimizes detection error and improves the directness and transparency of the hidden layer learning process was used in this model, which consisted of a 1 × 1 convolution. Finally, the result was produced by making use of a method of deep supervision which added the information from decoder layers X0,1, X0,2, X0,3, and X0,4.
- The differences between our model and other models: In comparison to UNet3+, the proposed model simplifies lateral connections and introduces vertical multiscale connections. This design choice aims to enable the model to capture more complex fine-grained features across different scales. Unlike UNet3+, we employed a multi-layer dense convolutional network, allowing the model to extract features on various scales. The features obtained on different scales are then fused through the dense convolutional network, enhancing the model’s ability to achieve superior results when handling complex targets.
2.4. Design of Experiments
2.5. Assessment System
3. Results and Discussion
3.1. Spectral Attributes of Cortical Fiber and Meat Tissues
3.2. Performance of Image Fusion
3.3. Performance of UNet4+
3.4. Comparison of Three Types of Images Based on UNet4+
3.5. Comparision of the UNet4+ Model with UNet++ and UNet3+
3.6. Discussion
- Innovation: Our model combined multiscale connections with dense convolutional networks. Multiscale connections can connect features of different fine-grained sizes across layers. The dense convolutional network further amalgamates the characteristic information from multiscale connections. This elevates the model’s complexity, enabling the acquisition of a broader array of features. Consequently, compared to traditional models, our model exhibited improved detection capabilities for small, irregular objects.
- Quantitative Comparison: Our model achieved higher accuracy than other models in quantitative comparisons, with a modest increase in the number of parameters. Our model had a strong anti-interference ability in the detection of complex targets, making it suitable for the effective detection of complex targets.
- Production Efficiency: In terms of production, our model can yield better results within a specified time frame, leading to higher efficiency compared to other models.
- Architectural Design: Our model utilized multi-scale connections and multiple layers of densely connected convolutional networks, enabling the extraction of finer and more diverse features from the target. Consequently, it was effective at recognizing complex targets like cortical fibers in pickled mustard.
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Zhu, L.; Spachos, P.; Pensini, E.; Plataniotis, K.N. Deep learning and machine vision for food processing: A survey. Curr. Res. Food Sci. 2021, 4, 233–249. [Google Scholar] [CrossRef] [PubMed]
- Zhou, L.; Zhang, C.; Liu, F.; Qiu, Z.; He, Y. Application of Deep Learning in Food: A Review. Compr. Rev. Food Sci. Food Saf. 2019, 18, 1793–1811. [Google Scholar] [CrossRef] [PubMed]
- ElMasry, G.; Wang, N.; Vigneault, C.; Qiao, J.; ElSayed, A. Early detection of apple bruises on different background colors using hyperspectral imaging. LWT-Food Sci. Technol. 2008, 41, 337–345. [Google Scholar] [CrossRef]
- Pandiselvam, R.; Mayookha, V.P.; Kothakota, A.; Ramesh, S.V.; Thirumdas, R.; Juvvi, P. Biospeckle laser technique—A novel non-destructive approach for food quality and safety detection. Trends Food Sci. Technol. 2020, 97, 1–13. [Google Scholar] [CrossRef]
- Mohammadian, N.; Ziaiifar, A.M.; Mirzaee-Ghaleh, E.; Kashaninejad, M.; Karami, H. Nondestructive Technique for Identifying Adulteration and Additives in Lemon Juice Based on Analyzing Volatile Organic Compounds (VOCs). Processes 2023, 11, 1531. [Google Scholar] [CrossRef]
- Haff, R.P.; Toyofuku, N. X-ray detection of defects and contaminants in the food industry. Sens. Instrum. Food Qual. Saf. 2008, 2, 262–273. [Google Scholar] [CrossRef]
- Chandrapala, J.; Oliver, C.; Kentish, S.; Ashokkumar, M. Ultrasonics in food processing—Food quality assurance and food safety. Trends Food Sci. Technol. 2012, 26, 88–98. [Google Scholar] [CrossRef]
- Baranowski, P.; Mazurek, W.; Wozniak, J.; Majewska, U. Detection of early bruises in apples using hyperspectral data and thermal imaging. J. Food Eng. 2012, 110, 345–355. [Google Scholar] [CrossRef]
- Vadivambal, R.; Jayas, D.S. Applications of Thermal Imaging in Agriculture and Food Industry—A Review. Food Bioprocess Technol. 2011, 4, 186–199. [Google Scholar] [CrossRef]
- Mo, C.; Kim, G.; Kim, M.S.; Lim, J.; Cho, H.; Barnaby, J.Y.; Cho, B.K. Fluorescence hyperspectral imaging technique for foreign substance detection on fresh-cut lettuce. J. Sci. Food Agr. 2017, 97, 3985–3993. [Google Scholar] [CrossRef]
- Ok, G.; Shin, H.J.; Lim, M.-C.; Choi, S.-W. Large-scan-area sub-terahertz imaging system for nondestructive food quality inspection. Food Control 2019, 96, 383–389. [Google Scholar] [CrossRef]
- Noordam, J.C.; van den Broek, W.H.A.M.; Buydens, L.M.C. Detection and classification of latent defects and diseases on raw French fries with multispectral imaging. J. Sci. Food Agr. 2005, 85, 2249–2259. [Google Scholar] [CrossRef]
- Seo, Y.; Kim, G.; Lim, J.; Lee, A.; Kim, B.; Jang, J.; Mo, C.; Kim, M.S. Non-Destructive Detection Pilot Study of Vegetable Organic Residues Using VNIR Hyperspectral Imaging and Deep Learning Techniques. Sensors 2021, 21, 2899. [Google Scholar] [CrossRef] [PubMed]
- Sonia, Z.; Lorenzo, C.; Ilaria, C. THz Imaging for Food Inspections: A Technology Review and Future Trends. In Terahertz Technology; Borwen, Y., Ja-Yu, L., Eds.; IntechOpen: Rijeka, Croatia, 2021. [Google Scholar] [CrossRef]
- Feng, Y.; Sun, D. Application of Hyperspectral Imaging in Food Safety Inspection and Control: A Review. Crit. Rev. Food Sci. Nutr. 2012, 52, 1039–1058. [Google Scholar] [CrossRef] [PubMed]
- He, H.J.; Sun, D. Inspection of harmful microbial contamination occurred in edible salmon flesh using imaging technology. J. Food Eng. 2015, 150, 82–89. [Google Scholar] [CrossRef]
- Cui, S.; Ling, P.; Zhu, H.; Keener, H.M. Plant Pest Detection Using an Artificial Nose System: A Review. Sensors 2018, 18, 378. [Google Scholar] [CrossRef]
- Su, W.; He, H.; Sun, D. Non-Destructive and rapid evaluation of staple foods quality by using spectroscopic techniques: A review. Crit. Rev. Food Sci. Nutr. 2017, 57, 1039–1051. [Google Scholar] [CrossRef]
- Gill, J.; Sandhu, P.S.; Singh, T. A review of automatic fruit classification using soft computing techniques. In Proceedings of the ICSCEE, Johannesburg, South Africa, 15–16 April 2014; pp. 91–98. [Google Scholar]
- Fan, K.J.; Su, W. Applications of Fluorescence Spectroscopy, RGB- and MultiSpectral Imaging for Quality Determinations of White Meat: A Review. Biosensors 2022, 12, 76. [Google Scholar] [CrossRef]
- Liu, Z.; Wang, L.; Liu, Z.; Wang, X.; Hu, C.; Xing, J. Detection of Cotton Seed Damage Based on Improved YOLOv5. Processes 2023, 11, 2682. [Google Scholar] [CrossRef]
- Cen, H.Y.; Lu, R.F.; Ariana, D.P.; Mendoza, F. Hyperspectral Imaging-Based Classification and Wavebands Selection for Internal Defect Detection of Pickling Cucumbers. Food Bioprocess Technol. 2014, 7, 1689–1700. [Google Scholar] [CrossRef]
- Otter, D.W.; Medina, J.R.; Kalita, J.K. A Survey of the Usages of Deep Learning for Natural Language Processing. IEEE Trans. Neural Netw. Learn. Syst. 2021, 32, 604–624. [Google Scholar] [CrossRef] [PubMed]
- Ma, C.; Pan, C.G.; Ye, Z.; Ren, H.B.; Huang, H.; Qu, J.X. Gout Staging Diagnosis Method Based on Deep Reinforcement Learning. Processes 2023, 11, 2450. [Google Scholar] [CrossRef]
- Hof, R.D. Deep Learning. Available online: https://www.technologyreview.com/technology/deep-learning/ (accessed on 14 November 2023).
- Medus, L.D.; Saban, M.; Frances-Villora, J.V.; Bataller-Mompean, M.; Rosado-Munoz, A. Hyperspectral image classification using CNN: Application to industrial food packaging. Food Control 2021, 125, 107962. [Google Scholar] [CrossRef]
- Gulzar, Y.; Ünal, Z.; Aktas, H.; Mir, M.S. Harnessing the Power of Transfer Learning in Sunflower Disease Detection: A Comparative Study. Agriculture 2023, 13, 1479. [Google Scholar] [CrossRef]
- Dhiman, P.; Kaur, A.; Balasaraswathi, V.R.; Gulzar, Y.; Alwan, A.A.; Hamid, Y. Image Acquisition, Preprocessing and Classification of Citrus Fruit Diseases: A Systematic Literature Review. Sustainability 2023, 15, 9643. [Google Scholar] [CrossRef]
- Yang, Y.; Liu, Z.; Huang, M.; Zhu, Q.; Zhao, X. Automatic detection of multi-type defects on potatoes using multispectral imaging combined with a deep learning model. J. Food Eng. 2023, 336, 111213. [Google Scholar] [CrossRef]
- ChinaDaily. Fuling ‘Zhacai’: The Tasty Chinese Pickled Vegetable. Available online: http://www.chinadaily.com.cn/a/201903/27/WS5c9b0e29a3104842260b2dcd.html (accessed on 14 November 2023).
- Li, S.; Kang, X.; Hu, J. Image Fusion with Guided Filtering. IEEE Trans. Image Process. 2013, 22, 2864–2875. [Google Scholar] [CrossRef]
- He, K.; Sun, J.; Tang, X. Guided Image Filtering. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 35, 1397–1409. [Google Scholar] [CrossRef]
- Cybenko, G. Approximation by superpositions of a sigmoidal function. Math. Control Signals Syst. 1989, 2, 303–314. [Google Scholar] [CrossRef]
- Zhou, Z.; Rahman Siddiquee, M.M.; Tajbakhsh, N.; Liang, J. UNet++: A Nested U-Net Architecture for Medical Image Segmentation. In Deep Learning in Medical Image Analysis and Multimodal Learning for Clinical Decision Support; Springer International Publishing: Berlin/Heidelberg, Germany, 2018; pp. 3–11. [Google Scholar] [CrossRef]
- Huang, H.; Lin, L.; Tong, R.; Hu, H.; Zhang, Q.; Iwamoto, Y.; Han, X.; Chen, Y.; Wu, J. UNet 3+: A Full-Scale Connected UNet for Medical Image Segmentation. In Proceedings of the ICASSP 2020—2020 IEEE International Conference on Acoustics, Speech and Signal Processing, Barcelona, Spain, 4–8 May 2020; pp. 1055–1059. [Google Scholar] [CrossRef]
- Ronneberger, O.; Fischer, P.; Brox, T. U-Net: Convolutional Networks for Biomedical Image Segmentation. In Proceedings of the 18th International Conference on Medical Image Computing and Computer-Assisted Intervention—MICCAI 2015, Munich, Germany, 5–9 October 2015; Volume 9351, pp. 234–241. [Google Scholar] [CrossRef]
- Nashat, S.; Abdullah, A.; Aramvith, S.; Abdullah, M.Z. Support vector machine approach to real-time inspection of biscuits on moving conveyor belt. Comput. Electron. Agric. 2011, 75, 147–158. [Google Scholar] [CrossRef]
- Lee, C.; Xie, S.; Patrick, G.; Zhang, Z.; Tu, Z. Deeply-Supervised Nets. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics, San Diego, CA, USA, 9–12 May 2015; pp. 562–570. [Google Scholar]
- Glenn, J.; Alex, S.; Jirka, B.; Stan, C.; Liu, C.; Hogan, A.; NanoCode012; Laughing; lorenzomammana; tkianai; et al. Ultralytics/yolov5: v3.0. Available online: https://zenodo.org/records/3983579 (accessed on 14 November 2023).
- Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollar, P. Focal Loss for Dense Object Detection. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2999–3007. [Google Scholar] [CrossRef]
- Goutte, C.; Gaussier, E. A Probabilistic Interpretation of Precision, Recall and F-Score, with Implication for Evaluation. In Advances in Information Retrieval; Springer: Berlin/Heidelberg, Germany, 2005; pp. 345–359. [Google Scholar] [CrossRef]
R (%) | P (%) | Dice (%) | |
---|---|---|---|
HD | 81.64 | 57.98 | 66.81 |
MS | 80.62 | 61.92 | 68.60 |
Fusion | 82.87 | 68.13 | 73.91 |
R (%) | P (%) | Dice (%) | Size (MB) | Speed (ms) | |
---|---|---|---|---|---|
UNet++ | 79.09 | 56.34 | 64.19 | 11.70 | 17 |
UNet3+ | 75.32 | 37.16 | 46.50 | 7.83 | 22 |
UNet4+ | 82.87 | 68.13 | 73.91 | 13.20 | 31 |
Backbone | Feature Layers | Input Size | Epoch | |
---|---|---|---|---|
UNet++ | VGG-16 | [16, 32, 64, 128, 256] | 256 × 256 × 3 | 200 |
UNet3+ | VGG-16 | [16, 32, 64, 128, 256] | 256 × 256 × 3 | 200 |
UNet4+ | VGG-16 | [16, 32, 64, 128, 256] | 256 × 256 × 3 | 200 |
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. |
© 2023 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
Deng, D.; Liu, Z.; Lv, P.; Sheng, M.; Zhang, H.; Yang, R.; Shi, T. Defect Detection in Food Using Multispectral and High-Definition Imaging Combined with a Newly Developed Deep Learning Model. Processes 2023, 11, 3295. https://doi.org/10.3390/pr11123295
Deng D, Liu Z, Lv P, Sheng M, Zhang H, Yang R, Shi T. Defect Detection in Food Using Multispectral and High-Definition Imaging Combined with a Newly Developed Deep Learning Model. Processes. 2023; 11(12):3295. https://doi.org/10.3390/pr11123295
Chicago/Turabian StyleDeng, Dongping, Zhijiang Liu, Pin Lv, Min Sheng, Huihua Zhang, Ruilong Yang, and Tiezhu Shi. 2023. "Defect Detection in Food Using Multispectral and High-Definition Imaging Combined with a Newly Developed Deep Learning Model" Processes 11, no. 12: 3295. https://doi.org/10.3390/pr11123295
APA StyleDeng, D., Liu, Z., Lv, P., Sheng, M., Zhang, H., Yang, R., & Shi, T. (2023). Defect Detection in Food Using Multispectral and High-Definition Imaging Combined with a Newly Developed Deep Learning Model. Processes, 11(12), 3295. https://doi.org/10.3390/pr11123295