A light guide plate surface defect detection method based on GCC-YOLOv8 network model

By improving the backbone network unit of the YOLOv8 network model and introducing a feature calibration module, the accuracy and robustness issues of light guide plate surface defect detection in complex backgrounds are solved, and efficient detection of defects of different scales is achieved.

CN119540724BActive Publication Date: 2025-10-03SI CHUAN JIN CHENG RUI ZHI HU LIAN WANG KE JI YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411663183.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-10-03
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

Surface defect detection of light guide plates is difficult to accurately identify defects of various scales against a complex texture background. Traditional machine vision methods have poor robustness, and the detection effect based on the YOLOv8 network is poor.

Method used

The GCC-YOLOv8 network model is adopted. By improving the GKA-Conv module of the backbone network unit, the CFC module for context and spatial feature calibration and the CPCA module for channel prior convolutional attention are introduced to enhance the feature expression ability and improve the detection accuracy and robustness.

Benefits of technology

It effectively detects defects of different scales on the surface of the light guide plate under complex backgrounds, improves detection accuracy and speed, and enhances the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540724B_ABST
    Figure CN119540724B_ABST
Patent Text Reader

Abstract

The present invention provides a light guide plate surface defect detection method based on a GCC-YOLOv8 network model. The method comprises the following steps: obtaining an image of a light guide plate to be detected; inputting the image into the GCC-YOLOv8 network model for defect detection; and outputting surface defect information of the light guide plate based on the detection result. The GCC-YOLOv8 network model is constructed based on the YOLOv8 network model and comprises a backbone network unit, a neck network unit, and a detection head network unit having three parallel detection branches, the backbone network unit being provided with two GKA-C2f1 modules at its end; the neck network unit comprising an FPN network unit and a PAN network unit, the FPN network unit comprising two upsampling modules, two C2f2 modules, two Concat modules, an SPPF module, and a CPCA module; and the PAN network unit comprising two CBS modules, two Concat modules, two C2f2 modules, three CPCA modules, a CFC module, and an SFC module. The present invention has good light guide plate surface defect detection performance and robustness, while taking into account an optimal detection speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for detecting surface defects of a light guide plate, and in particular to a method for detecting surface defects of a light guide plate based on a GCC-YOLOv8 network model, belonging to the technical field of automatic defect detection. Background Art

[0002] The light guide plate is a key component of the liquid crystal panel. During the production process, it is inevitable that the light guide plate will have defects such as bright spots, scratches, dirt, and shadows. Therefore, surface defect detection of the light guide plate during the production process is of great significance to improving the quality of the light guide plate and downstream products.

[0003] During the production of light guide plates (LGPs), automated defect detection is a crucial step in ensuring their quality. However, automated defect detection is extremely challenging due to the complex texture and background, numerous defect types, and wide variations in defect feature scales. With the advancement of machine vision and deep learning technologies, automated LGP surface defect detection has become feasible. Traditional machine vision methods require image preprocessing, feature extraction, and feature selection, are susceptible to environmental interference, lack robustness, and are unable to meet the requirements of real-time LGP defect detection. Compared to traditional machine vision methods, deep learning-based methods offer more efficient feature extraction, strong generalization capabilities, and excellent algorithmic flexibility and versatility, enabling them to handle tasks of varying scale and complexity. LGP surface defect detection using deep learning can significantly improve the accuracy and speed of LGP defect detection and optimize the LGP production process.

[0004] Light guide plate (LGP) surface defect detection requires high standards. To ensure quality control and optimize the production process, detection algorithms must accurately identify defect categories and locations. Deep learning-based classification networks can identify the primary object categories in an image, but cannot provide object location information. Object detection networks can detect multiple objects of different categories in an image and provide precise location information. These networks are adaptable to complex scenarios and meet the requirements of LGP surface defect detection.

[0005] YOLOv8 is one of the best single-stage object detection networks currently available, offering high detection speed and excellent accuracy. However, due to the complex texture and background of light guide plates, the wide variety of defects, the large differences in defect feature scales, and the low contrast between some defects and the background, false detections and missed detections are common. Therefore, directly applying the YOLOv8 network to light guide plate surface defect detection has been ineffective. Summary of the Invention

[0006] Based on the above background, the purpose of the present invention is to provide a light guide plate surface defect detection method based on the GCC-YOLOv8 network model to solve the problems described in the background technology.

[0007] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:

[0008] A method for detecting surface defects of a light guide plate based on a GCC-YOLOv8 network model, the method comprising the following steps:

[0009] Acquire an image of the light guide plate to be inspected;

[0010] Input the image into the GCC-YOLOv8 network model for defect detection;

[0011] Outputting surface defect information of the light guide plate based on the detection result of the GCC-YOLOv8 network model;

[0012] The GCC-YOLOv8 network model is constructed based on the YOLOv8 network model. The GCC-YOLOv8 network model includes a backbone network unit, a neck network unit, and a detection head network unit with three parallel detection branches arranged in sequence.

[0013] The backbone network unit is provided with two GKA-C2f1 modules at its end, and the two GKA-C2f1 modules are connected by a CBS module. The GKA-C2f1 module is obtained by replacing multiple bottleneck residual modules in the C2f1 module with a GKA bottleneck residual module. The GKA bottleneck residual module is used to divide the input features into two branches. The first branch is sequentially transformed by two series-connected GKA-Conv modules, and the second branch directly passes the input features. The output features of the two branches are output after element-by-element addition.

[0014] The neck network unit includes an FPN network unit and a PAN network unit. The FPN network unit includes two upsampling modules, two C2f2 modules, two Concat modules, an SPPF module and a CPCA module. The CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and the spatial dimension and then output them to an upsampling module. The PAN network unit includes two CBS modules, two Concat modules, two C2f2 modules, three CPCA modules, a CFC module and an SFC module. The first CPCA module is used to assign attention weights to the output features of a C2f2 module at the end of the FPN network unit. The output features of the 2f2 module are dynamically assigned attention weights in the channel dimension and spatial dimension and then output to a CBS module and an SFC module. The SFC module is used to calibrate the input spatial features and output it to a detection branch. The second CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and spatial dimension and then output it to a CBS module and another detection branch. The third CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and spatial dimension and then output it to the CFC module. The CFC module is used to calibrate the input contextual features and output it to another detection branch.

[0015] Preferably, the GKA-Conv module is used to divide the input features into two branches, map the features of the first branch to [-1,1] through the tanh activation function, and then perform Gram polynomial transformation to obtain four feature maps containing different information, which are then superimposed according to the channel dimension, and then SiLU activation function operation and convolution operation are performed in sequence, and the features of the second branch are directly subjected to SiLU activation function operation and convolution operation, and the output features of the two branches are added element by element and output.

[0016] Preferably, the CFC module is used to divide the input features into two branches, perform convolution and reshaping operations on the features of the first branch, obtain multi-scale context through the CPP module for the features of the second branch, and then generate two forms of context representation through two convolution operations respectively. The first form of context representation is element-wise multiplied with the output of the first branch and then subjected to a Softmax operation to obtain pixel context similarity. The pixel context similarity is element-wise multiplied with the second form of context representation and then context recalibrated through the CRB module to obtain a refined context. Finally, the refined context is directly added element-by-element to the input features of the CFC module and then output.

[0017] Preferably, the SFC module is used to convert the low-resolution feature F l and high-resolution features F hTwo convolution operations are performed to unify the channels to the same number, and then bilinear interpolation is used to adjust F l Upsample and cascade the upsampled F l and F h , and then send it to the convolution module to predict two sets of offset maps for aligning the features of the two levels, and predict two gate masks for controlling the flow of feature information of the two levels. Finally, the calibrated cross-level features are output after element-by-element addition.

[0018] Preferably, the CPCA module is used to process the input features through the channel attention module to obtain a one-dimensional channel attention map, multiply the one-dimensional channel attention map with the input features element by element, transfer the channel attention value along the spatial dimension to obtain a refined feature of the channel attention, and then process it through the spatial attention module to obtain a three-dimensional spatial attention map, and multiply the three-dimensional spatial attention map with the refined feature of the channel attention element by element and output it.

[0019] Preferably, the backbone network unit further includes five CBS modules and two C2f1 modules. Along the processing direction of the input features, the first CBS module, the second CBS module, the first C2f1 module, the third CBS module, the second C2f1 module, the fourth CBS module, the first GKA-C2f1 module, the fifth CBS module and the second GKA-C2f1 module are connected in sequence, and the second C2f1 module is also connected to the second Concat module along the input feature processing direction in the FPN network unit. The first GKA-C2f1 module is also connected to the first Concat module along the input feature processing direction in the FPN network unit, and the second GKA-C2f1 module is connected to the SPPF module of the FPN network unit;

[0020] In the FPN network unit, along the processing direction of the input feature, the SPPF module, the first upsampling module, the first Concat module, the first C2f2 module, the CPCA module, the second upsampling module, the second Concat module and the second C2f2 module are connected in sequence, the SPPF module is also connected to the second Concat module along the input feature processing direction in the PAN network unit, the first C2f2 module is also connected to the first Concat module along the input feature processing direction in the PAN network unit, and the second C2f2 module is connected to the first CPCA module along the input feature processing direction in the PAN network unit;

[0021] In the PAN network unit, along the processing direction of the input features, the first CPCA module, the first CBS module, the first Concat module, the first C2f2 module, the second CPCA module, the second CBS module, the second Concat module, the second C2f2 module and the third CPCA module are connected in sequence.

[0022] Preferably, the loss function of the GCC-YOLOv8 network model includes a classification loss function and a bounding box regression loss function. The classification loss function is a BCEWithLogitsLoss function, and its mathematical expression is:

[0023]

[0024] Where σ represents the Sigmoid function, p i Indicates the probability that the sample is predicted to be a positive example, y i Represents the true label of the sample;

[0025] The bounding box regression loss function is the CIoULoss function and the DFL function. The mathematical expression of the CIoULoss function is:

[0026]

[0027]

[0028] Where IoU represents the ratio of the intersection and union of the predicted box and the real box, d represents the distance between the center points of the predicted box and the real box, c represents the diagonal distance of the minimum circumscribed rectangle, and v represents the correction factor.

[0029] The mathematical expression of the DFL function is:

[0030] DFL(S i ,S i+1 )=-((y i+1 -y)log(S i )+(yy i )log(S i+1 ));

[0031] Where S i and S i+1 Represents the two adjacent predicted values ​​output by the network, y represents the actual value of the label, and y i 、y i+1 represents the actual values ​​of the two labels closest to y.

[0032] Preferably, the correction factor v is calculated by the following mathematical expression:

[0033]

[0034] Where w G Indicates the width of the target box, h G Indicates the height of the target box, w p Indicates the width of the prediction box, h p Indicates the height of the prediction box.

[0035] Preferably, the bounding box regression loss function is used in the training of the GCC-YOLOv8 network model using the following method: first, the bounding box distribution probability and the label distribution probability are calculated using the DFL function, and then the bounding box distribution probability is restored to the predicted box, and the loss is calculated for the predicted box and the actual box of the label using the CIoULoss function.

[0036] Preferably, the training parameters of the GCC-YOLOv8 network model are as follows: batch size is 16, momentum is 0.937, initial learning rate is 0.01, final learning rate is 0.0001, data enhancement method is Mosaic data enhancement method, data enhancement coefficient is 1.0, input image size is 640*640 pixels, number of training rounds is 200, number of warm-up rounds is 3, and weight decay is 0.0005.

[0037] Compared with the prior art, the present invention has the following advantages:

[0038] The present invention discloses a light guide plate surface defect detection method based on the GCC-YOLOv8 network model. The method improves the traditional YOLOv8 network model by replacing the Bottleneck convolution module in the two C2f1 modules after the backbone network unit of the traditional YOLOv8 network model with the GKA-Conv module, so that the model can more effectively capture nonlinear relationships and enhance the feature expression ability of the model. The CFC module with a context feature calibration mechanism and the SFC module with a spatial feature calibration mechanism are introduced into the neck network unit to efficiently mine context and spatial information with less computational effort, thereby improving the model's detection ability for small targets and low-contrast defects. Improve the positioning and classification accuracy of the model; and introduce a CPCA module with a channel prior convolutional attention mechanism in the neck network unit, dynamically allocate attention weights in the channel and spatial dimensions, and use multi-scale deep convolution to extract spatial relationships without affecting the channel prior, further enhance the feature expression ability of the model, and enable the model to simultaneously detect defects of different scales; the surface defect detection method of the light guide plate of the present invention can effectively deal with light guide plate images with complex texture background, small proportion of some defective pixels and low contrast with the background, large difference in defect features, and small target defects that are difficult to detect. It has good light guide plate surface defect detection performance and robustness, and takes into account better detection speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0040] Figure 1 It is a schematic diagram of the structure of the GCC-YOLOv8 network model in the present invention;

[0041] Figure 2 Schematic diagram of the structure of the GKA-Conv module of the GCC-YOLOv8 network model in the present invention;

[0042] Figure 3 Schematic diagram of the structure of the CFC module of the GCC-YOLOv8 network model in the present invention;

[0043] Figure 4 Schematic diagram of the structure of the SFC module of the GCC-YOLOv8 network model in the present invention;

[0044] Figure 5 Schematic diagram of the CPCA module of the GCC-YOLOv8 network model in the present invention;

[0045] Figure 6 This is a graph showing the test results of the light guide plate defect dataset in the present invention on different network models;

[0046] Figure 7 is the visual output graph of GradCAM in the present invention;

[0047] Figure 8 These are the test results of the NEU-DET hot-rolled steel strip defect dataset in the present invention on different network models. DETAILED DESCRIPTION

[0048] The technical solution of the present invention will be further described in detail below through specific embodiments and in conjunction with the accompanying drawings. It should be understood that the implementation of the present invention is not limited to the following embodiments, and any form of modification and / or change made to the present invention will fall within the scope of protection of the present invention.

[0049] In the present invention, unless otherwise specified, all parts and percentages are by weight. The equipment and raw materials used are commercially available or commonly used in the art. The methods in the following embodiments, unless otherwise specified, are conventional methods in the art. The components or equipment in the following embodiments, unless otherwise specified, are all universal standard parts or components known to those skilled in the art. Their structures and principles are known to those skilled in the art through technical manuals or routine experimental methods.

[0050] The following detailed description of the embodiments of the present invention is made in conjunction with the accompanying drawings. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present invention. However, one or more embodiments may be implemented by those skilled in the art without these specific details.

[0051] Light guide plate defects primarily include white spot defects, bright line defects, dark line defects, and surface defects. White spot defects typically appear as non-uniform dot-like marks. The imaging characteristic of a white spot defect is that the brightness of a particular light guide point is significantly greater than that of surrounding light guide points, with high contrast against the background. White spot defects are approximately 4-20 pixels in size, slightly larger than normal light guide points, and are typically caused by air bubbles or foreign matter during the manufacturing process. Bright line defects have high contrast against the background and appear as linear outlines exceeding a certain length range, with a width of several pixels. Bright line defects often occur when the surface of the light guide plate is scratched or impacted during transmission. Dark line defects are similar in size, shape, and cause of formation to bright line defects, but are darker in brightness and have low contrast against the background, making them more difficult to detect. Surface defects are characterized by irregular, large-scale bright and dark areas. This is generally caused by the light guide plate coming into contact with foreign matter during long-distance transmission, resulting in surface defects on the surface of the light guide plate.

[0052] According to the imaging characteristics of the above-mentioned light guide plates and the characteristics and causes of various defects on the light guide plates, the detection of surface defects on light guide plates has the following difficulties: First, the background of the light guide plate image is complex. The complex texture background greatly increases the difficulty of detecting defects with low contrast with the background, and the different density characteristics of the light guide plate image require the detection network to have the ability to adapt to backgrounds with different densities and distribution patterns. Second, white spot defects and some minor line defects are small in size, making them difficult to detect. Moreover, white spot defects are similar to dust features and are prone to misjudgment. Third, the characteristics of various defects on the light guide plates vary greatly. White spot defects are small in size and high in brightness, dark line defects are long strips with low contrast with the background, and surface defects are large in size. This requires the detection network to be able to detect defects of different sizes at the same time.

[0053] In response to the above technical difficulties, an embodiment of the present invention discloses a method for detecting surface defects of a light guide plate based on a GCC-YOLOv8 network model. The method comprises the following steps:

[0054] Acquire an image of the light guide plate to be inspected;

[0055] Input the image into the GCC-YOLOv8 network model for defect detection;

[0056] The detection results based on the GCC-YOLOv8 network model output the surface defect information of the light guide plate.

[0057] like Figure 1 As shown, the GCC-YOLOv8 network model includes a backbone network unit, a neck network unit, and a detection head network unit with three parallel detection branches, which are arranged in sequence.

[0058] The backbone network unit is equipped with two GKA-C2f1 modules at its end, and the two GKA-C2f1 modules are connected by a CBS module. The GKA-C2f1 module is obtained by replacing multiple bottleneck residual modules in the C2f1 module with a GKA bottleneck residual module. The GKA bottleneck residual module is used to divide the input features into two branches. The first branch performs feature transformation through two series-connected GKA-Conv modules in turn, and the second branch directly passes the input features. The output features of the two branches are added element by element and then output.

[0059] The neck network unit includes an FPN network unit and a PAN network unit. The FPN network unit includes two upsampling modules, two C2f2 modules, two Concat modules, an SPPF module and a CPCA module. The CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and the spatial dimension and then output them to an upsampling module; the PAN network unit includes two CBS modules, two Concat modules, two C2f2 modules, three CPCA modules, a CFC module and an SFC module. The first CPCA module is used to assign attention weights to the output features of a C2f2 module at the end of the FPN network unit. The output features of the block are dynamically assigned attention weights in the channel dimension and spatial dimension and then output to a CBS module and an SFC module. The SFC module is used to calibrate the input spatial features and output it to a detection branch. The second CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and spatial dimension and then output it to a CBS module and another detection branch. The third CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and spatial dimension and then output it to the CFC module. The CFC module is used to calibrate the input contextual features and output it to another detection branch.

[0060] The backbone network unit also includes five CBS modules and two C2f1 modules. Along the processing direction of the input features, the first CBS module, the second CBS module, the first C2f1 module, the third CBS module, the second C2f1 module, the fourth CBS module, the first GKA-C2f1 module, the fifth CBS module and the second GKA-C2f1 module are connected in sequence. The second C2f1 module is also connected to the second Concat module along the input feature processing direction in the FPN network unit. The first GKA-C2f1 module is also connected to the first Concat module along the input feature processing direction in the FPN network unit. The second GKA-C2f1 module is connected to the SPPF module of the FPN network unit.

[0061] In the FPN network unit, along the processing direction of the input features, the SPPF module, the first upsampling module, the first Concat module, the first C2f2 module, the CPCA module, the second upsampling module, the second Concat module and the second C2f2 module are connected in sequence. The SPPF module is also connected to the second Concat module along the input feature processing direction in the PAN network unit. The first C2f2 module is also connected to the first Concat module along the input feature processing direction in the PAN network unit. The second C2f2 module is connected to the first CPCA module along the input feature processing direction in the PAN network unit.

[0062] In the PAN network unit, along the processing direction of the input features, the first CPCA module, the first CBS module, the first Concat module, the first C2f2 module, the second CPCA module, the second CBS module, the second Concat module, the second C2f2 module and the third CPCA module are connected in sequence.

[0063] The GCC-YOLOv8 network model is based on the traditional YOLOv8 network model. Although YOLOv8 is one of the single-stage target detection networks with the best overall performance, it has high detection speed and excellent detection accuracy. However, due to the complex texture and background of the light guide plate image, the wide variety of defects, the large differences in the scale of defect features, and the low contrast between some defects and the background, it is easy to misdetect or miss. If the YOLOv8 network is directly applied to the light guide plate surface defect detection, the effect is not good. Therefore, the method of this embodiment mainly makes the following three improvements based on the traditional YOLOv8 network model.

[0064] First, the Gram Kolmogorov-Arnold Conv (GKA-Conv) module is introduced into the backbone network unit, replacing the Bottleneck convolution module in the last two C2f1 modules of the YOLOv8 backbone network. This enables the network to more effectively capture nonlinear relationships, enhance the network's feature expression capabilities, and improve network parameter utilization. Compared to the original convolution module, the GKA-Conv module maps input data to a high-dimensional space through Gram polynomial transformation, further extracting deep feature information, reducing network complexity while improving network generalization. Furthermore, combined with the Bottleneck structure, it speeds up network training and inference, enhancing the network's ability to model complex data.

[0065] Second, the YOLOv8 network lacks global information when extracting defect features, leading to pixel context mismatches. This can easily lead to inaccurate localization and classification for light guide plate defects with large scale variations and low contrast. This is especially true for defects with a small pixel ratio, resulting in low network detection accuracy. To address this issue, a contextual and spatial feature calibration (CSFC) module is introduced, consisting of a contextual feature calibration (CFC) module and a spatial feature calibration (SFC) module, embedded in the neck network unit. The CFC module uses a cascaded pyramid pooling module to efficiently capture nested contexts and then aggregates the private context of each pixel based on pixel context similarity to achieve contextual feature calibration. The SFC module partitions features into multiple sub-features along the channel dimension and propagates these sub-features through learnable sampling to achieve spatial feature calibration. Through these two modules, the CSFC module efficiently mines contextual and spatial information with minimal computational effort, improving the network's detection capabilities for small objects and low-contrast defects, and enhancing the network's localization and classification accuracy.

[0066] Third, to address the challenges of large variations in light guide plate defect characteristics, a wide variety of defects, and the difficulty in detecting small targets, a Channel Prior Convolutional Attention (CPCA) module was introduced and inserted after each C2f2 module in the neck. The CPCA module focuses on channel information and important regions, dynamically assigning attention weights across channels and spatial dimensions. It also leverages multi-scale deep convolution to extract spatial relationships without affecting channel priors, enhancing the network's feature representation capabilities and enabling simultaneous detection of defects of varying scales.

[0067] The following is a detailed description of each module involved in the improvement.

[0068] like Figure 2As shown, the GKA-Conv module is used to split the input features into two branches. The features of the first branch are mapped to [-1, 1] using the tanh activation function and then subjected to the Gram polynomial transformation to obtain four feature maps containing different information. These are then stacked according to the channel dimension to expand the features to higher dimensions and optimize the network's feature selection. The SiLU activation function and convolution operations are then performed sequentially, enabling the network to capture the complex relationships between input features, potentially improving the network's generalization ability. The features of the second branch are directly subjected to the SiLU activation function and convolution operations. Finally, the output features of the two branches are element-by-element summed and output. The residual connection fine-tunes the results of the Gram polynomial transformation to obtain highly optimized learning features, improving the network's expressive power and efficiency.

[0069] The GKA-Conv module constructs a residual Gram polynomial transformation to better fit different nonlinear output data. This brings a more flexible and responsive network structure that can dynamically adapt to more complex data patterns and improve the generalization ability of the network. As shown in the following formula, the GKA-Conv module can be expressed as a residual basis function b(x) and a Gram polynomial The sum of, where b(x) is SiLU(x), ω b Factors are used to better control the overall magnitude of the function. is a set of n-degree polynomials of x, ω i is the weight function.

[0070]

[0071]

[0072]

[0073] The GKA-Conv module leverages the simplicity and unique discreteness of the Gram polynomial transform to enable faster convergence when processing discrete data in images, enhancing the network's adaptability to spatial information and improving the network's ability to express nonlinear features. As shown below, the GKA-Conv module maps the original data space to a high-dimensional space using the Gram polynomial, improving the network's ability to capture nonlinear relationships between input data and its ability to utilize complex function mappings, allowing the network to better fit the transmitted information and provide a rich, adaptable response surface for network input.

[0074]

[0075] in, are polynomial coefficients, b n is the regulating factor.

[0076] The Contextual Feature Calibration (CFC) module and the Spatial Feature Calibration (SFC) module together form the Contextual and Spatial Feature Calibration (CSFC) module. The traditional YOLOv8 network divides the image into grids and predicts the bounding box and category of the object in each grid to detect objects. This approach requires the network to detect objects in each grid rather than globally understanding the entire image, leading to pixel-context mismatch. Light guide defects vary greatly in size, and dark line defects have low contrast with the background. Without sufficient global contextual information to assist in detection decisions, the network lacks adaptability to diverse inputs. Contextual information can provide rich scene category priors to correct misclassifications. The CFC module crops and refines the semantic context for each pixel, capturing multi-scale contextual information through efficient pooling operations. It then aligns pixels and context to address the pixel-context mismatch. The SFC module groups the channel dimension into multiple sub-features and calibrates them separately to alleviate the problem of spatial feature misalignment.

[0077] like Figure 3 As shown in the figure, the CFC module is used to divide the input features into two branches, perform convolution and reshaping operations on the features of the first branch, obtain multi-scale contexts through the CPP module for the features of the second branch, and then generate two forms of context representations through two convolution operations respectively. The first form of context representation is element-wise multiplied with the output of the first branch and then a Softmax operation is performed to obtain pixel context similarity. The pixel context similarity is element-wise multiplied with the second form of context representation and then context recalibrated through the CRB module to obtain a refined context. Finally, the refined context is directly added element-wise to the input features of the CFC module and output.

[0078] The CFC module aggregates context from semantically closer regions to capture the most instructive context for classification. For the input feature X∈R C×H×W , first process it to obtain a highly abstract multi-scale context Z∈R C×M , then calculate the pixel context similarity θ∈R N×M , where N = H × W, M represents the total number of pixels and contexts. Using θ as a guide, the context of each pixel is aggregated to achieve context feature calibration. Finally, the response value of each semantic context is further adjusted to generate fine-grained context information, thereby achieving context recalibration. The expression of the CFC module is as follows,

[0079]

[0080] Among them, {x i ,y i ,a i ,zj}∈R C×1 denote input, output, recalibration factor, and context, respectively. i ranges from [1,…,H×W], and f(·) denotes a pairwise function for computing the similarity between features.

[0081] The CFC module uses an efficient cascaded pyramid pooling (CPP) module to capture multi-scale context. It then calculates the similarity between pixels and context to aggregate semantically relevant context for each pixel, thereby achieving contextual feature calibration. Subsequently, with the help of the context recalibration (CRB) module, local context is conditionally learned by sharpening large objects while preserving spatial details, addressing the problem of small object feature corruption caused by context merging.

[0082] For the input feature X∈R c×H×W , first use a 1×1 convolutional layer to generate the dimension reduction feature Q∈R C′×H×W , where C′ is much smaller than C. Then, the CPP module is used to obtain the multi-scale context Z∈R C×M Finally, Z is introduced into two convolutional layers (with BN and ReLU) to produce two forms of context representation, namely K∈R c′×M and V∈R c×M Then, reshape and transpose Q into R N×C′ , and perform matrix multiplication between Q and K and add to the softmax layer to produce the pixel context similarity θ∈R N×M :

[0083]

[0084] Among them, θ i,j Indicates the i-th pixel Q i and the jth context K j Finally, between V and θ T Perform matrix multiplication between them to obtain the calibrated semantic context E∈R C×N , and reshape E into R C×H×W After obtaining the calibrated context E, it is sent to the context recalibration (CRB) module to generate the refined context E′. The CRB module adopts a residual-like design and can be expressed as:

[0085]

[0086] Among them, α∈E C×H×W is the recalibration factor, and Represents a convolutional layer. The tanh function is used here to remove redundant information and highlight useful information in the context (such as boundaries and small objects).

[0087] Finally, perform element-wise summation between X and E′ to generate the final output Y∈R C×H×W , as shown below:

[0088] Y=X+E′.

[0089] like Figure 4 As shown, the SFC module is used to transform the low-resolution feature F l and high-resolution features F h Two convolution operations are performed to unify the channels to the same number, and then bilinear interpolation is used to adjust F l Upsample and cascade the upsampled F l and F h , and then send it to the convolution module to predict two sets of offset maps for aligning the features of the two levels, and predict two gate masks for controlling the flow of feature information of the two levels. Finally, the calibrated cross-level features are output after element-by-element addition.

[0090] In order to compensate for the loss of spatial details caused by progressive downsampling, for a given low-resolution feature and high-resolution features The SFC module groups the channel dimensions into multiple sub-features for calibration operations respectively, and integrates a gating mechanism to adaptively fuse cross-layer features.

[0091] In terms of feature calibration, the SFC module uses feature resampling to reconstruct features. Assuming that the spatial coordinates of each position on the feature map are {(1,1), (1,2), …, (H, W)}, the learned 2D offset mapping is Δ∈R 2×H×W , then the calibration function τ(·) can be expressed as:

[0092]

[0093] The sampling characteristics are The output U is obtained h,w , and bilinear kernel interpolation is used to obtain the features of the sampling positions. For finer calibration, the SFC module divides the features F into G groups in the channel dimension and then aligns the features within each group separately.

[0094] In addition, the SFC module adaptively fuses the calibrated semantic features F′ through a gating strategy l and fine-grained features F′ h , to fill the representation gap between them, as shown in the following formula,

[0095]

[0096] Among them, β l and β h Indicates a door mask.

[0097] The specific processing flow of the SFC module is as follows: and First, two convolutional layers are used to unify their channels to the same number C. Then, bilinear interpolation is used to interpolate F. l Upsample and cascade the upsampled F l and F h Afterwards, they are fed into the convolutional module to predict two sets of offset maps: Δ l ∈R (2×G)×H×W and Δ h ∈R (2×G)×H×W , used to align the features of the two levels and predict two gate masks β l ,β h ∈R 1×H×W , which is used to control the flow of feature information between the two levels. Finally, the calibrated cross-level features are summed element by element to obtain the output. The SFC module can be written as follows:

[0098]

[0099] Where u(·) represents the bilinear upsampling function, represents a convolutional layer with BN and ReLU.

[0100] The weights of the last convolutional layer of the convolutional block are initialized to zero to gradually learn more accurate offsets and masks, so that the SFC module can be inserted into the network without affecting the original performance of the network. In addition, the gate mask uses 1+tanh as the activation function, so that τ(F,0) becomes an identity mapping and β=1+tanh(0)=1. Therefore, the SFC module can be expressed as:

[0101] O=u(W l F l )+W h F h .

[0102] like Figure 5 As shown in the figure, the CPCA module is used to process the input features through the channel attention module to obtain a one-dimensional channel attention map, multiply the one-dimensional channel attention map with the input features element by element, transfer the channel attention value along the spatial dimension to obtain the channel attention refined features, and then process it through the spatial attention module to obtain a three-dimensional spatial attention map, and multiply the three-dimensional spatial attention map with the channel attention refined features element by element and output.

[0103] The CPCA module first obtains channel attention maps through the CA module. Subsequently, a deep convolutional module is used to sequentially extract key spatial regions for each channel, generating dynamically distributed spatial attention maps for each channel. These dynamically distributed spatial attention maps are closer to the actual feature distribution in each channel, effectively improving the network's detection performance for complex defects in light guide plates.

[0104] For the input feature map F∈R C×H×W , after being processed by the CA module, we get a one-dimensional channel attention map M C ∈R C ×1×1 Then, M c Multiply the input feature F element by element and pass the channel attention value along the spatial dimension to obtain the channel attention refined feature F c ∈R C×H×W Then, the SA module c Process and generate a three-dimensional spatial attention map M s ∈R C×H×W Finally, M s With F c Multiply by elements to get the output features The overall process of the CPCA module is shown in the following formula, where Represents element-wise multiplication.

[0105]

[0106] In the channel attention component, the channel attention map is generated by the CA module by exploring the inter-channel relationships within the features. The CA module aggregates spatial information from the feature map using average and max pooling operations. The results of this aggregation process are fed into a shared MLP, and the two outputs are element-wise added to generate the channel attention map. The channel attention map is calculated as shown in the following formula, where σ represents the sigmoid function.

[0107] CA(F)=σ(MLP(AvgPool(F))+MLP(MaxPool(F))).

[0108] In the spatial attention component, the spatial attention map is generated by extracting spatial mapping relationships. The SA module uses deep convolution to capture the spatial relationships between features and adopts a multi-scale structure to enhance the convolution operation's ability to capture spatial relationships. In addition, the SA module uses a 1×1 convolution at the end to achieve channel mixing, resulting in a more refined attention map. The spatial attention map is calculated as follows:

[0109]

[0110] Among them, DwConv represents depth convolution, and Branch i Denotes the i-th branch (i∈{0,1,2,3}). The SA module uses two depthwise strip convolutions to approximate the standard channel-by-channel convolution with a large kernel. The kernel size of each channel is different, which can capture multi-scale information and enhance the network's ability to process complex data.

[0111] The above describes in detail each module involved in the improvement. The following is a detailed description of the training settings of the GCC-YOLOv8 network model.

[0112] The loss functions of the GCC-YOLOv8 network model include classification loss function and bounding box regression loss function.

[0113] The classification loss function is the BCEWithLogitsLoss function, and its mathematical expression is:

[0114]

[0115] Where σ represents the Sigmoid function, p i Indicates the probability that the sample is predicted to be a positive example, y i The BCEWithLogitsLoss function combines the Sigmoid activation function with the Binary Cross Entropy (BCE) loss function. It is numerically more stable, effectively avoiding vanishing and exploding gradients, and computationally more efficient, helping improve training efficiency.

[0116] The bounding box regression loss functions are CIoU Loss function and DFL function.

[0117] The mathematical expression of CIoU Loss function is:

[0118]

[0119]

[0120] Where IoU represents the ratio of the intersection and union of the predicted box and the true box, d represents the distance between the center points of the predicted box and the true box, c represents the diagonal distance of the minimum circumscribed rectangle, and v represents the correction factor.

[0121] The CIoU loss function takes the shape of the object bounding box into account in its design. By introducing a correction factor, the loss is made more robust to object bounding boxes of varying shapes, making it easier for the model to accurately capture the object's shape. Furthermore, the CIoU loss function comprehensively considers multiple factors, including position, shape, and orientation, enabling the model to more comprehensively learn the characteristics of the object bounding box, helping to improve its performance in complex scenarios.

[0122] The correction factor v is used to further adjust the loss function, taking into account the shape and orientation of the target box, which is calculated by the following mathematical expression,

[0123]

[0124] Where w G Indicates the width of the target box, h G Indicates the height of the target box, w p Indicates the width of the prediction box, h p Indicates the height of the prediction box.

[0125] The mathematical expression of the DFL function is,

[0126] DFL(S i ,S i+1 )=-((y i+1 -y)log(S i )+(yy i )log(S i+1 ));

[0127] Where S i and S i+1 Represents the two adjacent predicted values ​​output by the network, y represents the actual value of the label, and y i 、y i+1 represents the actual values ​​of the two labels closest to y.

[0128] The DFL function optimizes the probabilities of the two positions closest to the label y in the form of cross entropy, allowing the network to more quickly focus on the target position and the distribution of the surrounding area. This loss of learning around the label can enhance the model's generalization ability in complex situations such as occlusion and moving objects.

[0129] The bounding box regression loss function is used in the training of the GCC-YOLOv8 network model using the following method: first, the DFL function is used to calculate the loss of the bounding box distribution probability and the label distribution probability, thereby optimizing each edge. Then, the bounding box distribution probability is restored to the predicted box, and the CIoU Loss function is used to calculate the loss of the predicted box and the actual box of the label, thereby optimizing the predicted box as a whole.

[0130] The effect of this method is illustrated below with reference to a light guide plate surface defect detection experiment.

[0131] The light guide plate defect dataset was acquired using a 16K line scan camera on a factory production line. Defective light guide plate images were manually selected and labeled. The original light guide plate images have a high resolution and cannot be directly used for deep learning network training. Therefore, this experimental design uses a 224×224 cropping window to crop the images. Furthermore, the dataset is divided into white spot defects, bright line defects, dark line defects, and surface defects based on defect type. The original dataset size is 1926. Due to the varying number of defects in the captured images, the number of images for each defect type was expanded through translation, mirroring, and rotation to ensure training accuracy. The resulting dataset contains 4111 images. The specific number of images for each defect type is shown in Table 1.

[0132] Table 1 Self-made light guide plate defect dataset

[0133]

[0134] Considering the number of samples in the light guide plate defect dataset and the rationality of training, the dataset is divided into a training set, a validation set, and a test set in a ratio of 6:2:2. The division results are shown in Table 2.

[0135] Table 2 Division of training set, validation set and test set

[0136]

[0137]

[0138] Using the Mosaic data augmentation method, four images are randomly read from the dataset. These images are then randomly flipped, randomly translated, and randomly adjusted for brightness. These processed images are then cropped based on bounding box information. The cropped images are then spliced ​​together at random points to create a new image, which is then fed into the network as training data.

[0139] The training parameters of the GCC-YOLOv8 network model are as follows: batch size 16, momentum 0.937, initial learning rate 0.01, final learning rate 0.0001, data augmentation method Mosaic data augmentation method, data augmentation coefficient 1.0, input image size 640*640 pixels, number of training rounds 200, number of warm-up rounds 3, and weight decay 0.0005.

[0140] In order to test the performance of the GCC-YOLOv8 network model, this experiment selected mean precision (AP), average mean precision (mAP), confusion matrix, FPS, GFlops and parameter quantity as performance evaluation indicators.

[0141] In order to analyze the impact of the GKA-Conv module, CSFC module, and CPCA module on the performance of the GCC-YOLOv8 network model, this experiment first conducted an ablation experiment. The experimental results are shown in Table 3.

[0142] Table 3 Ablation experiment results of light guide plate defect dataset

[0143]

[0144]

[0145] Table 3 shows that the mAP of the traditional YOLOv8 network is 97.9%. Introducing the GKA-Conv module within the network backbone alone improves mAP to 98.4%. The AP for all four defects improves, with the most significant improvement for dark line detection, where the AP increases by 1.2%. This demonstrates that the GKA-Conv module enhances the network's feature extraction and nonlinear fitting capabilities, enabling accurate identification of small, low-contrast defects such as dark lines. Furthermore, despite an increase of 1.77M network parameters, there is no significant increase in GFLOPs, indicating that the GKA-Conv module improves model parameter utilization.

[0146] After adding the CSFC module to the network alone, the mAP increased to 98.3%. Among them, the detection accuracy of surface defects was significantly improved, with its AP increased by 1.6%. Compared with the introduction of the GKA-Conv module alone, the AP of surface defect detection increased by 1.2%. This shows that the CSFC module effectively calibrates the context and spatial information of pixels, improves the accuracy of feature information, and enables the network to obtain sufficient and accurate feature information of surface defects and correctly identify them.

[0147] Due to the complex texture background of the light guide plate image, the original network's feature extraction capability was insufficient, and the key information of the obtained feature map was lost or the feature context information did not match. As a result, the CPCA module located at the neck focused on the wrong channel information and failed to focus on the correct and effective feature area. As a result, after adding the CPCA module alone, the mAP dropped by 0.3%. Therefore, this experiment combined the modules and added them to the network for experiments to verify their effectiveness.

[0148] When the GKA-Conv module and the CPCA module are introduced simultaneously, the mAP is improved to 98.6%. Among them, the AP for white spot defect detection, dark line defect detection, and surface defect detection are improved by 0.2%, 0.8%, and 1.7%, respectively. This shows that after obtaining the rich feature information extracted by the backbone network improved by the GKA-Conv module, the CPCA module focuses on accurate and important channel information and spatial areas, and retains more important information in the feature fusion stage, reducing information loss during transmission and enhancing the network's ability to identify multi-scale defects.

[0149] When both the GKA-Conv module and the CSFC module are introduced, mAP increases to 98.7%, demonstrating that the network not only extracts richer information but also significantly enhances the correlation between feature information, improving the network's detection performance. Furthermore, compared to the CSFC module alone, GFlops decreases by 0.9, indicating that the GKA-Conv module effectively reduces network complexity and further proves that the GKA-Conv module effectively improves network parameter utilization.

[0150] When all three modules were added to the network simultaneously, mAP reached 99.0%. The detection accuracy for white dot defects, bright line defects, dark line defects, and surface defects all improved by 0.2%, 0.3%, 2.2%, and 1.8%, respectively. The detection effect was also improved for defects with large feature differences, low contrast, and varying sizes. The FPS reached 412, demonstrating the excellent detection performance of the GCC-YOLOv8 network model for light guide plate surface defects, which can meet the requirements of real-time detection in industrial sites.

[0151] To verify the accuracy and effectiveness of the GCC-YOLOv8 network model for light guide plate surface defect detection, this experiment also compared the GCC-YOLOv8 network model with the YOLOv5, YOLOv7, YOLOv8, YOLOv9, and RT-DETR networks, and conducted experiments based on the same light guide plate defect dataset. The experimental results are shown in Table 4.

[0152] Table 4 Comparative experimental results of light guide plate defect dataset

[0153]

[0154] Table 4 shows that the GCC-YOLOv8 network model achieves the best performance, achieving a mAP of 99.0%. This represents improvements of 0.7%, 1.0%, 1.1%, 0.8%, and 1.5% over the YOLOv5, YOLOv7, YOLOv8, YOLOv9, and RT-DETR networks, respectively. The GCC-YOLOv8 network model achieves a detection speed exceeding that of the YOLOv7, YOLOv9, and RT-DETR networks, reaching 412 FPS. Furthermore, the GCC-YOLOv8 network model uses fewer GFlops and fewer parameters than the YOLOv5, YOLOv7, YOLOv9, and RT-DETR networks, further demonstrating its fast detection speed and ease of deployment.

[0155] This experiment randomly selects images of each defect to test YOLOv5, YOLOv7, YOLOv8, YOLOv9, RT-DETR and GCC-YOLOv8 networks. The test results of different networks are shown in the figure. Figure 6 As shown in the figure, the GCC-YOLOv8 network model can achieve the highest confidence level for detecting different defects and has better detection performance.

[0156] In order to further verify the performance and effectiveness of the GCC-YOLOv8 network, this experiment selects each defect image and uses the GradCAM method to visualize the network output and observe the focus area of ​​the network for a given category, such as Figure 7 As shown in the figure, for a given image, the YOLOv8 network cannot effectively focus on the target information and is easily disturbed by surrounding information, while the GCC-YOLOv8 network model can focus on the target information more accurately, thereby achieving higher detection accuracy.

[0157] To further validate the performance and robustness of the GCC-YOLOv8 network model, this paper conducted comparative experiments on the NEU-DET hot-rolled steel strip defect dataset. This dataset contains 1800 defect images, each 200×200 pixels in size, divided into a 6:2:2 ratio. The proposed GCC-YOLOv8 network was compared with the YOLOv5, YOLOv7, YOLOv8, YOLOv9, and RT-DETR networks. The experimental results are shown in Table 5.

[0158] Table 5 Comparative experimental results of NEU-DET hot-rolled steel strip defect dataset

[0159]

[0160]

[0161] Table 5 shows that the GCC-YOLOv8 network model achieves the highest detection accuracy, with a mAP of 75.6%. This represents improvements of 4.4%, 3.6%, 0.9%, 0.3%, and 0.9% over the YOLOv5, YOLOv7, YOLOv8, YOLOv9, and RT-DETR networks, respectively. Compared to YOLOv8, the detection accuracy of cracks, plaques, and inclusions has increased by 6.3%, 1.1%, and 2.2%, respectively.

[0162] This experiment randomly selects pictures of each defect and tests the YOLOv5, YOLOv7, YOLOv8, YOLOv9, RT-DETR and GCC-YOLOv8 network models respectively. The test results are as follows: Figure 8 As shown in the figure, the GCC-YOLOv8 network model has the best performance, which shows that the GCC-YOLOv8 network has excellent robust performance.

[0163] In summary, the embodiment of the present invention discloses a light guide plate surface defect detection method based on the GCC-YOLOv8 network model, which is improved on the basis of the traditional YOLOv8 network model. The convolution module of the Bottleneck in the two C2f1 modules after the backbone network unit of the traditional YOLOv8 network model is replaced by the GKA-Conv module, so that the model can more effectively capture nonlinear relationships and enhance the feature expression ability of the model; the CFC module with a context feature calibration mechanism and the SFC module with a spatial feature calibration mechanism are introduced into the neck network unit to efficiently mine context and spatial information with less computational effort, thereby improving the model's accuracy for small targets and The detection capability of low-contrast defects improves the positioning and classification accuracy of the model; in addition, a CPCA module with a channel prior convolutional attention mechanism is introduced in the neck network unit to dynamically allocate attention weights in the channel and spatial dimensions, and use multi-scale deep convolution to extract spatial relationships without affecting the channel prior, further enhancing the feature expression capability of the model, so that the model can simultaneously detect defects of different scales; this method can effectively deal with light guide plate images with complex texture backgrounds, small proportion of some defective pixels and low contrast with the background, large difference in defect features, and small target defects that are difficult to detect. It has good light guide plate surface defect detection performance and robustness, and takes into account better detection speed.

[0164] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from the principles of the present invention, and such improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A method for detecting surface defects of light guide plates based on the GCC-YOLOv8 network model, characterized by: The method comprises the following steps: Acquire an image of the light guide plate to be inspected; Input the image into the GCC-YOLOv8 network model for defect detection; Outputting surface defect information of the light guide plate based on the detection result of the GCC-YOLOv8 network model; The GCC-YOLOv8 network model is constructed based on the YOLOv8 network model. The GCC-YOLOv8 network model includes a backbone network unit, a neck network unit, and a detection head network unit with three parallel detection branches arranged in sequence. The backbone network unit is provided with two GKA-C2f1 modules at its end, and the two GKA-C2f1 modules are connected by a CBS module. The GKA-C2f1 module is obtained by replacing multiple bottleneck residual modules in the C2f1 module with a GKA bottleneck residual module. The GKA bottleneck residual module is used to divide the input features into two branches. The first branch is sequentially transformed by two series-connected GKA-Conv modules, and the second branch directly passes the input features. The output features of the two branches are output after element-by-element addition. The neck network unit includes an FPN network unit and a PAN network unit. The FPN network unit includes two upsampling modules, two C2f2 modules, two Concat modules, an SPPF module and a CPCA module. The CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and the spatial dimension and then output them to an upsampling module. The PAN network unit includes two CBS modules, two Concat modules, two C2f2 modules, three CPCA modules, a CFC module and an SFC module. The first CPCA module is used to assign attention weights to the output features of a C2f2 module at the end of the FPN network unit. The output features of the 2f2 module are dynamically assigned attention weights in the channel dimension and the spatial dimension and then output to a CBS module and an SFC module. The SFC module is used to calibrate the input spatial features and output it to a detection branch. The second CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and the spatial dimension and then output it to a CBS module and another detection branch. The third CPCA module is used to dynamically assign attention weights to the output features of a C2f2 module in the channel dimension and the spatial dimension and then output it to the CFC module. The CFC module is used to calibrate the input contextual features and then output it to another detection branch. The GKA-Conv module is used to divide the input features into two branches, map the features of the first branch to [-1, 1] through the tanh activation function, and then perform Gram polynomial transformation to obtain four feature maps containing different information, which are then superimposed according to the channel dimension, and then sequentially perform SiLU activation function operation and convolution operation, and directly perform SiLU activation function operation and convolution operation on the features of the second branch, and the output features of the two branches are element-by-element added and output; The CFC module is used to divide the input features into two branches, perform convolution and reshaping operations on the features of the first branch, obtain multi-scale contexts from the features of the second branch through the CPP module, and then generate two forms of context representations through two convolution operations respectively. The first form of context representation is element-wise multiplied with the output of the first branch and then subjected to a Softmax operation to obtain pixel context similarity. The pixel context similarity is element-wise multiplied with the second form of context representation and then context recalibrated through the CRB module to obtain a refined context. Finally, the refined context is directly added element-by-element to the input features of the CFC module and output. The SFC module is used to transform the low-resolution feature F l and high-resolution features F h Two convolution operations are performed to unify the channels to the same number, and then bilinear interpolation is used to adjust F l Upsample and cascade the upsampled F l and F h , then it is fed into the convolution module to predict two sets of offset maps for aligning the features of the two levels, and predict two gate masks for controlling the flow of feature information of the two levels. Finally, the calibrated cross-level features are output after element-by-element addition. The CPCA module is used to process the input features through the channel attention module to obtain a one-dimensional channel attention map, multiply the one-dimensional channel attention map with the input features element by element, transfer the channel attention value along the spatial dimension to obtain a refined channel attention feature, and then process it through the spatial attention module to obtain a three-dimensional spatial attention map, multiply the three-dimensional spatial attention map with the refined channel attention feature element by element and output; In the PAN network unit, along the processing direction of the input features, the first CPCA module, the first CBS module, the first Concat module, the first C2f2 module, the second CPCA module, the second CBS module, the second Concat module, the second C2f2 module and the third CPCA module are connected in sequence.

2. The method for detecting surface defects of a light guide plate based on a GCC-YOLOv8 network model according to claim 1, wherein: The backbone network unit also includes five CBS modules and two C2f1 modules. Along the processing direction of the input features, the first CBS module, the second CBS module, the first C2f1 module, the third CBS module, the second C2f1 module, the fourth CBS module, the first GKA-C2f1 module, the fifth CBS module and the second GKA-C2f1 module are connected in sequence, and the second C2f1 module is also connected to the second Concat module along the input feature processing direction in the FPN network unit. The first GKA-C2f1 module is also connected to the first Concat module along the input feature processing direction in the FPN network unit, and the second GKA-C2f1 module is connected to the SPPF module of the FPN network unit; In the FPN network unit, along the processing direction of the input features, the SPPF module, the first upsampling module, the first Concat module, the first C2f2 module, the CPCA module, the second upsampling module, the second Concat module and the second C2f2 module are connected in sequence. The SPPF module is also connected to the second Concat module along the input feature processing direction in the PAN network unit. The first C2f2 module is also connected to the first Concat module along the input feature processing direction in the PAN network unit. The second C2f2 module is connected to the first CPCA module along the input feature processing direction in the PAN network unit.

3. The method for detecting surface defects of a light guide plate based on a GCC-YOLOv8 network model according to claim 1, wherein: The loss function of the GCC-YOLOv8 network model includes a classification loss function and a bounding box regression loss function. The classification loss function is the BCEWithLogitsLoss function, and its mathematical expression is: Where σ represents the Sigmoid function, p i Indicates the probability that the sample is predicted to be a positive example, y i Represents the true label of the sample; The bounding box regression loss function is the CIoU Loss function and the DFL function. The mathematical expression of the CIoU Loss function is: Where IoU represents the ratio of the intersection and union of the predicted box and the real box, d represents the distance between the center points of the predicted box and the real box, c represents the diagonal distance of the minimum circumscribed rectangle, and v represents the correction factor. The mathematical expression of the DFL function is: DFL(S i ,S i+1 )=-((y i+1 -y)log(S i )+(y-y i )log(S i+1 )); Where S i and S i+1 Represents the two adjacent predicted values ​​output by the network, y represents the actual value of the label, and y i 、y i+1 represents the actual values ​​of the two labels closest to y.

4. The method for detecting surface defects of a light guide plate based on a GCC-YOLOv8 network model according to claim 3, wherein: The correction factor v is calculated by the following mathematical expression, Where w G Indicates the width of the target box, h G Indicates the height of the target box, w p Indicates the width of the prediction box, h p Indicates the height of the prediction box.

5. The method for detecting surface defects of a light guide plate based on a GCC-YOLOv8 network model according to claim 3, wherein: The bounding box regression loss function is used in the training of the GCC-YOLOv8 network model using the following method: first, the bounding box distribution probability and the label distribution probability are calculated using the DFL function, and then the bounding box distribution probability is restored to the predicted box, and the CIoU Loss function is used to calculate the loss of the predicted box and the actual box of the label.

6. The method for detecting surface defects of a light guide plate based on a GCC-YOLOv8 network model according to claim 1, wherein: The training parameters of the GCC-YOLOv8 network model are as follows: batch size 16, momentum 0.937, initial learning rate 0.01, final learning rate 0.0001, data augmentation method Mosaic data augmentation method, data augmentation coefficient 1.0, input image size 640*640 pixels, number of training rounds 200, number of warm-up rounds 3, and weight decay 0.0005.