Lightweight mobile phone screen defect detection method based on improved YOLOv10
By improving the YOLOv10 model architecture, using Starnet, C2f-ODConv and Detect_LSCD modules, the problems of missed detection, false detection and high computational complexity of the YOLOv10 model in mobile phone screen defect detection are solved, achieving efficient and real-time detection performance and lightweighting.
Patent Information
- Application Number
- CN202510224895.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-04-29
AI Technical Summary
The YOLOv10 model has problems such as missed detection, missed detection and high computational complexity in mobile phone screen defect detection, which is difficult to meet the requirements of real-time detection.
By improving the YOLOv10 model architecture, the Starnet module, C2f-ODConv module and Detect_LSCD module are used to optimize the training data set and detection process, reducing the complexity and calculation amount of the model.
It realizes efficient deployment of models on devices and real-time detection performance, improves detection accuracy and lightweightness, and adapts to mobile deployment needs.
Smart Images

Figure CN119904449A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology, and in particular to a lightweight mobile phone screen defect detection method based on improved YOLOv10. Background Art
[0002] In today's digital age, smartphones have become an indispensable part of people's daily lives. With the continuous expansion of the smartphone market, the quality inspection of mobile phone screens, as the main interface for users to interact with devices, has become increasingly important. Various defects may occur on mobile phone screens during the production process, such as scratches, stains, oil spots, etc. These defects not only affect the appearance of the phone, but may also have a negative impact on the user experience. Therefore, it is of great practical significance to develop an efficient and accurate method for detecting defects in mobile phone screens.
[0003] Traditional methods for detecting defects in mobile phone screens mainly rely on manual visual inspection or automated inspection systems based on traditional image processing technology. Manual visual inspection has disadvantages such as low efficiency and susceptibility to subjective factors, making it difficult to meet the needs of large-scale production. Although the automated inspection system based on traditional image processing technology has improved the inspection efficiency to a certain extent, its inspection accuracy is limited. It is difficult to accurately identify some minor or complex defects, and it has poor adaptability to different lighting conditions and screen backgrounds.
[0004] In recent years, with the rapid development of deep learning technology, deep learning-based object detection algorithms have achieved remarkable results in the field of image recognition. As a leader in the field of real-time object detection, the YOLO series of algorithms are widely used in various object detection tasks due to their fast speed and high accuracy. The YOLO algorithm treats the object detection task as a regression problem and directly predicts the location and category of the object on the image, avoiding the complex feature extraction and candidate box generation process in traditional methods, greatly improving the detection efficiency.
[0005] However, the YOLOv10 model still faces some challenges when applied to mobile phone screen defect detection. First, the size of mobile phone screen defects is usually small and irregular in shape, which makes the model prone to missed detection or false detection during detection. Second, the YOLOv10 model has a large number of parameters and high computational complexity. When it is directly deployed and run on a device, it will be limited by the device's computing resources and storage space, resulting in a decrease in detection speed and failure to meet the requirements of real-time detection, which further increases the difficulty of defect detection.
[0006] In the prior art, patent CN119273992A discloses a method for detecting defects in mobile phone screen glass based on improved YOLOv8, which improves detection accuracy by adding an attention module and improving a convolution module. However, this method has the following limitations: it uses the YOLOv8 infrastructure, has a large number of parameters, high computational complexity, and low lightweight, making it difficult to meet the requirements of mobile terminal deployment; at the same time, the multi-scale feature fusion mechanism is simple and uses a basic detection head, so the detection accuracy is insufficient to a certain extent. Summary of the invention
[0007] In view of the above technical defects, the present invention proposes a lightweight mobile phone screen defect detection method based on improved YOLOv10. The method reduces the model complexity and computational complexity by improving the YOLOv10 model architecture, and optimizes the training data set and detection process, thereby improving the model deployment efficiency on the device and the real-time detection performance.
[0008] A lightweight mobile phone screen defect detection method based on improved YOLOv10 includes the following steps:
[0009] S1: Collect mobile phone screen image data, enhance and annotate the data set, and build a mobile phone screen defect training data set;
[0010] S2: Starnet module, C2f-ODConv module, and Detect_LSCD module are used to improve the YOLOv10 network model structure and build a mobile phone screen defect detection model with YOLO-STAR network structure;
[0011] S3: Use the mobile phone screen defect training dataset constructed in S1 as input to train the improved YOLOv10 network structure model;
[0012] S4: Deploy the trained YOLOv10 network structure model to the mobile device to perform real-time detection of the mobile phone screen image.
[0013] Furthermore, in said S1, the specific steps include:
[0014] S11: Collecting mobile phone screen image data, the image data including mobile phone screen images with scratches, stains, and oil spots;
[0015] S12: Perform data enhancement processing on the image data collected in S11. The data enhancement processing adopts a composite enhancement strategy driven by a physical model:
[0016]
[0017] in is a geometric transformation operator (random rotation ±30°, scaling 0.5-2.0×, perspective transformation), is a material reflection model based on the physical properties of defects, I raw is the original image, I aug is the image after data enhancement, θ is the transformation parameter;
[0018] S13: Label the image enhanced in S12, generate the label using labelimg, and construct a c ,y c , w, h) and annotation files of defect categories c∈0,1,2;
[0019] S14: Randomly divide the labeled data set in S13 into a training set and a validation set.
[0020] Furthermore, in S2, the improved YOLOv10 target detection network model includes a backbone network, a neck structure and a head structure, which is used for multi-scale target detection tasks;
[0021] In the backbone network, the network first performs preliminary feature extraction through the Starnet module, then uses the SPPF module to perform spatial pyramid pooling to enhance the scale invariance of the features, and finally introduces the parallel spatial attention mechanism through the PSA module to further enhance the spatial information of the features and output a high-resolution feature map P5;
[0022] In the neck network part, the network gradually upsamples the feature map P5 output by the backbone network and concatenates it with the feature maps P4 and P3 through multiple upsampling and feature fusion to form a multi-scale feature representation. At each scale, the network further processes the fused feature map through multiple convolution modules (C2f_ODConv, DWConv, C2fCIB) to enhance the feature expression ability;
[0023] Finally, in the head structure, the feature maps of different scales (P3, P4, P5) are input into the detection layer through the Detect_LSCD detection module, and the category, location and confidence information of the target are output.
[0024] The mobile phone screen defect detection model with YOLO-STAR network structure is as follows:
[0025] S21: Improve the Backbone part in YOLOv10 to the Starnet module;
[0026] S22: Improve the C2f module in YOLOv10 to the C2f-ODConv module;
[0027] S23: Improve the Head detection head in YOLOv10 to the Detect_LSCD module.
[0028] Furthermore, in S21, the Starnet module consists of a STEM layer and a multi-scale feature extraction stage, and its forward transfer method is:
[0029] S211: The input image first passes through a STEM layer, which consists of a 3x3 convolution kernel and a ReLU6 activation function, which can be specifically expressed as:
[0030] f STEM (x) = ReLU6(Conv 3×3 (x; C in =3, C out =32, stride=2))
[0031] The function of the STEM layer is to expand the number of channels of the input image from 3 to 32, and at the same time halve the spatial size of the image, reducing the amount of calculation and preparing for multi-scale feature extraction;
[0032] S212: The feature map processed by the STEM layer in S211 enters the multi-scale feature extraction stage (Stages);
[0033] The Stages consist of four stages, each of which contains the following two main parts:
[0034] Downsampling layer: Use a 3x3 convolution kernel to downsample the input feature map, further halving the spatial size while increasing the number of channels. This operation gradually reduces the resolution of the feature map, but gradually increases the number of channels, thereby capturing higher-level semantic information;
[0035] Multiple Star_Blocks: Each stage contains multiple Star_Block modules, which are used to extract rich features at the current scale. The Star_Block module further enhances the expressiveness of features and retains detailed information through internal convolution operations and activation functions;
[0036] S213: After the four stages of processing described in S212, feature maps of different scales are obtained. These feature maps have different spatial sizes and numbers of channels, and can capture multi-scale information from local details to global semantics, which is used for further multi-scale feature extraction of subsequent neck structures.
[0037] Furthermore, in S212, each Star_Block first performs spatial local aggregation on the input features of the current stage (i.e., the output of the previous module) through a depthwise separable convolution, and then performs channel feature fusion through two 1x1 convolutions and element-wise multiplication (Element-wise Multiplication), and then further processes the features through another depthwise separable convolution and 1x1 convolution, and performs a residual connection with the input to retain the original feature information;
[0038] Assume the input is Among them C in is the number of input channels, H and W are the height and width respectively, then the Star_Block module can be expressed as:
[0039] x dw =DWConv(x)
[0040] x out =x+DropPath(DWConv2(MLP g (ReLU6(MLP1(x dw ))⊙MLP2(x dw )))))
[0041] Among them, DWConv is a depth-wise separable convolution, MLP is a linear transformation (convolution), ReLU6 is an activation function, and DropPath is an operation of randomly discarding a path.
[0042] Furthermore, in S22, the C2f-ODConv module integrates the OD_Attention mechanism on the basis of the C2f module, and uses ODConv to replace the Bottleneck convolution module in C2f; wherein, the OD_Attention mechanism simultaneously considers information in four dimensions: channel attention, filter attention, spatial attention, and convolution kernel attention. By performing attention calculation on the four dimensions of the feature map, it can more accurately focus on the area with important semantic information in the image; assuming the input is Where B is the batch size, C in is the number of input channels, H and W are the height and width respectively, then the specific implementation of ODConv convolution is:
[0043] S221: First calculate channel attention, filter attention, spatial attention and convolution kernel attention:
[0044] (A c , A f , A s , A k ) = OD_Attention(x)
[0045] Among them, OD_Attention is an attention module that outputs four attention maps, A c is the channel attention map, A f is the filter attention map, A s is the spatial attention map, A k is the convolution kernel attention map;
[0046] S222: Multiply the channel attention with the input feature map to enhance the features of important channels:
[0047] x′=x⊙A c
[0048] S223: Calculate the aggregation weight according to the attention mechanism and weight parameters:
[0049] W agg =A s ⊙A k ⊙W k
[0050] Where W k is the convolution kernel, W agg is the weight after aggregation;
[0051] S224: Perform convolution operation using the aggregated weights to obtain an output feature map:
[0052] y = Conv(x′, W agg )
[0053] S225: Reshape the output feature map to the original batch size and multiply it with the filter attention to get the final output:
[0054] y′=y⊙A f
[0055] The ODConv module introduces multiple attention mechanisms to achieve dynamic adjustment of input feature maps, convolution kernels, and output feature maps, thereby improving the expressiveness and adaptability of the model.
[0056] Furthermore, in S221, the specific calculation method of the OD_Attention module is: assuming that the input is
[0057] First, the input is globally averaged pooled, the feature map after pooling passes through the fully connected layer, and finally the channel attention is calculated; the specific expression is:
[0058]
[0059] Among them, AdaptiveAvgPool is adaptive average pooling, BN is batch normalization layer, ReLU is activation function, σ is Sigmoid activation function, temperature is temperature parameter, softmax is normalized exponential function, Conv is convolution layer, x avg is the feature map after pooling, x fc is the feature map after being processed by the fully connected layer, A c is the channel attention map, A f is the filter attention map, A s is the spatial attention map, A k is the convolution kernel attention map, C in is the number of input channels, C out is the number of output channels.
[0060] Furthermore, in S23, the Detect_LSCD module adopts the Share_Conv shared convolution layer, which includes two convolution layers for further feature extraction and fusion of the feature map to enhance the expression ability of the features. The specific structure of the Share_Conv shared convolution layer is:
[0061] The first convolutional layer adopts the Conv_GN structure, including convolution operations and group normalization, which is used to perform preliminary feature extraction on the input feature map;
[0062] The second convolutional layer also uses the Conv_GN structure to further extract and fuse the output of the first convolutional layer to enhance the expressiveness of the features.
[0063] Furthermore, S3 specifically includes: using the improved YOLOv10 model architecture, taking the data set constructed in S1 as input, setting the learning rate and number of iterations during the training process, using the stochastic gradient descent (SGD) optimizer to gradually converge the model, and learning the feature representation and detection rules of mobile phone screen targets.
[0064] Furthermore, in S4, the target detection method is applied to the mobile phone screen detection scenario. After the model is deployed on the mobile device, the model is also quantized. The quantization method includes converting the weights and activation values of the model from floating point numbers to fixed point numbers, and further reducing the storage space and calculation amount of the model through quantization; when the image is collected in real time on the mobile phone screen, the image is also preprocessed. The preprocessing method includes adjusting the image size and normalizing the pixel value so that the image meets the input requirements of the model.
[0065] Beneficial effects of the present invention:
[0066] The present invention achieves the dual advantages of model lightweight and high detection accuracy by optimizing the model structure and algorithm mechanism. Specifically, StarNet is used as the backbone network. Its unique four-stage hierarchical architecture and core mechanism can efficiently calculate in low-dimensional space while taking into account the extraction of high-dimensional features, thereby greatly reducing the number of model parameters and computational complexity while still maintaining a strong feature extraction capability. The C2f-ODConv module introduces dynamic convolution and multi-dimensional attention mechanisms, dynamically adjusts the convolution kernel weights according to the input, accurately captures the shape and texture information of the target, and further improves the accuracy of feature extraction. The Detect_LSCD module reduces repeated calculations through a shared convolution mechanism, so that multiple detection tasks can share the features of the convolution layer, which not only reduces the computational complexity, but also improves the accuracy of target classification and positioning. This combination of lightweight and high precision enables the model to run efficiently on low-resource devices while meeting the strict requirements for detection accuracy and real-time performance in actual application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 This is a flow chart of a lightweight mobile phone screen defect detection method based on improved YOLOv10.
[0068] Figure 2 Schematic diagram of the C2f-ODConv module structure of the lightweight mobile phone screen defect detection method based on improved YOLOv10.
[0069] Figure 3 This is a schematic diagram of the overall structure of the model of the lightweight mobile phone screen defect detection method based on the improved YOLOv10.
[0070] Figure 4 The detection results of the lightweight mobile phone screen defect detection method based on improved YOLOv10.
[0071] Figure 5 Schematic diagram of the performance indicators of the lightweight mobile phone screen defect detection method based on the improved YOLOv10. DETAILED DESCRIPTION
[0072] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely explain the technical solutions in the embodiments of the present invention. It should be clear that the described embodiments are only part of the many embodiments of the present invention, not all.
[0073] like Figure 1 As shown in the figure, the lightweight mobile phone screen defect detection method based on the improved YOLOv10 includes the following steps:
[0074] 1. Build a mobile phone screen defect training dataset:
[0075] 1,200 mobile phone screen images were collected, including 400 images with scratches, 400 images with stains, and 400 images with oil spots.
[0076] The collected image data is enhanced using a physical model-driven composite enhancement strategy, including random rotation of ±30°, scaling of 0.5-2.0×, perspective transformation, etc. The enhanced image is annotated, including the target category (scratches, stains, oil spots) and position coordinates (x1, y1, x2, y2). The image resolution is 1920×1080 and the format is JPEG.
[0077] 2. Improve the YOLOv10 target detection network model:
[0078] The Backbone part in YOLOv10 is improved to the Starnet module. The Starnet module consists of a STEM layer and a multi-scale feature extraction stage (Stages). The STEM layer consists of a 3×3 convolution and a ReLU6 activation function, which changes the number of channels of the input image from 3 to 32 and halves the spatial size. The multi-scale feature extraction stage consists of four stages, each of which contains a downsampling layer and multiple Star_Blocks. The downsampling layer uses a 3×3 convolution to further halve the spatial size and increase the number of channels. The output feature maps of all stages form a feature list as the final output of Starnet. These feature maps have different sizes and semantic information and can be used for different subsequent tasks, such as object detection, semantic segmentation, etc. Each Star_Block input feature map first undergoes a deep convolution with a convolution kernel size of 7, a stride of 1, a padding of 3, and a grouping number equal to the number of input channels. The feature map is convolved in the spatial dimension to extract local spatial features. The feature map after deep convolution is divided into two parallel convolution branches f1 and f2.
[0079] The f1 branch expands the number of channels through a point-by-point convolution (1x1 convolution), and the f2 branch also expands the number of channels through a point-by-point convolution. The output of the f1 branch is processed by the ReLU6 activation function and then fused with the output of the f2 branch by element-wise multiplication to obtain a fused feature map. This fusion method can enhance the nonlinear expression ability of the features. The fused feature map is then transformed in the channel dimension through a point-by-point convolution (g), the number of channels is restored to the number of input channels, and then a deep convolution is performed on the spatial dimension to further refine the features. Finally, a residual connection is performed to add the feature map after the above operation to the input feature map to obtain the output feature map of the StarBlock module.
[0080] The C2f module in YOLOv10 is improved to the C2f-ODConv module. The C2f-ODConv module integrates the ODConv technology based on the C2f module. The specific implementation of ODConv convolution is as follows: calculate channel attention, filter attention, spatial attention, and convolution kernel attention; multiply the channel attention with the input feature map to enhance the features of important channels; reshape the input feature map into 1 batch; calculate the aggregation weight according to the attention mechanism and weight parameters; perform convolution operation using the aggregation weight to obtain the output feature map; reshape the output feature map to the original batch size and multiply it with the filter attention to obtain the final output.
[0081] The improved C2f-ODConv network structure model is as follows Figure 2 As shown in the figure, it first extracts features from the input image through a convolutional layer, and then divides the feature map into multiple parts. Each part is processed by a Bottleneck_ODConv, which contains multiple ODConv operations to extract deeper features. Finally, these processed feature maps are concatenated and the final feature map is output through another convolutional layer. In Bottleneck_ODConv, the input first passes through an ODConv layer, then a bottleneck layer, and finally another ODConv layer.
[0082] The Head detection head in YOLOv10 is improved to the Detect_LSCD network structure. The Detect_LSCD module uses the Share_Conv shared convolution layer, which includes two convolution layers, both of which use the Conv_GN structure, including convolution operations and group normalization. The first convolution layer is used to perform preliminary feature extraction on the input feature map, and the second convolution layer further extracts and fuses the output of the first convolution layer to enhance the feature expression capability.
[0083] After improvement, the network structure model based on the improved YOLOv10 algorithm is as follows Figure 3As shown in the figure, the structure of the improved YOLOv10 target detection network model is composed of a backbone network, a neck structure and a head structure, which is used for multi-scale target detection tasks; in the backbone network part, the network first performs preliminary feature extraction through the Starnet module, and then uses the SPPF module to perform spatial pyramid pooling to enhance the scale invariance of the features. Finally, the parallel spatial attention mechanism is introduced through the PSA module to further strengthen the spatial information of the features and output a high-resolution feature map P5; in the neck network part, the network gradually upsamples the feature map P5 output by the backbone network through multiple upsampling and feature fusion, and splices it with the P4 and P3 feature maps to form a multi-scale feature representation. At each scale, the network further processes the fused feature map through multiple convolution modules (C2f_ODConv, DWConv, C2fCIB) to enhance the expressiveness of the features; finally, in the head structure, the feature maps of different scales (P3, P4, P5) are input into the detection layer through the Detect_LSCD detection module, and the category, position and confidence information of the target are output.
[0084] 3. Use the improved YOLOv10 model architecture for model training:
[0085] The model training this time uses the improved YOLOv10 model architecture, which is optimized based on the original YOLO model to better adapt to the task of mobile phone screen object detection. After preprocessing and accurate annotation, the training data set is used as the input for model training. All training processes are carried out on high-performance servers to ensure that the model can learn and converge efficiently.
[0086] During the training process, the training parameters of the model were configured. The initial learning rate was set to 1e-2, the total number of training iterations was 300 epochs, the stochastic gradient descent (SGD) optimizer was used, the weight decay coefficient was set to 0.0003, the momentum was set to 0.95, and the input image size during training was 640×640 pixels.
[0087] Through the above configuration, the model gradually converges during the training process and learns the feature representation and detection rules of mobile phone screen targets. After the training is completed, the model will have efficient detection capabilities and can accurately identify and locate mobile phone screen targets.
[0088] 4. Deploy the trained model to the mobile device and perform real-time detection on the mobile phone screen image:
[0089] When the trained model is deployed on a mobile device, the model is quantized, converting the model's weights and activation values from floating point numbers to fixed point numbers. This quantization method not only significantly reduces the model's storage space, but also reduces computational complexity. After quantization optimization, the model runs much faster on mobile devices while maintaining high detection accuracy.
[0090] When capturing images in real time on the mobile phone screen, first adjust the captured images to the size required by the model input (640×640). Then, normalize the images and adjust the pixel value range to [0,1]. This preprocessing method can effectively improve the adaptability of the model to the input data and ensure the reliability of the detection results.
[0091] like Figure 4 As shown in Figure 2, the optimized model is able to detect defects in mobile phone screen images in real time on mobile devices. Figure 4 Comparing the original mobile phone screen image with the detection results, it can be seen that the optimized model can detect screen defects with a high overall confidence level.
[0092] like Figure 5 As shown in the figure, compared with the original YOLOv10, in actual tests, the mAP@0.5 of the improved YOLOv10 model is increased to 0.95, the number of parameters is reduced to 1.45M, and the amount of calculation is reduced to 4.1GFLOPs, which shows that the overall performance of the present invention is better than the original model. The above performance indicators fully demonstrate the efficiency and accuracy of the technical solution in practical applications, and reflect the advantages of lightweight models.
[0093] In summary, the present invention has effectively improved the accuracy and efficiency of mobile phone screen defect detection by improving the Backbone backbone part in YOLOv10 into a Starnet network structure, the C2f module into a C2f-ODConv module, and the Head detection head into a Detect_LSCD network structure. At the same time, it has reduced the computational complexity and storage space requirements of the model, so that it can better adapt to real-time detection scenarios on mobile devices.
[0094] The above description is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Within the spirit and principle of the present invention, any modification, equivalent substitution, improvement, etc. of the present invention shall be included in the protection scope of the present invention. Any technician familiar with the technical field shall be included in the protection scope of the present invention if he / she makes equivalent substitution or change according to the technical solution and inventive concept of the present invention within the technical scope disclosed by the present invention.
Claims
1. A lightweight mobile phone screen defect detection method based on improved YOLOv10, characterized in that: The following steps are involved: S1: Collect mobile phone screen image data, enhance and annotate the data set, and build a mobile phone screen defect training data set; S2: Starnet module, C2f-ODConv module, and Detect_LSCD module are used to improve the YOLOv10 network model structure and build a mobile phone screen defect detection model with YOLO-STAR network structure; S3: Use the mobile phone screen defect training dataset constructed in S1 as input to train the improved YOLOv10 network structure model; S4: Deploy the trained YOLOv10 network structure model to the mobile device to perform real-time detection of the mobile phone screen image.
2. According to claim 1, the lightweight mobile phone screen defect detection method based on improved YOLOv10 is characterized in that: In S1, the specific steps include: S11: Collecting mobile phone screen image data, the image data including mobile phone screen images with scratches, stains, and oil spots; S12: Perform data enhancement processing on the image data collected in S11. The data enhancement processing adopts a composite enhancement strategy driven by a physical model: in is the geometric transformation operator, is a material reflection model based on the physical properties of defects, I raw is the original image, I aug is the image after data enhancement, θ is the transformation parameter; S13: Label the image enhanced in S12, generate the label using labelimg, and construct a c ,y c , w, h) and annotation files of defect categories c∈0,1,2; S14: Randomly divide the labeled data set in S13 into a training set and a validation set.
3. The lightweight mobile phone screen defect detection method based on improved YOLOv10 according to claim 1 is characterized in that: In S2, the improved YOLOv10 target detection network model includes a backbone network, a neck structure and a head structure, which is used for multi-scale target detection tasks; In the backbone network, the network first performs preliminary feature extraction through the Starnet module, then uses the SPPF module for spatial pyramid pooling, and finally introduces the parallel spatial attention mechanism through the PSA module to output a high-resolution feature map P5; In the neck network part, the network gradually upsamples the feature map P5 output by the backbone network through multiple upsampling and feature fusion, and splices it with the feature maps P4 and P3 to form a multi-scale feature representation. At each scale, the network further processes the fused feature map through multiple convolution modules (C2f_ODConv, DWConv, C2fCIB); Finally, in the head structure, the feature maps of different scales (P3, P4, P5) are input into the detection layer through the Detect_LSCD detection module, and the category, location and confidence information of the target are output.
4. The lightweight mobile phone screen defect detection method based on improved YOLOv10 according to claim 3 is characterized in that: The mobile phone screen defect detection model with YOLO-STAR network structure is as follows: S21: Improve the Backbone part in YOLOv10 to the Starnet module; S22: Improve the C2f module in YOLOv10 to the C2f-ODConv module; S23: Improve the Head detection head in YOLOv10 to the Detect_LSCD module.
5. The lightweight mobile phone screen defect detection method based on improved YOLOv10 according to claim 4 is characterized in that: In S21, the Starnet module consists of a STEM layer and a multi-scale feature extraction stage, and its forward transfer method is: S211: The input image first passes through a STEM layer, which consists of a 3x3 convolution kernel and a ReLU6 activation function, which can be specifically expressed as: f STEM (x)=ReLU6(Conv 3×3 (x;C in =3,C out =32,stride=2)) The function of the STEM layer is to expand the number of channels of the input image from 3 to 32, while halving the spatial size of the image; S212: The feature map processed by the STEM layer in S211 enters the multi-scale feature extraction stage (Stages); The Stages consist of four stages, each of which contains the following two main parts: Downsampling layer: Use 3x3 convolution kernel to downsample the input feature map to capture higher-level semantic information; Multiple Star_Blocks: Each stage contains multiple Star_Block modules, which are used to extract rich features at the current scale. The Star_Block module uses internal convolution operations and activation functions; S213: After the four stages of processing in S212, feature maps of different scales are obtained for further multi-scale feature extraction of the subsequent neck structure; In S212, each Star_Block first performs spatial local aggregation on the input features of the current stage through a depthwise separable convolution, then performs feature fusion on the channel through two 1x1 convolutions and element-wise multiplication, and then further processes the features through another depthwise separable convolution and 1x1 convolution, and performs a residual connection with the input to retain the original feature information; Assume the input is Among them C in is the number of input channels, H and W are the height and width respectively, then the Star_Block module is represented as: x dw =DDWConv(x) x out =x+DropPath((DWConv2(MLP g (ReLU6(MLP1(x dw ))☉MLP2(x dw ))))) Among them, DWConv is a depth-wise separable convolution, MLP is a linear transformation (convolution), ReLU6 is an activation function, and DropPath is an operation of randomly discarding a path.
6. The lightweight mobile phone screen defect detection method based on improved YOLOv10 according to claim 4 is characterized in that: In S22, the C2f-ODConv module integrates the OD_Attention mechanism on the basis of the C2f module, and uses ODConv to replace the convolution module of Bottleneck in C2f; wherein the OD_Attention mechanism simultaneously considers information in four dimensions: channel attention, filter attention, spatial attention, and convolution kernel attention; assuming the input is Where B is the batch size, C in is the number of input channels, H and W are the height and width respectively, then the specific implementation of ODConv convolution is: S221: First calculate channel attention, filter attention, spatial attention and convolution kernel attention: (A c ,A f ,A s ,A k )=OD_Attention(x) Among them, OD_Attention is an attention module that outputs four attention maps, A c is the channel attention map, A f is the filter attention map, A s is the spatial attention map, A k is the convolution kernel attention map; S222: Multiply the channel attention with the input feature map: x′=x☉A c S223: Calculate the aggregation weight according to the attention mechanism and weight parameters: W agg =A s ☉A k ☉W k Where W k is the convolution kernel, W agg is the weight after aggregation; S224: Perform convolution operation using the aggregated weights to obtain an output feature map: y=Conv(x′,W agg ) S225: Reshape the output feature map to the original batch size and multiply it with the filter attention to get the final output: y′=y☉A f 。 7. The lightweight mobile phone screen defect detection method based on improved YOLOv10 according to claim 6 is characterized in that: In S221, the specific calculation method of the OD_Attention module is: assuming that the input is First, the input is globally averaged pooled, the feature map after pooling passes through the fully connected layer, and finally the channel attention is calculated; the specific expression is: Among them, AdaptiveAvgPool is adaptive average pooling, BN is batch normalization layer, ReLU is activation function, σ is Sigmoid activation function, temperature is temperature parameter, softmax is normalized exponential function, Conv is convolution layer, x avg is the feature map after pooling, x fc is the feature map after being processed by the fully connected layer, A c is the channel attention map, A f is the filter attention map, A s is the spatial attention map, A k is the convolution kernel attention map, C in is the number of input channels, C out is the number of output channels.
8. The lightweight mobile phone screen defect detection method based on improved YOLOv10 according to claim 4 is characterized in that: In S23, the Detect_LSCD module uses the Share_Conv shared convolution layer, which includes two convolution layers for further feature extraction and fusion of the feature map. The specific structure of the Share_Conv shared convolution layer is: The first convolutional layer adopts the Conv_GN structure, including convolution operations and group normalization, which is used to perform preliminary feature extraction on the input feature map; The second convolutional layer also uses the Conv_GN structure to further extract and fuse the output of the first convolutional layer.
9. The lightweight mobile phone screen defect detection method based on improved YOLOv10 according to claim 1 is characterized in that: The S3 specifically includes: using the improved YOLOv10 model architecture, taking the data set constructed in S1 as input, setting the learning rate and number of iterations during the training process, using the stochastic gradient descent (SGD) optimizer to gradually converge the model, and learning the feature representation and detection rules of mobile phone screen targets.
10. The lightweight mobile phone screen defect detection method based on improved YOLOv10 according to claim 1 is characterized in that: In S4, the target detection method is applied to the mobile phone screen detection scenario. After the model is deployed on the mobile device, the model is also quantized. The quantization method includes converting the weights and activation values of the model from floating point numbers to fixed point numbers, and further reducing the storage space and calculation amount of the model through quantization. When the image is collected in real time on the mobile phone screen, the image is also preprocessed. The preprocessing method includes adjusting the image size and normalizing the pixel value so that the image meets the input requirements of the model.
Citation Information
Patent Citations
Mobile phone screen glass defect detection method based on improved YOLOv8
CN119273992A
Cited By
PCB surface defect detection system and method based on improved YOLOv10
CN120125585A
A PCB surface defect detection system and method based on improved YOLOv10
CN120125585B
Chip packaging defect detection method applied to edge device based on YOLOv11m
CN120219388A
Knowledge graph and improved YOLOv10 overhead conductor detection method and system
CN120259309A
Overhead wire detection method and system based on knowledge graph and improved YOLOv10
CN120259309B