An industrial equipment defect detection method, system, device and medium based on semantic feature information

By introducing a self-supervised training method that combines dual-dimensional noisy features with a CNN-ViT collaborative feature extraction architecture, the problems of sample scarcity and high annotation costs in industrial equipment defect detection are solved. This enables efficient detection of minute, atypical, and novel defects, and allows for rapid deployment in flexible manufacturing scenarios with multiple varieties and small batches.

CN122156126APending Publication Date: 2026-06-05INSPUR GENERSOFT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INSPUR GENERSOFT CO LTD
Filing Date
2026-03-02
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing industrial equipment defect detection methods suffer from insufficient generalization ability due to the scarcity of defect samples and the high cost of high-quality mask annotation. This leads to decreased model sensitivity to small, atypical, or novel defects, weak robustness, and high false detection and false negative rates, making them difficult to apply effectively in flexible manufacturing and multi-variety, small-batch production environments.

Method used

We adopt a detection method based on semantic feature information. By introducing dual-dimensional noisy features and CNN-ViT collaborative feature extraction architecture, we use a self-supervised training mechanism for defect detection and combine multi-scale cosine similarity weighted calculation of defect scores to achieve model training and accurate defect judgment without the need for defect positive sample labeling.

Benefits of technology

It enhances the model's semantic perception of minute, atypical, and novel defects, reduces the reliance on high-quality mask annotations, improves detection accuracy and robustness in complex backgrounds, and adapts to rapid deployment in flexible manufacturing scenarios with multiple varieties and small batches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156126A_ABST
    Figure CN122156126A_ABST
Patent Text Reader

Abstract

The application discloses an industrial equipment defect detection method and system based on semantic feature information, equipment and medium, mainly relates to the technical field of industrial equipment defect detection, in order to solve the problem that the existing scheme has few samples and lacks mask annotation. Including: inputting the original detection image into the CNN neural network to obtain the down-sampling dimension feature; inputting the down-sampling dimension feature into the ViT algorithm to obtain the global information of the preset first dimension; based on the first feature information and the global information, the fusion information of the preset second dimension is obtained; based on the second feature information and the fusion information, the cross attention is used to obtain the similarity weight, and then the reconstructed image is obtained; different scale features are extracted from the original detection image and the reconstructed image, and the cosine similarity is calculated; the defect score is obtained by weighted calculation using the cosine similarity of each scale; when the defect score is greater than the preset threshold, it is determined that there is a defect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial equipment defect detection technology, and in particular to an industrial equipment defect detection method, system, equipment and medium based on semantic feature information. Background Technology

[0002] Currently, anomaly detection in industrial equipment generally adopts a collaborative model of "manual inspection + sensor monitoring," supplemented by deep learning-driven diffusion models for image analysis. Among these, the Denoising Diffusion Probability Model (DDPM) and the Latent Diffusion Model (LDM) have been introduced into the defect identification process to learn data distribution from normal samples and generate reconstructed images. Building upon this, the DiAD diffusion model for multi-class anomaly detection further achieves semantic-level feature extraction and anomaly region localization, becoming an important technical path in the field of industrial visual inspection. These methods rely on large-scale labeled data training and determine defect presence through pixel-level reconstruction errors, and have already been initially deployed in some standardized production lines.

[0003] However, due to the scarcity of defect samples and the high cost of high-quality mask annotation in industrial scenarios, the aforementioned models generally face the bottleneck of insufficient generalization ability. Supervised learning frameworks, lacking sufficient positive samples, struggle to effectively learn the semantic representation of defects, leading to a significant decrease in the model's sensitivity to minor, atypical, or novel defects. Simultaneously, traditional diffusion models rely on training with complete noise-clean image pairings, but in actual production lines, it is almost impossible to obtain sufficient defect samples to construct such pairing datasets. This results in weak robustness of the models in real-world complex environments, with persistently high false positive and false negative rates, severely restricting their application in flexible manufacturing and multi-variety, small-batch production environments. Summary of the Invention

[0004] This application provides a method, system, device, and medium for detecting defects in industrial equipment based on semantic feature information, in order to solve the problems of insufficient sample size and lack of labeled masks in existing solutions.

[0005] Firstly, this application provides a method for detecting defects in industrial equipment based on semantic feature information, the method comprising: The original detection image is encoded into initial features of a preset feature information dimension; noise is added to the initial features to obtain a first feature information of a preset first dimension and a second feature information of a preset second dimension with noise. The original detection image is input into a CNN neural network to obtain downsampled dimension features; the downsampled dimension features are input into the ViT algorithm to obtain global information in the first preset dimension; based on the first feature information and the global information, the preset second dimension fusion information is obtained; based on the second feature information and the fusion information, cross attention is used to obtain similarity weights, and then the reconstructed image is obtained. Features at different scales are extracted from the original detection image and the reconstructed image, and cosine similarity is calculated. The cosine similarity at each scale is used to calculate a weighted score to obtain the defect score. When the defect score is greater than a preset threshold, a defect is determined to exist.

[0006] In one implementation of this application, the original detection image is encoded into initial features of a preset feature information dimension; noise addition processing is applied to the initial features, specifically including: The original detection image is encoded into initial features of a preset feature information dimension through an autoencoder; The initial features are progressively noise-added through a forward diffusion process, where the progressive noise-adding formula is: ; Where y represents the initial feature. Indicates the first Initial features after noise reduction processing; , This represents the product of the single-step noise coefficients of the first n steps. This represents the single-step noise figure at step n. This represents random noise that follows a standard normal distribution.

[0007] In one implementation of this application, obtaining first feature information with a preset first dimension and second feature information with a preset second dimension, both containing noise, specifically includes: The initial features after adding noise are processed into 32×32 first feature information using U-Net encoding; The first feature information is encoded step by step to obtain the second feature information of 4×4.

[0008] In one implementation of this application, the original detection image is input into a CNN neural network to obtain downsampled dimension features; the downsampled dimension features are then input into the ViT algorithm to obtain global information in a preset first dimension, specifically including: By using a multi-layer convolutional CNN neural network, the original detection image is downsampled and its dimensions are adjusted step by step to obtain a preset low-resolution downsampled dimension feature. The downsampled dimensional features are processed by a network-within-a-network module consisting of 1×1 convolutions to obtain the input features; The ViT algorithm extracts global features from the input features to obtain 32×32 global information.

[0009] In one implementation of this application, based on the first feature information and global information, fusion information with a preset second dimension is obtained, specifically including: The semantic encoding module fuses the first feature information and global information to obtain initial fused information. The initial fusion information is encoded step by step to obtain the first and second fusion information in 8×8 and 4×4 dimensions; The first and second fusion information are fed into a feature fusion module dominated by a spatial attention module to obtain fusion information in a preset second dimension.

[0010] In one implementation of this application, based on the second feature information and fusion information, cross-attention is used to obtain similarity weights, thereby obtaining a reconstructed image, specifically including: The fused information is used as the guiding feature of cross-attention, and the second feature information is used as the input feature of cross-attention. Using cross-attention, the preset optimized feature of the input feature and the guiding feature is calculated. The preset optimized features are input into the self-decoder to obtain the reconstructed image.

[0011] In one implementation of this application, features at different scales are extracted from the original detection image and the reconstructed image, and cosine similarity is calculated. A defect score is obtained by weighting the cosine similarities at each scale, specifically including: Through the formula: Calculate the cosine similarity of features at the m-scale; in, This represents the m-scale features of the original detection image. The m-scale features representing the reconstructed image. Cosine similarity represents the features at the m-scale. Through the formula: Score = Calculate the defect score; in, Indicates the total number of scales. This represents the weighting coefficients at the m-scale.

[0012] Secondly, this application provides an industrial equipment defect detection system based on semantic feature information, the system comprising: The acquisition module is used to encode the original detection image into initial features of a preset feature information dimension; and to add noise to the initial features to obtain first feature information of a preset first dimension and second feature information of a preset second dimension with noise. The reconstruction module is used to input the original detection image into the CNN neural network to obtain downsampled dimension features; input the downsampled dimension features into the ViT algorithm to obtain global information in the first preset dimension; fuse the first feature information and global information to obtain fusion information in the second preset dimension; and use cross attention to obtain similarity weights based on the second feature information and fusion information, thereby obtaining the reconstructed image. The determination module is used to extract features at different scales from the original detection image and the reconstructed image, and calculate the cosine similarity; using the cosine similarity at each scale, a weighted calculation is performed to obtain the defect score; when the defect score is greater than a preset threshold, a defect is determined to exist.

[0013] Thirdly, this application provides an industrial equipment defect detection device based on semantic feature information, the device comprising: processor; And a memory that stores executable code, which, when executed, causes the processor to execute an industrial equipment defect detection method based on semantic feature information, as described above.

[0014] Fourthly, this application provides a non-volatile computer storage medium storing computer instructions thereon, which, when executed, implement an industrial equipment defect detection method based on semantic feature information as described above.

[0015] As can be seen from the above technical solutions, this application has the following advantages: By introducing dual-dimensional noisy features and a CNN-ViT collaborative feature extraction architecture, this approach overcomes the reliance of traditional supervised learning on a large number of defect samples and high-cost mask annotations. Without requiring any positive defect sample annotations, the system can complete model training using only normal workpiece images, avoiding the semantic representation learning failure problem caused by the scarcity of defect samples in industrial production lines. By encoding the original image as initial features and applying noise perturbations of different dimensions, a self-supervised training mechanism that does not require paired clean-noisy images is constructed, enabling the model to learn the latent semantic structure of defects under unsupervised conditions. Simultaneously, CNN is responsible for extracting local texture and edge details, while ViT captures global structural semantics. The two achieve dynamic feature fusion through a cross-attention mechanism, improving the model's semantic perception ability for minor, atypical, and novel defects. This allows for accurate modeling of abnormal patterns in complex backgrounds without relying on manual annotation, providing scalable underlying technical support for flexible manufacturing scenarios with multiple product types and small batches.

[0016] By calculating defect scores using multi-scale cosine similarity weighting, an end-to-end defect determination mechanism is constructed that requires no threshold tuning or post-processing filtering. Traditional methods rely on the absolute value of reconstruction errors or pixel-level mask comparison, which is easily affected by non-defect factors such as illumination changes, surface reflections, and texture interference, leading to increased false detection rates. By extracting feature vectors from the original and reconstructed images at multiple spatial scales and using cosine similarity as the similarity metric, this method essentially focuses on the consistency of semantic structure rather than pixel intensity matching, reducing false positive responses caused by background noise or process fluctuations. Simultaneously, the weighted fusion mechanism allows the model to adaptively assign different importance to features at different scales, strengthening the joint discrimination capability between local minor defects and global structural anomalies. This eliminates the reliance on high-quality mask annotation and the need for an additional anomaly scoring calibration module, reducing the complexity of system deployment and maintenance, and providing a highly robust detection foundation for rapid production line switching and dynamic adaptation to new products in industrial settings. Attached Figure Description

[0017] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of an industrial equipment defect detection method based on semantic feature information provided in an embodiment of this application.

[0019] Figure 2 This is a schematic diagram of the internal structure of an industrial equipment defect detection system based on semantic feature information provided in an embodiment of this application.

[0020] Figure 3 This is a schematic diagram of the internal structure of an industrial equipment defect detection device based on semantic feature information provided in an embodiment of this application. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Those skilled in the art should understand that the embodiments described below are merely preferred embodiments of this disclosure and do not imply that this disclosure can only be implemented through these preferred embodiments. These preferred embodiments are merely used to explain the technical principles of this disclosure and are not intended to limit the scope of protection of this disclosure. Based on the preferred embodiments provided by this disclosure, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of this disclosure.

[0023] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover 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 process, method, article, or apparatus. Unless otherwise specified, 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 that element.

[0024] To address the long-standing issues of limited sample sizes and a scarcity of labeled masks in the field of industrial equipment inspection, this paper proposes an unsupervised method based on image reconstruction. This method employs a diffusion model for image reconstruction and compares the reconstructed image with the original image to pinpoint potential defects. This approach eliminates the need for extensive training with images of defective industrial equipment; defect-free images are sufficient, thus reducing sample requirements and effectively addressing the problem of scarce industrial image datasets.

[0025] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0026] The embodiment provides a method for detecting defects in industrial equipment based on semantic feature information, such as Figure 1 As shown in the embodiments of this application, the method mainly includes the following steps: Step 110: Encode the original detection image into initial features of a preset feature information dimension; add noise to the initial features to obtain first feature information of a preset first dimension and second feature information of a preset second dimension with noise.

[0027] In some embodiments, the original detection image is encoded into initial features of a preset feature information dimension; noise addition processing is applied to the initial features, specifically including: The original detection image is encoded into initial features of a preset feature information dimension through an autoencoder; The initial features are progressively noise-added through a forward diffusion process, where the progressive noise-adding formula is: ; Where y represents the initial feature. Indicates the first Initial features after noise reduction processing; , This represents the product of the single-step noise coefficients of the first n steps. This represents the single-step noise figure at step n. This represents random noise that follows a standard normal distribution.

[0028] Specifically, obtaining first feature information with a preset first dimension and second feature information with a preset second dimension, which have noise, includes: The initial features after adding noise are processed into 32×32 first feature information using U-Net encoding; The first feature information is encoded step by step to obtain the second feature information of 4×4.

[0029] It should be noted that by uniformly encoding the original detection images to a preset feature dimension through an autoencoder, the inconsistency in representation of images from different sources or at different resolutions in the feature space is effectively alleviated, providing a structurally stable input foundation for the subsequent diffusion process. The progressive noise addition mechanism introduced in the forward diffusion process enables the initial features to form statistically diverse intermediate representations under noise perturbation, which helps reduce the model's tendency to overfit to specific noise patterns and improves the generalization ability of the subsequent inverse denoising stage.

[0030] By using U-Net encoding, the initial noisy features are mapped to 32×32 first feature information, achieving controllable dimensionality reduction and preservation of local structure. Further, 4×4 second feature information is generated through progressive encoding, constructing a multi-scale noise representation system from fine-grained to coarse-grained. This design allows subsequent processing modules to simultaneously utilize the noise distribution characteristics of local details and global semantics, enhancing sensitivity to weak anomalous signals without increasing computational complexity, and providing richer input cues for noise feature-based detection tasks.

[0031] Step 120: Input the original detection image into the CNN neural network to obtain downsampled dimension features; input the downsampled dimension features into the ViT algorithm to obtain global information of the first preset dimension; based on the first feature information and the global information, fuse them to obtain fusion information of the second preset dimension; based on the second feature information and the fusion information, use cross attention to obtain similarity weights, and then obtain the reconstructed image.

[0032] Specifically, the original detected image is input into a CNN neural network to obtain downsampled dimensional features; these downsampled dimensional features are then input into the ViT algorithm to obtain global information in a preset first dimension, including: By using a multi-layer convolutional CNN neural network, the original detection image is downsampled and its dimensions are adjusted step by step to obtain a preset low-resolution downsampled dimension feature. The downsampled dimensional features are processed by a network-within-a-network module consisting of 1×1 convolutions to obtain the input features; The ViT algorithm extracts global features from the input features to obtain 32×32 global information.

[0033] It should be noted that by using the multi-layer convolution of CNN to perform preliminary shallow local feature extraction on the input image, the potential information is captured in advance while reducing the image dimensionality. After feeding it into ViT, global speech information is captured, which will effectively reduce the computational complexity of using the Transformer model while improving the model accuracy.

[0034] By using a cascaded architecture of CNN and ViT, hierarchical extraction of local details and global semantics is achieved. Multi-layer convolution completes the initial edge and texture encoding at low resolution, reducing the sequence length and computational overhead of subsequent ViT modules. This avoids redundant computation caused by directly applying Transformer to high-resolution images, while preserving key structural information for global modeling.

[0035] Specifically, based on the first feature information and global information, fusion information of a preset second dimension is obtained, including: The semantic encoding module fuses the first feature information and global information to obtain initial fused information. The initial fusion information is encoded step by step to obtain the first and second fusion information in 8×8 and 4×4 dimensions; The first and second fusion information are fed into a feature fusion module dominated by a spatial attention module to obtain fusion information in a preset second dimension.

[0036] It should be noted that by initially fusing the downsampled features from the CNN output with the 32×32 global information from the ViT output through the semantic encoding module, feature alignment at different semantic levels is achieved. Further, multi-scale fusion features of 8×8 and 4×4 are generated through progressive encoding, constructing a semantic pyramid from fine-grained to coarse-grained. This structure enables the subsequent reconstruction process to adjust the response intensity based on contextual information at different scales, maintaining overall structural consistency while preserving local texture. This provides structured semantic guidance for image reconstruction without introducing additional training dependencies or external priors.

[0037] Specifically, based on the second feature information and fused information, cross-attention is used to obtain similarity weights, thereby obtaining the reconstructed image, which includes: The fused information is used as the guiding feature of cross-attention, and the second feature information is used as the input feature of cross-attention. Using cross-attention, the preset optimized feature of the input feature and the guiding feature is calculated. The preset optimized features are input into the self-decoder to obtain the reconstructed image.

[0038] It should be noted that, to ensure consistency between the semantic information of the input image and the reconstructed image, a cross-attention mechanism is employed to improve the reconstruction effect in terms of image details. Cross-attention establishes an attention relationship between two different sequences (or data sources). The core of this mechanism is that it allows one sequence (called the Query, the input feature) to focus on another sequence (called the Key and Value, the guiding feature), thereby achieving information fusion. By calculating the pre-optimized feature relationship between the guiding feature and the input feature, it assists the input feature in aligning with the spatial or semantic position of the guiding signal. Furthermore, it can focus on key information based on weights, suppress irrelevant noise, and thus improve the preservation of global contextual information, thereby enhancing the reconstruction effect.

[0039] The refined fusion information (as guiding features) and the second feature information (as input features) after forward diffusion with added noise and encoding are fused through cross-attention, which can be represented as follows: , in, Derived from input features, Derived from guiding features. Cross-attention effectively improves image reconstruction results by calculating preset optimized features between input features and guiding features.

[0040] Furthermore, the reconstruction phase employs element-wise multiplication of the original detection image using preset optimized features, a non-parametric information modulation method. This operation does not alter the pixel distribution range of the image; it only strengthens the regions that guide semantic matching through weighted masks, while weakening irrelevant or noisy regions, thereby achieving semantic enhancement while preserving the physical authenticity of the original image.

[0041] Step 130: Extract features at different scales from the original detection image and the reconstructed image, and calculate the cosine similarity; use the cosine similarity at each scale to calculate the defect score by weighting; when the defect score is greater than the preset threshold, it is determined that a defect exists.

[0042] In some embodiments, features at different scales are extracted from the original detection image and the reconstructed image, and cosine similarity is calculated; a defect score is obtained by weighting the cosine similarity at each scale, specifically including: Through the formula: Calculate the cosine similarity of features at the m-scale; in, This represents the m-scale features of the original detection image. The m-scale features representing the reconstructed image. Cosine similarity represents the features at the m-scale. Through the formula: Score = Calculate the defect score; in, Indicates the total number of scales. This represents the weighting coefficients at the m-scale.

[0043] It should be noted that by extracting features from the original detection image and the reconstructed image at multiple scales and calculating cosine similarity, a hierarchical quantification of structural consistency changes is achieved. Features at different scales reflect the local details and overall semantic structure of the image, respectively. Multi-scale comparison effectively reduces the risk of misjudgment caused by noise, texture fluctuations, or sampling distortion at a single scale, making defect judgment more dependent on structural deviations that persist across multiple levels, rather than instantaneous perturbations.

[0044] By introducing adjustable weight coefficients to perform weighted summation of cosine similarities at each scale, the defect score calculation process has structural flexibility, allowing the contribution weight of different semantic levels to be adjusted according to the application scenario. For example, the weight of high-resolution scales can be increased when detecting small cracks, or low-resolution features can be emphasized when identifying large-area deformations.

[0045] Based on the foregoing description, this embodiment can be specifically described as follows: The original image x of the industrial equipment is encoded into a feature y of the feature information dimension, and then noise is added to obtain a noisy feature. Original images of industrial equipment It will branch off through the semantic information extraction module, first processing the original image... The CNN, after undergoing multi-layer convolution, performs step-by-step downsampling and dimensionality adjustment to obtain low-resolution feature maps. Each level of feature maps changes to 128×128, 64×64, and 32×32, reducing the dimensionality. Before being input into ViT, the feature maps pass through a network-within-a-network module consisting of 1×1 convolutions to align dimensions and unify the number of feature channels for use by the ViT model.

[0046] The adjusted dimensional features are fed into the ViT model, where a self-attention mechanism establishes dependencies between feature image patches. The previous-level feature image is divided into numerous patches, which are then tiled and input into the network. A Transformer encoder extracts the features, followed by a 32×32 convolution to adjust the number of channels, resulting in... Features after adding noise The first 32×32 feature map after U-Net encoding is named the encoding block. (16×16 level coding) 8×8 is 4×4 is ),Will and The fused feed is then fed into a semantic encoding module similar to the U-Net encoding section. This process is a step-by-step encoding process with dimensions of 32×32, 16×16, 8×8, and 4×4 (resulting in...). ).Will , The data is fed into a feature fusion module led by a spatial attention module. This module contains multiple sub-modules, including 3×3 convolutional layers, normalization layers, and activation layers, to fuse features from different dimensions to obtain the final feature set. This serves as a guiding feature for subsequent processing.

[0047] refined semantic features (As guiding features), and the features after forward diffusion with added noise and encoding. (Input features) undergo cross-attention fusion computation; then, the reconstructed image is obtained after passing through a self-decoder. , will be compared with the original image The input is fed into another feature extraction space to extract features at different scales. The cosine similarity between features is calculated. A pre-trained ResNet-50 is used as a feature extractor to calculate the defect score based on the cosine similarity at different scales.

[0048] In addition, this application Figure 2 This application provides an industrial equipment defect detection system based on semantic feature information. For example... Figure 2 As shown in the embodiments of this application, the system mainly includes: The acquisition module 210 is used to encode the original detection image into initial features of a preset feature information dimension; and to add noise to the initial features to obtain first feature information of a preset first dimension and second feature information of a preset second dimension with noise.

[0049] The reconstruction module 220 is used to input the original detection image into the CNN neural network to obtain downsampled dimension features; input the downsampled dimension features into the ViT algorithm to obtain global information of the first preset dimension; fuse the first feature information and global information to obtain fusion information of the second preset dimension; and obtain similarity weights by using cross attention based on the second feature information and fusion information, thereby obtaining the reconstructed image.

[0050] The determination module 230 is used to extract features at different scales from the original detection image and the reconstructed image, and calculate the cosine similarity; using the cosine similarity at each scale, a weighted calculation is performed to obtain the defect score; when the defect score is greater than a preset threshold, a defect is determined to exist.

[0051] The above are method embodiments of this application. Based on the same inventive concept, this application also provides an industrial equipment defect detection device based on semantic feature information. Figure 3 As shown, the device includes: a processor; and a memory storing executable code thereon, which, when executed, causes the processor to perform an industrial equipment defect detection method based on semantic feature information as described in the above embodiments.

[0052] Specifically, the server encodes the original detection image into initial features of a preset feature information dimension; it adds noise to the initial features to obtain a first feature information of a preset first dimension and a second feature information of a preset second dimension with noise; it inputs the original detection image into a CNN neural network to obtain downsampled dimension features; it inputs the downsampled dimension features into a ViT algorithm to obtain global information of a preset first dimension; it fuses the first feature information and global information to obtain fused information of a preset second dimension; it uses cross-attention to obtain similarity weights based on the second feature information and fused information, thereby obtaining a reconstructed image; it extracts features of different scales from the original detection image and the reconstructed image and calculates cosine similarity; it uses the cosine similarity of each scale to calculate a weighted defect score; when the defect score is greater than a preset threshold, a defect is determined to exist.

[0053] In addition, this application embodiment also provides a non-volatile computer storage medium storing executable instructions, which, when executed, implement the above-described method for detecting industrial equipment defects based on semantic feature information.

[0054] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting defects in industrial equipment based on semantic feature information, characterized in that, The method includes: The original detection image is encoded into initial features of a preset feature information dimension; noise is added to the initial features to obtain a first feature information of a preset first dimension and a second feature information of a preset second dimension with noise. The original detection image is input into a CNN neural network to obtain downsampled dimension features; the downsampled dimension features are input into the ViT algorithm to obtain global information in the first preset dimension; based on the first feature information and the global information, the preset second dimension fusion information is obtained; based on the second feature information and the fusion information, cross attention is used to obtain similarity weights, and then the reconstructed image is obtained. Features at different scales are extracted from the original detection image and the reconstructed image, and cosine similarity is calculated. The cosine similarity at each scale is used to calculate a weighted score to obtain the defect score. When the defect score is greater than a preset threshold, a defect is determined to exist.

2. The industrial equipment defect detection method based on semantic feature information according to claim 1, characterized in that, The original detection image is encoded into initial features of a preset feature information dimension; The initial features are subjected to noise processing, specifically including: The original detection image is encoded into initial features of a preset feature information dimension through an autoencoder; The initial features are progressively noise-added through a forward diffusion process, where the progressive noise-adding formula is: ; Where y represents the initial feature. Indicates the first Initial features after noise reduction processing; , This represents the product of the single-step noise coefficients for the first n steps. This represents the single-step noise figure at step n. This represents random noise that follows a standard normal distribution.

3. The industrial equipment defect detection method based on semantic feature information according to claim 1, characterized in that, Obtaining first feature information with a preset first dimension and second feature information with a preset second dimension, specifically including: U-Net encoding is used to process the initial features after adding noise into 32×32 first feature information; The first feature information is encoded step by step to obtain the second feature information of 4×4.

4. The industrial equipment defect detection method based on semantic feature information according to claim 1, characterized in that, The original detection image is input into a CNN neural network to obtain downsampled dimension features; these downsampled dimension features are then input into the ViT algorithm to obtain global information in a preset first dimension, specifically including: By using a multi-layer convolutional CNN neural network, the original detection image is downsampled and its dimensions are adjusted step by step to obtain a preset low-resolution downsampled dimension feature. The downsampled dimensional features are processed by a network-in-network module consisting of 1×1 convolutions to obtain the input features; The ViT algorithm extracts global features from the input features to obtain 32×32 global information.

5. The industrial equipment defect detection method based on semantic feature information according to claim 1, characterized in that, Based on the first feature information and global information, fused information of a preset second dimension is obtained, specifically including: The semantic encoding module fuses the first feature information and global information to obtain initial fused information. The initial fusion information is encoded step by step to obtain the first fusion information in 8×8 and 4×4 dimensions. Second fusion information ; First fusion information Second fusion information The information is fed into a feature fusion module led by a spatial attention module to obtain fusion information in a preset second dimension.

6. The industrial equipment defect detection method based on semantic feature information according to claim 1, characterized in that, Based on the second feature information and fused information, similarity weights are obtained using cross-attention, thereby yielding the reconstructed image, specifically including: The fused information is used as the guiding feature of cross-attention, and the second feature information is used as the input feature of cross-attention. Using cross-attention, the preset optimized feature of the input feature and the guiding feature is calculated. The preset optimized features are input into the self-decoder to obtain the reconstructed image.

7. The industrial equipment defect detection method based on semantic feature information according to claim 1, characterized in that, Features at different scales are extracted from the original detection image and the reconstructed image, and cosine similarity is calculated. The defect score is then calculated by weighting the cosine similarity at each scale, specifically including: Through the formula: Calculate the cosine similarity of features at the m-scale; in, This represents the m-scale features of the original detection image. The m-scale features representing the reconstructed image. Cosine similarity represents the features at the m-scale. Through the formula: Score = Calculate the defect score; in, Indicates the total number of scales. This represents the weighting coefficients at the m-scale.

8. An industrial equipment defect detection system based on semantic feature information, characterized in that, The system includes: The acquisition module is used to encode the original detection image into initial features of a preset feature information dimension; and to add noise to the initial features to obtain first feature information of a preset first dimension and second feature information of a preset second dimension with noise. The reconstruction module is used to input the original detection image into the CNN neural network to obtain downsampled dimension features; input the downsampled dimension features into the ViT algorithm to obtain global information in the first preset dimension; fuse the first feature information and global information to obtain fusion information in the second preset dimension; and use cross attention to obtain similarity weights based on the second feature information and fusion information, thereby obtaining the reconstructed image. The determination module is used to extract features at different scales from the original detection image and the reconstructed image, and calculate the cosine similarity; using the cosine similarity at each scale, a weighted calculation is performed to obtain the defect score; when the defect score is greater than a preset threshold, a defect is determined to exist.

9. An industrial equipment defect detection device based on semantic feature information, characterized in that, The device includes: processor; And a memory having executable code stored thereon, which, when executed, causes the processor to perform an industrial equipment defect detection method based on semantic feature information as described in any one of claims 1-7.

10. A non-volatile computer storage medium, characterized in that, It stores computer instructions, which, when executed, implement an industrial equipment defect detection method based on semantic feature information as described in any one of claims 1-7.