Abstract
The external appearance of carrot plays a vital role in the sales of carrots. In this study, a recognition method of defective carrots was proposed based on deep learning and transfer learning. Five classical CNNs (Densenet-121, ResNet-50, Inception-V3, VGG-16, and VGG-19) were applied for recognizing defective carrots. And these models were fine-tuned on a new dataset including 1115 normal and 1330 defective carrots. From the experimental results, the transfer learning model of ResNet-50 performed best. Moreover, the hyper-parameters (batch size, learning rate, and fine-tuned layers) of ResNet-50 were optimized to enhance the performance. To further improve the recognition rate of defective carrots, the final label was obtained by selective ensemble, the results of different detection models. In these ensemble models, ResNet-50 was selected as a fixed model fused with any two of the other four models by an averaging method. The results showed that the ensemble model with ResNet-50, Densenet-121, and VGG-16 (R-D-V16) performed best with accuracy, precision, sensitivity, specificity, F1-score, and detection speed of 97.34%, 99.53%, 94.62%, 99.62%, 97.01%, and 0.09s per image, respectively. Therefore, the robust performance of CNNs through transfer learning indicated that it can be an effective method of recognizing defective carrots.
Similar content being viewed by others
Data Availability
The datasets used or analyzed during the current study are available from the corresponding author on reasonable request.
Funding
This work is financially supported by the National Key Research and Development Program of China (No.2018YFD0700102-02).
References
Altuntaş, Y., Cömert, Z., & Kocamaz, A. F. (2019). Identification of haploid and diploid maize seeds using convolutional neural networks and a transfer learning approach. Computers and Electronics in Agriculture, 163, 104874. https://doi.org/10.1016/j.compag.2019.104874.
Aukkapinyo, K., Sawangwong, S., Pooyoi, P., & Kusakunniran, W. (2020). Localization and classification of rice-grain images using region proposals-based convolutional neural network. International Journal of Automation and Computing, 17(2), 233–246. https://doi.org/10.1007/s11633-019-1207-6.
Chakraborty, M., Biswas, S. K., & Purkayastha, B. (2020). A novel ensembling method to boost performance of neural networks. Journal of Experimental & Theoretical Artificial Intelligence, 32(1), 17–29. https://doi.org/10.1080/0952813X.2019.1610799.
Cho, B., Koyama, K., Diaz, E., & Koseki, S. (2020). Determination of “Hass” avocado ripeness during storage based on smartphone image and machine learning model. Food and Bioprocess Technology, 13(9), 1579–1587. https://doi.org/10.1007/s11947-020-02494-x.
Cömert, Z., & Kocamaz, A. F. (2018). Open-access software for analysis of fetal heart rate signals. Biomed. Signal Process. Control, 45, 98–108. https://doi.org/10.1016/j.bspc.2018.05.016.
Cortes, V., Cubero, S., Blasco, J., Alexixos, N., & Talens, P. (2019). In-line application of visible and near-infrared diffuse reflectance spectroscopy to identify apple varieties. Food and Bioprocess Technology, 12(6), 1021–1030. https://doi.org/10.1007/s11947-019-02268-0.
Da, C. A. Z., Figueroa, H. E. H., & Fracarolli, J. A. (2020). Computer vision based detection of external defects on tomatoes using deep learning. Biosystems Engineering, 190, 131–144. https://doi.org/10.1016/j.biosystemseng.2019.12.003.
Deng, L., Du, H., & Han, Z. (2017). A carrot sorting system using machine vision technique. Applied Engineering in Agriculture, 33(2), 149–156. https://doi.org/10.13031/aea.11549.
Diederik, P. K., & Jimmy, L. B. (2015). Adam: A method for stochastic optimization. In: International Conference on Learning Representations, (pp. 1-13).
Ezhilan, M., Nesakumar, N., Babu, K., Sinandan, C., & Rayappan, J. (2020). A multiple approach combined with portable electronic nose for assessment of post-harvest sapota contamination by foodborne pathogens. Food and Bioprocess Technology, 13(7), 1193–1205. https://doi.org/10.1007/s11947-020-02473-2.
FAO (2018). FAOSTAT. http://www.fao.org/faostat/en/#data/QC.
Feng, H., Hu, M., Yang, Y., & Xia, K. (2019). Tree species recognition based on overall tree image and ensemble of transfer learning. Transactions of the Chinese Society for Agricultural Machinery, 50(8), 235–242. https://doi.org/10.6041/j.issn.1000-1298.2019.08.025.
Garcia-Garcia, A., Orts-Escolano, S., Oprea, S., Villena-Martinez, V., Martinez-Gonzalez, P., & Garcia-Rodriguez, J. (2018). A survey on deep learning techniques for image and video semantic segmentation. Applied Soft Computing Journal, 70, 41–65. https://doi.org/10.1016/J.ASOC.2018.05.018.
He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition, (pp. 770-778). https://doi.org/10.1109/CVPR.2016.90.
Huang, G., Liu, Z., van der Maaten, L., & Weinberger, K. Q. (2017). Densely connected convolutional networks. In: 2017 IEEE Conference on Computer Vision and Pattern Recognition, (pp. 2261-2269). https://doi.org/10.1109/CVPR.2017.243.
John, D., Elad, H., & Yoram, S. (2011). Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12, 2121–2159.
Kamilaris, A., & Prenafeta-Boldú, F. X. (2018). Deep learning in agriculture: A survey. Computers and Electronics in Agriculture, 147, 70–90. https://doi.org/10.1016/j.compag.2018.02.016.
Koirala, A., Walsh, K. B., Wang, Z., & McCarthy, C. (2019). Deep learning – Method overview and review of use for fruit detection and yield estimation. Computers and Electronics in Agriculture, 162, 219–234. https://doi.org/10.1016/j.compag.2019.04.017.
Li, Y., & Liu, L. (2019). Image quality classification algorithm based on InceptionV3 and SVM. MATEC Web of Conferences, 277, 2036. https://doi.org/10.1051/matecconf/201927702036.
Li, Z., Niu, B., Peng, F., & Li, G. (2020). Estimation method of fry body length based on visible spectrum. Spectroscopy and Spectral Analysis, 40(4), 1243–1250. https://doi.org/10.3964/j.issn.1000-0593(2020)04-1243-08.
Lin, P., Li, X. L., Chen, Y. M., & He, Y. (2018). A deep convolutional neural network architecture for boosting image discrimination accuracy of rice species. Food and Bioprocess Technology, 11(4), 765–773. https://doi.org/10.1007/s11947-017-2050-9.
Liu, Z. (2020). Soft-shell shrimp recognition based on an improved alexnet for quality evaluations. Journal of Food Engineering, 266, 109698. https://doi.org/10.1016/j.jfoodeng.2019.109698.
Mazo, C., Bernal, J., Trujillo, M., & Alegre, E. (2018). Transfer learning for classification of cardiovascular tissues in histological images. Computer Methods and Programs in Biomedicine, 165, 69–76. https://doi.org/10.1016/j.cmpb.2018.08.006.
Mo, S. & Liu, Q. (2010). Adaptive optimization algorithm for CDS control parameters of high-speed CCD. In: 5th International Symposium on Advanced Optical Manufacturing and Test Technologies, 76582C. https://doi.org/10.1117/12.867639.
Moscetti, R., Haff, R., Ferri, S., Raponi, F., Monarca, D., Liang, P., & Massantini, R. (2017). Real-time monitoring of organic carrot (var. Romance) during hot-air drying using near-infrared spectroscopy. Food and Bioprocess Technology, 10(11), 2046–2059. https://doi.org/10.1007/s11947-017-1975-3.
Ning, Q. (1999). On the momentum term in gradient descent learning algorithms. Neural networks: the official journal of the International Neural Network Society, 12(1), 145–151.
Pan, S. J., & Yang, Q. (2010). A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22(10), 1345–1359. https://doi.org/10.1109/TKDE.2009.191.
Pisantanaroj, P., Tanpisuth, P., Sinchavanwat, P., Phasuk, S., Phienphanich, P., Jangtawee, P., Yakoompai, K., Donphoongpi, M., Ekgasit, S., & Tantibundhit, C. (2020). Automated firearm classification from bullet markings using deep learning. IEEE Access, 8, 1–78251. https://doi.org/10.1109/ACCESS.2020.2989673.
Ravikanth, L., Jayas, D., White, N., Fields, P., & Sun, D. (2017). Extraction of spectral information from hyperspectral data and application of hyperspectral imaging for food and agricultural products. Food and Bioprocess Technology, 10(1), 1–33. https://doi.org/10.1007/s11947-016-1817-8.
Simonyan, K., & Zisserman, A. (2015). Very deep convolutional networks for large-scale image recognition. In 3rd International Conference on Learning Representations, ICLR 2015. United states: San Diego, CA.
Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., & Wojna, Z. (2016). Rethinking the inception architecture for computer vision. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition, (pp. 2818-2826). https://doi.org/10.1109/CVPR.2016.308.
Xiao, G., Wu, Q., Chen, H., Da, D., Guo, J., & Gong, Z. (2020). A deep transfer learning solution for food material recognition using electronic scales. IEEE Transactions on Industrial Informatics, 16(4), 2290–2300. https://doi.org/10.1109/TII.2019.2931148.
Xie, W., Wang, F., & Yang, D. (2019a). Research on carrot grading based on machine vision feature parameters. IFAC-PapersOnLine, 52(30), 30–35. https://doi.org/10.1016/j.ifacol.2019.12.485.
Xie, W., Wang, F., & Yang, D. (2019b). Research on carrot surface defect detection methods based on machine vision. IFAC-PapersOnLine, 52(30), 24–29. https://doi.org/10.1016/j.ifacol.2019.12.484.
Zhou, L., & Lai, K. (2009). Adaboosting neural networks for credit scoring. In The Sixth International Symposium on Neural Networks (ISNN 2009) (p. 56). Berlin, Heidelberg: Advances in Intelligent and Soft Computing, Springer. https://doi.org/10.1007/978-3-642-01216-7_93.
Zhu, H., Deng, L., Wang, D., Gao, J., Ni, J., & Han, Z. (2019). Identifying carrot appearance quality by transfer learning. Journal of Food Process Engineering, 42(6), e13187. https://doi.org/10.1111/jfpe.13187.
Zhuang, F. Z., Luo, P., He, Q., & Shi Zh, Z. (2015). Survey on transfer learning research. Ruan Jian Xue Bao/Journal of Software, 26(01), 26–39. https://doi.org/10.13328/j.cnki.jos.004631.
Zou, F., Shen, L., Jie, Z., Zhang, W., & Liu, W. (2019). c. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (pp. 11119–11127). CA, USA: Long Beach. https://doi.org/10.1109/CVPR.2019.01138.
Code Availability
Some or all data, models, or code generated or used during the study are available from the corresponding author by request.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of Interest
The authors declare no competing interests.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Xie, W., Wei, S., Zheng, Z. et al. Recognition of Defective Carrots Based on Deep Learning and Transfer Learning. Food Bioprocess Technol 14, 1361–1374 (2021). https://doi.org/10.1007/s11947-021-02653-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11947-021-02653-8