Infrared image defect recognition method and system based on improved YOLOv11n

By introducing the SMAttention mechanism into the Neck part of the YOLOv11n model, the problems of low contrast and high noise in infrared image recognition are solved, improving detection accuracy and efficiency, making it suitable for application on resource-constrained devices.

CN119693654BActive Publication Date: 2025-10-28GUANGZHOU CITY UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411799888.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-10-28
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

The existing YOLOv11 algorithm suffers from low contrast and high noise in infrared image recognition, resulting in low detection accuracy, high false negative and false positive rates, and a large computational burden, making it difficult to run efficiently on resource-constrained devices.

Method used

The SMAttention attention mechanism is introduced into the Neck part of the YOLOv11n model. By recalibrating features, it enhances the attention to defect areas in infrared images, reduces background noise interference, improves the model's attention to key areas, and optimizes feature extraction and detection performance.

Benefits of technology

It significantly improves the accuracy and efficiency of infrared image defect detection, reduces the false negative and false positive rates, and maintains a low computational burden, making it suitable for real-time applications on resource-constrained devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693654B_ABST
    Figure CN119693654B_ABST
Patent Text Reader

Abstract

This invention relates to the field of infrared image defect recognition technology, and proposes an infrared image defect recognition method and system based on an improved YOLOv11n. The infrared image defect recognition method includes the following steps: S1: acquiring an infrared image with defects; S2: adding an SMAttention attention mechanism to the Neck part of the YOLOv11n model to obtain a YOLOv11n-SMAttention model, wherein the SMAttention attention mechanism is used to recalibrate the feature map of the infrared image with defects; S3: inputting the infrared image with defects into the YOLOv11n-SMAttention model to detect the defect features of the infrared image and obtain the defect recognition result of the infrared image. This invention improves the YOLOv11n algorithm, making it more suitable for detecting low-contrast targets in infrared images, extracting features of infrared images more effectively, reducing the false negative rate, and significantly increasing the model's detection capability without increasing the computational burden.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of infrared image defect recognition technology, and in particular to an infrared image defect recognition method and system based on an improved YOLOv11n. Background Technology

[0002] The rapid development of infrared imaging technology has led to its increasingly widespread application in military, security, and medical fields. However, infrared images suffer from inherent problems such as low resolution, high noise, and low contrast, making it difficult for traditional image recognition algorithms to achieve ideal results. In recent years, the YOLO series of algorithms has achieved remarkable success in the field of visible light imaging due to its end-to-end architecture, real-time processing, and efficient target detection.

[0003] The latest YOLOv11 algorithm has further optimized detection accuracy and speed, significantly improving model performance. However, when directly applying the YOLOv11 algorithm to infrared images, it still faces many technical challenges and requires further improvement and optimization. Summary of the Invention

[0004] To address the aforementioned shortcomings, the present invention aims to propose an infrared image defect recognition method and system based on an improved YOLOv11n. By improving the YOLOv11n algorithm, it is made more suitable for detecting low-contrast targets in infrared images, extracts infrared image features more effectively, reduces the false negative rate, and significantly enhances the model's detection capabilities without increasing the computational burden.

[0005] To achieve this objective, the present invention adopts the following technical solution:

[0006] An infrared image defect identification method based on an improved YOLOv11n, the infrared image defect identification method comprising the following steps:

[0007] S1: Acquire an infrared image with defects;

[0008] S2: Add the SMAttention attention mechanism to the Neck part of the YOLOv11n model to obtain the YOLOv11n-SMAttention model. The SMAttention attention mechanism is used to recalibrate the feature map of the defective infrared image.

[0009] S3: Input the defective infrared image into the YOLOv11n-SMAttention model to detect the defect features of the infrared image and obtain the defect recognition result of the infrared image.

[0010] Preferably, the YOLOv11n model includes a first Backbone structure, a first Neck structure, and a first Head structure;

[0011] The first Backbone structure includes a first Conv module, a second Conv module, a first C3k2 module, a third Conv module, a second C3k2 module, a fourth Conv module, a third C3k2 module, a fifth Conv module, a fourth C3k2 module, an SPPF module, and a C2PSA module arranged sequentially.

[0012] The first Neck structure includes the fifth C3k2 module to the eighth C3k2 module, the first Concat module to the fourth Concat module, the first Upsample module, the second Upsample module, the sixth Conv module, and the seventh Conv module;

[0013] The output of the second C3k2 module is simultaneously used as the input of the second Concat module, the output of the third C3k2 module is simultaneously used as the input of the first Concat module, and the output of the C2PSA module is simultaneously used as the input of the first Upsample module and the fourth Concat module. The first Upsample module, the first Concat module, the fifth C3k2 module, the second Upsample module, the second Concat module, and the sixth C3k2 module are set in sequence. The output of the sixth C3k2 module is simultaneously used as the input of the sixth Conv module. The sixth Conv module, the third Concat module, the seventh C3k2 module, the seventh Conv module, the fourth Concat module, and the eighth C3k2 module are set in sequence. The output of the first Concat module is simultaneously used as another input of the seventh C3k2 module.

[0014] The first Head structure includes a first Detect module, a second Detect module, and a third Detect module. The output of the sixth C3k2 module is also used as the input of the first Detect module, the output of the seventh C3k2 module is also used as the input of the second Detect module, and the output of the eighth C3k2 module is also used as the input of the third Detect module.

[0015] Preferably, in step S2, the SMAttention attention mechanism for recalibrating the feature map of the defective infrared image includes:

[0016] Perform full average pooling and local average pooling on the feature map to obtain the global features and local features of the feature map, respectively;

[0017] After performing deformation and permutation operations and the first convolution operation on the local features in sequence, the processed local features are weighted to obtain local attention weights;

[0018] After performing dimension transformation and second convolution operations on the global features in sequence, the processed global features are weighted to obtain the global attention weights.

[0019] The local attention weights are activated and output using an activation function to obtain a first result. The local attention weights are then activated and output using an activation function, and an adaptive pooling operation is performed to obtain a second result.

[0020] The first and second results are fused together, and then multiplied element-wise with the original features of the defective infrared image obtained in step S1 to obtain a feature map after recalibration.

[0021] Furthermore, in step S2, a three-layer SMAttention mechanism is added to the Neck part of the YOLOv11n model.

[0022] Furthermore, the YOLOv11n-SMAttention model includes a second Backbone structure, a second Neck structure, and a second Head structure;

[0023] The second Backbone structure includes a first Conv module, a second Conv module, a first C3k2 module, a third Conv module, a second C3k2 module, a fourth Conv module, a third C3k2 module, a fifth Conv module, a fourth C3k2 module, an SPPF module, and a C2PSA module arranged sequentially.

[0024] The second Neck structure includes a first SMAttention module to a third SMAttention module, a fifth C3k2 module to an eighth C3k2 module, a first Concat module to a fourth Concat module, a first Upsample module, a second Upsample module, a sixth Conv module, and a seventh Conv module;

[0025] The output of the second C3k2 module is simultaneously used as the input of the second Concat module, the output of the third C3k2 module is simultaneously used as the input of the first Concat module, and the output of the C2PSA module is simultaneously used as the input of the first Upsample module and the fourth Concat module. The first Upsample module, the first Concat module, the fifth C3k2 module, the second Upsample module, the second Concat module, and the sixth C3k2 module are set in sequence. The output of the sixth C3k2 module is simultaneously used as the input of the first SMAttention module. The first SMAttention module, the sixth Conv module, the third Concat module, the seventh C3k2 module, the second SMAttention module, the seventh Conv module, the fourth Concat module, the eighth C3k2 module, and the third SMAttention module are set in sequence. The output of the fifth C3k2 module is simultaneously used as another input of the third Concat module.

[0026] The second Head structure includes a first Detect module, a second Detect module, and a third Detect module. The output of the sixth C3k2 module is also used as the input of the first Detect module, the output of the seventh C3k2 module is also used as the input of the second Detect module, and the output of the third SMAttention module is also used as the input of the third Detect module.

[0027] Furthermore, the inputs from the sixth C3k2 module to the first SMAttention module, the seventh C3k2 module to the second SMAttention module, and the eighth C3k2 module to the third SMAttention module are different feature maps corresponding to the defective infrared image.

[0028] An infrared image defect recognition system based on an improved YOLOv11n, wherein the infrared image defect recognition system applies the infrared image defect recognition method described above, and the infrared image defect recognition system includes:

[0029] Image acquisition module, used to acquire infrared images with defects;

[0030] The model improvement module is used to add the SMAttention attention mechanism to the Neck part of the YOLOv11n model to obtain the YOLOv11n-SMAttention model. The SMAttention attention mechanism is used to recalibrate the feature map of the defective infrared image.

[0031] The defect detection module is used to input the defective infrared image into the YOLOv11n-SMAttention model to detect the defect features of the infrared image and obtain the defect recognition result of the infrared image.

[0032] One of the above technical solutions has the following advantages or beneficial effects:

[0033] This invention improves the YOLOv11n algorithm. SMAttention, through its attention mechanism, filters out background noise and unimportant information, focusing the model's attention on key regions, thereby reducing false negative and false positive rates. The YOLOv11n-SMAttention model enhances the image's focus areas, especially defect areas, thus improving detection accuracy. The YOLOv11n algorithm has the lowest computational cost among the YOLOv11 algorithms and is best suited for hardware deployment, exhibiting high efficiency. It significantly improves the model's detection capabilities without adding excessive computational burden, and enhances the model's real-time application capabilities on resource-constrained devices. Incorporating SMAttention into the Neck structure of the YOLOv11n algorithm optimizes the algorithm structure, enabling it to more effectively extract features from infrared images and fully utilize spectral information to improve detection performance. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0035] Figure 1 This is a flowchart of the infrared image defect recognition method provided in the embodiments of the present invention;

[0036] Figure 2 This is a schematic diagram of the original YOLOv11n model of the infrared image defect recognition method provided in this embodiment of the invention;

[0037] Figure 3This is a schematic diagram of the structure of the YOLOv11n-SMAttention model, which is an improved version of the YOLOv11n model, in the infrared image defect recognition method provided in this embodiment of the invention.

[0038] Figure 4 This is an infrared image defect recognition effect diagram of the original YOLOv11n model of the infrared image defect recognition method provided in the embodiments of the present invention;

[0039] Figure 5 This is an image showing the infrared image defect recognition effect of the infrared image defect recognition method provided in this embodiment of the invention, based on the improved YOLOv11n-SMAttention model.

[0040] Figure 6 These are experimental data graphs of the original YOLOv11n model and the improved YOLOv11n-SMAttention model based on the YOLOv11n model for infrared image defect recognition provided in this embodiment of the invention.

[0041] Figure 7 This is a schematic diagram of the SMAttention module in the infrared image defect recognition method provided in this embodiment of the invention;

[0042] Figure 8 This is a schematic diagram of the structure of the infrared image defect recognition system provided in an embodiment of the present invention. Detailed Implementation

[0043] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0044] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0045] The rapid development of infrared imaging technology has led to its increasingly widespread application in military, security, and medical fields. However, infrared images suffer from inherent problems such as low resolution, high noise, and low contrast, making it difficult for traditional image recognition algorithms to achieve ideal results. In recent years, the YOLO series of algorithms has achieved remarkable success in the field of visible light imaging due to its end-to-end architecture, real-time processing, and efficient target detection.

[0046] The latest YOLOv11 algorithm has further optimized detection accuracy and speed, significantly improving model performance. However, when directly applying the YOLOv11 algorithm to infrared images, it still faces many technical challenges and requires further improvement and optimization.

[0047] Therefore, a defect identification method for infrared images based on the improved YOLOv11n is proposed, such as... Figure 1 As shown, in a preferred embodiment of the present invention, the infrared image defect identification method includes the following steps:

[0048] S1: Acquire an infrared image with defects;

[0049] S2: Add the SMAttention attention mechanism to the Neck part of the YOLOv11n model to obtain the YOLOv11n-SMAttention model. The SMAttention attention mechanism is used to recalibrate the feature map of the defective infrared image.

[0050] S3: Input the defective infrared image into the YOLOv11n-SMAttention model to detect the defect features of the infrared image and obtain the defect recognition result of the infrared image.

[0051] Infrared imaging technology generates images by detecting the infrared radiation (mainly thermal radiation) emitted by objects. These images typically reflect the temperature distribution of the object; in infrared images, areas with higher temperatures appear as brighter colors, while areas with lower temperatures appear as darker colors. Unlike visible light images, infrared images generally have lower resolution, more noise, and lower contrast, making it difficult to represent details and features. Acquiring infrared images with defects means capturing images with certain defects (such as cracks, temperature anomalies, or structural damage) from infrared cameras or thermal imaging devices. These defective areas can manifest as abnormal temperature distributions, surface cracks, or localized heating. The quality of the image (such as noise and resolution) directly affects the performance of subsequent defect detection.

[0052] YOLO (You Only Look Once) is a widely used deep learning model for object detection. It detects objects by dividing an image into multiple grids. In YOLOv11n, the Neck part further processes the features extracted from the Backbone to facilitate object localization and classification in the Head part. The Neck part further optimizes and integrates key information in the image so that the model can effectively identify targets. However, traditional YOLO models perform poorly when processing low-contrast or high-noise infrared images because the features in these images are often inconspicuous and easily affected by noise. To improve YOLOv11n's performance in processing infrared images, the SMAttention (Spatial-ModalAttention) mechanism can be introduced into the Neck part of YOLOv11n. SMAttention is a weighted attention mechanism that recalibrates the input feature map, aiming to increase attention to important regions and suppress interference from irrelevant regions. Specifically, the SMAttention mechanism first extracts local and global features of the image, using different weighting strategies to assign different "importances" to features in different regions, thereby highlighting the features of defective areas in the infrared image. For example, the SMAttention mechanism enhances the model's sensitivity to low-contrast regions in the image by weighting these regions, thereby improving its performance in infrared images. After adding SMAttention, the Neck part of YOLOv11n can better identify subtle differences in infrared images, making the model more accurate in detecting defects.

[0053] In step S3, the defective infrared image is input into a YOLOv11n model enhanced with SMAttention for defect detection. The core of this process is leveraging the feature extraction and target detection capabilities of the YOLOv11n model. The SMAttention mechanism recalibrates the image, enhancing the features of the defective region and thus improving detection accuracy. The YOLOv11n model, through its structured prediction method, can accurately locate defective regions in the image and classify and locate detected targets through the network's head part, ultimately outputting the recognition result.

[0054] Due to the characteristics of infrared images, such as low contrast and high noise, directly applying traditional target detection algorithms may lead to missed detections or false detections. The SMAttention mechanism, through weighted summarization and feature recalibration, enhances YOLOv11n's attention to defect regions in infrared images, enabling the model to better capture minute defects in the image. These defects may manifest as abnormal temperature changes, surface cracks, or other structural damage. In this process, the YOLOv11n-SMAttention model can output not only the location of the defect region (marked by bounding boxes), but also information such as the defect type and the model's confidence level. These outputs allow users to further analyze, process, or make decisions.

[0055] like Figure 4 , Figure 5 and Figure 6 As shown, compared to the YOLOv11n algorithm, the YOLOv11n-SMAttention model effectively improves the model's detection accuracy, increasing Map@0.5 to 93.5%. Precision, Recall, and Map50-95 are also improved. The model achieves high accuracy at Map@0.5, representing a significant improvement in accuracy compared to the original YOLOv11n model. Meanwhile, GFLOPs are only increased by 0.1, without significantly increasing the computational burden, ensuring the model's efficiency in resource-constrained environments. The YOLOv11n-SMAttention model not only has higher detection performance but can also run efficiently on mobile devices, addressing the shortcomings of the traditional YOLOv11n model in infrared image recognition.

[0056] This invention improves the YOLOv11n algorithm. SMAttention, through its attention mechanism, filters out background noise and unimportant information, focusing the model's attention on key regions, thereby reducing false negative and false positive rates. The YOLOv11n-SMAttention model enhances the image's focus areas, especially defect areas, thus improving detection accuracy. The YOLOv11n algorithm has the lowest computational cost among the YOLOv11 algorithms and is best suited for hardware deployment, exhibiting high efficiency. It significantly improves the model's detection capabilities without adding excessive computational burden, and enhances the model's real-time application capabilities on resource-constrained devices. Incorporating SMAttention into the Neck structure of the YOLOv11n algorithm optimizes the algorithm structure, enabling it to more effectively extract features from infrared images and fully utilize spectral information to improve detection performance.

[0057] Preferably, the YOLOv11n model includes a first Backbone structure, a first Neck structure, and a first Head structure;

[0058] The first Backbone structure includes a first Conv module, a second Conv module, a first C3k2 module, a third Conv module, a second C3k2 module, a fourth Conv module, a third C3k2 module, a fifth Conv module, a fourth C3k2 module, an SPPF module, and a C2PSA module arranged sequentially.

[0059] The first Neck structure includes the fifth C3k2 module to the eighth C3k2 module, the first Concat module to the fourth Concat module, the first Upsample module, the second Upsample module, the sixth Conv module, and the seventh Conv module;

[0060] The output of the second C3k2 module is simultaneously used as the input of the second Concat module, the output of the third C3k2 module is simultaneously used as the input of the first Concat module, and the output of the C2PSA module is simultaneously used as the input of the first Upsample module and the fourth Concat module. The first Upsample module, the first Concat module, the fifth C3k2 module, the second Upsample module, the second Concat module, and the sixth C3k2 module are set in sequence. The output of the sixth C3k2 module is simultaneously used as the input of the sixth Conv module. The sixth Conv module, the third Concat module, the seventh C3k2 module, the seventh Conv module, the fourth Concat module, and the eighth C3k2 module are set in sequence. The output of the first Concat module is simultaneously used as another input of the seventh C3k2 module.

[0061] The first Head structure includes a first Detect module, a second Detect module, and a third Detect module. The output of the sixth C3k2 module is also used as the input of the first Detect module, the output of the seventh C3k2 module is also used as the input of the second Detect module, and the output of the eighth C3k2 module is also used as the input of the third Detect module.

[0062] Among them, such as Figure 2 As shown, the first Backbone structure in the YOLOv11n model extracts image features step by step through multiple convolutions and C3k2 modules. The first Neck structure fuses and enhances features through Concat and Upsample modules to improve the model's ability to perceive objects at different scales. The first Head structure achieves accurate target classification and localization through multiple Detect modules.

[0063] Traditional target detection methods, such as convolutional neural networks (CNN) or HOG+SVM based on artificial features, often require complex feature engineering and long training times. YOLOv11n, on the other hand, automatically extracts image features through deep learning, eliminating the complexity of manually designed features. It can better cope with the problems of low contrast, high noise and blurred boundaries in infrared images. It can automatically identify and extract key target features in infrared images, thereby significantly improving detection accuracy.

[0064] Compared to previous versions of YOLO, YOLOv11n has further optimized the network architecture, introducing more efficient feature extraction and multi-scale fusion strategies, which improves the detection capabilities of small targets, distant targets, and targets in complex backgrounds. For example, compared to versions such as YOLOv4 or YOLOv5, YOLOv11n can maintain higher accuracy and stability in infrared images with low light, blur, or a lot of noise. Therefore, improving the YOLOv11n model is more advantageous than improving the models of previous versions of YOLO.

[0065] Preferably, in step S2, the SMAttention attention mechanism for recalibrating the feature map of the defective infrared image includes:

[0066] Perform full average pooling and local average pooling on the feature map to obtain the global features and local features of the feature map, respectively;

[0067] After performing deformation and permutation operations and the first convolution operation on the local features in sequence, the processed local features are weighted to obtain local attention weights;

[0068] After performing dimension transformation and second convolution operations on the global features in sequence, the processed global features are weighted to obtain the global attention weights.

[0069] The local attention weights are activated and output using an activation function to obtain a first result. The local attention weights are then activated and output using an activation function, and an adaptive pooling operation is performed to obtain a second result.

[0070] The first result and the second result are fused together, and then multiplied element-wise with the original features of the defective infrared image obtained in step S1 to obtain a feature map after recalibration.

[0071] like Figure 7 As shown, Figure 7This is a block diagram of the SMAttention attention mechanism. Taking infrared image detection of a power switchgear as an example, SMAttention first performs local average pooling (local_arv_pool) on the input feature map to generate local features. This operation mainly focuses on small regions of the input image, aiming to capture detailed information in the image. For example, the unique shape and markings of a specific component in the power switchgear will be effectively expressed through local features. The features (local_arv) formed after local average pooling contain detailed information about the small region, which can identify local morphology, texture, and other details. Global feature extraction is performed through global average pooling (global_arv_pool). This process aims to capture the overall contextual information of the image, which is crucial for understanding the relationships between different parts in the image. Global features (global_arv) contain global information of the image, enabling the model to identify the correlation between various parts of the image during the detection process.

[0072] After extraction, local and global features undergo different processing to enhance their expressive power. Local features are transformed and transposed to reshape or rearrange the feature map, thereby enhancing its expressive power. This operation helps capture complex local patterns, especially in situations with complex backgrounds or different viewpoints. Transformation helps the network better understand the correlation between different regions and improves the model's accuracy in recognizing details. Global features are processed by dimensional transformation to adjust the shape and size of the feature map to adapt to subsequent convolution operations. Through dimensional transformation, the model can ensure that the number of channels and size of the feature map meet the network's input requirements, thereby avoiding errors caused by size mismatch and improving the model's processing efficiency. After these processing steps, local features are processed through a dedicated local convolutional layer (Conv_local), while global features are processed through standard convolution operations (Conv). Local convolution operations help capture local details, while global convolution operations help extract complex global features.

[0073] The SMAttention mechanism calculates weights through an attention mechanism when processing local and global features, focusing on important features. For global features, the calculated global attention weight (y_global) reflects the importance of the overall image structure. This global attention weight helps the model identify relationships between different parts of the image, enabling it to comprehensively consider the connections between various parts during detection, rather than just individual details. For images of power switchgear, global features help identify the overall layout of components and their spatial relationships, improving the understanding of the switchgear structure. On the other hand, local attention weights (y_local) weight local features through an attention mechanism, representing the relevance of certain local regions in the image to the task. Local attention weights highlight detailed features in the image, such as the shape, texture, or color of electrical components, helping the model to more accurately identify target components. The weighted calculation of local and global features allows the model to simultaneously focus on image details and global structure, thereby improving detection accuracy.

[0074] After attention-weighting, local and global features undergo feature fusion and recalibration. Feature fusion combines globally attention-weighted features (y_global) and locally attention-weighted features (y_local) through an additive operation, preserving the advantages of both global and local information. This allows the model to have a more comprehensive understanding of the input image. By fusing features at different levels, the model can better identify and understand key information in the image, improving object detection capabilities. Furthermore, after feature fusion, the model combines the weighted local and global features with the original features through element-wise multiplication. This better utilizes the advantages of all three and helps the model retain details that might be overlooked during feature extraction, while avoiding interference from redundant information, further enhancing the model's expressive power. This series of steps ultimately yields a recalibrated feature map, which helps improve the model's ability to focus on key information in defective images, thereby helping the model to detect and identify targets more accurately.

[0075] In step S2, a three-layer SMAttention mechanism is added to the Neck part of the YOLOv11n model.

[0076] The purpose of applying the SMAttention attention mechanism multiple times is to strengthen the focus on important features at different levels. This allows the model to better extract and integrate features in multi-level and complex backgrounds, improving detection accuracy and robustness. Another purpose is to strengthen the focus on important features at multiple levels and different scales, reduce background noise interference, and improve the ability to integrate complex features. This allows the model to maintain stable focus on key features in multi-level and multi-scale feature processing, thereby achieving high-precision and robust target detection in infrared images with complex backgrounds.

[0077] Furthermore, the YOLOv11n-SMAttention model includes a second Backbone structure, a second Neck structure, and a second Head structure;

[0078] The second Backbone structure includes a first Conv module, a second Conv module, a first C3k2 module, a third Conv module, a second C3k2 module, a fourth Conv module, a third C3k2 module, a fifth Conv module, a fourth C3k2 module, an SPPF module, and a C2PSA module arranged sequentially.

[0079] The second Neck structure includes a first SMAttention module to a third SMAttention module, a fifth C3k2 module to an eighth C3k2 module, a first Concat module to a fourth Concat module, a first Upsample module, a second Upsample module, a sixth Conv module, and a seventh Conv module;

[0080] The output of the second C3k2 module is simultaneously used as the input of the second Concat module, the output of the third C3k2 module is simultaneously used as the input of the first Concat module, and the output of the C2PSA module is simultaneously used as the input of the first Upsample module and the fourth Concat module. The first Upsample module, the first Concat module, the fifth C3k2 module, the second Upsample module, the second Concat module, and the sixth C3k2 module are set in sequence. The output of the sixth C3k2 module is simultaneously used as the input of the first SMAttention module. The first SMAttention module, the sixth Conv module, the third Concat module, the seventh C3k2 module, the second SMAttention module, the seventh Conv module, the fourth Concat module, the eighth C3k2 module, and the third SMAttention module are set in sequence. The output of the fifth C3k2 module is simultaneously used as another input of the third Concat module.

[0081] The second Head structure includes a first Detect module, a second Detect module, and a third Detect module. The output of the sixth C3k2 module is also used as the input of the first Detect module, the output of the seventh C3k2 module is also used as the input of the second Detect module, and the output of the third SMAttention module is also used as the input of the third Detect module.

[0082] like Figure 3As shown, modules 6 through 8 (C3k2) are placed at the back end of the Neck structure of the YOLOv11n-SMAttention model primarily to enhance feature extraction and representation capabilities. These modules allow the model to better fuse multi-scale features, improving its ability to recognize objects of different sizes. Simultaneously, the outputs of these modules provide deeper feature support to the SMAttention module, enabling the attention mechanism to weight features at a higher level of semantic information and optimize feature representation. By combining these modules with operations such as Concat and Upsample, the model can more effectively fuse features at different levels, further improving the accuracy of object detection. Furthermore, the outputs of modules 6 through 8 (C3k2) provide diverse feature inputs to the various Detect modules in the Head structure, helping to improve object detection accuracy and robustness. The SMAttention module adaptively weights these features, helping the model focus more on important local and global information, thereby improving object detection accuracy. By adding SMAttention after these modules, the model can better fuse and optimize features from different scales, improving its understanding of complex targets and backgrounds, enhancing its ability to extract important information, and reducing interference from irrelevant features, further improving computational efficiency and detection accuracy.

[0083] Furthermore, the inputs from the sixth C3k2 module to the first SMAttention module, the seventh C3k2 module to the second SMAttention module, and the eighth C3k2 module to the third SMAttention module are different feature maps corresponding to the defective infrared image.

[0084] The sixth C3k2 module inputs different feature maps corresponding to the defective infrared image to the first SMAttention module, the seventh C3k2 module inputs to the second SMAttention module, and the eighth C3k2 module inputs to the third SMAttention module. By inputting these feature maps at different levels into the corresponding SMAttention modules, each SMAttention module can automatically adjust the weights of important regions based on the specific information of its input feature map, optimizing the focus on defective regions and thus improving the detection accuracy of defects in infrared images. The SMAttention module can effectively guide the network to focus on defective regions while suppressing interference from irrelevant backgrounds, thereby enhancing the model's performance in processing defect detection tasks in infrared images.

[0085] An infrared image defect recognition system based on an improved YOLOv11n, such as Figure 8As shown, the infrared image defect recognition system applies the infrared image defect recognition method described above, and the infrared image defect recognition system includes:

[0086] Image acquisition module 1 is used to acquire infrared images with defects;

[0087] Model improvement module 2 is used to add the SMAttention attention mechanism to the Neck part of the YOLOv11n model to obtain the YOLOv11n-SMAttention model. The SMAttention attention mechanism is used to recalibrate the feature map of the defective infrared image.

[0088] The defect detection module 3 is used to input the infrared image with defects into the YOLOv11n-SMAttention model to detect the defect features of the infrared image and obtain the defect recognition result of the infrared image.

[0089] This embodiment implements an infrared image defect identification method and its implementation process based on the improved YOLOv11n. Please refer to the above embodiments, which will not be described in detail here.

[0090] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0091] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for infrared image defect recognition based on an improved YOLOv11n, characterized in that, The infrared image defect identification method includes the following steps: S1: Acquire an infrared image with defects; S2: Add the SMAttention mechanism to the Neck part of the YOLOv11n model to obtain the YOLOv11n-SMAttention model; S3: Input the defective infrared image into the YOLOv11n-SMAttention model to detect the defect features of the infrared image and obtain the defect recognition result of the infrared image. In step S2, the SMAttention attention mechanism includes: Perform full average pooling and local average pooling on the feature map input to the SMAttention attention mechanism to obtain the global features and local features of the feature map, respectively; After performing deformation and permutation operations and the first convolution operation on the local features in sequence, the processed local features are weighted to obtain local attention weights; After performing dimension transformation and second convolution operations on the global features in sequence, the processed global features are weighted to obtain the global attention weights. The local attention weights are activated and output using an activation function to obtain a first result. The local attention weights are then activated and output using an activation function, and an adaptive pooling operation is performed to obtain a second result. The first result and the second result are fused together, and then multiplied element-wise with the feature map input to the SMAttention attention mechanism to obtain the recalibrated feature map. In step S2, a three-layer SMAttention mechanism is added to the Neck part of the YOLOv11n model.

2. The infrared image defect identification method according to claim 1, characterized in that, The YOLOv11n-SMAttention model includes a second Backbone structure, a second Neck structure, and a second Head structure. The second Backbone structure includes a first Conv module, a second Conv module, a first C3k2 module, a third Conv module, a second C3k2 module, a fourth Conv module, a third C3k2 module, a fifth Conv module, a fourth C3k2 module, an SPPF module, and a C2PSA module arranged sequentially. The second Neck structure includes a first SMAttention module to a third SMAttention module, a fifth C3k2 module to an eighth C3k2 module, a first Concat module to a fourth Concat module, a first Upsample module, a second Upsample module, a sixth Conv module, and a seventh Conv module; The output of the second C3k2 module is simultaneously used as the input of the second Concat module, the output of the third C3k2 module is simultaneously used as the input of the first Concat module, and the output of the C2PSA module is simultaneously used as the input of the first Upsample module and the fourth Concat module. The first Upsample module, the first Concat module, the fifth C3k2 module, the second Upsample module, the second Concat module, and the sixth C3k2 module are set in sequence. The output of the sixth C3k2 module is simultaneously used as the input of the first SMAttention module. The first SMAttention module, the sixth Conv module, the third Concat module, the seventh C3k2 module, the second SMAttention module, the seventh Conv module, the fourth Concat module, the eighth C3k2 module, and the third SMAttention module are set in sequence. The output of the fifth C3k2 module is simultaneously used as another input of the third Concat module. The second Head structure includes a first Detect module, a second Detect module, and a third Detect module. The output of the sixth C3k2 module is also used as the input of the first Detect module, the output of the seventh C3k2 module is also used as the input of the second Detect module, and the output of the third SMAttention module is also used as the input of the third Detect module.

3. An infrared image defect recognition system based on an improved YOLOv11n, wherein the infrared image defect recognition system applies the infrared image defect recognition method according to any one of claims 1-2, characterized in that, The infrared image defect recognition system includes: Image acquisition module, used to acquire infrared images with defects; The model improvement module is used to add the SMAttention attention mechanism to the Neck part of the YOLOv11n model to obtain the YOLOv11n-SMAttention model. The defect detection module is used to input the defective infrared image into the YOLOv11n-SMAttention model to detect the defect features of the infrared image and obtain the defect recognition result of the infrared image.