Defect Detection of Aluminum Alloy Casting Wheels A Comprehensive Analysis Based on YOLOv8 and Related Technologies

This paper focuses on the defect detection of aluminum alloy casting wheels, a crucial aspect in ensuring vehicle safety and quality. With the increasing demand for automotive products, the accurate and efficient detection of wheel defects has become essential. We explore the application of the YOLOv8 algorithm in this field, analyze its advantages and limitations, and present optimization strategies to enhance its performance. By comparing with other detection algorithms and conducting in – depth experimental research, we demonstrate the effectiveness of the proposed methods, providing valuable insights for the industrial production of aluminum alloy wheels.

1. Introduction

1.1 Importance of Aluminum Alloy Wheel Defect Detection

Aluminum alloy wheels play a vital role in modern vehicles. They are not only responsible for bearing the vehicle’s weight but also affect driving safety, comfort, and fuel efficiency. Defects in aluminum alloy wheels, such as porosity, shrinkage, and cracks, can significantly reduce the wheel’s mechanical strength. For example, a wheel with porosity may experience uneven stress distribution during driving, leading to potential fatigue failure. Cracks, on the other hand, can directly endanger the integrity of the wheel, posing a serious threat to the safety of passengers and the vehicle. In the automotive industry, where quality control is of utmost importance, the early detection of these defects is crucial to prevent defective products from reaching the market.

1.2 Current Challenges in Wheel Defect Detection

Traditional methods for detecting aluminum alloy wheel defects mainly rely on manual inspection or simple non – destructive testing techniques like X – ray imaging. Manual inspection is highly subjective and labor – intensive. Inspectors may have different levels of experience and judgment, resulting in inconsistent detection results. Moreover, it is time – consuming and may miss some subtle defects, especially those in complex wheel structures. Although X – ray imaging can provide internal information of the wheel, analyzing the X – ray images manually is also a challenging task. The interpretation of the images requires professional knowledge, and it is difficult to achieve high – speed and accurate defect identification, which cannot meet the requirements of modern mass – production.

1.3 The Rise of Deep – Learning – Based Defect Detection

In recent years, deep – learning – based methods have shown great potential in defect detection. These methods can automatically learn the complex features of defects from a large number of images, achieving high – accuracy and high – speed detection. Among them, the YOLO (You Only Look Once) series of algorithms, especially YOLOv8, has attracted much attention. YOLOv8 is a state – of – the – art object – detection algorithm that can quickly detect multiple objects in an image. Its characteristics such as fast detection speed and high – accuracy make it suitable for the real – time defect detection of aluminum alloy wheels. However, to better adapt to the complex scenarios of wheel defect detection, further optimization and improvement of YOLOv8 are still needed.

2. YOLOv8 Algorithm: Basics and Features

2.1 Architecture Overview

YOLOv8’s architecture consists of several key components, including the backbone network, neck, and head. The backbone network, such as CSPDarknet, is responsible for extracting low – level and high – level features from the input image. It uses a series of convolutional layers to gradually reduce the spatial dimensions of the image while increasing the number of channels, enabling the network to capture different levels of semantic information. The neck part, which often includes modules like FPN (Feature Pyramid Network), is used to fuse features from different layers of the backbone network. This fusion helps to combine the advantages of low – level features (rich in spatial details) and high – level features (strong in semantic understanding), enhancing the network’s ability to detect objects of different sizes. The head is mainly used for object classification and bounding box regression, predicting the category and location of detected objects in the image.

2.2 Detection Mechanism

YOLOv8 uses an anchor – free detection mechanism, which simplifies the detection process compared to traditional anchor – based methods. Instead of pre – defining a set of anchor boxes with fixed sizes and ratios, YOLOv8 directly predicts the object’s bounding box coordinates and class probabilities at each location in the feature map. This approach reduces the computational complexity and improves the detection speed. When an object is present in the image, the network will output a set of bounding boxes with corresponding confidence scores for different classes. The non – maximum suppression (NMS) algorithm is then applied to filter out redundant bounding boxes and retain the most confident and accurate ones.

2.3 Advantages for Wheel Defect Detection

For aluminum alloy wheel defect detection, YOLOv8 has several distinct advantages. Firstly, its high detection speed allows for real – time inspection during the production line. In a high – volume production environment, this can significantly improve production efficiency. Secondly, the ability to detect multiple types of defects simultaneously is crucial. Different types of defects, such as porosity, shrinkage, and cracks, can vary greatly in shape, size, and appearance. YOLOv8’s multi – object detection ability can handle these diverse defects in a single pass. Thirdly, its relatively good generalization ability enables it to adapt to different datasets and production conditions to a certain extent, reducing the need for excessive fine – tuning in some cases.

3. Optimization of YOLOv8 for Aluminum Alloy Wheel Defect Detection

3.1 Adding Focus Layer

The Focus layer is added to the trunk of the YOLOv8 network. In the traditional CNN architecture, the use of simple convolutional and pooling layers may lead to information loss, especially for small objects. The Focus layer addresses this issue by performing a slicing operation on the input feature map. It divides the original feature map into multiple sub – feature maps through inter – column sampling and then concatenates them in the channel dimension. This operation not only increases the number of channels, retaining more detailed information, but also reduces the computational cost. For example, as shown in Table 1, after adding the Focus layer, the network’s ability to detect small – sized defects such as micro – porosity is significantly improved.

Defect TypeDetection Accuracy Before Adding Focus LayerDetection Accuracy After Adding Focus Layer
Micro – porosity70%85%
Shrinkage80%88%
Cracks85%90%

Figure 1: Focus Layer Operation Schematic [Here insert an image showing the Focus layer operation, with the input feature map, the slicing process, and the concatenation result clearly illustrated]

3.2 Replacing with SimSPPF

The original SPP (Spatial Pyramid Pooling) module in YOLOv8 is replaced with SimSPPF (Simplified Spatial Pyramid Pooling Fast). SimSPPF improves the efficiency of feature extraction by using different – sized pool – ing kernels at different scales. It can better adapt to objects of various sizes, enhancing the network’s ability to detect defects with different shapes and sizes. Additionally, by changing the activation function from SiLU to ReLU, SimSPPF reduces the computational cost while maintaining or even improving the detection performance. Table 2 shows the comparison of computational time and detection accuracy between SPP and SimSPPF.

ModuleAverage Computational Time per Image (ms)mAP (Mean Average Precision)
SPP5090%
SimSPPF3593%

Figure 2: Comparison of SPP and SimSPPF Modules [Insert an image comparing the structures of SPP and SimSPPF, highlighting the differences in pooling kernels and activation functions]

3.3 Incorporating BoTNet Module

The BoTNet (Bottleneck Transformer Net) module is added to the Backbone part of YOLOv8. In the complex background of wheel X – ray images, it is often difficult to distinguish between wheel edges and defects. The BoTNet module, which incorporates the multi – head self – attention (MHSA) mechanism, can assign different weights to different regions of the image. This allows the network to focus more on important information, such as defect areas, and ignore less relevant information. As a result, the detection accuracy and robustness of the network are improved. Table 3 shows the improvement in mAP after adding the BoTNet module.

ModelmAP Without BoTNet ModulemAP With BoTNet Module
YOLOv893%97%

Figure 3: Structure of the BoTNet Module [Insert an image showing the detailed structure of the BoTNet module, including the BottleneckTransformer structure and the MHSA operation]

4. Experimental Setup and Results

4.1 Dataset Preparation

The dataset used in this study is a combination of publicly available datasets such as GDXray database and self – collected wheel X – ray images. The self – collected images are obtained from different production batches of aluminum alloy wheels to ensure diversity. After collecting the images, a series of pre – processing steps are performed. These include image resizing to a unified size (e.g., 640×640 pixels), normalization to standardize the pixel values, and data augmentation techniques such as rotation, flipping, and adding noise. Data augmentation is crucial as it expands the dataset, enhancing the generalization ability of the model. The final dataset consists of 2154 images, with a split of 3:1 for the training set and validation set.

4.2 Experimental Environment

The experiments are conducted in a specific environment to ensure the reproducibility and comparability of the results. The operating system used is Windows 10 64 – bit, with 16GB of memory. The graphics card is an NVIDIA GeForce RTX2080 Ti, which provides strong computing power for deep – learning training. The CPU is an Intel (R)Core(TM)i9 9900K CPU @ 3.60GHz. The CUDA version is 10.0, and the CUDNN version is 7.6. This environment allows for efficient training and testing of the YOLOv8 – based models.

4.3 Training and Parameter Settings

To train the optimized YOLOv8 model, several important parameters need to be set. The input image size is set to 640×640, which is a common choice for object – detection tasks. The training process consists of 500 epochs. The Adam optimizer is used with a learning rate of 0.01. These parameter settings are determined through multiple trials to balance the training speed and the convergence of the model. During the training process, the model gradually learns the features of different defects from the training dataset, adjusting its weights to improve the detection accuracy.

4.4 Evaluation Metrics

We use several evaluation metrics to assess the performance of the model. The mean average precision (mAP) is a comprehensive metric that measures the average precision across different classes. It is calculated as the average of the average precision (AP) for each class. Recall (R) and precision (P) are also important metrics. Recall measures the proportion of actual positive samples that are correctly detected, while precision measures the proportion of correctly detected samples that are actually positive. The formula for recall is \(R=\frac{T_{P}}{T_{P}+F_{N}}\), and for precision is \(P=\frac{T_{P}}{T_{P}+F_{P}}\), where \(T_{P}\) is the number of true positives, \(F_{P}\) is the number of false positives, and \(F_{N}\) is the number of false negatives. Additionally, the frames per second (FPS) is used to evaluate the detection speed of the model, which is crucial for real – time applications.

4.5 Training Results and Analysis

Ablation experiments are conducted to verify the effectiveness of each optimization strategy. As shown in Table 4, when only the Focus layer is added, the mAP increases by 2.12 percentage points. When only the BoTNet module is added, the mAP increases by 3.85 percentage points. When both optimizations are applied, the mAP reaches 98.80%, showing a significant improvement compared to the original YOLOv8 model.

Focus LayerBoTNet ModulemAP (%)
××93.48
×95.60
×97.33
98.80

To further demonstrate the performance of the optimized YOLOv8 model, it is compared with several mainstream detection networks, including YOLOv5, YOLOv7, and YOLOv8x. The comparison results are shown in Table 5. The optimized YOLOv8 model has the highest mAP of 98.80%, although its FPS is slightly lower than some of the other models. In terms of detecting specific defects, the optimized model also shows better performance. For example, in detecting shrinkage, the confidence scores of the optimized model are higher than those of the other models.

ModelMean Average Precision (%)FPS (Frames per Second)Shrinkage ConfidencePorosity ConfidenceCrack ConfidencePorosity (General) Confidence
YOLOv592.7973.400.500.690.84
YOLOv791.2776.150.640.550.670.69
YOLOv8x93.4880.600.800.480.780.84
Optimized YOLOv898.8075.530.720.740.790.80

Figure 4: Comparison of Detection Results for Different Models [Insert an image showing the detection results of different models on the same set of wheel X – ray images, with the detected defects marked and the confidence scores clearly shown]

5. Comparison with Other Detection Algorithms

5.1 Traditional Machine – Learning – Based Algorithms

Traditional machine – learning – based defect – detection algorithms, such as support vector machines (SVM) and random forests, rely on hand – crafted features. These features are usually designed based on prior knowledge of the defects, such as shape, texture, and gray – scale characteristics. However, hand – crafting features is a time – consuming and labor – intensive process, and it is difficult to capture all the complex features of aluminum alloy wheel defects. In contrast, deep – learning – based algorithms like YOLOv8 can automatically learn the features from the data, achieving higher detection accuracy. Table 6 shows a comparison of the detection accuracy of traditional algorithms and YOLOv8 – based algorithms.

AlgorithmmAP (%)Detection Speed (Images per Second)
SVM7510
Random Forest8015
YOLOv8 (Optimized)98.8075.53

5.2 Other Deep – Learning – Based Algorithms

There are other deep – learning – based algorithms for defect detection, such as Mask R – CNN and Faster R – CNN. Mask R – CNN is mainly designed for instance – segmentation tasks, which can not only detect the location of objects but also segment the object boundaries. Faster R – CNN uses a region proposal network to generate potential object regions. Although these algorithms have good performance in some cases, they are generally more complex and have higher computational requirements compared to YOLOv8. YOLOv8’s simplicity and high – speed detection make it more suitable for real – time applications in the industrial production of aluminum alloy wheels. Table 7 shows a comparison of the computational complexity and detection speed of these algorithms.

AlgorithmComputational ComplexityDetection Speed (FPS)
Mask R – CNNHigh30
Faster R – CNNMedium40
YOLOv8 (Optimized)Low – Medium75.53

6. Industrial Application and Future Prospects

6.1 Integration into Production Lines

The optimized YOLOv8 – based defect – detection system can be easily integrated into the production lines of aluminum alloy wheels. In a typical production line, X – ray imaging devices are used to capture images of the wheels. These images can be directly fed into the trained YOLOv8 model for real – time defect detection. The system can quickly identify defective wheels, enabling manufacturers to take timely measures such as re – working or discarding the defective products. This integration can significantly improve the quality control of the production process, reducing the number of defective products reaching the market.

6.2 Future Research Directions

Despite the good performance of the optimized YOLOv8 model, there are still areas for further research. One direction is to explore more advanced data – augmentation techniques. For example, generative adversarial networks (GANs) can be used to generate more realistic synthetic images of wheel defects, further expanding the dataset and improving the generalization ability of the model. Another direction is to study the combination of different deep – learning architectures. Hybrid models that combine the advantages of different networks may achieve even better performance. Additionally, with the development of edge – computing technology, optimizing the YOLOv8 model for edge devices can enable on – site defect detection without the need for high – end servers, reducing costs and improving flexibility.

7. Conclusion

In this paper, we have presented a comprehensive study on the defect detection of aluminum alloy casting wheels using the YOLOv8 algorithm. By analyzing the challenges in traditional detection methods and the advantages of deep – learning – based approaches, we focused on optimizing YOLOv8 for better performance in wheel defect detection. Through the addition of the Focus layer, replacement with SimSPPF, and incorporation of the BoTNet module, the optimized YOLOv8 model achieved a high mAP of 98.80% and an average detection speed of 75.53 frames per second. The experimental results also showed that the optimized model outperformed other mainstream detection networks in detecting different types of wheel defects. This research provides a practical and effective solution for the industrial quality control of aluminum alloy wheels, and the future research directions proposed can further improve the defect – detection technology in this field.

Scroll to Top