Light guide plate surface defect detection method based on LGP-DETR target detection model
Through the light guide plate surface defect detection method based on the LGP-DETR object detection model, the problem of insufficient recognition ability under complex background and brightness differences in the prior art is solved, and defect detection with high precision and high speed is achieved, meeting the needs of light guide plate quality detection.
Patent Information
- Application Number
- CN202411703151.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art detects surface defects of light guide plates, especially under complex backgrounds and brightness differences, and the recognition capability is insufficient, making it difficult to meet the actual quality detection requirements.
The surface defect detection method of light guide plate based on the LGP-DETR object detection model is adopted to build a model with backbone network unit, neck network unit and head network unit. By introducing the DtransFusion module, DySample module, RepC3 module and OrthoC3 module, the feature extraction and upsampling process is optimized, and the detection accuracy and speed are improved.
It significantly improves the accuracy and speed of surface defect detection of light guide plates, effectively overcomes the detection difficulties under complex background and brightness differences, and meets the needs of light guide plate quality detection.
Smart Images

Figure CN119648653A_ABST
Abstract
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 an LGP-DETR target detection model, and belongs to the technical field of target detection. Background Art
[0002] As a key optical component, light guide plate (LGP) is widely used in display devices and lighting systems such as liquid crystal displays (LCDs), TVs, mobile phone screens, and backlight modules. Its main function is to evenly distribute point light sources or line light sources across the entire plane to achieve efficient light transmission and uniform lighting. The quality of the light guide plate directly affects the brightness, uniformity, and overall visual effect of the display device. Therefore, high-precision quality inspection of the light guide plate surface is crucial.
[0003] During the production process of light guide plates, common defects include scratches, bubbles, impurities, and uneven light distribution. Light guide plates have unique imaging characteristics, and the density of light guide points on their surface is uneven. On the light-incident side, the light guide points are relatively sparse and the brightness is relatively low. This part of the area is called the "sparse area"; on the light-exiting side, due to multiple reflections of light, the light guide points become dense and the brightness is high. This part of the area is called the "dense area". These imaging characteristics cause the light guide plate image to present a complex background and uneven brightness visual effect. This complex background and brightness difference bring technical difficulties to the defect detection task.
[0004] Although a variety of methods for light guide plate (LGP) defect detection have been disclosed in the prior art, such as LGP defect detection method based on dynamic weight combination classifier (CCDW), LGP defect detection method based on dense bilinear convolutional neural network (BCNN), LGP defect detection method based on semantic segmentation supported by deep learning, end-to-end multi-task learning network for mobile phone LGP defect detection, HM-YOLOv5 network for hot pressing LGP defect detection, and vehicle-mounted LGPs defect detection method based on improved RetinaNet, etc. However, these methods still have certain limitations in detection accuracy and reasoning speed, especially the lack of recognition ability of light guide plate surface defects under complex backgrounds and brightness differences, and it is difficult to fully meet the needs of actual LGP quality detection. Summary of the invention
[0005] 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 LGP-DETR target detection model, which effectively overcomes the detection difficulties such as small targets, low contrast and complex texture background in the surface defects of the light guide plate, significantly improves the detection accuracy and effectively improves the detection speed.
[0006] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:
[0007] A method for detecting surface defects of a light guide plate based on an LGP-DETR target detection model, the method comprising the following steps:
[0008] Construct an LGP-DETR target detection model with a backbone network unit, a neck network unit and a head network unit, wherein the backbone network unit is constructed based on the FasterNet neural network architecture, the neck network unit includes multiple standard convolution modules, a DtransFusion module combining a deformable attention mechanism with a Transformer encoder structure, a DySample module for lightweight dynamic upsampling, a RepC3 module with a reparameterized convolution feature, and an OrthoC3 module combining an orthogonal channel attention mechanism with a RepC3 module structure, and the head network unit is constructed based on a decoder module of the RT-DETR neural network architecture;
[0009] Acquire the surface image of the light guide plate and form a data set of surface defects of the light guide plate, divide the data set into a training set, a validation set, and a test set, and train the LGP-DETR target detection model;
[0010] Obtain the surface image of the light guide plate and input it into the trained LGP-DETR target detection model for defect detection;
[0011] The surface defect information of the light guide plate is output based on the defect detection result of the LGP-DETR target detection model.
[0012] Preferably, the steps of constructing the neck network unit specifically include:
[0013] Construct DtransFusion module, DySample module, RepC3 module and OrthoC3 module;
[0014] The first standard convolution module, the second standard convolution module and the third standard convolution module respectively receive different output features of the backbone network unit;
[0015] The output of the first standard convolution module is connected to the fourth standard convolution module through the DtransFusion module; the output of the fourth standard convolution module forms two branches, the first branch of which is upsampled by the first DySample module and then fused with the output of the second standard convolution module, and then connected to the fifth standard convolution module through the RepC3 module; the output of the fifth standard convolution module forms two branches, the first branch of which is upsampled by the second DySample module and then fused with the output of the third standard convolution module, and then input into the first OrthoC3 module; the output of the first OrthoC3 module forms two branches, the first branch of which is output to the head network unit;
[0016] The second branch of the output of the first OrthoC3 module is connected to the sixth standard convolution module, the output of the sixth standard convolution module is feature fused with the second branch of the output of the fifth standard convolution module, and then input into the second OrthoC3 module; the output of the second OrthoC3 module forms two branches, the first branch of which is output to the head network unit;
[0017] The second branch of the output of the second OrthoC3 module is connected to the seventh standard convolution module, the output of the seventh standard convolution module is feature fused with the second branch of the output of the fourth standard convolution module, and then output to the head network unit through the third OrthoC3 module.
[0018] Preferably, the steps of constructing the DtransFusion module specifically include:
[0019] The original input is passed through the DAttention module with a deformable attention mechanism and then through the first Dropout layer for the first discarding process. The output of the first discarding process is added element by element to the original input, and then the first normalization process is performed.
[0020] The original output after the first normalization processing passes through the first two-dimensional convolution layer and the GELU activation function layer, and then passes through the second Dropout layer for the second discard processing. After passing through the second two-dimensional convolution layer, it passes through the third Dropout layer for the third discard processing. The output of the third discard processing is added element by element to the original output after the first normalization processing, and then the second normalization processing is performed and then output.
[0021] Preferably, the steps of constructing the OrthoC3 module specifically include:
[0022] The input is convolved twice with 1x1 convolution and added element by element. After being processed by the ConvOrtho module, it is convolved once more with 1x1 convolution and then output.
[0023] Preferably, the steps of constructing the ConvOrtho module specifically include:
[0024] The original input is subjected to a convolution operation for feature extraction, processed by the orthogonal channel attention module to generate a compressed vector, and then the Excitation module performs channel weighting to generate attention weights. The attention weights are multiplied by the original input channel by channel, and then added to the original input element by element for output.
[0025] Preferably, the steps of constructing the backbone network unit specifically include:
[0026] Build the FasterNetBlock module;
[0027] The original input is processed by four FasterNetBlock modules in sequence. An embedding operation is performed before the first FasterNetBlock module, and a merging operation is performed before the next three FasterNetBlock modules. The two middle FasterNetBlock modules output two branches after processing. The first branch continues to enter the next FasterNetBlock module after the merging operation, and the second branch is output to the neck network unit. The last FasterNetBlock module outputs to the neck network unit.
[0028] Preferably, the construction steps of the FasterNetBlock module specifically include:
[0029] The original input is partially convolved through the PartialConv module, and then two 1x1 convolution operations are performed before being added element-by-element to the original input. Between the two 1x1 convolution operations, batch normalization and ReLU activation function operations are performed in sequence.
[0030] Preferably, when training the LGP-DETR target detection model, the hyperparameters of the model training are set to an input image size of 448×448, 200 training rounds, a batch size of 16, an optimizer of AdamW, an initial learning rate of 0.0001, a momentum of 0.9, and a weight decay coefficient of 0.0005.
[0031] Compared with the prior art, the present invention has the following advantages:
[0032] The present invention discloses a method for detecting surface defects of a light guide plate based on an LGP-DETR target detection model. First, a backbone network unit of the LGP-DETR target detection model is constructed based on the FasterNet neural network architecture to improve the ability to capture fine features of the surface image of the light guide plate; secondly, a DySample module is introduced into the neck network unit of the model for dynamic upsampling, and the detection accuracy is improved by optimizing the upsampling process to retain key details and edge features; then, a DtransFusion module is constructed based on an improved AIFI structure and a Deformable Attention module, and the neck network unit of the model is introduced to achieve larger-scale feature capture to enhance the model's recognition ability and computational efficiency for complex defects; an OrchoC3 module is constructed by introducing an orthogonal channel attention mechanism into a RepC3 module and the neck network unit of the model is introduced to further improve the model's ability to focus on defect features, suppress background noise, and reduce the false detection rate; after training, the LGP-DETR target detection model constructed by the above method performs defect detection on the surface image of the light guide plate, effectively overcoming the detection difficulties of small targets, low contrast, and complex texture background in the surface defects of the light guide plate, significantly improving the detection accuracy, and effectively improving the detection speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0034] Figure 1 It is a schematic diagram of the structure of the LGP-DETR target detection model in the present invention;
[0035] Figure 2 It is a structural diagram of a backbone network unit in the present invention;
[0036] Figure 3 It is a structural diagram of the DtransFusion module in the present invention;
[0037] Figure 4 It is a schematic diagram of the structure of the DAttention module in the present invention;
[0038] Figure 5 is a schematic diagram of the structure of the OrthoC3 module in the present invention;
[0039] Figure 6 It is a schematic diagram of the structure of the ConvOrtho module in the present invention;
[0040] Figure 7 It is a comparison chart of the loss function changes of the RT-DETR model and the LGP-DETR target detection model in the present invention during the training process and the verification process;
[0041] Figure 8 It is a comparison chart of the performance of the RT-DETR model and the LGP-DETR target detection model in the present invention in terms of precision, recall and mAP;
[0042] Fig. 9 It is a diagram showing the detection effects of different detection models on five different types of defects in the comparative experiment of the present invention;
[0043] Fig.10 It is a diagram showing the detection effects of different detection models on different types of cloth defects in the generalization experiment of the present invention. DETAILED DESCRIPTION
[0044] The technical solution of the present invention is 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 protection scope of the present invention.
[0045] In the present invention, unless otherwise specified, all parts and percentages are weight units, and the equipment and raw materials used can be purchased from the market or are 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 universal standard parts or components known to those skilled in the art, and their structures and principles are known to those skilled in the art through technical manuals or conventional experimental methods.
[0046] The embodiments of the present invention are described in detail below 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 also be implemented by those skilled in the art without these specific details.
[0047] An embodiment of the present invention discloses a method for detecting surface defects of a light guide plate based on an LGP-DETR target detection model, the method comprising the following steps:
[0048] Construct an LGP-DETR target detection model with backbone network units, neck network units and head network units;
[0049] Acquire the surface image of the light guide plate and form a data set of surface defects of the light guide plate, divide the data set into a training set, a validation set, and a test set, and train the LGP-DETR target detection model;
[0050] Obtain the surface image of the light guide plate and input it into the trained LGP-DETR target detection model for defect detection;
[0051] The defect detection results based on the LGP-DETR target detection model output the surface defect information of the light guide plate.
[0052] Among them, the backbone network unit is built based on the FasterNet neural network architecture, the neck network unit includes multiple standard convolution modules, the DtransFusion module that combines the deformable attention mechanism and the Transformer encoder structure, the DySample module for lightweight dynamic upsampling, the RepC3 module with reparameterized convolution characteristics, and the OrthoC3 module that combines the orthogonal channel attention mechanism and the RepC3 module structure. The head network unit is built based on the decoder module of the RT-DETR neural network architecture.
[0053] The LGP-DETR target detection model disclosed in this embodiment is an end-to-end target detection model, which has made multiple improvements on the basis of the RT-DETR network model in the prior art, aiming to improve the performance of light guide plate defect detection. The main improvements are as follows:
[0054] The backbone network unit is built based on the FasterNet neural network architecture to improve feature extraction capabilities and more accurately capture subtle defects on the surface of the light guide plate;
[0055] The neck network unit is improved based on the CCFM module of the RT-DETR network model, and the DySample module for lightweight dynamic upsampling is introduced into it, so as to effectively retain the details and edge features of the light guide plate surface image;
[0056] The DtransFusion module is built based on the Deformable Attention module and the AIFI module. This module combines the deformable attention mechanism with the Transformer encoder structure, and can adaptively adjust the focus of attention, so as to more accurately capture the defect characteristics of the light guide plate surface at different scales and positions.
[0057] The OrthoC3 module is constructed by combining the orthogonal channel attention mechanism with the RepC3 module structure to improve the accuracy of feature focusing and reduce the false detection rate.
[0058] The above improvements enable the LGP-DETR target detection model to better cope with defects of different scales when handling light guide plate defect detection tasks in complex industrial scenarios, while achieving a good balance between detection accuracy and speed.
[0059] The specific structure of the LGP-DETR target detection model disclosed in this embodiment is as follows: Figure 1 As shown in the figure, the workflow of the model is that the input image is firstly extracted and compressed through the backbone network unit, and then the extracted features are effectively refined and enhanced through the neck network unit. After being processed by the neck network unit, the final defect detection and classification are performed in the head network unit. The construction steps of the backbone network unit, the neck network unit and the head network unit are described in detail below.
[0060] The steps for constructing the backbone network unit specifically include:
[0061] Build the FasterNetBlock module;
[0062] The original input is processed by four FasterNetBlock modules in sequence. An embedding operation is performed before the first FasterNetBlock module, and a merging operation is performed before the next three FasterNetBlock modules. The two middle FasterNetBlock modules output two branches after processing. The first branch continues to enter the next FasterNetBlock module after the merging operation, and the second branch is output to the neck network unit. The last FasterNetBlock module outputs to the neck network unit.
[0063] The construction steps of the FasterNetBlock module include:
[0064] The original input is partially convolved through the PartialConv module, and then two 1x1 convolution operations are performed before being added element-by-element to the original input. Between the two 1x1 convolution operations, batch normalization and ReLU activation function operations are performed in sequence.
[0065] The backbone network unit directly uses the FasterNet neural network, which significantly reduces the computational complexity and number of parameters while ensuring high accuracy. It can run quickly in resource-constrained environments and is particularly suitable for application scenarios that require efficient real-time processing, which is particularly important for the detection of subtle defects on the surface of light guide plates. Because the defects of light guide plates usually appear as tiny and inconspicuous features, FasterNet can effectively capture these details, thereby improving the overall detection performance of the model.
[0066] The structure of the completed backbone network unit is as follows: Figure 2 Its detailed parameters are shown in Table 1.
[0067] Table 1 Modules and parameters of backbone network units
[0068]
[0069] Using the FasterNet neural network as the backbone network unit helps improve the model's detection accuracy for light guide plate surface defects, while ensuring the real-time and high efficiency of the model.
[0070] The steps for constructing the neck network unit specifically include:
[0071] Construct DtransFusion module, DySample module, RepC3 module and OrthoC3 module;
[0072] The first standard convolution module, the second standard convolution module and the third standard convolution module respectively receive different output features of the backbone network unit;
[0073] The output of the first standard convolution module is connected to the fourth standard convolution module through the DtransFusion module; the output of the fourth standard convolution module forms two branches, the first branch of which is upsampled by the first DySample module and then fused with the output of the second standard convolution module, and then connected to the fifth standard convolution module through the RepC3 module; the output of the fifth standard convolution module forms two branches, the first branch of which is upsampled by the second DySample module and then fused with the output of the third standard convolution module, and then input into the first OrthoC3 module; the output of the first OrthoC3 module forms two branches, the first branch of which is output to the head network unit;
[0074] The second branch of the output of the first OrthoC3 module is connected to the sixth standard convolution module, the output of the sixth standard convolution module is feature fused with the second branch of the output of the fifth standard convolution module, and then input into the second OrthoC3 module; the output of the second OrthoC3 module forms two branches, the first branch of which is output to the head network unit;
[0075] The second branch of the output of the second OrthoC3 module is connected to the seventh standard convolution module, the output of the seventh standard convolution module is feature fused with the second branch of the output of the fourth standard convolution module, and then output to the head network unit through the third OrthoC3 module.
[0076] The construction steps of the DtransFusion module include:
[0077] The original input is passed through the DAttention module with a deformable attention mechanism and then through the first Dropout layer for the first discarding process. The output of the first discarding process is added element by element to the original input, and then the first normalization process is performed.
[0078] The original output after the first normalization processing passes through the first two-dimensional convolution layer and the GELU activation function layer, and then passes through the second Dropout layer for the second discard processing. After passing through the second two-dimensional convolution layer, it passes through the third Dropout layer for the third discard processing. The output of the third discard processing is added element by element to the original output after the first normalization processing, and then the second normalization processing is performed and then output.
[0079] like Figure 3 As shown in the figure, the DtransFusion module introduces a DAttention module with a deformable attention mechanism, which can capture complex feature interactions. The purpose of this design is that the AIFI module is used in the original RT-DETR network model, which adopts a standard multi-head self-attention mechanism to calculate attention by flattening and transposing the input features, and relies on two-dimensional sine-cosine position embedding to provide position information. Each head of the multi-head self-attention mechanism calculates global attention at a fixed attention position, focusing mainly on global information. However, since the attention mechanism of each head is fixed within a specific range, the attention area cannot be adjusted dynamically. Therefore, the original mechanism has limitations in processing features with rich details or complex structures. The deformable attention mechanism can dynamically generate attention positions, better focus on local areas in images or feature maps, and provide the model with higher flexibility and sensitivity, especially when processing features with rich details or complex structures.
[0080] like Figure 4 As shown in the figure, in the DAttention module, the input feature x is linearly transformed to generate a query vector q, which is input into the offset network to generate an offset θ_offset through convolution, activation and other operations. The position of the offset point is calculated based on the initial position (reference point) and the generated offset θ_offset. These positions determine the feature positions sampled from the input feature map x. Then, new sampled features are sampled from the offset point positions through bilinear interpolation, and linear transformations are used to generate key vectors k and value vectors v, respectively. Finally, multi-head attention calculations are performed on the query vector and the sampled features, and the results are linearly transformed to generate the final output feature z.
[0081] In order to overcome the problem that traditional upsampling methods often cause detail loss and blurring when processing complex areas such as edges and textures in images, the DySample module is introduced in the neck network unit. The DySample module dynamically samples the local information of the input feature map, so that the detail information can be better preserved during the upsampling process, especially in the edge and complex texture areas. The DySample module dynamically generates a sampling offset and adjusts the upsampling sampling position according to the local content of the input feature map, thereby improving the upsampling accuracy.
[0082] The construction steps of the OrthoC3 module include:
[0083] The input is convolved twice with 1x1 convolution and added element by element. After being processed by the ConvOrtho module, it is convolved once more with 1x1 convolution and then output.
[0084] Among them, the construction steps of the ConvOrtho module specifically include:
[0085] The original input is subjected to a convolution operation for feature extraction, processed by the orthogonal channel attention module to generate a compressed vector, and then the Excitation module performs channel weighting to generate attention weights. The attention weights are multiplied by the original input channel by channel, and then added to the original input element by element for output.
[0086] The structure of the OrthoC3 module is as follows Figure 5 As shown, the structure of the ConvOrtho module is as follows Figure 6 shown.
[0087] The OrthoC3 module first performs two 1x1 convolutions on the input feature map to generate two sets of feature maps, which are then added and refined by the ConvOrtho module. The ConvOrtho module includes an orthogonal channel attention module, OrthoAttention, which uses an orthogonal filter to extract and weight features. After OrthoAttention processing, the channel attention of the feature map is adjusted by the attention weights generated by the Excitation module. Finally, the adjusted feature map is added to the original input feature map, and then subjected to a 1x1 convolution to output the final feature map.
[0088] In the Conv_Ortho module, the input feature map is first extracted through a series of convolutional layers (Conv Blocks) to generate a feature map of shape (H×W×C). In the orthogonal channel attention module OrthoAttention, a tensor of shape (C, 1, H, W) is initialized by a random number generator (RNG), and the Gram-Schmidt orthogonalization method is applied to generate orthogonal filters. Then, these orthogonal filters are multiplied by the input feature map channel by channel, and the results are summed in the spatial dimension to generate a compressed vector of shape (1×1×C). This vector is channel-weighted by the Excitation module to generate attention weights. Finally, these attention weights are multiplied by the original feature map channel by channel, and the adjusted feature map is added to the input feature map to output a feature map with enhanced channel attention.
[0089] Based on RepC3, the OrthoC3 module significantly enhances the feature extraction capability by introducing the orthogonal channel attention mechanism. In the LGP-DETR target detection model, the OrthoC3 module optimizes the focus on the defect features of the light guide plate and suppresses background noise, thereby improving detection accuracy and reducing false detection rate.
[0090] The head network unit directly uses the decoder module RTDETRDecoder of the RT-DETR neural network architecture.
[0091] The modules and parameters of the constructed LGP-DETR target detection model are shown in Table 2.
[0092] Table 2 Modules and parameters of LGP-DETR target detection model
[0093]
[0094]
[0095] Through various modules and parameters, the LGP-DETR target detection model can achieve high-precision light guide plate defect detection in complex industrial scenarios.
[0096] In order to verify the actual performance of the light guide plate surface defect detection method disclosed in this embodiment in the light guide plate defect detection application scenario, the following experiments were also conducted.
[0097] The types of defects in light guide plates are complex and varied, mainly including scratches, bubbles, stains, and uneven distribution of light and dark. According to actual industrial needs and defect characteristics, these defects are divided into five main types: B_line (bright line defect), D_line (dark line defect), area (regional defect), white_point (white point defect) and lack (missing defect). These categories cover the most common quality problems in light guide plate production.
[0098] The data set of surface defects of light guide plates is collected by an image acquisition device. The data set contains a total of 9384 images and their corresponding 9384 annotation files. All images are bmp format images after segmentation processing, with a resolution of 224×224 pixels. The data set is divided into training set, validation set and test set in a ratio of 6:2:2, containing 5630, 1877 and 1877 images respectively.
[0099] The hyperparameters for model training are set as follows: input image size is 448×448, training rounds are 200, batch size is 16, optimizer is AdamW, initial learning rate is 0.0001, momentum is 0.9, and weight decay coefficient is 0.0005. These settings help the model to update parameters stably, reduce overfitting, and improve generalization ability.
[0100] The evaluation indicators of the LGP-DETR target detection model include average precision mAP, floating-point operations per second GFLOPs, frames per second FPS and model parameter Params.
[0101] The experimental results of the ablation experiment are shown in Table 3.
[0102] Table 3 Ablation experiment results
[0103]
[0104] First, the most basic model in the ablation experiment uses ResNet18 as the backbone network unit. In the five detection tasks, although its mAP reaches 96.6%, its GFLOPs is as high as 58.3, indicating that its computational complexity is high. After replacing the backbone network unit with the lighter FastNet, the GFLOPs of the model is significantly reduced to 29.6, and the mAP is also increased to 97.0%, indicating that FastNet can maintain a high detection accuracy while reducing the computational cost.
[0105] Next, each improved module is gradually introduced to observe its impact on model performance. First, after adding the DtransFusion module, the mAP of the model is increased to 97.6%, especially the detection accuracy in the D_line and white_point categories has been significantly improved, verifying the effectiveness of DtransFusion in feature fusion. However, the computational complexity has increased, and GFLOPs has reached 36.0. Secondly, the DySample module is introduced to optimize the upsampling process. Although GFLOPs increased to 33.3, mAP also increased to 97.2%, demonstrating the significant contribution of DySample in improving efficiency while ensuring the stability of the model in detection accuracy.
[0106] After adding the OrthoC3 module, the model's mAP increased to 97.3%, especially in the detection accuracy of the area and lack categories. This result shows that the OrthoC3 module can effectively enhance the feature expression ability, especially in the target detection task under complex backgrounds. At the same time, GFLOPs only increased slightly to 30.1, which is still within a relatively controllable range.
[0107] When all the improved modules are combined, the final LGP-DETR object detection model achieves the best performance with an mAP of 97.9% and a GFLOPs of 45.4. In the five detection tasks, the detection accuracy of each category has been significantly improved, especially in the D_line and white_point categories.
[0108] The comparative models for comparative experiments include DETR, RT-DETR series (RT-DETR-r18 and RT-DETR-r50 based on ResNet18 and ResNet50 respectively), and YOLOv8 series (YOLOv8s and YOLOv8m) models. In the experiments, all models are trained and evaluated on the same hardware environment and dataset to ensure the comparability of the results. The experimental results of the comparative experiments are shown in Table 4.
[0109] Table 4 Comparative experimental results
[0110]
[0111] As can be seen from Table 4, the LGP-DETR target detection model performs well in multiple indicators such as mAP, FPS and GFLOPs.
[0112] In terms of mAP performance, the LGP-DETR target detection model achieved an mAP of 97.9%, the best performance among all models. It performed well in handling various types of defects, especially in difficult-to-detect defect categories such as "B_line" and "D_line".
[0113] In terms of speed and computational efficiency, the LGP-DETR object detection model achieved 60FPS while maintaining a high mAP, which is much higher than DETR's 23FPS and better than RT-DETR-r50's 37FPS. This shows that LGP-DETR can not only provide higher detection accuracy, but also has better real-time performance. In addition, LGP-DETR's GFLOPs is 45.4, which is significantly lower than RT-DETR-r50, indicating that the model has a high computational efficiency.
[0114] In terms of model complexity, the LGP-DETR target detection model has 21.7M parameters, which is slightly higher than YOLOv8s (11.1M) and YOLOv8m (25.9M), but its overall performance in detection accuracy and speed is superior, which shows that the LGP-DETR target detection model has achieved a good balance between complexity and performance.
[0115] The experiment also compared the training process of the original RT-DETR model and the LGP-DETR target detection model, and compared the changes in the loss functions of the two models during the training and verification processes. Figure 7 As shown in Figure 2, the performance comparison of the two models in terms of precision, recall, and mAP is shown in Figure 2. Figure 8 shown.
[0116] from Figure 7 It can be seen that LGP-DETR shows faster convergence speed and lower final loss value in each loss (GIoU loss, classification loss, L1 loss). In particular, the significant reduction of GIoU loss and L1 loss shows that LGP-DETR is more accurate in bounding box regression and can better fit the defect area. Overall, these results show that LGP-DETR is not only more efficient in optimization, but also more robust when processing light guide images with complex backgrounds and uneven brightness.
[0117] from Figure 8 It can be seen that LGP-DETR quickly increased in various indicators at the beginning of training and surpassed RT-DETR, especially in the detection indicators under the two strict conditions of mAP@0.5 and mAP@0.5:0.95. This shows that LGP-DETR can better identify defect targets of different scales while improving detection accuracy and recall rate, thereby maintaining stable detection performance in complex industrial scenarios.
[0118] Fig. 9 The figure shows the detection effects of different detection models DETR, RT-DETR-r18, RT-DETR-r50, YOLOv8s, YOLOv8m and LGP-DETR for five different types of defects. In the figure, the detection results of different models for each defect are marked in red font with confidence, which is convenient for intuitive comparison of the differences between models. LGP-DETR shows higher confidence and more accurate detection results in most cases, especially in complex D_line and lack defect detection, which further verifies its superiority in light guide plate defect detection tasks.
[0119] The experiment also verified the generalization performance of the LGP-DETR target detection model. The LGP-DETR target detection model was trained and verified based on the glass fiber cloth dataset, which is a set of images with a resolution of 320×320. These images were annotated by technicians and contain a variety of cloth defect categories, such as wavy edges, coarse wefts, loose warps, broken wefts, fuzz, and broken yarns. The generalization experiment results are shown in Table 5.
[0120] Table 5 Generalization experiment results
[0121]
[0122]
[0123] As can be seen from Table 5, in terms of AP performance, LGP-DETR performs well in all categories, especially in complex defects such as "Wave selvedge" and "Broken end", with AP values of 96.3% and 99.5% respectively. In contrast, DETR performs poorly in these categories, especially in the "Wave selvedge" category, with an AP of only 82.5%. The RT-DETR series models and YOLOv8m also perform well in various categories, but are slightly inferior to LGP-DETR.
[0124] In terms of FPS performance, although LGP-DETR is slower than YOLOv8s, it can still reach a high level of 57FPS while ensuring high detection accuracy, indicating that it has achieved a good balance between accuracy and speed.
[0125] In terms of GFLOPs and parameter performance, LGP-DETR maintains high precision while maintaining a GFLOPs of 45.4 and a parameter count of 21.7M, which is relatively moderate, indicating that LGP-DETR can still maintain good computational efficiency in complex scenarios.
[0126] Fig.10The results show the detection effects of different detection models DETR, RT-DETR-r18, RT-DETR-r50, YOLOv8s, YOLOv8m and LGP-DETR for different types of cloth defects. LGP-DETR shows strong performance in the detection of multiple defect categories, especially in the detection of complex defects such as 'Slack end', 'Slub' and 'Broken end', with high confidence, showing strong adaptability to multiple defect types. In contrast, RT-DETR-r50 and YOLOv8m perform similarly on some defects (such as 'Torn selvedge' and 'Slub'), but are slightly inferior to LGP-DETR in overall performance and consistency. Although the YOLO series models (YOLOv8s and YOLOv8m) perform well in some detection tasks (such as 'Wave selvedge' and 'Hair'), their performance has declined in the detection of complex defects (such as 'Double pick' and 'Broken end'). In contrast, the DETR model performs poorly in complex background and subtle defect detection, especially in the detection of broken warp defects, where the confidence level is low and cannot meet the high-precision detection requirements. From the above experimental results, it can be seen that LGP-DETR has demonstrated excellent generalization capabilities.
[0127] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made to the present invention without departing from the principles of the present invention, and these 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 a light guide plate based on an LGP-DETR target detection model, characterized in that: The method comprises the following steps: Construct an LGP-DETR target detection model with a backbone network unit, a neck network unit and a head network unit, wherein the backbone network unit is constructed based on the FasterNet neural network architecture, the neck network unit includes multiple standard convolution modules, a DtransFusion module combining a deformable attention mechanism with a Transformer encoder structure, a DySample module for lightweight dynamic upsampling, a RepC3 module with a reparameterized convolution feature, and an OrthoC3 module combining an orthogonal channel attention mechanism with a RepC3 module structure, and the head network unit is constructed based on a decoder module of the RT-DETR neural network architecture; Acquire the surface image of the light guide plate and form a data set of surface defects of the light guide plate, divide the data set into a training set, a validation set, and a test set, and train the LGP-DETR target detection model; Obtain the surface image of the light guide plate and input it into the trained LGP-DETR target detection model for defect detection; The surface defect information of the light guide plate is output based on the defect detection result of the LGP-DETR target detection model.
2. The method for detecting surface defects of a light guide plate based on the LGP-DETR target detection model according to claim 1, characterized in that: The steps of constructing the neck network unit specifically include: Construct DtransFusion module, DySample module, RepC3 module and OrthoC3 module; The first standard convolution module, the second standard convolution module and the third standard convolution module respectively receive different output features of the backbone network unit; The output of the first standard convolution module is connected to the fourth standard convolution module through the DtransFusion module; the output of the fourth standard convolution module forms two branches, the first branch of which is upsampled by the first DySample module and then fused with the output of the second standard convolution module, and then connected to the fifth standard convolution module through the RepC3 module; the output of the fifth standard convolution module forms two branches, the first branch of which is upsampled by the second DySample module and then fused with the output of the third standard convolution module, and then input into the first OrthoC3 module; the output of the first OrthoC3 module forms two branches, the first branch of which is output to the head network unit; The second branch of the output of the first OrthoC3 module is connected to the sixth standard convolution module, the output of the sixth standard convolution module is feature fused with the second branch of the output of the fifth standard convolution module, and then input into the second OrthoC3 module; the output of the second OrthoC3 module forms two branches, the first branch of which is output to the head network unit; The second branch of the output of the second OrthoC3 module is connected to the seventh standard convolution module, the output of the seventh standard convolution module is feature fused with the second branch of the output of the fourth standard convolution module, and then output to the head network unit through the third OrthoC3 module.
3. The method for detecting surface defects of a light guide plate based on the LGP-DETR target detection model according to claim 2, characterized in that: The construction steps of the DtransFusion module specifically include: The original input is passed through the DAttention module with a deformable attention mechanism and then through the first Dropout layer for the first discarding process. The output of the first discarding process is added element by element to the original input, and then the first normalization process is performed. The original output after the first normalization processing passes through the first two-dimensional convolution layer and the GELU activation function layer, and then passes through the second Dropout layer for the second discard processing. After passing through the second two-dimensional convolution layer, it passes through the third Dropout layer for the third discard processing. The output of the third discard processing is added element by element to the original output after the first normalization processing, and then the second normalization processing is performed and then output.
4. The method for detecting surface defects of a light guide plate based on the LGP-DETR target detection model according to claim 2, characterized in that: The construction steps of the OrthoC3 module specifically include: The input is convolved twice with 1x1 convolution and added element by element. After being processed by the ConvOrtho module, it is convolved once more with 1x1 convolution and then output.
5. The method for detecting surface defects of a light guide plate based on the LGP-DETR target detection model according to claim 4, characterized in that: The construction steps of the ConvOrtho module specifically include: The original input is subjected to a convolution operation for feature extraction, processed by the orthogonal channel attention module to generate a compressed vector, and then the Excitation module performs channel weighting to generate attention weights. The attention weights are multiplied by the original input channel by channel, and then added to the original input element by element for output.
6. The method for detecting surface defects of a light guide plate based on the LGP-DETR target detection model according to claim 1, characterized in that: The steps of constructing the backbone network unit specifically include: Build the FasterNetBlock module; The original input is processed by four FasterNetBlock modules in sequence. An embedding operation is performed before the first FasterNetBlock module, and a merging operation is performed before the next three FasterNetBlock modules. The two middle FasterNetBlock modules output two branches after processing. The first branch continues to enter the next FasterNetBlock module after the merging operation, and the second branch is output to the neck network unit. The last FasterNetBlock module outputs to the neck network unit.
7. The method for detecting surface defects of a light guide plate based on the LGP-DETR target detection model according to claim 6, characterized in that: The construction steps of the FasterNetBlock module specifically include: The original input is partially convolved through the PartialConv module, and then two 1x1 convolution operations are performed before being added element-by-element to the original input. Between the two 1x1 convolution operations, batch normalization and ReLU activation function operations are performed in sequence.
8. The method for detecting surface defects of a light guide plate based on the LGP-DETR target detection model according to claim 1, characterized in that: When training the LGP-DETR target detection model, the hyperparameters of the model training are set as follows: the input image size is 448×448, the training rounds are 200 rounds, the batch size is 16, the optimizer is AdamW, the initial learning rate is 0.0001, the momentum is 0.9, and the weight decay coefficient is 0.0005.