Light guide plate defect detection method based on improved YOLOv9 neural network model
By improving the YOLOv9 neural network model and introducing PKINet and RFAConv modules, the problem of insufficient feature extraction in light guide plate defect detection was solved, achieving higher detection accuracy and fewer model parameters, and improving adaptability to multi-scale targets.
Patent Information
- Application Number
- CN202411107606.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-26
AI Technical Summary
The existing YOLOv9 neural network model cannot fully extract medium and shallow texture and contour information in light guide plate defect detection, resulting in serious missed detections and false detections. It also has poor adaptability to multi-scale targets and has a large number of model parameters.
An improved YOLOv9 neural network model was constructed, introducing the PKINet and RFAConv modules to enhance feature extraction capabilities. The PKINet module extracts multi-scale target features and long-range context information, while the RFAConv module reduces the number of model parameters. Furthermore, the detection accuracy is improved through feature fusion and loss function optimization.
It significantly improves the accuracy of light guide plate defect detection, reduces the number of network model parameters, enhances the detection capability for multi-scale targets, and reduces the rate of missed detections and false detections.
Smart Images

Figure CN119027388A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a light guide plate defect detection method, and in particular to a light guide plate defect detection method based on an improved YOLOv9 neural network model, and belongs to the technical field of machine vision detection. Background Art
[0002] During the production process of light guide plates, various defects may appear on the surface of light guide plates due to the influence of raw materials, processes, environment and other factors. In order to improve the detection accuracy and automation level, machine vision technology has been widely used in the field of light guide plate defect detection in recent years, and a variety of machine learning algorithms have also been introduced into the classification of light guide plate defects. YOLOv9 is the latest basic network in the YOLO series. Although it is suitable for detecting the category and position of multi-scale targets, it cannot fully extract some medium and shallow textures and contour information when directly applied to light guide plate defect detection. The background texture is relatively complex, and the situation of missed detection and false detection is relatively serious. The adaptability to multi-scale targets is poor, and a considerable amount of model parameters is required. Therefore, how to enhance the detection ability of the network model for multi-scale targets in light guide plate defect detection, expand the receptive field of the network model to fully extract medium and shallow textures and contour information, and reduce the amount of network model parameters are technical problems that need to be solved in this field. Summary of the invention
[0003] Based on the above background, the purpose of the present invention is to provide a light guide plate defect detection method based on an improved YOLOv9 neural network model to solve the problems described in the background technology.
[0004] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:
[0005] A light guide plate defect detection method based on an improved YOLOv9 neural network model, the method comprising the following steps:
[0006] Based on the YOLOv9 neural network model, an improved YOLOv9 neural network model is constructed, wherein the improved YOLOv9 neural network model includes a backbone network and a head and neck network connected to the backbone network, wherein the backbone network has two branch networks, wherein the first branch network includes a Conv module, an RFAConv module, four RepNCSPELAN4 modules, three ADown modules, and a PKINet module, and the second branch network includes an RFAConv module, a Conv module, a RepNCSPELAN4 module, and an ADown module; wherein the RFAConv module performs a receptive field attention convolution operation, and the PKINet module uses a non-expanded multi-scale convolution kernel to extract target features of different scales and capture local context information, and can capture remote context information;
[0007] Acquire a light guide plate surface defect dataset, classify the dataset according to defect type, and divide the dataset into a training set, a validation set, and a test set, and train an improved YOLOv9 neural network model based on the dataset;
[0008] After training, the collected light guide plate images are input into the trained improved YOLOv9 neural network model for defect detection.
[0009] Preferably, the first branch network is connected in such a way that the Conv module, the RFAConv module, the first RepNCSPELAN4 module, the first ADown module, the second RepNCSPELAN4 module, the second ADown module, the third RepNCSPELAN4 module, the third ADown module, the fourth RepNCSPELAN4 module and the PKINet module are connected in sequence; the second branch network is connected in such a way that the RFAConv module, the Conv module, the RepNCSPELAN4 module and the ADown module are connected in sequence; wherein the output of the PKINet module in the first branch network is connected to the head and neck network, and the branch output of the first RepNCSPELAN4 module, the branch output of the second RepNCSPELAN4 module and the branch output of the third RepNCSPELAN4 module in the first branch network are also feature fused with the output of the second branch network in the head and neck network.
[0010] Preferably, the PKINet module includes four serially connected feature extraction modules. In each feature extraction module, the input first passes through a downsampling module and a Conv module, and then is divided into two parts in the channel dimension. One part is calculated by the FNN module to obtain a first output, and the other part is calculated by the PKI Block module to obtain a second output. The first output and the second output are merged in the channel dimension and then passed through the Conv module to obtain the final output; wherein the PKI Block module includes a PKI module for extracting multi-scale local features and a CAA module for capturing remote context information. The output attention weight of the CAA module is multiplied by the output feature of the PKI module, and then added to the output feature of the PKI module, and the output of the PKI Block module is obtained through a 1×1 convolution.
[0011] Preferably, the PKI module extracts local features through 3×3 depth-wise separable convolution, and then applies 5×5 depth-wise separable convolution, 7×7 depth-wise separable convolution, 9×9 depth-wise separable convolution and 11×11 depth-wise separable convolution in parallel to extract contextual features, and then adds the local features of the identity mapping and all the contextual features, and then fuses them through 1×1 convolution to obtain the output.
[0012] Preferably, the CAA module obtains the attention weight through global average pooling, 1×1 convolution, two serially connected depth-separable convolutions, and then through 1×1 convolution and sigmoid activation function.
[0013] Preferably, the RFAConv module extracts receptive field features through 3×3 grouped convolution, performs average pooling on the receptive field features to aggregate the global information of each receptive field feature, performs information interaction of the receptive field features through 1×1 grouped convolution, emphasizes the importance of each feature in the receptive field through softmax function operation, generates a receptive field attention map, multiplies the receptive field attention map with the receptive field features that have been processed by ReLU function operation and normalization to obtain an output, adjusts the shape, and then obtains the final output through 3×3 convolution.
[0014] Preferably, the mathematical expression of the loss function of the improved YOLOv9 neural network model is:
[0015] Loss = λ conf L conf +λ box L box +λ cls L cls
[0016] In the formula, λ conf represents the confidence loss weight, λ box represents the positioning loss weight, λ cls represents the classification loss weight, L conf Represents the confidence loss function, using the binary cross entropy loss function, L cls Represents the classification function, using the binary cross entropy loss function, L box Represents the positioning loss function, which adopts CIoU loss function.
[0017] Preferably, the defect types include white spot defects, black spot defects, bright line defects, dark line defects and area defects.
[0018] Compared with the prior art, the present invention has the following advantages:
[0019] The present invention discloses a light guide plate defect detection method based on an improved YOLOv9 neural network model. YOLOv9 is used as a baseline network model, and combined with a PKINet module and an RFAConv module, so that the network model obtains a stronger feature extraction capability, effectively reduces the number of network model parameters, enhances the network representation of features, and significantly improves the detection accuracy of the network model for light guide plate defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] 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.
[0021] Figure 1 It is a flow chart of a light guide plate defect detection method based on an improved YOLOv9 neural network model of the present invention;
[0022] Figure 2 It is a schematic diagram of the structure of the improved YOLOv9 neural network model in the present invention;
[0023] Figure 3 is a schematic diagram of a PKINet module in the present invention;
[0024] Figure 4 is a schematic diagram of each feature extraction module of the PKINet module in the present invention;
[0025] Figure 5 is a schematic diagram of the PKI Block module in the present invention;
[0026] Figure 6 is a schematic diagram of a PKI module in the present invention;
[0027] Figure 7 is a schematic diagram of a CAA module in the present invention;
[0028] Figure 8 is a schematic diagram of the RFAConv module in the present invention;
[0029] Fig. 9 It is a curve comparison diagram of the improved YOLOv9 neural network model in the present invention and the original YOLOv9 neural network model;
[0030] Fig.10 It is a defect detection confidence comparison chart of the improved YOLOv9 neural network model in the present invention and other comparison models;
[0031] Fig.11It is a comparison chart of the confidence of PCB defect detection by the improved YOLOv9 neural network model in the present invention and other comparison models. DETAILED DESCRIPTION
[0032] 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.
[0033] 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.
[0034] 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.
[0035] The embodiment of the present invention discloses a light guide plate defect detection method based on an improved YOLOv9 neural network model, such as Figure 1 As shown, the method comprises the following steps:
[0036] Based on the YOLOv9 neural network model, an improved YOLOv9 neural network model is constructed. The improved YOLOv9 neural network model includes a backbone network and a head and neck network connected to the backbone network. The backbone network has two branch networks. The first branch network includes a Conv module, an RFAConv module, four RepNCSPELAN4 modules, three ADown modules, and a PKINet module. The second branch network includes an RFAConv module, a Conv module, a RepNCSPELAN4 module, and an ADown module. Among them, the RFAConv module performs receptive field attention convolution operations, and the PKINet module uses non-expanded multi-scale convolution kernels to extract target features of different scales and capture local context information, and can capture remote context information.
[0037] Obtain a data set of surface defects on light guide plates, classify the data set according to defect types, and divide the data set into training set, validation set, and test set. Based on the data set, train the improved YOLOv9 neural network model.
[0038] After training, the collected light guide plate images are input into the trained improved YOLOv9 neural network model for defect detection.
[0039] The structure of the improved YOLOv9 neural network model is as follows Figure 2 As shown in the figure, the changes compared with the YOLOv9 neural network model are mainly reflected in the structure of the backbone network.
[0040] In the two branch networks of the backbone network, the connection method of the first branch network is that the Conv module, the RFAConv module, the first RepNCSPELAN4 module, the first ADown module, the second RepNCSPELAN4 module, the second ADown module, the third RepNCSPELAN4 module, the third ADown module, the fourth RepNCSPELAN4 module, and the PKINet module are connected in sequence.
[0041] The connection method of the second branch network is that the RFAConv module, the Conv module, the RepNCSPELAN4 module and the ADown module are connected in sequence.
[0042] The output of the PKINet module in the first branch network is connected to the head and neck network. The branch output of the first RepNCSPELAN4 module, the branch output of the second RepNCSPELAN4 module, and the branch output of the third RepNCSPELAN4 module in the first branch network are also fused with the output of the second branch network in the head and neck network.
[0043] Through the above structural changes, the network's ability to detect multi-scale targets is enhanced, the network's receptive field is expanded to fully extract mid- and shallow-layer texture and contour information, and the number of model parameters is reduced.
[0044] The introduction of the PKINet module improves the network's ability to detect multi-scale target defects and reduces the negative impact of complex texture background on detection.
[0045] like Figure 3 As shown, the PKINet module includes four serially connected feature extraction modules.
[0046] like Figure 4 As shown in the figure, in each feature extraction module, the input first passes through the downsampling module and the Conv module, and then is divided into two parts in the channel dimension. One part is calculated by the FNN module to obtain the first output, and the other part is calculated by the PKI Block module to obtain the second output. After the first output and the second output are merged in the channel dimension, they are passed through the Conv module to obtain the final output.
[0047] like Figure 5 As shown in the figure, the PKI Block module has a PKI module for extracting multi-scale local features and a CAA module for capturing remote context information. The output attention weight of the CAA module is multiplied by the output feature of the PKI module, and then added to the output feature of the PKI module. Through a 1×1 convolution, the output of the PKI Block module is obtained.
[0048] like Figure 6 As shown in the figure, the PKI module extracts local features through 3×3 depth-wise separable convolution, and then applies 5×5 depth-wise separable convolution, 7×7 depth-wise separable convolution, 9×9 depth-wise separable convolution and 11×11 depth-wise separable convolution in parallel to extract contextual features. After that, the local features of the identity mapping and all the contextual features are added together, and then fused through 1×1 convolution to obtain the output.
[0049] like Figure 7 As shown in the figure, the CAA module obtains the attention weight after global average pooling, 1×1 convolution, two serially connected depth-separable convolutions, and then 1×1 convolution and sigmoid activation function.
[0050] The introduction of the RFAConv module effectively reduces the number of model parameters and improves network detection performance.
[0051] like Figure 8 As shown in the figure, the RFAConv module extracts receptive field features through 3×3 grouped convolution, averages the receptive field features to aggregate the global information of each receptive field feature, performs information interaction of receptive field features through 1×1 grouped convolution, emphasizes the importance of each feature in the receptive field through softmax function operation, generates a receptive field attention map, multiplies the receptive field attention map with the receptive field features after ReLU function operation and normalization to obtain the output, adjusts the shape, and then obtains the final output through 3×3 convolution. The RFAConv module not only pays attention to the spatial features of the receptive field, but also provides effective attention weights for large-size convolution kernels.
[0052] The mathematical expression of the loss function of the improved YOLOv9 neural network model is:
[0053] Loss = λ conf L conf +λ box L box +λ cls L cls
[0054] In the formula, λ conf represents the confidence loss weight, λ box represents the positioning loss weight, λ clsrepresents the classification loss weight, L conf Represents the confidence loss function, using the binary cross entropy loss function, L cls Represents the classification function, using the binary cross entropy loss function, L box Represents the positioning loss function, which adopts CIoU loss function.
[0055] Among them, the binary cross entropy loss function and the CIoU loss function are both existing technologies, and the specific formulas are not repeated here.
[0056] The following takes the application scenario of hot-pressed light guide plate defect detection as an example to further explain the light guide plate defect detection method in detail.
[0057] In this embodiment, the original images of the data set are collected by the hot-pressed light guide plate defect detection device at the hot-pressed light guide plate industrial production site. After cropping, the original images of the hot-pressed light guide plate are generated to generate a single-channel grayscale sample image with a resolution of 224×224. The hot-pressed light guide plate surface defect data set includes 6160 images and 9588 annotations. The defect types include white spot defects, black spot defects, bright line defects, dark line defects, and regional defects. The number of images of each type of defect is shown in Table 1.
[0058] Table 1 Distribution of defect quantity in the hot-pressed light guide plate defect dataset
[0059] type White Spot Black Spot Bright Line Dark Line area quantity 1075 412 1266 1368 2146
[0060] The dataset is divided into training set, validation set and test set in a ratio of 7:2:1, containing 4312, 1232 and 616 images respectively. The distribution of each type of defect in the training set, validation set and test set is shown in Table 2.
[0061] Table 2 Distribution of the number of training sets, validation sets, and test sets of the hot-pressed light guide plate defect dataset
[0062] category White Spot Black Spot Bright Line Dark Line area Training set 752 288 886 957 1502 Validation set 215 82 253 273 429 Test Set 108 42 127 138 215
[0063] During the training process, in order to improve the robustness of the network and improve the detection accuracy, data enhancement is added to the network input. This embodiment adopts a mosaic data enhancement method. This method randomly extracts 4 pictures from the training set, randomly scales, randomly crops, and randomly arranges the extracted pictures, and randomly selects a picture splicing point, and finally splices the transformed pictures into the same window according to the splicing point.
[0064] The hardware environment of this embodiment is as follows: the processor is Intel(R) Core(TM) i7-10750H CPU@2.60GHz, the memory is 32GB, the graphics card model is Nvidia GTX 3090Ti (single card), the video memory is 32GB, and the disk size is 1T. The operating system is Windows 11 (64-bit), the Compute Unified Device Architecture (CUDA) version is 11.7, the cuDNN version is 8.6.0, the deep learning framework uses Pytorch 1.13.1, and the compiler is Python 3.7.
[0065] In this embodiment, the COCO dataset pre-trained weights of the original YOLOv9 neural network model will be used for transfer learning, and the relevant hyperparameters are set as follows: the size of the input image is 576×576 pixels. The network uses 3 epoches for warm-up training, the initial learning rate is set to 0.1, the minimum learning rate is set to 0.01, and a total of 300 epoches are trained. Momentum is set to 0.937, the optimizer uses SGD (Stochastic Gradient Descent), weight_decay is set to 0.0005, considering the training speed and video memory size, batchsize is set to 32, and mosaic data enhancement is turned on.
[0066] In order to ensure that the model is fully evaluated, this embodiment analyzes the network model through accuracy, recall, F1-score, mAP and parameter quantity. Accuracy (Precision) indicates the proportion of correct hot-pressed light guide plate defects among the targets detected by the network, and recall (Recall) indicates the proportion of all hot-pressed light guide plate defects that are correctly detected by the network. Recall is a constraint on accuracy. If the accuracy is too high but the recall is too low, it means that the network has detected too many hot-pressed light guide plate defects that are classified as non-light guide plate defects. At this time, the network will punish its excessively high accuracy.
[0067] The calculation formula for accuracy is:
[0068]
[0069] The calculation formula for recall is:
[0070]
[0071] In the formula, TP represents the number of hot-pressed light guide plate defects correctly detected by the network, FP represents the number of non-hot-pressed light guide plate defects incorrectly detected by the network, and FN represents the number of non-hot-pressed light guide plate defects incorrectly detected by the network as hot-pressed light guide plate defects. The calculation formula of F1-score is:
[0072]
[0073] mAP represents the average value of AP of different types of hot-pressed light guide plate defects, and AP represents the area between the PR (Precision-Recall) curve and the coordinate axis.
[0074] In order to verify the effect of the improved YOLOv9 neural network model, this embodiment separately introduces the PKINet module and the RFAConv module into the YOLOv9 neural network model for ablation experiments. The experimental results are shown in Table 3.
[0075] Table 3 Ablation experiment results
[0076] network Parameter quantity mAP(%) Recall rate (%) Accuracy (%) F1-Score(%) YOLOv9 60.81M 98.03 95.61 96.44 96.02 YOLOv9-PKINet 54.61M 98.11 96.99 95.35 96.16 YOLOv9-RFAConv 51.02M 98.25 97.28 96.18 96.72 Improved YOLOv9 54.62M 98.40 98.08 96.22 97.14
[0077] As shown in Table 3, adding the PKINet module to the YOLOv9 network reduces the number of network parameters by 6.20M, while increasing the recall rate by 1.38% and the Fl-Score by 0.14% compared with the original YOLOv9 network, and has a small improvement in mAP. At the same time, adding the RFAConv module to the YOLOv9 network reduces the number of network parameters by 9.79M, while increasing the mAP by 0.22%, the recall rate by 1.67%, and the Fl-Score by 0.70% compared with the original YOLOv9 network. Both the PKINet module and the RFAConv module can significantly reduce the number of parameters required for model training on the basis of improving a certain mAP, and improve the network's recall rate and F1-Score to varying degrees. After the two modules are combined, the improved YOLOv9 reduces the number of parameters by 6.19M compared to the original YOLOv9 network, increases mAP by 0.37%, recall by 2.47%, and F1-Score by 1.12%, with only a small loss in accuracy, greatly improving the actual detection capability.
[0078] In order to further verify the effect of the improved YOLOv9 neural network model, this embodiment compares it with target detection networks such as YOLOv5s, YOLOv5l, YOLOv7, YOLOv7x and YOLOv9. The training results of each network are shown in Tables 4 and 5.
[0079] Table 4 AP and mAP results of comparative experiments
[0080]
[0081]
[0082] Table 5 F1-score and parameter amount results of comparative experiments
[0083] Network Model F1-Score(%) Parameter quantity YOLOv5s 96.01 28.03M YOLOv5s-CA 96.42 28.84M YOLOv5l 96.02 28.03M YOLOv5-improve 96.35 34.31M YOLOv7 95.55 38.20M YOLOv7x 95.52 70.84M YOLOv9 96.02 60.81M Improved YOLOv9 97.14 54.62M
[0084] It can be seen from Tables 4 and 5 that on the hot-pressed light guide plate dataset, the mAPs of YOLOv5s and YOLOv5l networks are higher, 97.59% and 97.84% respectively; YOLOv7 has fewer parameters, but its mAP is only 96.63%; although YOLOv7x has a better mAP, its parameters are too large; and the F1-Scores of the above four networks are all around 96%.
[0085] Compared with the original YOLOv9 neural network model, the improved YOLOv9 neural network model has a mAP improvement of 0.37% to 98.40%, of which the detection accuracy of white spot defects has increased by 0.4%, and that of dark line defects has increased by 1.1%. The detection effect of small target defects and low-contrast defects has also been improved, and the F1-Score has increased by 1.12% to 97.71%. In addition, the improved YOLOv9 neural network model has achieved model lightweighting, and its parameter volume has decreased by 10.18% compared with the original YOLOv9 neural network model.
[0086] The mAP curve, F1-Score curve, training dfl loss function curve, and verification dfl loss function curve of the improved YOLOv9 neural network model and the original YOLOv9 neural network model are as follows Fig. 9 As shown in the figure. The mAP curve of the improved YOLOv9 is close to convergence at about 75 epochs, and the mAP curve of the original YOLOv9 is close to convergence at about 100 epochs; the F1-Score curve of the improved YOLOv9 and the F1-Score curve of the original YOLOv9 are close to convergence at about 100 epochs, but the overall value of the F1-Score curve of the improved YOLOv9 is higher than that of the original YOLOv9; the training dfl loss function curve and the verification dfl loss function curve of the improved YOLOv9 and the original YOLOv9 converge quickly within the first 25 epochs, and the curve convergence speed is similar, but the overall value of the training dfl loss function curve and the verification dfl loss function curve of the improved YOLOv9 is lower than that of the original YOLOv9.
[0087] Comparison of defect detection confidence between the improved YOLOv9 neural network model and other comparison models Fig.10 shown.
[0088] Through comparative experiments, it can be seen that the improved YOLOv9 neural network model has obvious advantages. Compared with the original YOLOv9 neural network model, it greatly reduces the number of network parameters while ensuring mAP, and effectively improves the network recall rate and F1-Score. Compared with the original YOLOv9 neural network model, the improved YOLOv9 neural network model also performs better in actual defect detection. The confidence of white spot defects, bright line defects and dark line defects is increased by 0.04, 0.10 and 0.06 respectively, achieving better detection effect.
[0089] In addition, in order to verify the robustness of the improved YOLOv9 neural network model, this embodiment also conducted experiments on the DEEP-PCB dataset, and the experimental method was the same as the experimental method based on the hot-pressed light guide plate defect dataset. The DEEP-PCB dataset contains defects such as scratches and short circuits that occur when printing PCBs, and the sample image resolution is 576×576. Compared with the hot-pressed light guide plate defect dataset, the background texture of the DEEP-PCB dataset is simple, the contrast between defects and background is high, and it is easier to extract defect features, but there are more defect categories in the DEEP-PCB dataset, and the number of samples is smaller, only 1,350. Therefore, it requires the network model to have a faster convergence speed to prevent overfitting due to the small number of samples.
[0090] The comparative experimental results are shown in Table 6.
[0091] Table 6 PCB comparison test results
[0092] Network Model mAP(%) Accuracy (%) Recall rate (%) F1-Score(%) YOLOv5s 97.38 97.22 94.92 96.06 YOLOv5s-CA 97.83 96.70 95.22 95.95 YOLOv5l 98.06 97.19 95.33 96.25 YOLOv5-improve 97.71 97.22 95.66 96.43 YOLOv7 95.07 94.27 90.48 92.34 YOLOv7x 97.23 96.32 94.59 95.45 YOLOv9 98.64 98.05 96.13 97.08 Improved YOLOv9 98.90 98.67 96.72 97.69
[0093] For the comparison of PCB defect detection confidence Fig.11 shown.
[0094] It can be seen that the improved YOLOv9 neural network model also outperforms other comparison models in terms of indicators on the DEEP-PCB dataset, and the improved YOLOv9 neural network model has excellent robustness.
[0095] 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 light guide plate defect detection method based on an improved YOLOv9 neural network model, Features: The method comprises the following steps: Based on the YOLOv9 neural network model, an improved YOLOv9 neural network model is constructed, wherein the improved YOLOv9 neural network model includes a backbone network and a head and neck network connected to the backbone network, wherein the backbone network has two branch networks, wherein the first branch network includes a Conv module, an RFAConv module, four RepNCSPELAN4 modules, three ADown modules, and a PKINet module, and the second branch network includes an RFAConv module, a Conv module, a RepNCSPELAN4 module, and an ADown module; wherein the RFAConv module performs a receptive field attention convolution operation, and the PKINet module uses a non-expanded multi-scale convolution kernel to extract target features of different scales and capture local context information, and can capture remote context information; Acquire a light guide plate surface defect dataset, classify the dataset according to defect type, and divide the dataset into a training set, a validation set, and a test set, and train an improved YOLOv9 neural network model based on the dataset; After training, the collected light guide plate images are input into the trained improved YOLOv9 neural network model for defect detection.
2. According to claim 1, a light guide plate defect detection method based on an improved YOLOv9 neural network model, Features: The connection mode of the first branch network is that the Conv module, the RFAConv module, the first RepNCSPELAN4 module, the first ADown module, the second RepNCSPELAN4 module, the second ADown module, the third RepNCSPELAN4 module, the third ADown module, the fourth RepNCSPELAN4 module, and the PKINet module are connected in sequence; the connection mode of the second branch network is that the RFAConv module, the Conv module, the RepNCSPELAN4 module and the ADown module are connected in sequence; wherein, the output of the PKINet module in the first branch network is connected to the head and neck network, and the branch output of the first RepNCSPELAN4 module, the branch output of the second RepNCSPELAN4 module, and the branch output of the third RepNCSPELAN4 module in the first branch network are also feature fused with the output of the second branch network in the head and neck network.
3. According to claim 1, a light guide plate defect detection method based on an improved YOLOv9 neural network model, Features: The PKINet module includes four serially connected feature extraction modules. In each feature extraction module, the input first passes through a downsampling module and a Conv module, and then is divided into two parts in the channel dimension. One part is calculated by the FNN module to obtain a first output, and the other part is calculated by the PKI Block module to obtain a second output. The first output and the second output are merged in the channel dimension and then passed through the Conv module to obtain the final output. Among them, the PKI Block module has a PKI module for extracting multi-scale local features and a CAA module for capturing remote context information. The output attention weight of the CAA module is multiplied by the output feature of the PKI module, and then added to the output feature of the PKI module. Through 1×1 convolution, the output of the PKI Block module is obtained.
4. According to claim 3, a light guide plate defect detection method based on an improved YOLOv9 neural network model, Features: The PKI module extracts local features through 3×3 depth-wise separable convolution, and then applies 5×5 depth-wise separable convolution, 7×7 depth-wise separable convolution, 9×9 depth-wise separable convolution and 11×11 depth-wise separable convolution in parallel to extract contextual features, then adds the local features of the identity mapping and all the contextual features, and then fuses them through 1×1 convolution to obtain the output.
5. According to claim 3, a light guide plate defect detection method based on an improved YOLOv9 neural network model, Features: The CAA module obtains the attention weight through global average pooling, 1×1 convolution, two serially connected depth-wise separable convolutions, and then 1×1 convolution and sigmoid activation function.
6. The method for detecting defects of a light guide plate based on an improved YOLOv9 neural network model according to claim 1, Features: The RFAConv module extracts receptive field features through 3×3 grouped convolution, average-pools the receptive field features to aggregate the global information of each receptive field feature, performs information interaction of the receptive field features through 1×1 grouped convolution, emphasizes the importance of each feature in the receptive field through softmax function operation, generates a receptive field attention map, multiplies the receptive field attention map with the receptive field features that have been processed by ReLU function operation and normalization to obtain an output, adjusts the shape, and then obtains the final output through 3×3 convolution.
7. The method for detecting defects of a light guide plate based on an improved YOLOv9 neural network model according to claim 1, Features: The mathematical expression of the loss function of the improved YOLOv9 neural network model is: Loss=λ conf L conf +λ box L box +λ cls L cls In the formula, λ conf represents the confidence loss weight, λ box represents the positioning loss weight, λ cls represents the classification loss weight, L conf Represents the confidence loss function, using the binary cross entropy loss function, L cls Represents the classification function, using the binary cross entropy loss function, L box Represents the positioning loss function, which adopts CIoU loss function.
8. The method for detecting defects of a light guide plate based on an improved YOLOv9 neural network model according to claim 1, Features: The defect types include white spot defects, black spot defects, bright line defects, dark line defects and area defects.
Citation Information
Cited By
Commercial vehicle chassis visual detection method, system and device based on neural network and medium
CN121304603A
