LAD-YOLO: A Lightweight YOLOv5 Network for Surface Defect Detection on Aluminum Profiles

Dongxue Zhao, Shenbo Liu, Yuanhang Chen, Da Chen, Zhelun Hu, Lijun TangInternational Journal of Advanced Computer Science and Applications 2023 · DOI

TL;DR

LAD-YOLO is a highly optimized version of YOLOv5 designed specifically for detecting surface defects on aluminum profiles. By integrating lightweight modules like ShuffleNetV2 and a novel "Ghost_SPPFCSPC_group" structure, the researchers achieved a 96.9% mean Average Precision (mAP) while slashing the model size by over 50% compared to the standard YOLOv5s.

What Problem Does This Paper Address?

In industrial manufacturing, aluminum profiles are prone to defects like scratches, pinholes, and wrinkles. While deep learning models like YOLOv5 have revolutionized object detection, they often struggle in real-world factory settings. The primary challenges are:

  1. Computational Complexity: Standard models are often too large and slow for "edge" deployment on low-cost industrial hardware.
  2. Small Target Detection: Tiny defects (like pinholes) are easily missed by general-purpose architectures.
  3. Parameter Bloat: High parameter counts lead to slow inference speeds, making real-time monitoring difficult.

The authors aim to bridge the gap between high-accuracy laboratory models and the practical need for lightweight, real-time industrial inspection.

Methods

The researchers transformed the YOLOv5 architecture into LAD-YOLO (Lightweight Aluminum Defect YOLO) using several key innovations:

  • ShuffleNetV2 Backbone: They replaced the standard CSPDarknet53 backbone with ShuffleNetV2 modules. This utilizes "channel shuffling" and depthwise separable convolutions to drastically reduce memory access and parameter counts without losing significant feature information.
  • CBAM (Convolutional Block Attention Module): To compensate for the potential accuracy loss of a lightweight backbone, the authors added CBAM. This attention mechanism helps the network focus on the most relevant spatial regions and feature channels—crucial for spotting subtle surface defects.
  • The "Ghost_SPPFCSPC_group" Structure: This is the paper's most novel contribution. It combines:
  • Spatial Pyramid Pooling-Fast (SPPF): For multi-scale feature fusion.
  • Ghost Convolutions: Which use cheap linear operations to generate "ghost" feature maps, reducing redundant computation.
  • Group Convolutions: To further split the workload across channel groups.
  • DSConv in the Neck: Depthwise Separable Convolutions (DSConv) are used in the neck of the network to further reduce floating-point operations (FLOPs) during feature fusion.

Datasets

The study utilized a custom dataset of aluminum profile images captured via a Hikvision high-definition industrial camera.

  • Categories: Pinhole, scratch, dirt, and wrinkle.
  • Data Augmentation: Because the initial sample size was small, the authors used panning, rotation, brightness adjustment, shearing, and mirroring to expand the set.
  • Final Count: 5,013 images containing over 17,000 labeled defects. The data was split into 60% training, 20% validation, and 20% testing.

Key Insights and Ideas

  • Efficiency via Redundancy Management: The use of Ghost Convolutions acknowledges that many feature maps in deep networks are similar. By generating these "duplicates" through cheap linear transformations rather than expensive standard convolutions, the model maintains performance while shedding weight.
  • Attention as a Balancer: The paper demonstrates that lightweight models don't have to be "dumb." By strategically placing attention modules (CBAM), the network can "squint" at the important parts of an image, allowing a smaller backbone to perform like a much larger one.
  • Multi-Scale is Mandatory: Defects on aluminum aren't uniform; a scratch might be long and thin, while a pinhole is tiny and circular. The custom SPP structure is essential for the model to "see" at multiple scales simultaneously.

Key Results

LAD-YOLO outperformed several established benchmarks, including SSD, YOLOv3, YOLOv4-tiny, and the baseline YOLOv5s:

  • Accuracy: Achieved a 96.9% mAP, which is a 2.8% improvement over YOLOv5s and a 7.2% improvement over YOLOv5s-MobileNetv3.
  • Model Size: Reduced to just 6.64 MB, a 52.8% reduction compared to YOLOv5s (14.07 MB).
  • Computational Speed: GFLOPs dropped to 5.5, a massive 65% reduction from the baseline (15.8).
  • Category Performance: The model was exceptionally good at finding dirt (99.3% AP) and pinholes (98.8% AP), though scratches remained the most challenging category at 91.1% AP.

Limitations and Future Work

While the results are impressive, the authors note a few areas for improvement:

  • Environmental Sensitivity: Scratches are still the hardest to detect because their appearance changes significantly based on lighting and the angle of the camera.
  • Dataset Diversity: The current model is trained on a specific set of conditions. Future work will involve augmenting the dataset with images featuring uneven lighting, occlusions, and more complex real-world backgrounds to improve the model's resilience.
  • Real-time Edge Testing: While the metrics suggest high speed, the next step is deploying the model on actual low-power embedded systems in a factory environment to validate real-time performance.

Summary updated

Abstract

In this paper, we leverage the advantages of YOLOv5 in target detection to propose a highly accurate and lightweight network, called LAD-YOLO, for surface defect detection on aluminum profiles. The LAD-YOLO addresses the issues of computational complexity, low precision, and a large number of model parameters encountered in YOLOv5 when applied to aluminum profiles defect detection. LAD-YOLO reduces the model parameters and computation while also decreasing the model size by utilizing the ShuffleNetV2 module and depthwise separable convolution in the backbone and neck networks, respectively. Meanwhile, a lightweight structure called "Ghost_SPPFCSPC_group", which combines Cross Stage Partial Network Connection Operation, Ghost Convolution, Group Convolution and Spatial Pyramid Pooling-Fast structure, is designed. This structure is incorporated into the backbone along with the Convolutional Block Attention Module (CBAM) to achieve lightweight. Simultaneously, it enhances the model's ability to extract features of weak and small targets and improves its capability to learn information at different scales. The experimental results show that the mean Average Precision (mAP) of LAD-YOLO on aluminum profiles defect datasets reaches 96.9%, model size is 6.64MB, and Giga Floating Point Operations (GFLOPs) is 5.5. Compared with YOLOv5, YOLOV5s-MobileNetv3, and other networks, LAD-YOLO proposed in this paper has higher accuracy, fewer parameters, and lower floating-point computation.
BibTeX
@article{zhao2023lad,
  author = {Dongxue Zhao and Shenbo Liu and Yuanhang Chen and Da Chen and Zhelun Hu and Lijun Tang},
  title = {{LAD-YOLO: A Lightweight YOLOv5 Network for Surface Defect Detection on Aluminum Profiles}},
  journal = {International Journal of Advanced Computer Science and Applications},
  year = {2023},
  doi = {10.14569/ijacsa.2023.0140924},
}
Figure