Industrial defect small target detection method based on improved YOLOv9

By improving the YOLOv9 model, combining custom modules and bounding box loss function, the missed detection and misjudgment problems in the detection of small targets of industrial defects in traditional manual detection methods are solved, and accurate detection in complex industrial environments is achieved and improved Inspection efficiency and product quality.

CN119477792APending Publication Date: 2025-02-18HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411324455.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Traditional manual detection methods have problems such as missed detection and misjudgment in small target detection of industrial defects, and it is difficult to meet the testing needs in complex industrial environments.

Method used

Using the industrial defect small object detection method based on improved YOLOv9, the model's feature learning and feature learning are improved by building a custom RepNCSPELAN4_DSConv module, a fusion feature downsampling module FFDown and a custom FEConv feature enhancement convolution module, combined with the TinyScaled-CIoU bounding box loss function. Detection accuracy.

Benefits of technology

Accurate inspection of small defects in complex industrial environments has been achieved, detection efficiency has been improved, labor consumption has been reduced, product quality has been significantly improved, and industrial automation has been promoted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119477792A_ABST
    Figure CN119477792A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial defect small target detection method based on improved YOLOv9. The method comprises the steps of collecting an industrial defect data set and performing data enhancement; the method comprises the following steps of: constructing a user-defined RepNCSPELAN4DSConv module, and replacing a RepNCSPELAN4 module in the Backbone by the user-defined RepNCSPELAN4DSConv module; constructing a user-defined fusion feature down-sampling module FFDown to replace a part of AConv modules in Backbone and Head for down-sampling; a self-defined FEEConv feature enhancement convolution module is added in the Head, and a wavelet transform method is utilized to improve the capturing capability of the model for important features of a defect small target; the constructed TinyScaled-CIoU bounding box loss function is used for replacing the original bounding box loss function; and training the improved YOLOv9 model to obtain a trained target detection model. On the basis of an original model, the real-time detection speed is guaranteed, meanwhile, the detection effect on a defect small target is improved, and the detection precision is improved by 2.9% and 1.9% on an industrial oil stain defect data set and a hot-rolled strip steel surface defect data set respectively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of target detection, and in particular relates to a method for detecting small industrial defect targets based on improved YOLOv9. Background Art

[0002] Industrial defect small target detection plays an increasingly important role in modern manufacturing and quality control, especially in industries such as automobiles, aviation, and electronics. Monitoring product defects is directly related to product safety and reliability. With the increase in industrial demand, traditional manual inspection methods are unable to cope with the demand. Long hours of work and human errors often lead to missed inspections and misjudgments, thus affecting overall production efficiency and product quality.

[0003] In recent years, with the rapid development of deep learning algorithms, small target detection technology based on computer vision has gradually emerged. Through deep learning models such as convolutional neural networks, features can be automatically extracted in complex environments to detect extremely small defects, while having good generalization ability and high precision. The trained deep learning model can quickly identify defective targets within a millisecond response time, effectively improving the detection efficiency, and can still effectively identify subtle defects in complex environments. Research on small target defect detection technology based on deep learning can not only improve the level of automation of detection and reduce the loss of manual labor, but also significantly improve product quality and promote the development of industrial automation. This has important practical significance for the future of the manufacturing industry, especially high-standard and high-precision industrial production. Summary of the invention

[0004] Purpose of the invention: In order to solve the above-mentioned problems, the present invention provides an industrial defect small target detection method based on improved YOLOv9, which can accurately detect defect small targets in complex industrial environments.

[0005] Technical solution: The invention discloses a method for detecting small industrial defect targets based on improved YOLOv9, comprising the following steps:

[0006] (1) Construct a small target dataset of industrial defects and perform data cleaning, data preprocessing and data enhancement, and annotate the enhanced dataset;

[0007] (2) Divide the processed industrial defect small target data set into a training set, a validation set, and a test set according to a pre-set ratio;

[0008] (3) Construct an industrial defect small target detection model based on improved YOLOv9; the improved YOLOv9 is to construct a custom RepNCSPELAN4_DSConv module to replace the RepNCSPELAN4 module in Backbone; construct a fusion feature downsampling module FFDown to replace some AConv modules in Backbone and Head; add a custom FEConv feature enhancement convolution module before the last two RepNCSPELAN4 modules in Head; replace the bounding box loss function of YOLOv9 with the TinyScaled-CIoU bounding box loss function;

[0009] (4) Use the training set and validation set to train the improved YOLOv9 industrial defect small target detection model to obtain the optimal industrial defect small target detection model;

[0010] (5) Input the test set into the optimal industrial defect small target detection model and output the defect detection results.

[0011] Furthermore, the implementation process of step (1) is as follows:

[0012] The acquired image data is cleaned, including removing duplicate, damaged and irrelevant images; after cleaning, data preprocessing is performed, including adjusting the image resolution and image denoising, and then data enhancement is performed through random rotation and random cropping; the processed image data is labeled using the labelimg tool, and the label format is the YOLO label format.

[0013] Furthermore, the implementation process of the custom RepNCSPELAN4_DSConv module in step (3) is as follows:

[0014] The input feature map is processed by a 1×1 convolution channel and then divided into two parts with the same number of channels. One part is directly passed to the Concat layer, and the other part leads to two branches. One branch is directly passed to the Concat layer, and the other branch is processed by a RepNCSP module and a 3×3 convolution. Then, two branches are led out, one branch is directly passed to the Concat layer, and the other branch is passed to the Concat layer after a RepNCSP module and a 3×3 convolution. The feature map spliced ​​by the Concat layer according to the dimension enters the DSConv module to obtain the output feature map.

[0015] Furthermore, the DSConv module introduces a deformation offset Δ on the standard convolution kernel, adopts an iterative strategy to prevent the perception domain from deviating from the target, and the position of each node depends on the position of the previous node, ensuring that the convolution kernel conforms to the linear morphological structure. The input features are convolved with the processed linear convolution kernel, and the output feature map is obtained through Group Normalization and ReLU activation function.

[0016] Furthermore, the implementation process of the fusion feature downsampling module FFDown in step (3) is as follows:

[0017] The feature map X with an input size of (S, S, C1) is divided into two parts, X1 and X2, according to the number of channels; X1 is decomposed by low-pass and high-pass filters to obtain a feature map X with a size of (S, S / 2, C1) 1,1 and X 1,2 , X 1,1 and X 1,2 The feature map X of size (S / 2, S / 2, C1) is obtained by low-pass and high-pass decomposition filters respectively. 1,1,1 , X 1,1,2 , X 1,2,1 , X 1,2,2 , X 1,1,1 , X 1,1,2 , X 1,2,1 , X 1,2,2 The concatenation is performed by dimension and then passes through a convolution layer with a convolution kernel size of 1×1 and a stride of 1 to adjust the number of channels, and the output feature map Y1 of size (S / 2, S / 2, C1) is obtained; X2 passes through the SPDConv module to obtain the output feature map X of size (S / 2, S / 2, C1) 2,1 , X 2,1 After ECA channel attention, we get the channel weight vector λ1, and then add λ1 to X 2,1 Multiply to get the output feature map Y2; concatenate Y1 and Y2 by dimension and pass through a convolution layer with a convolution kernel size of 1×1 and a stride of 1 to adjust the number of channels to get an output feature map Y0 of size (S / 2, S / 2, C1); Y0 passes through the ECA channel attention to get the channel weight vector λ2, and then multiply λ2 by Y0 to get the final output feature map Y.

[0018] Furthermore, the SPDConv module is composed of a space-to-depth layer and a non-cross-row convolution layer. For a given input feature map X of size (S, S, C1), it is divided into four sub-feature maps f of size (S / 2, S / 2, C1) according to scale = 2. 0,0 , f 1,0 , f 0,1 , f 1,1, downsample X by a factor of 2; concatenate the four sub-feature maps by dimension to obtain a feature map of size (S / 2, S / 2, 4C1), and then adjust the number of channels through a convolution layer with a convolution kernel size of 1×1 and a stride of 1 to obtain an output feature map of size (S / 2, S / 2, C2).

[0019] Furthermore, the implementation process of the custom FEConv feature enhancement convolution module in step (3) is as follows:

[0020] The input feature map X leads to two branches. One branch obtains the output feature map Y after Haar wavelet transform and inverse wavelet transform:

[0021] Y = IWT(Conv(W, WT(X)))

[0022] The other branch of the input feature map X passes through the DSConv module to obtain the output feature map Z; the feature maps Y and Z are added to fuse the information, and then pass through the CBAM attention mechanism module to obtain the final output feature map.

[0023] Furthermore, the Haar wavelet transform uses the following four filters, producing a depthwise convolution with a stride of 2:

[0024]

[0025] These four filters generate four output feature maps X LL , X LH , X HL , X HH , the spatial resolution of each feature map is half of the original feature map, and the process is expressed as follows:

[0026] [X LL , X LH , X HL , X HH ]=Conv([f LL , f LH , f HL , f HH ],X).

[0027] Furthermore, the inverse wavelet transform is implemented by transposed convolution, and the process is expressed as follows:

[0028] X = Conv-transposed ([f LL , f LH , f HL , f HH ],[X LL , X LH , X HL , X HH ]).

[0029] Furthermore, the TinyScaled-CIoU bounding box loss function in step (3) is:

[0030]

[0031] Among them, d represents the distance between the center point of the predicted box and the real box, c represents the diagonal distance of the minimum enclosing rectangle, (w G ,h G ) and (w P ,h P ) represent the width and height of the real box and the predicted box respectively, λ is a hyperparameter, indicating the influence of (1-w), β represents the preset weight adjustment coefficient, S is the area of ​​the predicted bounding box, is the average area of ​​all ground-truth bounding boxes.

[0032] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:

[0033] The present invention utilizes the fusion of DSConv and RepNCSPELAN4 modules to construct the RepNCSPELAN4_DSConv module, which overcomes the limitations of standard convolution and enables it to better capture the complex feature relationships of small defective targets; constructs a fusion feature downsampling module FFDown, maintains fine-grained information, enhances the model's ability to capture key information, and improves the learning efficiency of small defective target features; constructs a custom FEConv feature enhancement convolution module, expands the receptive field of the convolutional neural network, while maintaining parameter efficiency, can achieve multi-frequency response to input data, and enhances the feature recognition ability of the model; constructs a TinyScaled-CIoU bounding box loss function, so that the model is more inclined to accurately predict the position and shape of small targets; the small defective target detection realized by the present invention can accurately detect small defective targets in complex industrial environments, thereby improving detection efficiency, reducing the consumption of manual labor, significantly improving product quality, and promoting the development of industrial automation. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is a flow chart of the present invention;

[0035] Figure 2 This is a schematic diagram of the industrial defect small target detection model based on improved YOLOv9;

[0036] Figure 3 This is a schematic diagram of the DSConv module structure;

[0037] Figure 4 It is a schematic diagram of the RepNCSPELAN4_DSConv module structure;

[0038] Figure 5 This is a schematic diagram of the structure of the fusion feature downsampling module;

[0039] Figure 6 This is a schematic diagram of the SPDConv module structure;

[0040] Figure 7 Schematic diagram of the FEConv feature enhancement convolution module structure. DETAILED DESCRIPTION

[0041] The present invention will be further described in detail below in conjunction with the accompanying drawings.

[0042] like Figure 1 As shown, the present invention provides an industrial defect small target detection method based on improved YOLOv9, comprising the following steps:

[0043] Step 1: Build a small target dataset of industrial defects and perform data cleaning, data preprocessing and data enhancement, and annotate the enhanced dataset.

[0044] Data cleaning, including removing duplicate, damaged and irrelevant images, can better meet the needs of various deep learning algorithms, making image processing results more reliable and stable, which is crucial to ensure the reliability and effectiveness of data analysis results. After cleaning, data preprocessing is performed, including adjusting the image resolution and image denoising, to provide accurate and reliable information for subsequent image processing and analysis. Then data enhancement is performed by random rotation and random cropping to solve the problem of insufficient sample data. Use the labelimg tool to annotate the processed image data. The label format is the YOLO label format, and the label file type is a txt file, which includes the category number of each defect target and the center coordinates, width and height information of the defect target box.

[0045] Step 2: Divide the dataset into training set, validation set, and test set in a ratio of 8:1:1. The training set is used to train the model and adjust the model parameters; the validation set is used to adjust the model hyperparameters and perform model selection to determine the generalization ability of the model; the test set is used to evaluate the performance of the final model to ensure the reliability and accuracy of the model in practical applications.

[0046] Step 3: If Figure 2As shown in the figure, an industrial defect small target detection model based on improved YOLOv9 is constructed. By introducing DSConv (Dynamic Snake Convolution) and fusing it with the original RepNCSPELAN4 module of YOLOv9, a custom RepNCSPELAN4_DSConv module is constructed and replaces the RepNCSPELAN4 module in Backbone; a fusion feature downsampling module FFDown (Fusion Feature Downsampling) is constructed to replace some AConv modules in Backbone and Head; a custom FEConv (Feature Enhanced Convolution) feature enhancement convolution module is added to the Head, and the wavelet transform method is used to improve the model's ability to capture important features of defect small targets; a TinyScaled-CIoU (TinyScaled Complete Intersection over Union) bounding box loss function is constructed to replace the bounding box loss function in YOLOv9.

[0047] (3.1) Figure 3 As shown in the figure, the DSConv module introduces a deformation offset Δ on the standard convolution kernel, and adopts an iterative strategy to prevent the perception domain from deviating from the target. The position of each node depends on the position of the previous node, ensuring that the convolution kernel conforms to the linear morphological structure. The input features are convolved with the processed linear convolution kernel, and the output feature map is obtained through Group Normalization and ReLU activation function. DSConv is integrated with the RepNCSPELAN4 module to build a custom RepNCSPELAN4_DSConv module and replace the RepNCSPELAN4 module in Backbone.

[0048] like Figure 4As shown in the figure, the implementation process of the RepNCSPELAN4_DSConv module is as follows: the input feature map is processed by a 1×1 convolution channel and then divided into two parts with the same number of channels. One part is directly passed to the Concat layer, and the other part leads to two branches. One branch is directly passed to the Concat layer, and the other branch is processed by a RepNCSP module and a 3×3 convolution. Then, two branches are led out, one branch is directly passed to the Concat layer, and the other branch is passed to the Concat layer after a RepNCSP module and a 3×3 convolution. The feature map spliced ​​by the Concat layer according to the dimension enters the DSConv module to obtain the output feature map. The RepNCSPELAN4_DSConv module overcomes the limitations of standard convolution, maintains the continuity of the focus area through an iterative strategy, improves the accuracy and efficiency of detection, and enhances the recognition and extraction of small target features of defects.

[0049] (3.2) Figure 5 As shown in the figure, the fusion feature downsampling module FFDown is constructed to maintain fine-grained information, enhance the model's ability to capture key information, and improve the learning efficiency of defect small target features. The implementation process of the fusion feature downsampling module FFDown is as follows:

[0050] The feature map X with an input size of (S, S, C1) is divided into two parts, X1 and X2, according to the number of channels. X1 is filtered by low-pass and high-pass decomposition filters to obtain a feature map X with a size of (S, S / 2, C1). 1,1 and X 1,2 , X 1,1 and X 1,2 The feature map X of size (S / 2, S / 2, C1) is obtained by low-pass and high-pass decomposition filters respectively. 1,1,1 , X 1,1,2 , X 1,2,1 , X 1,2,2 , X 1,1,1 , X 1,1,2 , X 1,2,1 , X 1,2,2 The concatenation is performed by dimension and then passes through a convolution layer with a convolution kernel size of 1×1 and a stride of 1 to adjust the number of channels, and the output feature map Y1 of size (S / 2, S / 2, C1) is obtained; X2 passes through the SPDConv module to obtain the output feature map X of size (S / 2, S / 2, C1) 2,1 , X 2,1 After ECA channel attention, we get the channel weight vector λ1, and then add λ1 to X 2,1Multiply to get the output feature map Y2; concatenate Y1 and Y2 by dimension and then pass through a convolution layer with a convolution kernel size of 1×1 and a step size of 1 to adjust the number of channels to get an output feature map Y0 of size (S / 2, S / 2, C1). Y0 passes through the ECA channel attention to get the channel weight vector λ2, and then multiply λ2 by Y0 to get the final output feature map Y.

[0051] like Figure 6 As shown in Figure 1, the SPDConv module consists of a space-to-depth layer and a non-cross-row convolution layer. For a given input feature map X of size (S, S, C1), it is divided into four sub-feature maps f of size (S / 2, S / 2, C1) according to scale = 2. 0,0 , f 1,0 , f 0,1 , f 1,1 , downsample X by a factor of 2; concatenate the four sub-feature maps by dimension to obtain a feature map of size (S / 2, S / 2, 4C1), and then adjust the number of channels through a convolution layer with a convolution kernel size of 1×1 and a stride of 1 to obtain an output feature map of size (S / 2, S / 2, C2).

[0052] (3.3) Figure 7 As shown, a custom FEConv feature enhancement convolution module is constructed, and the implementation process is as follows:

[0053] The input feature map X leads to two branches. One branch obtains the output feature map Y after Haar wavelet transform and inverse wavelet transform. This process can be expressed as:

[0054] Y = IWT(Conv(W, WT(X)))

[0055] The other branch of the input feature map X passes through the DSConv module to obtain the output feature map Z. The feature maps Y and Z are added for information fusion, and then pass through the CBAM attention mechanism module to obtain the final output feature map.

[0056] The Haar wavelet transform uses the following four filters, producing a depthwise convolution with a stride of 2:

[0057]

[0058] These four filters generate four output feature maps X LL , X LH , X HL , X HH , the spatial resolution of each feature map is half of the original feature map, and the process is expressed as follows:

[0059] [X LL , X HL , XHL , X HH ]=Conv([f LL , f LH , f HL , f HH ],X)

[0060] The inverse wavelet transform is implemented by transposed convolution, and the process is expressed as follows:

[0061] X=Conv-transposed([f LL , f HL , f HL , f HH ],[X LL , X LH , X HL , X HH ]).

[0062] (3.4) The TinyScaled-CIoU bounding box loss function is constructed to enhance the model's adaptability to different target sizes, especially focusing on the detection of small targets. By dynamically adjusting the strategy, the model's emphasis on small targets is increased, thereby improving the detection effect of small targets. The implementation process of the TinyScaled-CIoU bounding box loss function is as follows:

[0063]

[0064]

[0065] Among them, L TinyScaled-CIoU represents the final TinyScaled-CIoU loss, d represents the distance between the center point of the predicted box and the real box, c represents the diagonal distance of the minimum bounding rectangle, (w G ,h G ) and (w P ,h P ) represent the width and height of the real box and the predicted box respectively, λ is a hyperparameter, indicating the influence of (1-w), β represents the preset weight adjustment coefficient, S is the area of ​​the predicted bounding box, is the average area of ​​all ground-truth bounding boxes.

[0066] Step 4: Use the divided training set and validation set to train the improved YOLOv9 industrial defect small target detection model to obtain the optimal defect small target detection weight model; input the test set into the optimal defect small target detection weight model to obtain the detection result.

[0067] The evaluation indicators used in the implementation of the present invention are mAP50 and mAP50-95, where mAP50 refers to the value of mean average precision when the IoU threshold is 0.5, and mAP50-95 refers to the average value of mean average precision when the IoU threshold ranges from 0.5 to 0.95 (with a step size of 0.05). The calculation formula is as follows:

[0068]

[0069] Among them, TP (True Positive) refers to the number of instances correctly predicted as positive, FP (False Positive) refers to the number of instances incorrectly predicted as positive, FN (False Negative) refers to the number of instances incorrectly predicted as negative, Precision is the proportion of correctly predicted positive, Recall is the proportion of true samples correctly predicted as positive to all positive samples, AP (Average Precision) is the area under the Precision-Recall curve, n is the number of categories, i refers to the i-th category, and j is the IoU threshold.

[0070] To verify the effectiveness of the present invention, the data sets used in this embodiment include an industrial oil stain defect data set and a hot-rolled strip surface defect data set. The total amount of data in the industrial oil stain defect data set is 660, and the total amount of data in the hot-rolled strip surface defect data set is 1800. The simulation results are shown in Table 1:

[0071] Table 1 Comparison of simulation results between YOLOv9 and the present invention

[0072]

[0073] The technical solution of the present invention has been described in the specific experimental process shown in the accompanying drawings. However, the protection scope of the present invention is not limited to the above-mentioned embodiments. Under the premise of following the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and these changes or alternatives are deemed to be within the protection scope of the present invention. The above embodiments only represent the preferred technical solutions of the present invention and should not be regarded as limitations of the present invention. The embodiments and features in this application may be combined arbitrarily without conflict. The protection scope of the present invention shall be based on the technical solutions described in the claims, including solutions for equivalent substitution of these technical features.

Claims

1. A method for detecting small industrial defect targets based on improved YOLOv9, characterized in that: The following steps are involved: (1) Construct a small target dataset of industrial defects and perform data cleaning, data preprocessing and data enhancement, and annotate the enhanced dataset; (2) Divide the processed industrial defect small target data set into a training set, a validation set, and a test set according to a pre-set ratio; (3) Construct an industrial defect small target detection model based on improved YOLOv9; the improved YOLOv9 is to construct a custom RepNCSPELAN4_DSConv module to replace the RepNCSPELAN4 module in Backbone; construct a fusion feature downsampling module FFDown to replace some AConv modules in Backbone and Head; add a custom FEConv feature enhancement convolution module before the last two RepNCSPELAN4 modules in Head; replace the bounding box loss function of YOLOv9 with the TinyScaled-CIoU bounding box loss function; (4) Use the training set and validation set to train the improved YOLOv9 industrial defect small target detection model to obtain the optimal industrial defect small target detection model; (5) Input the test set into the optimal industrial defect small target detection model and output the defect detection results.

2. According to claim 1, a method for detecting small industrial defect targets based on improved YOLOv9 is characterized in that: The implementation process of step (1) is as follows: The acquired image data is cleaned, including removing duplicate, damaged and irrelevant images; after cleaning, data preprocessing is performed, including adjusting the image resolution and image denoising, and then data enhancement is performed through random rotation and random cropping; the processed image data is labeled using the labelimg tool, and the label format is the YOLO label format.

3. The method for detecting small industrial defect targets based on improved YOLOv9 according to claim 1, characterized in that: The implementation process of the custom RepNCSPELAN4_DSConv module in step (3) is as follows: The input feature map is processed by a 1×1 convolution channel and then divided into two parts with the same number of channels. One part is directly passed to the Concat layer, and the other part leads to two branches. One branch is directly passed to the Concat layer, and the other branch is processed by a RepNCSP module and a 3×3 convolution. Then, two branches are led out, one branch is directly passed to the Concat layer, and the other branch is passed to the Concat layer after a RepNCSP module and a 3×3 convolution. The feature map spliced ​​by the Concat layer according to the dimension enters the DSConv module to obtain the output feature map.

4. The method for detecting small industrial defect targets based on improved YOLOv9 according to claim 3, characterized in that: The DSConv module introduces a deformation offset Δ on the standard convolution kernel, adopts an iterative strategy to prevent the perception domain from deviating from the target, and the position of each node depends on the position of the previous node to ensure that the convolution kernel conforms to the linear morphological structure. The input features are convolved with the processed linear convolution kernel, and the output feature map is obtained through Group Normalization and ReLU activation function.

5. The method for detecting small industrial defect targets based on improved YOLOv9 according to claim 1, characterized in that: The implementation process of the fusion feature downsampling module FFDown in step (3) is as follows: The feature map X with an input size of (S, S, C1) is divided into two parts, X1 and X2, according to the number of channels; X1 is decomposed by low-pass and high-pass filters to obtain a feature map X with a size of (S, S / 2, C1) 1,1 and X 1,2 , X 1,1 and X 1,2 The feature map X of size (S / 2, S / 2, C1) is obtained by low-pass and high-pass decomposition filters respectively. 1,1,1 , X 1,1,2 , X 1,2,1 , X 1,2,2 , X 1,1,1 , X 1,1,2 , X 1,2,1 , X 1,2,2 The concatenation is performed by dimension and then passes through a convolution layer with a convolution kernel size of 1×1 and a stride of 1 to adjust the number of channels, and the output feature map Y1 of size (S / 2, S / 2, C1) is obtained; X2 passes through the SPDConv module to obtain the output feature map X of size (S / 2, S / 2, C1) 2,1 , X 2,1 After ECA channel attention, we get the channel weight vector λ1, and then add λ1 to X 2,1 Multiply to get the output feature map Y2; concatenate Y1 and Y2 by dimension and pass through a convolution layer with a convolution kernel size of 1×1 and a stride of 1 to adjust the number of channels to get an output feature map Y0 of size (S / 2, S / 2, C1); Y0 passes through the ECA channel attention to get the channel weight vector λ2, and then multiply λ2 by Y0 to get the final output feature map Y.

6. The method for detecting small industrial defect targets based on improved YOLOv9 according to claim 5, characterized in that: The SPDConv module consists of a space-to-depth layer and a non-cross-row convolutional layer. For a given input feature map X of size (S, S, C1), it is divided into four sub-feature maps of size (S / 2, S / 2, C1) by scale = 2. 0,0 , f 1,0 , f 0,1 , f 1,1 , downsample X by a factor of 2; concatenate the four sub-feature maps by dimension to obtain a feature map of size (S / 2, S / 2, 4C1), and then adjust the number of channels through a convolution layer with a convolution kernel size of 1×1 and a stride of 1 to obtain an output feature map of size (S / 2, S / 2, C2).

7. The method for detecting small industrial defect targets based on improved YOLOv9 according to claim 1, characterized in that: The implementation process of the custom FEConv feature enhancement convolution module in step (3) is as follows: The input feature map X leads to two branches. One branch obtains the output feature map Y after Haar wavelet transform and inverse wavelet transform: Y = IWT(Conv(W, WT(X))) The other branch of the input feature map X passes through the DSConv module to obtain the output feature map Z; the feature maps Y and Z are added to fuse the information, and then pass through the CBAM attention mechanism module to obtain the final output feature map.

8. The method for detecting small industrial defect targets based on improved YOLOv9 according to claim 7, characterized in that: The Haar wavelet transform uses the following four filters, producing a depthwise convolution with a stride of 2: These four filters generate four output feature maps X LL , X LH , X HL , X HH , the spatial resolution of each feature map is half of the original feature map, and the process is expressed as follows: [X LL ,X LH ,X HL ,X HH ]=Conv([f LL ,f LH ,f HL ,f HH ],X)。 9. The method for detecting small industrial defect targets based on improved YOLOv9 according to claim 7, characterized in that: The inverse wavelet transform is implemented by transposed convolution, and the process is expressed as follows: X=Conv-transposed([f LL ,f LH ,f HL ,f HH ],[X LL ,X LH ,X HL ,X HH ])。 10. The method for detecting small industrial defect targets based on improved YOLOv9 according to claim 1, characterized in that: The TinyScaled-CIoU bounding box loss function in step (3) is: Among them, d represents the distance between the center point of the predicted box and the real box, c represents the diagonal distance of the minimum enclosing rectangle, (w G ,h G ) and (w P ,h P ) represent the width and height of the real box and the predicted box respectively, λ is a hyperparameter, indicating the influence of (1-w), β represents the preset weight adjustment coefficient, S is the area of ​​the predicted bounding box, is the average area of ​​all ground-truth bounding boxes.

Citation Information

Cited By

  • Artificial intelligence-based plum blossom growth cycle disease image processing method and system

    CN119919814A