Bamboo cane defect detection method based on improved YOLOv9

By introducing the Bottleneck_Asy module and multi-scale feature fusion module in the YOLOv9 model, the problems of high manual detection cost and strong environmental dependence in bamboo strip defect detection are solved, and efficient and real-time bamboo strip defect detection is achieved, and the detection accuracy is improved and adapted. Industrial production demand.

CN119295404APending Publication Date: 2025-01-10XIAMEN UNIV TAN KAH KEE COLLEGE +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411392541.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing bamboo strip defect detection methods rely on high manual detection cost, low accuracy and no real-time performance. The traditional machine vision methods are highly dependent on the environment and cannot meet the rapid detection needs of industrial production.

Method used

Using the bamboo strip defect detection method based on improved YOLOv9, the Bottleneck_Asy module is introduced into the GELAN structure to form the RepNCSPELAN4_Asy feature extraction module, combined with SAF and AAF modules to perform multi-scale feature fusion, and use auxiliary branches and Mosaic data enhancement to improve the features of the model. Extraction and detection capabilities.

Benefits of technology

Accurate positioning and rapid identification of bamboo strip surface defects is achieved, the detection speed reaches real-time standard, and the detection accuracy reaches 94.1%, which significantly improves generalization and adaptability, and is suitable for industrial production scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295404A_ABST
    Figure CN119295404A_ABST
Patent Text Reader

Abstract

The invention provides a bamboo strip defect detection method based on improved YOLOv9, and the method comprises the steps: employing a bamboo strip defect detection model based on YOLOv9, introducing a BottleneckAey module in a GELAN structure, and forming a RepNCSPELAN4Aey feature extraction module, so as to enhance the feature extraction capability of a Backbone network; and performing defect detection on the bamboo cane image after the model is trained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to technical fields such as machine vision, deep learning and industrial production, and in particular to a bamboo strip defect detection method based on improved YOLOv9. Background Art

[0002] Bamboo occupies an important position in the manufacturing industry. Its high strength, light weight, and rapid growth make bamboo a sustainable and environmentally friendly resource, and it is widely used in many fields such as construction, furniture, handicrafts, and papermaking. In recent years, with the popularization of the concept of sustainable development, the multifunctional and environmentally friendly characteristics of bamboo have made it an important resource for promoting green transformation in the manufacturing industry. Before being put into production, bamboo needs to be processed into bamboo strips through processes such as cutting and polishing to adapt to diverse production applications. However, bamboo strips are prone to various defects during production, transportation, and storage, which affect the performance and appearance of the final product. How to efficiently and quickly detect and troubleshoot bamboo strip defects has become an urgent problem to be solved in the production process of contemporary bamboo products.

[0003] Traditional bamboo strip defects are mainly detected manually, which requires a lot of manpower, material resources and time, bringing high costs to manufacturing companies. With the rapid development of computer technology, defect detection methods based on traditional machine vision have gradually been applied. For example, first, the captured image is cut and divided for preprocessing; then, based on expert experience or experimental results, threshold segmentation, texture analysis and other methods are used to extract key features; finally, classification is performed based on the extracted features. This type of method has high requirements for the quality of the captured image, and at the same time relies on subjective feature selection. It has strong environmental dependence and low generalization, cannot locate defects, and cannot meet the needs of actual production. In summary, the existing widely used defect detection methods have the following disadvantages: 1. High detection cost 2. Low detection accuracy 3. Low generalization, robustness and flexibility.

[0004] Since neural networks have good generalization and flexibility, they are now also used in defect detection in industrial production. Among them, the YOLO series of algorithms are widely used, with the characteristics of real-time single-stage detection and easy deployment of terminal equipment, as well as being lightweight and fast while having a high accuracy rate. However, the YOLO algorithm itself was developed in life scenarios, and the detection targets are common objects in life. It still has the disadvantage of insufficient generalization for bamboo defects with different scales, shapes and small category distinctions in industrial scenarios, and needs to be improved to adapt to the production scenarios of bamboo defect detection. Summary of the invention

[0005] Considering that the manual defect detection method relies on human vision and experience, it has the disadvantages of high cost, insufficient consistency and accuracy, and its efficiency is difficult to match the high-speed production line of modern industry. The detection method based on traditional machine vision relies on the experience of experts in feature design, and has the disadvantages of insufficient robustness, sensitivity to noise and different environments, and low applicability to products with diverse features. Therefore, the present invention proposes a bamboo strip defect detection method based on improved YOLOv9, which can automatically extract features, has strong robustness and adaptability, does not have strong environmental dependence, and realizes accurate positioning and rapid identification of bamboo strip surface defects. The detection speed reaches the real-time standard to match the industrial production speed. In addition, the method has good generalization and adaptability, and can also provide a reference for real-time defect detection in similar scenarios.

[0006] The present invention specifically adopts the following technical solutions: A bamboo strip defect detection method based on improved YOLOv9 was proposed. The bamboo strip defect detection model based on YOLOv9 was adopted, and the Bottleneck_Asy module was introduced into the GELAN structure to form the RepNCSPELAN4_Asy feature extraction module to enhance the feature extraction ability of the Backbone network. After the model was trained, defects were detected on bamboo strip images.

[0007] Furthermore, the dataset is generated by using a camera to capture images of the side and front of the bamboo strips; marking the defects in the images and generating corresponding annotation files; dividing the annotated images and files into a training set, a validation set, and a test set in a ratio of 7:2:1.

[0008] Furthermore, the bamboo strip defect detection model includes: a feature extraction backbone network Backbone, a multi-scale feature fusion network MAFPN and a decoupled detection head DecoupledHead; and an auxiliary branch AuxiliaryBranch is used in the training process; First, the image data to be detected flows into the Backbone part of the detection model, which includes a separate Conv module and four feature extraction stages. Each stage consists of a downsampling module and a feature extraction module. The first Conv module is used to perform preliminary downsampling and channel shaping on the image, which consists of convolution operations, batch normalization, and activation functions. The next four stages downsample and extract features from the feature maps obtained in the previous part. In the first stage, only the ELAN1 module is used for feature extraction. In the next three stages, the AConv downsampling module is composed of an average pooling layer and a Conv module, and the GELAN structure is used for feature extraction. Then, the P5 feature map of the final stage is first subjected to multi-scale feature fusion by the SPPELAN module, and then combined with the feature maps of the first three stages. Figure 1The deep and shallow information are input into MAFPN; MAFPN introduces two feature fusion methods SAF and AAF, which are used to integrate deep and shallow information and strengthen feature interaction respectively; among them, the SAF part fuses the current layer, the lower layer with high-level semantic information and the upper layer with high resolution, and uses the Conv module to downsample the shallow features and control the number of channels to control the increase in the number of parameters and the amount of calculation; the AAF part fuses the current layer, the lower layer and the two upper layer features, and the final output aggregates the deep semantic information from four different layers, thereby improving the classification ability of the network; after the SAF and AAF modules, the RepNCSPELAN4 module is used to process the fused information; the feature map fused by the MAFPN network is sent to the DecoupledHead to generate the location information and category prediction of the defect.

[0009] Furthermore, the GELAN structure uses Bottleneck_Asy to replace the basic module RepNBottleneck in RepNCSPELAN4 to form the RepNCSPELAN4_Asy module, so as to improve the model's feature extraction capability for bamboo defects; Bottleneck_Asy is composed of the RepConv_Asy module and the Conv module; RepConv_Asy introduces a new branch with 1 xk convolution in the training stage to learn the information omitted by the kxk and 1 x 1 branches, and integrates it into the kxk convolution together with the 1 x1 convolution in the test inference stage, so as to achieve stronger feature extraction capability without affecting the model size and inference speed.

[0010] Furthermore, the auxiliary branch Auxiliary Branch is constructed through the backbone feature graphs of the last three levels; during training, the three auxiliary branches also learn and generate losses, but the losses of the auxiliary branches are back-propagated at a ratio of 0.25 and pruned in the final inference prediction stage; so as to improve the expressiveness of the model without affecting the final prediction inference speed and size of the model.

[0011] Furthermore, during the model training process, the Mosaic data enhancement method is used to enhance the training data online to enhance the network's ability to detect different defects.

[0012] Furthermore, the image to be detected is input into the trained model, and the obtained defect prediction box is subjected to non-maximum suppression processing to finally obtain the defect detection result.

[0013] And, a bamboo strip defect detection system based on improved YOLOv9, comprising: Based on the bamboo defect detection model of YOLOv9, the Bottleneck_Asy module is introduced into the GELAN structure to form the RepNCSPELAN4_Asy feature extraction module to enhance the feature extraction capability of the Backbone network; And, a training module is used to perform defect detection on bamboo strip images after the bamboo strip defect detection model is trained.

[0014] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of a bamboo strip defect detection method based on improved YOLOv9 are implemented as described above.

[0015] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a bamboo strip defect detection method based on improved YOLOv9 as described above.

[0016] Compared with the prior art, the present invention and its preferred solution introduce the Bottleneck_Asy module into the GELAN structure proposed by YOLOv9 to form a new RepNCSPELAN4_Asy feature extraction module, which strengthens the feature extraction capability of the Backbone network. At the same time, in the feature fusion network part, the SAF and AAF modules are introduced to form a new MAFPN fusion network, which realizes the full fusion of shallow and deep network information flows and effectively improves the detection accuracy. The detection accuracy of this method reaches 94.1%, which is 1.3% higher than the original YOLOv9 and 1.6% higher than the widely used YOLOv8 network. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments: Figure 1 This is a diagram of the improved YOLOv9 network structure according to an embodiment of the present invention; Figure 2 This is a diagram of the reasoning conversion process of the RepConv_Asy module in an embodiment of the present invention; Figure 3 This is a diagram of the data set file structure of an embodiment of the present invention; Figure 4 A result diagram of the embodiment of the present invention is marked; Figure 5 This is a diagram showing the model yaml file of an embodiment of the present invention; Figure 6 This is a diagram showing the verification accuracy of the embodiment of the present invention; Figure 7 This is a graph showing the training loss of an embodiment of the present invention; Figure 8 This is an example diagram of the model detection effect of an embodiment of the present invention. DETAILED DESCRIPTION

[0018] Hereinafter, the specific embodiments of the present application will be described in detail with reference to the accompanying drawings. According to these detailed descriptions, those skilled in the art can clearly understand the present application and can implement the present application. Without violating the principles of the present application, the features in the various embodiments can be combined to obtain new implementations, or certain features in certain embodiments can be replaced to obtain other preferred implementations.

[0019] In order to make the features and advantages of this patent more obvious and easy to understand, the following embodiments are specifically described in detail with the accompanying drawings as follows: The method provided by the embodiment of the present invention is mainly divided into four parts, including: collecting and dividing data sets, building detection models, training detection models and detecting defect images. The following are the technical measures of the four steps: 1. Collect and divide the data set. In an actual industrial production environment, use a camera to collect images of the side and front of bamboo strips. Use annotation software to annotate the defects in the images and generate corresponding annotation files. Divide the annotated images and files into training set, validation set, and test set in a ratio of 7:2:1.

[0020] 2. Build a detection model. Figure 1 As shown in the figure, the detection model is based on the architecture of the YOLOv9 model and is improved. It is mainly composed of a feature extraction backbone network (Backbone), a multi-scale feature fusion network (MAFPN) and a decoupled detection head (DecoupledHead). In the two stages of training and reasoning, the flow of image data in the network is roughly the same, and the auxiliary branch (Auxiliary Branch) only exists during the training process.

[0021] First, the image data to be detected flows into the Backbone part of the detection model, which includes a separate Conv module and four feature extraction stages. Each stage consists of a downsampling module and a feature extraction module. The first Conv module is used to perform preliminary downsampling and channel shaping of the image. It consists of convolution operations, batch normalization, and activation functions. This module is used everywhere as the basic convolution module in the entire network. The last four stages downsample and extract features from the feature maps obtained in the previous part. In the first stage, only the ELAN1 module is used for feature extraction. This is because at the beginning of the network, the feature map only has low-level features. Using an overly complex feature extraction module will cause the network to overfit and lose some basic information, resulting in a decrease in model performance. In the last three stages, the AConv downsampling module consists of an average pooling layer and a Conv module, and the GELAN basic architecture of YOLOv9 is used for feature extraction. Since the YOLOv9 model has limited generalization ability for bamboo defects, this embodiment uses Bottleneck_Asy to replace the basic module RepNBottleneck in RepNCSPELAN4 to form a new RepNCSPELAN4_Asy module to improve the model's feature extraction ability for bamboo defects. Bottleneck_Asy consists of the RepConv_Asy module and the Conv module. Figure 2 As shown in the figure, RepConv_Asy introduces a new branch with 1xk convolution in the training phase to learn the key information missed by the kxk and 1x1 branches, and integrates it into the kxk convolution together with the 1x1 convolution in the test and reasoning phase, achieving stronger feature extraction capabilities without affecting the model size and reasoning speed.

[0022] Then, the P5 feature map of the final stage will first be fused with multi-scale features through the SPPELAN module, and then combined with the features of the first three stages. Figure 1Together they are input into MAFPN (multi-branch assisted FPN). This embodiment introduces two feature fusion methods, SAF (shallow assisted fusion) and AAF (advanced assisted fusion), in MAFPN, which are used to integrate deep and shallow information and strengthen feature interaction, respectively. In the SAF part, the current layer, the lower layer with high-level semantic information, and the upper layer features with high resolution are fused. Compared with the traditional PAN network, it aims to retain the rich positioning details of the shallow layer to enhance the positioning ability of the network. At the same time, considering that adding splicing branches will increase the number of parameters, SAF uses the Conv module to downsample the shallow features and control the number of channels to control the increase in the number of parameters and the amount of calculation; in the AAF part, the current layer, the lower layer and the two upper layer features are fused, and the final output aggregates the deep semantic information from four different layers, thereby improving the classification ability of the network. After the SAF and AAF modules, the RepNCSPELAN4 module is used to process the fused information.

[0023] At the same time, as the feature fusion network becomes more complex, deep networks are prone to information loss during training. As a result, although complex fusion networks have better feature representation capabilities, they are prone to feature expression bottlenecks caused by information loss during training, and complex networks perform worse than simple networks. This method uses the last three levels of Backbone feature maps to construct auxiliary branches. During training, the three auxiliary branches also learn and generate losses, but the losses of the auxiliary branches are back-propagated at a ratio of 0.25 and pruned in the final inference prediction stage. The expressive power of the model is improved without affecting the final prediction inference speed and size of the model.

[0024] Finally, the feature map fused by the MAFPN network is sent to the DecoupledHead to generate the defect location information and category prediction.

[0025] 3. Train the detection model. Use the bamboo defect dataset constructed in step 1 to train the improved YOLOv9 defect detection model constructed in step 2. During training, use the Mosaic data enhancement method to enhance the training data online to enhance the network's detection ability for different defects.

[0026] 4. Detect defective images. Input the image to be detected into the trained model, perform non-maximum suppression (NMS) on the obtained defect prediction box, and finally obtain the defect detection result.

[0027] The following is a further demonstration of the details and effects of the solution of the present invention through specific test examples: The computer environment used is as follows: CPU: Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz, GPU: NVIDIA GeForce RTX 4090 24G, Memory: 128G, Python: 3.8.19, Pytorch: 2.2.2, CUDA: 12.1.

[0028] 1. Collect and divide the data set In this embodiment, a total of 22,325 images were collected in actual industrial production scenarios. The defect categories include: bamboo green, inner carbon, scar, crack edge, concave yellow, black node, mildew, tile, bamboo yellow, and without plane. Each image consists of the front and side of a bamboo strip. The upper part of the image is the side and the lower part is the front. The resolution is 1024x450. Then, the defects in all images are annotated using Labelimg annotation software, and the images and annotation files are divided into training set, validation set, and test set. The data set structure is as follows: Figure 3 , the annotation results are as follows Figure 4 .

[0029] 2. Build a detection model According to the model structure diagram, write the code of each module and the model structure yaml file, and "register" the modules used in the yolo.py file. The configuration file is as follows Figure 5 As shown, the following module parameter list only explains its meaning when it appears for the first time.

[0030] Backbone network yaml configuration: The parameter list of the 0th Conv downsampling module is [32, 3, 2], indicating that the number of output channels is 32, the convolution kernel is 3x3, and the stride is 2; the parameter list of the 1st Conv downsampling module is [64, 3, 2]; the parameter list of the 2nd ELAN feature extraction module is [64, 64, 32], indicating that the module has 64 output channels, the number of output channels of the first Conv in the module is 64, and the number of channels of the two branches is 32; the parameter list of the 3rd AConv downsampling module is

[128] , indicating that the number of output channels is 128; the parameter list of the 4th RepNCSPELAN4_Asy feature extraction module is [128, 128, 64, 3], which means the module output channel is 128, the first Conv module in the module has an output channel of 128, the number of channels of the two CSP branches in the module is 64, and the Bottleneck_Asy module is repeated 3 times; the parameter list of the 5th Aconv module is

[224] ; the parameter list of the 6th RepNCSPELAN4_Asy module is [224, 224, 112, 3]. The parameter list of the 7th Aconv module is

[320] ; the parameter list of the 8th RepNCSPELAN4_Asy module is [320,320, 160, 3].

[0031] MAFPN network yaml configuration: The output of the last layer (P5 layer) of the Backbone network must first pass through a SPPELAN module, and the parameter list is [320, 160], indicating that the module outputs 320 channels, and the first Conv module in the block outputs 160 channels. The feature fusion MAFPN network is similar to the original YOLOv9, and the RepNCSPELAN4 parameter list of each layer is the same as the RepNCSPELAN4_Asy of the corresponding Backbone layer (P3, P4, P5). The SAF module of each feature layer is used for downsampling and controlling the number of channels of the Conv module, and the output channels are P3:32, P4:64, and P5:128 respectively; the Conv module in the AAF module has output channels of P4:128 and P5:224 respectively.

[0032] The network configuration of the auxiliary branch is the same as that of the auxiliary branch of the YOLOv9s model. Adjust the RepNCSPELAN4 parameter list of each feature layer to the parameters of the corresponding layer RepNCSPELAN4_Asy.

[0033] Finally, the input part of the detection head is changed to the number of each layer received.

[0034] 3. Train the detection model.

[0035] During the training process, the Mosaic online data enhancement method is used by default. There is no need to change the data in the training set. Only after simple data enhancement operations are performed online on multiple training images during the training phase, they are spliced ​​into a new image to enhance the robustness of the model. Hyperparameter settings during training: input size imgsz: 640x640, number of training rounds epoch: 500, number of early stopping rounds patience: 100, batch_size: 16, initial learning rate lr1: 0.01, end learning rate ratio lrf: 0.01, warmup rounds warmup_epochs: 3.0, momentum momentum: 0.937, weight decay weight_decay: 0.0005, optimizer optimizer: SGD. The model training loss and validation set accuracy changes during the training process are as follows: Figure 6 , Figure 7 shown.

[0036] 4. Detect defective images Use detect.py to import the best.pt model file obtained during the training process, which performs best on the validation set, and detect the defect image to obtain the prediction of the defect category and location. Figure 8 As shown, the defect category and confidence level are above the prediction box.

[0037] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0038] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0039] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0040] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0041] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0042] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

[0043] This patent is not limited to the above-mentioned optimal implementation mode. Anyone can derive other forms of a bamboo strip defect detection method based on improved YOLOv9 under the inspiration of this patent. All equal changes and modifications made according to the scope of the patent application of the present invention should be covered by this patent.

Claims

1. A bamboo strip defect detection method based on improved YOLOv9, characterized in that: A bamboo strip defect detection model based on YOLOv9 is adopted, and the Bottleneck_Asy module is introduced into the GELAN structure to form the RepNCSPELAN4_Asy feature extraction module to enhance the feature extraction ability of the Backbone network. After training, the model is used to detect defects in bamboo strip images.

2. The bamboo strip defect detection method based on improved YOLOv9 according to claim 1, characterized in that: The dataset is generated by using a camera to capture images of the side and front of bamboo strips; marking the defects in the images and generating corresponding annotation files; dividing the annotated images and files into training set, validation set, and test set in a ratio of 7:2:

1.

3. The bamboo strip defect detection method based on improved YOLOv9 according to claim 1, characterized in that: The bamboo strip defect detection model includes: a feature extraction backbone network Backbone, a multi-scale feature fusion network MAFPN and a decoupled detection head DecoupledHead; and an auxiliary branch Auxiliary Branch is used in the training process; First, the image data to be detected flows into the Backbone part of the detection model, which includes a separate Conv module and four feature extraction stages. Each stage consists of a downsampling module and a feature extraction module. The first Conv module is used to perform preliminary downsampling and channel shaping on the image, which consists of convolution operations, batch normalization, and activation functions. The next four stages downsample and extract features from the feature maps obtained in the previous part. In the first stage, only the ELAN1 module is used for feature extraction. In the next three stages, the AConv downsampling module is composed of an average pooling layer and a Conv module, and the GELAN structure is used for feature extraction. Then, the P5 feature map of the final stage is first subjected to multi-scale feature fusion by the SPPELAN module, and then input into MAFPN together with the feature maps of the first three stages; MAFPN introduces two feature fusion methods, SAF and AAF, which are used to integrate deep and shallow information and strengthen feature interaction respectively; among them, the SAF part fuses the current layer, the lower layer with high-level semantic information, and the upper layer with high resolution, and uses the Conv module to downsample the shallow features and control the number of channels to control the increase in the number of parameters and the amount of calculation; the AAF part fuses the current layer, the lower layer and the two upper layer features, and the final output aggregates the deep semantic information from four different layers, thereby improving the classification ability of the network; after the SAF and AAF modules, the RepNCSPELAN4 module is used to process the fused information; the feature map fused by the MAFPN network is sent to the DecoupledHead to generate the location information and category prediction of the defect.

4. The bamboo strip defect detection method based on improved YOLOv9 according to claim 1, characterized in that: The GELAN structure uses Bottleneck_Asy to replace the basic module RepNBottleneck in RepNCSPELAN4 to form the RepNCSPELAN4_Asy module, so as to improve the model's feature extraction capability for bamboo defects; Bottleneck_Asy is composed of the RepConv_Asy module and the Conv module; RepConv_Asy introduces a new branch with 1 xk convolution in the training phase to learn the information missed by the kxk and 1 x 1 branches, and integrates it into the kx k convolution together with the 1 x 1 convolution in the test inference phase, so as to achieve stronger feature extraction capability without affecting the model size and inference speed.

5. The bamboo strip defect detection method based on improved YOLOv9 according to claim 3 is characterized in that: The auxiliary branch Auxiliary Branch is constructed through the last three levels of Backbone feature maps; during training, the three auxiliary branches also learn and generate losses, but the losses of the auxiliary branches are back-propagated at a ratio of 0.25 and pruned in the final inference prediction stage; so as to improve the expressiveness of the model without affecting the final prediction inference speed and size of the model.

6. The bamboo strip defect detection method based on improved YOLOv9 according to claim 1, characterized in that: During the model training process, the Mosaic data enhancement method is used to enhance the training data online to enhance the network's ability to detect different defects.

7. The bamboo strip defect detection method based on improved YOLOv9 according to claim 1, characterized in that: The image to be detected is input into the trained model, and the obtained defect prediction box is subjected to non-maximum suppression processing to finally obtain the defect detection result.

8. A bamboo strip defect detection system based on improved YOLOv9, characterized in that: include: Based on the bamboo defect detection model of YOLOv9, the Bottleneck_Asy module is introduced into the GELAN structure to form the RepNCSPELAN4_Asy feature extraction module to enhance the feature extraction capability of the Backbone network; And, a training module is used to perform defect detection on bamboo strip images after the bamboo strip defect detection model is trained.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of a bamboo strip defect detection method based on improved YOLOv9 are implemented as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a bamboo strip defect detection method based on improved YOLOv9 are implemented as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Photovoltaic cell defect detection method and device, computer equipment and storage medium

    CN119477906A

  • Fresh corn appearance detection method based on image fusion and deep learning

    CN120997627A