Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 Jul 20:9:e1463.
doi: 10.7717/peerj-cs.1463. eCollection 2023.

CAM-YOLO: tomato detection and classification based on improved YOLOv5 using combining attention mechanism

Affiliations

CAM-YOLO: tomato detection and classification based on improved YOLOv5 using combining attention mechanism

Seetharam Nagesh Appe et al. PeerJ Comput Sci. .

Abstract

Background: One of the key elements in maintaining the consistent marketing of tomato fruit is tomato quality. Since ripeness is the most important factor for tomato quality in the viewpoint of consumers, determining the stages of tomato ripeness is a fundamental industrial concern with regard to tomato production to obtain a high quality product. Since tomatoes are one of the most important crops in the world, automatic ripeness evaluation of tomatoes is a significant study topic as it may prove beneficial in ensuring an optimal production of high-quality product, increasing profitability. This article explores and categorises the various maturity/ripeness phases to propose an automated multi-class classification approach for tomato ripeness testing and evaluation.

Methods: Object detection is the critical component in a wide variety of computer vision problems and applications such as manufacturing, agriculture, medicine, and autonomous driving. Due to the tomato fruits' complex identification background, texture disruption, and partial occlusion, the classic deep learning object detection approach (YOLO) has a poor rate of success in detecting tomato fruits. To figure out these issues, this article proposes an improved YOLOv5 tomato detection algorithm. The proposed algorithm CAM-YOLO uses YOLOv5 for feature extraction, target identification and Convolutional Block Attention Module (CBAM). The CBAM is added to the CAM-YOLO to focus the model on improving accuracy. Finally, non-maximum suppression and distance intersection over union (DIoU) are applied to enhance the identification of overlapping objects in the image.

Results: Several images from the dataset were chosen for testing to assess the model's performance, and the detection performance of the CAM-YOLO and standard YOLOv5 models under various conditions was compared. The experimental results affirms that CAM-YOLO algorithm is efficient in detecting the overlapped and small tomatoes with an average precision of 88.1%.

Keywords: CBAM; Distance intersection over union; Non-max suppression; Object detection.

PubMed Disclaimer

Conflict of interest statement

The authors declare there are no competing interests.

Figures

Figure 1
Figure 1. Types of object detection systems.
Figure 2
Figure 2. (A) Single tomato. (B) Overlapping of tomatoes. (C) Tomatoes occlusion by branch. (D) Under shading conditions. (E) In sunlight conditions.
Figure 3
Figure 3. YOLOv5 model.
Figure 4
Figure 4. YOLOv5 model architecture.
Figure 5
Figure 5. Mosaic data augmentation.
Figure 6
Figure 6. Proposed YOLOv5 architecture with attention mechanism.
Figure 7
Figure 7. CBAM structure.
Figure 8
Figure 8. Channel attention module.
Figure 9
Figure 9. Spatial attention module.
Figure 10
Figure 10. The curve of training loss function.
Figure 11
Figure 11. Performance metrics of proposed model.
Figure 12
Figure 12. Comparison of detection algorithms.
Figure 13
Figure 13. Identification of overlapped tomatoes (A) Original image (B) YOLOV5s (C) Improved YOLOv5 algorithm.
Figure 14
Figure 14. Identification of small tomatoes (A) Original image (B) YOLOV5s (C) Improved YOLOv5 algorithm.

References

    1. Bochkovskiy A, Wang C-Y, Liao H-YM. YOLOv4: optimal speed and accuracy of object detection. 20202004.10934
    1. Dai G, Fan J. An industrial-grade solution for crop disease image detection tasks. Frontiers in Plant Science. 2022;13 doi: 10.3389/fpls.2022.921057. - DOI - PMC - PubMed
    1. Desai M, Shah M. An anatomization on breast cancer detection and diagnosis employing multi-layer perceptron neural network (MLP) and convolutional neural network (CNN) Clinical eHealth. 2021;4:1–11. doi: 10.1016/j.ceh.2020.11.002. - DOI
    1. Edan Y, Bac CW, Van Henten EJ, Hemming J. Harvesting robots for high-value crops : state-of-the-art review and challenges ahead. Journal of Field Robotics. 2014;31(6):888–911.
    1. Jiao L, Zhang F, Liu F, Yang S, Li L, Feng Z, Qu R. A survey of deep learning-based object detection. IEEE Access. 2019;7:128837–128868. doi: 10.1109/ACCESS.2019.2939201. - DOI

LinkOut - more resources