SAB-YOLOv5: An Improved YOLOv5 Model for Permanent Magnetic Ferrite Magnet Rotor Detection
Abstract
:1. Introduction
- A machine vision-based method for automatic identification of surface defects using a visual line scan camera is proposed in Figure 2, and multiple defect samples are collected to provide high-quality data for research on defect and impurity detection on the surface of rotors.
- An SAB-YOLOv5 surface defect detection algorithm is introduced, which incorporates the Atrous Spatial Pyramid Pooling (ASPP) structure and the Bidirectional Feature Pyramid Network (BiFPN) structure to enhance feature extraction and fusion. The algorithm also utilizes the Spatial Pyramid Dilated (SPD) convolutional structure to improve detection performance for minute defects on the surface.
- The improved model is tested and validated, and its performance is compared with that of other object detection model algorithms. The visual detection results are presented.
2. Data Acquisition
2.1. Images Acquisition
2.2. Image Annotation and Dataset Production
3. Methodologies
3.1. Overview of the Proposed Method
- (1)
- Diverse Scale of Identical Features: Features with the same characteristics exist at different scales, sometimes exhibiting significant differences. For example, features like edge collapse may vary in size from as small as 5 × 5 pixels to as large as 80 × 80 pixels.
- (2)
- Detection of Small Targets: Some defects are of exceedingly small size, presenting a challenge in the context of small object detection. Examples include fine crack structures.
3.2. About YOLO
3.3. Space to Depth
3.4. Adding the ASPP Module
- (1)
- Atrous Convolution (Atrous Convolution): The core of the ASPP module is the Atrous convolution, also known as dilated convolution. This convolutional operation allows for the convolutional kernel to skip a fixed number of pixel points on the input feature map, thus enlarging the receptive field. Atrous convolution aids in increasing the context information of features without introducing additional parameters.
- (2)
- Multi-scale Sampling of Atrous Convolution: The ASPP module typically employs multiple convolutional kernels with different dilation rates to obtain different receptive field scales. These kernels capture local details and broader contextual information, making the model more robust at different scales.
- (3)
- Parallel Structure: The ASPP module is often organized in a parallel manner, incorporating multiple Atrous convolution operations, each with a different dilation rate. The feature maps produced by these operations are concatenated along the channel dimension, forming a feature representation with multi-scale contextual information.
- (4)
- Global Pooling: To capture global contextual information, the ASPP module usually includes global average pooling, transforming the entire feature map into a single value. This value provides information about the entire image.
- (5)
- Output: The output of the ASPP module typically comprises multiple feature maps obtained after Atrous convolution and global pooling operations. These feature maps capture contextual information at different scales. They can be concatenated with other feature maps or a convolutional layer.
3.5. Utilization of the BiFPNConcat Layer
4. Implementation Details
4.1. Experimental Rig
- (1)
- Frame: The supporting structure of the entire device.
- (2)
- Feeding lifting mechanism: A mechanism used to lift materials from the bottom to the top, including the chain plate conveyor lifting mechanism and the material distribution baffle. The chain plate conveyor lifting mechanism is fixed on the frame and has two channels, and the material distribution baffle is used to distribute the materials into the two channels.
- (3)
- Feeding conveyor mechanism: A mechanism used to transport materials from the feeding lifting mechanism to the next step. It includes the first conveyor belt, the first partition baffle, the preliminary screening detection component, the preliminary screening waste kicking component, and the material pushing component. The first conveyor belt is installed on the frame, and the materials are transported from the chain plate conveyor lifting mechanism to the first conveyor belt. The first partition baffle is set along the length of the first conveyor belt, dividing it into a middle channel and two side material channels. The preliminary screening detection component is used to detect half-cut materials or materials with large-sized defects, and the preliminary screening waste kicking component is placed in the middle channel to kick the waste materials into the waste kicking channel. The material pushing component is located at the end of the material channels.
- (4)
- Main detection mechanism: Fixed on the frame, it includes the supporting star wheel, the detection camera, and the material discharging component. The supporting star wheel has multiple slots to catch the materials. Two supporting star wheels arranged in parallel correspond to the position of the material pushing component, and the material discharging component is located on the side of the supporting star wheel away from the material pushing component. The detection cameras are evenly distributed on the top of the supporting star wheel.
- (5)
- Material discharging conveyor mechanism: Fixed on the frame, located below the material discharging component, used to transport materials out of the device.
- (6)
- Boxing mechanism: Fixed on the frame, it is located below the material discharging conveyor mechanism and used for boxing the materials.
4.2. Experimental Environment
4.3. Evaluation Criteria
5. Experimental Results and Analysis
5.1. Ablation Experiments
5.2. Visualization and Discussion
5.3. Comparison Results on Different Models
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Egorov, D.; Petrov, I.; Pyrhönen, J.; Link, J.; Stern, R. Hysteresis loss in ferrite permanent magnets in rotating electrical machinery. IEEE Trans. Ind. Electron. 2018, 65, 9280–9290. [Google Scholar] [CrossRef]
- Lauwers, B.; Klocke, F.; Klink, A.; Tekkaya, A.E.; Neugebauer, R.; Mcintosh, D. Hybrid processes in manufacturing. CIRP Ann. 2014, 63, 561–583. [Google Scholar] [CrossRef]
- De Gennaro, M.; Jürgens, J.; Zanon, A.; Gragger, J.; Schlemmer, E.; Fricassè, A.; Marengo, L.; Ponick, B.; Olabarri, E.T.; Kinder, J.; et al. Designing, prototyping and testing of a ferrite permanent magnet assisted synchronous reluctance machine for hybrid and electric vehicles applications. Sustain. Energy Technol. Assess. 2019, 31, 86–101. [Google Scholar] [CrossRef]
- Tao, J.; Wang, Y.; Wang, K. Defect detection for end surface of ferrite magnetic tile. In Proceedings of the 8th International Symposium on Advanced Optical Manufacturing and Testing Technologies: Optical Test, Measurement Technology, and Equipment, Suzhou, China, 26–29 April 2016; SPIE: Bellingham, WA, USA, 2016; Volume 9684, pp. 513–520. [Google Scholar]
- Gallimore, E.; Terrill, E.; Pietruszka, A.; Gee, J.; Nager, A.; Hess, R. Magnetic survey and autonomous target reacquisition with a scalar magnetometer on a small AUV. J. Field Robot. 2020, 37, 1246–1266. [Google Scholar] [CrossRef]
- Li, M.; Jia, J.; Lu, X.; Zhang, Y. A method of surface defect detection of irregular industrial products based on machine vision. Wirel. Commun. Mob. Comput. 2021, 2021, 6630802. [Google Scholar] [CrossRef]
- Sultana, F.; Sufian, A.; Dutta, P. Advancements in image classification using convolutional neural network. In Proceedings of the 2018 Fourth International Conference on Research in Computational Intelligence and Communication Networks (ICRCICN), Kolkata, India, 22–23 November 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 122–129. [Google Scholar]
- Kim, J.; Um, S.; Min, D. Fast 2D complex Gabor filter with kernel decomposition. IEEE Trans. Image Process. 2017, 27, 1713–1722. [Google Scholar] [CrossRef] [PubMed]
- Aminzadeh, M.; Kurfess, T. Automatic thresholding for defect detection by background histogram mode extents. J. Manuf. Syst. 2015, 37, 83–92. [Google Scholar] [CrossRef]
- Chen, X.; Fu, C.; Tie, M.; Sham, C.W.; Ma, H. AFFNet: An Attention-Based Feature-Fused Network for Surface Defect Segmentation. Appl. Sci. 2023, 13, 6428. [Google Scholar] [CrossRef]
- Liu, J.; Shen, X.; Wang, J.; Jiang, L.; Zhang, H. An intelligent defect detection approach based on cascade attention network under complex magnetic flux leakage signals. IEEE Trans. Ind. Electron. 2022, 70, 7417–7427. [Google Scholar] [CrossRef]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Yue, X.; Wang, Q.; He, L.; Li, Y.; Tang, D. Research on tiny target detection technology of fabric defects based on improved Yolo. Appl. Sci. 2022, 12, 6823. [Google Scholar] [CrossRef]
- Zuo, Y.; Wang, J.; Song, J. Application of YOLO object detection network in weld surface defect detection. In Proceedings of the 2021 IEEE 11th Annual International Conference on CYBER Technology in Automation, Control, and Intelligent Systems (CYBER), Jiaxing, China, 27–31 July 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 704–710. [Google Scholar]
- Hussain, M. YOLO-v1 to YOLO-v8, the Rise of YOLO and Its Complementary Nature toward Digital Manufacturing and Industrial Defect Detection. Machines 2023, 11, 677. [Google Scholar] [CrossRef]
- Zhong, Y.; Wang, J.; Peng, J.; Zhang, L. Anchor box optimization for object detection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Snowmass, CO, USA, 1–5 March 2020; pp. 1286–1294. [Google Scholar]
- Murthy, C.B.; Hashmi, M.F.; Muhammad, G.; AlQahtani, S.A. YOLOv2PD: An efficient pedestrian detection algorithm using improved YOLOv2 model. Comput. Mater. Contin. 2021, 69, 3015–3031. [Google Scholar]
- Zhang, X.; Gao, Y.; Wang, H.; Wang, Q. Improve YOLOv3 using dilated spatial pyramid module for multi-scale object detection. Int. J. Adv. Robot. Syst. 2020, 17, 1729881420936062. [Google Scholar] [CrossRef]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. [Google Scholar] [CrossRef] [PubMed]
- Zhang, J.; Zhang, H.; Liu, B.; Qu, G.; Wang, F.; Zhang, H.; Shi, X. Small object intelligent detection method based on adaptive recursive feature pyramid. Heliyon 2023, 9, e17730. [Google Scholar] [CrossRef] [PubMed]
- Liao, X.; Lv, S.; Li, D.; Luo, Y.; Zhu, Z.; Jiang, C. YOLOv4-MN3 for PCB surface defect detection. Appl. Sci. 2021, 11, 11701. [Google Scholar] [CrossRef]
- Liu, R.; Chen, Y.; Wang, J.; Guo, Z. Attentive Mix: An Efficient Data Augmentation Method for Object Detection. In Proceedings of the 2021 7th International Conference on Computer and Communications (ICCC), Chengdu, China, 10–13 December 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 770–774. [Google Scholar]
- Gao, X.; Yu, A.; Tan, J.; Gao, X.; Zeng, X.; Wu, C. GSD-YOLOX: Lightweight and more accurate object detection models. J. Vis. Commun. Image Represent. 2024, 98, 104009. [Google Scholar] [CrossRef]
- Yu, G.; Zhou, X. An Improved YOLOv5 Crack Detection Method Combined with a Bottleneck Transformer. Mathematics 2023, 11, 2377. [Google Scholar] [CrossRef]
- Li, A.; Sun, S.; Zhang, Z.; Feng, M.; Wu, C.; Li, W. A Multi-Scale Traffic Object Detection Algorithm for Road Scenes Based on Improved YOLOv5. Electronics 2023, 12, 878. [Google Scholar] [CrossRef]
- Liu, H.; Sun, F.; Gu, J.; Deng, L. Sf-yolov5: A lightweight small object detection algorithm based on improved feature fusion mode. Sensors 2022, 22, 5817. [Google Scholar] [CrossRef]
- Ji, Z.; Wu, Y.; Zeng, X.; An, Y.; Zhao, L.; Wang, Z.; Ganchev, I. Lung nodule detection in medical images based on improved YOLOv5s. IEEE Access 2023, 11, 76371–76387. [Google Scholar] [CrossRef]
- Ye, M.; Qu, X.; Huang, J.; Wu, X. In-air Handwriting System Based on Improved YOLOv5 algorithm and Monocular Camera. In Proceedings of the 2022 IEEE 34th International Conference on Tools with Artificial Intelligence (ICTAI), Macao, China, 31 October–2 November 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 949–954. [Google Scholar]
- Jocher, G.; Stoken, A.; Borovec, J.; Changyu, L.; Hogan, A.; Diaconu, L.; Poznanski, J.; Yu, L.; Rai, P.; Ferriday, R.; et al. ultralytics/yolov5; V3.0; Zenodo: Geneva, Switzerland, 2020. [Google Scholar]
Item | Type |
---|---|
CPU | Intel(R) Core(TM) i9-10980XE |
CPU @ 3.00 GHZ | |
Memory | 128 G |
GPU | NVIDIA GeForce RTX 3090 24 G *2 |
Operating System | Ubuntu 18.04.6 LTS(64-bit) |
CUDA Version | 11.3 |
Deep Learning Frame | Pytorch |
Model | Para | GFLOPs | GPU Mem | Forward | Backward |
---|---|---|---|---|---|
YOLOv5X | 292695610 | 204.7 | 2.152 | 38.26 | 50.96 |
YOLOv5X+ASPP | 95838001 | 364.6 | 3.93 | 46.28 | 79.88 |
YOLOv5X+SPD | 87674170 | 313 | 2.814 | 35.47 | 57.64 |
YOLOv5X+BIFPN | 306427450 | 219.2 | 2.288 | 36 | 60.11 |
YOLOv5X+ASPP+BIFPN | 306427450 | 388.9 | 4.156 | 48.49 | 85.67 |
YOLOv5X+ASPP+SPD | 323108081 | 490.3 | 4.482 | 53.22 | 82.10 |
SAB-YOLOv5 | 294308409 | 429.6 | 4.316 | 47.32 | 79.05 |
Methods | mAP (%) | Precision (%) | Recall (%) | F1-Score |
---|---|---|---|---|
YOLOv5X | 84.2 | 84.0 | 78.7 | 80.3 |
YOLOv5X+SPD | 86.1 | 85.5 | 81.4 | 83.4 |
YOLOv5X+ASPP | 87.2 | 82.8 | 84.2 | 83.5 |
YOLOv5X+BIFPN | 89.2 | 87.0 | 84.6 | 85.8 |
SAB-YOLOv5 | 98.3 | 97.1 | 96.0 | 98.3 |
Methods | mAP (%) |
---|---|
Yolov5s | 75.6 |
Yolov5m | 82.1 |
Yolov5x | 84.2 |
Faster RCNN | 88.6 |
Yolov8x | 88.1 |
Ours | 98.3 |
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. |
© 2024 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, B.; Li, Q.; Jiao, W.; Zhang, S.; Zhu, Y. SAB-YOLOv5: An Improved YOLOv5 Model for Permanent Magnetic Ferrite Magnet Rotor Detection. Mathematics 2024, 12, 957. https://doi.org/10.3390/math12070957
Yu B, Li Q, Jiao W, Zhang S, Zhu Y. SAB-YOLOv5: An Improved YOLOv5 Model for Permanent Magnetic Ferrite Magnet Rotor Detection. Mathematics. 2024; 12(7):957. https://doi.org/10.3390/math12070957
Chicago/Turabian StyleYu, Bo, Qi Li, Wenhua Jiao, Shiyang Zhang, and Yongjun Zhu. 2024. "SAB-YOLOv5: An Improved YOLOv5 Model for Permanent Magnetic Ferrite Magnet Rotor Detection" Mathematics 12, no. 7: 957. https://doi.org/10.3390/math12070957
APA StyleYu, B., Li, Q., Jiao, W., Zhang, S., & Zhu, Y. (2024). SAB-YOLOv5: An Improved YOLOv5 Model for Permanent Magnetic Ferrite Magnet Rotor Detection. Mathematics, 12(7), 957. https://doi.org/10.3390/math12070957