Lightweight Cooperative Attention for Empowering YOLOv7-Tiny in Lithium Battery Surface Defect Recognition
Abstract
1. Introduction
- Due to different formation mechanisms, lithium battery surface defects often exhibit diverse shapes, such as linear scratches and point-like pinholes. To adapt to varied defect morphologies, detection methods need to develop attention capabilities for different defect types, thereby improving detection accuracy.
- The scale of these defects also varies, such as pinhole defects spanning only a few pixels. Detection methods must effectively perceive small-scale information to enhance the detection capability for small targets.
- To improve detection speed, it is necessary to reduce the computational burden of the model.
- We propose an improved YOLOv7-tiny target detection network, aiming to achieve high-precision and high-efficiency automated detection of lithium battery surface defects.
- We introduce the LKA module into the neck network. Through decoupled large-kernel depthwise convolution and spatial convolution, this module constructs a multi-scale receptive field with long-range dependencies. It efficiently models the spatial contextual information of irregular and polymorphic lithium battery surface defects with a lower parameter count, thereby enhancing the network’s feature understanding and geometric adaptability to complex defects.
- We integrate the SimAM into the backbone network. With minimal computational overhead, this module adaptively enhances the feature response in small target regions while suppressing redundant background information. Consequently, it more completely preserves the semantic information of tiny defects during forward feature propagation, effectively mitigating the feature dilution problem in deep networks and improving the model’s sensitivity and detection robustness to small, low-contrast defects.
2. Related Works
2.1. Traditional Detection Methods
2.2. Object Detection Methods Based on Deep Learning
2.2.1. Two-Stage Detection Network
2.2.2. Single-Stage Detection Network
3. Materials and Methods
3.1. Lithium Battery Data
3.1.1. Dataset Composition and Defect Categories
3.1.2. Image Acquisition and Preprocessing
- (1)
- Lighting setup for acquisition
- (2)
- Pouch Lithium Battery Surface Image Preprocessing
- (3)
- Data Augmentation
3.2. Network Architecture for Surface Defect Detection of Lithium Batteries
3.3. A Simple Parameter-Free Attention Module
3.4. Large Kernel Attention Module
4. Results and Discussion
4.1. Experiment Setup and Interpretation
4.2. Evaluation Metrics
4.3. Ablation Studies
4.4. Training Dynamics and Convergence Analysis
4.5. Comparison of Defect Detection Visualization Results
4.6. Comparison of Performance Across Different Models
4.7. Comparison of Different Model Complexities
5. Conclusions and Discussion
- (1)
- Diverse lighting. The dataset was collected under relatively uniform illumination, whereas industrial scenes exhibit dynamic lighting. Specular reflection on battery surfaces can locally saturate or shadow regions, corrupting defect-related features. Although data augmentation was used to simulate brightness variations, the model’s robustness under extreme lighting must still be verified with data streamed directly from production lines.
- (2)
- Single-angle imaging. The images in this study were all acquired from a single imaging viewpoint. Under this condition, specular reflections or background textures on the battery surface can easily obscure subtle defects such as faint scratches and shallow dents, making their features difficult to extract effectively. In contrast, multi-view imaging can enable the same defect to exhibit higher contrast and clarity from at least one viewing angle, thereby significantly reducing the risk of missed detection caused by feature concealment.
- (3)
- Diverse battery types. The training data used in this study are relatively homogeneous and do not comprehensively cover the diverse battery types encountered in real-world industrial settings. Due to significant differences in casing materials, surface reflective properties, geometric shapes, and manufacturing processes among various types of lithium-ion batteries, the current model may exhibit limited generalization capability when applied across different battery types. In future work, it is necessary to incorporate training data from a wider range of battery types in order to enhance the model’s adaptability and robustness in diverse industrial scenarios.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Ministry of Industry and Information Technology of the People’s Republic of China. Operation Status of the National Lithium-ion Battery Industry from January to April 2025. 2025. Available online: https://www.miit.gov.cn/gxsj/tjfx/dzxx/art/2025/art_d7af22f806cd42928f5ae531aca47f45.html (accessed on 25 December 2025).
- Xie, Y.; Xu, X.; Liu, S.Y. Machine vision-based detection of surface defects in cylindrical battery cases. J. Energy Storage 2024, 101, 113949. [Google Scholar] [CrossRef] [Scilit]
- Muralidhar, S. Recent Advancements in Machine Vision Systems for Industrial Defect Detection: A Review. J. Eng. Res. Rep. 2025, 27, 385–392. [Google Scholar] [CrossRef] [Scilit]
- Wang, B.; Liu, G.; Wu, J. Blind deblurring of saturated images based on optimization and deep learning for dynamic visual inspection on the assembly line. Symmetry 2019, 11, 678. [Google Scholar] [CrossRef] [Scilit]
- Chen, X.; Liu, M.; Niu, Y.; Wang, X.; Wu, Y.C. Deep-Learning-Based Lithium Battery Defect Detection via Cross-Domain Generalization. IEEE Access 2024, 12, 78505–78514. [Google Scholar] [CrossRef] [Scilit]
- Zhang, J.; Wang, Y.; Jiang, B.; He, H.; Huang, S.; Wang, C.; Zhang, Y.; Han, X.; Guo, D.; He, G.; et al. Realistic fault detection of li-ion battery via dynamical deep learning. Nat. Commun. 2023, 14, 5940. [Google Scholar] [CrossRef] [Scilit]
- Lin, Y.H.; Ruan, S.J.; Chen, Y.X.; Li, Y.F. Physics-informed deep learning for lithium-ion battery diagnostics using electrochemical impedance spectroscopy. Renew. Sustain. Energy Rev. 2023, 188, 113807. [Google Scholar] [CrossRef] [Scilit]
- Li, S.B.; Yang, J.; Wang, Z.; Zhu, S.D.; Yang, G.C. Review of development and application of defect detection technology. Acta Autom. Sin. 2020, 46, 2319−2336. [Google Scholar] [CrossRef]
- Xiao, Y.J.; Qin, H.; Zhou, W.; Peng, K.; Meng, Z.Z.; Zhang, X.H. Detection and recognition of roll surface defects in lithium battery pole rolling mill. J. Electron. Meas. Instrum. 2019, 33, 148–156. [Google Scholar] [CrossRef]
- Xu, C.; Li, L.; Li, J.; Wen, C. Surface defects detection and identification of lithium battery pole piece based on multi-feature fusion and PSO-SVM. IEEE Access 2021, 9, 85232–85239. [Google Scholar] [CrossRef] [Scilit]
- Wang, Z.J.; Zan, A.; Gu, F. Surface Defect Detection of Pouch Cells Based on Gabor Filtering. Modul. Mach. Tool Autom. Manuf. Tech. 2023, 11, 146–149. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Process. Syst. 2015, 39, 1137–1149. [Google Scholar] [CrossRef] [Scilit]
- Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar] [CrossRef] [Scilit]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar] [CrossRef] [Scilit]
- Redmon, J.; Farhadi, A. YOLO9000: Better, faster, stronger. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 7263–7271. [Google Scholar] [CrossRef] [Scilit]
- Redmon, J.; Farhadi, A. Yolov3: An incremental improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar] [CrossRef] [Scilit]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar] [CrossRef] [Scilit]
- Yan, B.; Fan, P.; Lei, X.; Liu, Z.; Yang, F. A real-time apple targets detection method for picking robot based on improved YOLOv5. Remote Sens. 2021, 13, 1619. [Google Scholar] [CrossRef] [Scilit]
- Li, C.; Li, L.; Jiang, H.; Weng, K.; Geng, Y.; Li, L.; Ke, Z.; Li, Q.; Cheng, M.; Nie, W.; et al. YOLOv6: A single-stage object detection framework for industrial applications. arXiv 2022, arXiv:2209.02976. [Google Scholar] [CrossRef] [Scilit]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the 2014 IEEE Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 23–28 June 2014; pp. 580–587. [Google Scholar] [CrossRef] [Scilit]
- Hu, B.; Wang, J. Detection of PCB surface defects with improved faster-RCNN and feature pyramid network. IEEE Access 2020, 8, 108335–108345. [Google Scholar] [CrossRef] [Scilit]
- Lang, X.; Zhang, Y.; Shu, S.; Liang, H.; Zhang, Y. Lithium battery surface defect detection based on the YOLOv3 detection algorithm. In Proceedings of the Tenth International Symposium on Precision Mechanical Measurements, Qingdao, China, 15–17 October 2021; SPIE: Cergy Pontoise, France, 2021; Volume 12059, pp. 558–565. [Google Scholar] [CrossRef] [Scilit]
- Gui, J.; Li, L.; Mao, X.; Wang, Q. Lithium battery defect detection method based on improved YOLOv4. Electron. Meas. Technol. 2022, 45, 144–150. [Google Scholar] [CrossRef]
- Hu, H.; Zhu, Z. Sim-YOLOv5s: A method for detecting defects on the end face of lithium battery steel shells. Adv. Eng. Inf. 2023, 55, 101824. [Google Scholar] [CrossRef] [Scilit]
- Zhang, Y.; Shu, S.; Lang, X.; Liang, H.; Yu, Z.; Yang, Z. A real-time method for detecting bottom defects of lithium batteries based on an improved YOLOv5 model. Meas. Sci. Technol. 2023, 34, 125149. [Google Scholar] [CrossRef] [Scilit]
- Yang, L.; Zhang, R.Y.; Li, L.; Xie, X. Simam: A simple, parameter-free attention module for convolutional neural networks. In Proceedings of the 38th International Conference on Machine Learning, Virtual, 18–24 July 2021; pp. 11863–11874. [Google Scholar]
- Webb, B.S.; Dhruv, N.T.; Solomon, S.G.; Tailby, C.; Lennie, P. Early and late mechanisms of surround suppression in striate cortex of macaque. J. Neurosci. 2005, 25, 11666–11675. [Google Scholar] [CrossRef] [Scilit]
- Cao, J.; Wang, Q.; Xian, Y.; Li, Y.; Ni, B.; Pi, Z.; Zhang, K.; Zhang, Y.; Timofte, R.; Gool, L.V. Ciaosr: Continuous implicit attention-in-attention network for arbitrary-scale image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 17–24 June 2023; pp. 1796–1807. [Google Scholar] [CrossRef] [Scilit]
- Liu, H.; Huo, G.; Li, Q.; Guan, X.; Tseng, M.L. Multiscale lightweight 3D segmentation algorithm with attention mechanism: Brain tumor image segmentation. Expert Syst. Appl. 2023, 214, 119166. [Google Scholar] [CrossRef] [Scilit]
- Guo, M.H.; Lu, C.Z.; Liu, Z.N.; Cheng, M.M.; Hu, S.M. Visual attention network. In Computational Visual Media; IEEE: New York, NY, USA, 2023; Volume 9, pp. 733–752. [Google Scholar] [CrossRef] [Scilit]










| Model | mAP@0.5 (%) | Recall (%) | Precision (%) | F1 |
|---|---|---|---|---|
| YOLOv3 | 86.02 | 75.51 | 90.56 | 0.82 |
| YOLOv5 | 89.79 | 76.73 | 96.78 | 0.84 |
| Ours | 93.14 | 75.38 | 97.37 | 0.83 |
| Parameter Value | Description | Setting |
|---|---|---|
| Freeze_Epoch | Freeze Epochs | 50 |
| UnFreeze_Epoch | Unfreeze Epochs | 250 |
| Total_Epoch | Total Epochs | 300 |
| Freeze_Batch_Size | Batch Size (Freeze Phase) | 32 |
| Unfreeze_Batch_Size | Batch Size (Unfreeze Phase) | 16 |
| Init_lr | Initial Learning Rate | 1 × 10−2 |
| lr_decay_type | Learning Rate Decay Schedule | cos |
| Min_lr | Minimum Learning Rate | 1 × 10−4 |
| optimizer_type | Optimizer | SGD |
| momentum | Momentum Factor | 0.937 |
| Baseline | SimAM | LKA | mAP@0.5(%) | Number of Parameters | FPS (Sheets/s) |
|---|---|---|---|---|---|
| √ | 90.06 | 6.2 M | 105 | ||
| √ | √ | 92.25 | 6.2 M | 104 | |
| √ | √ | √ | 93.14 | 6.5 M | 94 |
| Model | mAP@0.5 (%) | Recall (%) | Precision (%) | F1 |
|---|---|---|---|---|
| Faster R-CNN | 86.78 | 89.64 | 71.49 | 0.79 |
| YOLOv3 | 86.02 | 75.51 | 90.56 | 0.82 |
| YOLOv5 | 89.79 | 76.73 | 96.78 | 0.84 |
| YOLOv7 | 93.62 | 79.09 | 97.67 | 0.86 |
| YOLOv7-tiny | 90.06 | 74.41 | 96.71 | 0.83 |
| SLT- YOLOv7 | 93.14 | 75.38 | 97.37 | 0.83 |
| Model | mAP@0.5 (%) | Params | GFLOPs | FPS (Sheets/s) |
|---|---|---|---|---|
| Faster R-CNN | 86.78 | 137 M | 154.3 | 12 |
| YOLOv3 | 86.02 | 61.9 M | 6.2 | 68 |
| YOLOv5 | 89.79 | 46.6 M | 4.5 | 73 |
| YOLOv7 | 93.62 | 37.2 M | 4.2 | 77 |
| YOLOv7-tiny | 90.06 | 6.2 M | 0.5 | 105 |
| SLT-YOLOv7 | 93.14 | 6.5 M | 0.6 | 94 |
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. |
© 2026 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.
Share and Cite
Wang, J.; Liu, M.; Yu, C.; Ye, S.; Chen, J. Lightweight Cooperative Attention for Empowering YOLOv7-Tiny in Lithium Battery Surface Defect Recognition. Energies 2026, 19, 1044. https://doi.org/10.3390/en19041044
Wang J, Liu M, Yu C, Ye S, Chen J. Lightweight Cooperative Attention for Empowering YOLOv7-Tiny in Lithium Battery Surface Defect Recognition. Energies. 2026; 19(4):1044. https://doi.org/10.3390/en19041044
Chicago/Turabian StyleWang, Jianhua, Mengyu Liu, Caihong Yu, Shilin Ye, and Jian Chen. 2026. "Lightweight Cooperative Attention for Empowering YOLOv7-Tiny in Lithium Battery Surface Defect Recognition" Energies 19, no. 4: 1044. https://doi.org/10.3390/en19041044
APA StyleWang, J., Liu, M., Yu, C., Ye, S., & Chen, J. (2026). Lightweight Cooperative Attention for Empowering YOLOv7-Tiny in Lithium Battery Surface Defect Recognition. Energies, 19(4), 1044. https://doi.org/10.3390/en19041044

