Super-resolution industrial image anomaly detection and positioning system based on normalized stream
By employing a normalized flow-based super-resolution method, which enhances feature representation using an information cascade extension module and a multi-kernel feature weighting module, and combining a probability distribution-based normalized flow model, the problem of low image resolution and noise interference in complex industrial scenarios is solved, achieving high-precision industrial image anomaly detection and localization.
Patent Information
- Application Number
- CN202510821701.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-10-31
AI Technical Summary
In complex industrial scenarios, existing technologies suffer from low-resolution industrial images, resulting in limited information and noise interference that leads to misclassification of normal and abnormal samples, making it difficult to achieve high-precision anomaly detection and localization.
A super-resolution method based on normalized flow is adopted, which enhances feature representation through information cascade extension modules and multi-kernel feature weighting modules, and combines a normalized flow model of probability distribution to achieve high-precision anomaly detection and localization.
It improves the resolution of industrial images, enhances the detection accuracy and positioning precision of minute and structural anomalies, and solves the detection and positioning challenges in complex industrial environments.
Smart Images

Figure CN120876930A_ABST
Abstract
Description
Technical Field
[0002] This invention relates to the field of target anomaly detection and localization algorithms in industrial machine vision, specifically a super-resolution industrial image anomaly detection and localization system based on normalized flow. Background Technology
[0004] With the rapid development of industrial production technology and the increasing demands for intelligent manufacturing, the requirements for quality inspection, anomaly diagnosis, and production process optimization of industrial products are also rising in actual production processes. However, traditional inspection methods, due to their over-reliance on manual judgment and production experience, suffer from a series of problems such as low inspection efficiency, human fatigue, strong subjectivity, and the risk of safety accidents, making it difficult to meet the high-precision inspection needs of large-scale intelligent production processes. Therefore, unsupervised deep learning methods have gradually become a research hotspot. However, due to the complexity of industrial production environments, existing methods still have limitations. In detection and localization tasks, traditional single-scale images suffer from low resolution and blurred imaging, resulting in limited information contained in the image. Noise interference in the production process leads to misjudgment of normal and abnormal samples and blurred boundary distinctions between normal and abnormal regions, thus affecting the performance of detection and localization tasks. Therefore, how to improve the resolution of industrial images and the detection accuracy and localization precision of small and structural anomalies in complex industrial scenarios is an urgent problem to be solved. Summary of the Invention
[0006] Based on the above ideas, this invention proposes a super-resolution industrial image anomaly detection and localization system based on normalized flow. This system utilizes feature information extracted from images of different resolutions and effectively enhances the expression of important features through a feature enhancement module. Finally, it uses a normalized flow model to achieve high-precision industrial anomaly detection and localization. The information cascade extension module integrates image super-resolution methods and Gaussian convolution operations, enabling the simultaneous acquisition of high-resolution detail images, original images, and structural images. This allows for the acquisition of richer image information during feature extraction, solving the problems of insufficient image information and information loss caused by deep feature extraction from single-scale images. Addressing the issue of blurred boundaries between normal and abnormal regions due to industrial noise, a multi-kernel feature weighting module utilizes multi-view heterogeneous convolution operations combined with adaptive weights to enhance the response of important features. The dual-branch normalized flow model is optimized, and a lightweight Transformer module is introduced into the simple branch. Utilizing the reversible mapping of normalized flow, it simultaneously learns the local and global feature distribution probabilities, enabling the normalized flow model to accurately detect structural anomalies in industrial images as well as effectively identify minute anomalies, thus improving the accuracy of anomaly detection and localization.
[0007] To achieve the above objectives, the following technical solution is adopted:
[0008] A super-resolution industrial image anomaly detection and localization system based on normalized flow includes an information cascade extension module, a multi-kernel feature weighting module, and a normalized flow module based on probability distribution.
[0009] Information cascade extension module: To address the issues of blurred imaging and inherent resolution limitations in industrial images, a multi-scale method is used to convert the input industrial images into images of different scales. The different resolutions of the multi-scale images contain different types of image information. Lower resolution images contain the overall structural information of the image, while higher resolution images reflect the details and texture information of the image, thereby obtaining richer image feature information.
[0010] The information cascade extension module includes an image super-resolution and convolutional downsampling module with global feature fusion coordinates. The industrial image is simultaneously processed by the image super-resolution and convolutional downsampling modules to obtain texture detail images, original images, and overall structure images at different scales and resolutions, which contain richer image information.
[0011] The information cascading extension module includes:
[0012] Image super-resolution module: By embedding attention and aggregating visual features and coordinate space information, the input image achieves collaborative optimization of global features, local features and coordinate distance, and together completes the image information representation process, generating a high-quality super-resolution industrial image containing texture detail information;
[0013] Convolutional downsampling module: The input industrial image is downsampled by a Gaussian convolution kernel, and the resolution is reduced by discarding even-numbered rows and columns to obtain an overall structural image containing structural information;
[0014] The multi-kernel feature weighting module contains three parallel branches. Each branch uses heterogeneous convolution kernels, weighted feature modules, and multi-scale feature concatenation for feature enhancement. Finally, 1×1 convolution is used to eliminate redundant information from the multi-branch outputs, ultimately generating multi-scale enhanced features.
[0015] The probability distribution-based normalization flow module utilizes a dual-branch improved normalization process for enhanced wear-free pixel modeling, improving sensitivity to minute probabilities. This framework constructs a dual-path architecture: the global context modeling branch learns the overall semantic distribution of the image through an attention mechanism, capturing the image's global macroscopic features; the local feature distribution learning branch uses a convolutional network to model pixel-level texture probability density, focusing on the image's local features. High-precision anomaly detection and localization are achieved by leveraging the probability distribution differences between normal and abnormal features.
[0016] The aforementioned super-resolution industrial image anomaly detection and localization system based on normalized flow includes an image super-resolution module comprising depth feature extraction, depth feature and coordinate space feature aggregation, and local weight aggregation.
[0017] Among them, deep feature extraction based on embedded attention: on the basis of traditional attention mechanism, an additional attention mechanism is embedded. After passing through the feature extractor, the latent feature encoding is obtained, and deep feature extraction is performed using the embedded attention mechanism, thereby capturing the global information of image features.
[0018] Feature aggregation based on depth features and coordinate space: After obtaining depth features containing global information, additional coordinate information is added to the depth features and local features of the image to improve the accuracy of predicted point information.
[0019] Local weight aggregation based on implicit attention: It learns the aggregation weight of local regions by using local features and local features with added coordinate information, and combines them with deep features containing global information to finally output reasonable prediction values for prediction points.
[0020] The super-resolution industrial image anomaly detection and localization system based on normalized flow, wherein the deep feature extraction based on embedded attention is as follows: First, SwinIR is used as the backbone model of the feature network to obtain the latent feature encoding of the image from the input image. Then, in the embedded attention mechanism, query features, key features, and value features are obtained from the latent feature encoding F respectively. The specific formula is as follows:
[0021]
[0022] In the above formula, F represents the latent feature encoding obtained from the feature extraction network, and Q, K, and V represent the non-local features of query, key, and value obtained from the latent feature encoding F, respectively. , This represents the network in the corresponding attention mechanism.
[0023] Next, the extracted non-local features are used to further calculate global features containing global visual information. The specific formula for obtaining global features is as follows:
[0024]
[0025] In the above formula This represents the global features extracted from the embedded attention mechanism. This represents the concatenation function. This represents the convolutional downsampling operation. The softmax activation function is used to calculate global similarity weights.
[0026] The aforementioned super-resolution industrial image anomaly detection and localization system based on normalized flow, which incorporates feature aggregation based on depth features and coordinate space, introduces coordinate information into the attention mechanism. This effectively enhances the model's ability to learn spatial relationships. Specifically, by calculating the coordinate distance between the query vector and the key and value vectors, the spatial dependencies between the target location and other locations are learned. This coordinate distance calculation integrates spatial location information into the model's learning process. The specific calculation formula for coordinate information is as follows:
[0027]
[0028] In the above formula, This represents the coordinate distance between the corresponding key vector, value vector, and query vector. That is, the coordinates of the query vector representing the target location. These represent the coordinate positions corresponding to local and global feature information, respectively.
[0029] By embedding the calculated coordinate information into local and global features respectively, the introduction of coordinate information ensures that the query vector, key vector, and value vector not only contain visual semantic features but also encode the spatial relationship between the target location and other locations. This fusion of dual information significantly enhances the expressive power of the attention mechanism. The calculation formulas for the query vector, key vector, and value vector of the aggregate attention mechanism are as follows:
[0030]
[0031] In the above formula, It is the process of extracting features of the nearest neighbor region of the query from the latent features F. These are the extracted query features. It is the corresponding attention network. It is a local feature that integrates coordinate space information. It is a global feature that integrates coordinate space information.
[0032] The aforementioned super-resolution industrial image anomaly detection and localization system based on normalized flow, wherein the implicit attention-based local weight aggregation: in order to adaptively capture similar patterns in global features, an attention mechanism that fuses spatial location information and local visual features is used to better learn the overall weights of local regions. The specific formula is as follows:
[0033]
[0034] In the above formula It is the overall weight of the learned local region. It is the softmax activation function.
[0035] In the process of target location prediction, it is necessary to consider the image's coordinate space information, local information, and similar global information simultaneously. In the final step, information containing global information is utilized... and the overall weights of the learned local regions Matrix multiplication is performed, and the feature aggregation process is further optimized through an attention network to obtain the predicted value of the final target location. The specific formula is as follows:
[0036]
[0037] In the above formula It is the predicted RGB value of the target location. Represents matrix multiplication.
[0038] The super-resolution industrial image anomaly detection and localization system based on normalized flow includes a convolutional downsampling module. This module utilizes Gaussian convolution kernels, which effectively suppress high-frequency noise interference due to their smoothing properties while preserving edge information in the image. To avoid losing crucial information and obtain clearer structural information, a Gaussian distribution model is used as the convolution kernel for downsampling. Gaussian convolution processing is applied to the input image to eliminate local texture disturbances while preserving the main geometric structure. Subsequently, resolution reduction is achieved by discarding even-numbered rows and columns, compressing the spatial dimension of the feature map. This cascaded operation effectively maintains the continuity of structural features while reducing computational complexity. The Gaussian convolution downsampling formula is as follows:
[0039]
[0040] In the above formula, The image shows the structure after Gaussian convolution. To remove even-numbered rows and columns for downsampling operations, The original input image, It's a convolution operation. It is a Gaussian convolution kernel.
[0041] The super-resolution industrial image anomaly detection and localization system based on normalized flow, as described above, includes a multi-kernel feature weighting module. To avoid potential information loss during the enhancement and fusion process, this module fully utilizes the complementary characteristics of features at different scales and designs a hierarchical cascaded feature fusion strategy. First, a 1×1 convolutional kernel is used to eliminate redundant information and enhance the expressive power of key features through dimensionality reduction and compression. Then, a top-down feature fusion path is used to spatially align high-level texture features with low-level structural features through downsampling. Finally, cross-layer connections preserve the integrity of the original features while injecting texture details, thereby generating new fused features.
[0042] This module first inputs the fused texture features, original features, and structural features into parallel processing branches. Each branch uses heterogeneous convolutional kernels (sizes 1×1, 1×3, and 1×5) to learn features from multiple perspectives on the same region, focusing on enhancing the representation ability of anomaly-sensitive regions. The specific formula is as follows:
[0043]
[0044] In the above formula The 1×1 convolution kernel is intended to enhance the representational power of fused features. and These represent 1×3 and 3×1 symmetric convolution kernels, respectively, which improve the ability to capture image features while maintaining the consistency of feature map spatial dimensions.
[0045] Next, the SEWeight module is introduced into the module for adaptive weight calibration. By element-wise multiplying the learned weights with the feature map, the feature response of key regions is enhanced. A dilated convolution architecture is employed, using dilated convolution operations with 3×3 kernels and dilation rates of 3 and 5 to capture multi-scale contextual information of the feature map. After obtaining multi-scale feature representations through parallel dilated convolution operations, the channel attention-weighted feature map is concatenated with the multi-scale features across channels to obtain weighted information features, as shown in the following formula:
[0046]
[0047] In the above formula These represent the weighted information features obtained from the three branches, respectively. It's the introduced SEWeight weighting module. Represents the concatenation function. and These represent 3×3 dilated convolutions with holes of 3 and 5, respectively.
[0048] The updated multi-scale features are concatenated to construct a fusion feature space with multi-scale representation capabilities. Finally, a 1×1 convolution kernel is used to enhance feature discriminative power. The specific formula is as follows:
[0049]
[0050] The aforementioned super-resolution industrial image anomaly detection and localization system based on normalized flow includes a probability distribution-based normalized flow module: the normalized flow establishes a bidirectional transformation relationship between the image space and the latent space through an invertible mapping function. The distribution X of high-dimensional image data is transformed into a distribution Z in a latent space using a repeatable invertible mapping function. Maximum likelihood estimation is then used to optimize the invertible transformation parameters, making the simple distribution of the transformed latent space closer to the true distribution of the data. The likelihood function formula for the variable change model distribution is shown below:
[0051]
[0052] In the above formula The probability density function represents the simple distribution of the transformed latent space. This represents an invertible mapping function that transforms a high-dimensional image data distribution X to a latent spatial distribution Z. This represents the Jacobian determinant, used to adjust the probability density. Based on the variable substitution theorem, an optimization objective for probability density estimation is constructed by maximizing the likelihood function of the observed data X. Implement model parameters Optimization.
[0053] The acquired multi-scale enhanced features (texture, structure, and original features) are simultaneously input into the normalized flow network. To improve modeling efficiency, a divide-and-conquer strategy is adopted to optimize the two branches: the local path reduces computational complexity through convolutional kernel parameter sharing, while the global path establishes long-distance dependencies through a multi-head attention mechanism. Finally, adaptive fusion of the probability densities of the two branches is achieved through feature concatenation and an invertible mapping function, further enhancing transformation and expressive capabilities to obtain the final feature distribution probability. The specific formula for the normalized flow two-branch structure is as follows:
[0054]
[0055] In the above formula and These are operations of splitting and splicing along the channel, respectively. To split the enhanced feature into two features along the channel, This involves using Transformer operations to learn the distribution patterns of global structural features. and The system uses 3×3 and 1×1 convolutional layers, with the last layer being fully connected. Local feature distribution patterns are learned through two convolutions. A dual-branch structure is used to ensure the integrity of the normalized flow model space.
[0056] Ultimately, three probability distribution feature blocks at different scales were obtained. These feature blocks were then uniformly adjusted to the original image scale, and their probability distribution was used as the key basis for anomaly classification. Through in-depth analysis of the probability distribution features, anomalies in images can be effectively identified. The specific formula is as follows:
[0057]
[0058] In the above formula This will serve as a key basis for determining the classification and location of anomalies. and Corresponding to downsampling and upsampling operations respectively, this operation adjusts the texture feature distribution and structural feature distribution obtained from the normalized flow to the same size as the original image. By utilizing the complementarity between the three different scales of information, accurate industrial image anomaly detection and localization can be achieved.
[0059] The beneficial effects of this invention are:
[0060] This invention constructs a super-resolution industrial image anomaly detection and localization system based on normalized flow, enabling non-contact measurement in real industrial environments. This invention is an improvement upon image super-resolution methods and normalized flow models. Addressing the information loss caused by blurred industrial images in practical industrial scenarios, it utilizes an information cascade extension module to capture information at different resolutions and a multi-kernel feature enhancement module to enhance feature representation. Finally, the normalized flow model is used to achieve anomaly detection and localization. The results of this invention can be widely applied to various scenarios such as quality inspection of industrial products, anomaly type diagnosis, and production process optimization, providing effective support and improvement for industrial production and operation. Attached Figure Description
[0062] Figure 1 This is a schematic diagram of the overall process of the super-resolution industrial image anomaly detection and localization system based on normalized flow of the present invention.
[0063] Figure 2 This is a flowchart illustrating the specific process of image super-resolution using the information cascade extension module of the present invention.
[0064] Figure 3 This is a flowchart illustrating the specific process of deep feature extraction based on embedded attention according to the present invention.
[0065] Figure 4This is a flowchart illustrating the multi-core feature weighting module of the present invention.
[0066] Figure 5 This is a flowchart illustrating the normalized flow module based on probability distribution of the present invention.
[0067] Figure 6 This is a heatmap of anomaly localization from the MVTec AD dataset used in the super-resolution industrial image anomaly detection and localization system based on normalized flow in this invention.
[0068] Figure 7 This is a heatmap of anomaly localization in the VisA dataset used in the super-resolution industrial image anomaly detection and localization system based on normalized flow in this invention. Detailed Implementation
[0070] The present invention will be described in detail below with reference to specific embodiments.
[0071] A super-resolution industrial image anomaly detection and localization system based on normalized flow includes an information cascade extension module, a multi-kernel feature weighting module, and a normalized flow module based on probability distribution; the overall flowchart is shown below. Figure 1 As shown, it includes the following:
[0072] A1 first performs multi-scale feature decomposition on the collected industrial image input information through a cascaded expansion module. Addressing the issues of blurred images and limited inherent resolution in industrial images, a multi-scale method is used to transform the input industrial images into images of different scales. The different resolutions of these multi-scale images contain different types of image information: lower-resolution images contain overall structural information, while higher-resolution images reflect details and texture information, thus obtaining richer image feature information. The industrial images are then simultaneously processed through image super-resolution and convolutional downsampling modules to ultimately obtain texture detail images, the original image, and overall structural images at different scales and resolutions, containing even richer image information.
[0073] A2 first processes industrial images through image super-resolution, ultimately obtaining texture detail images of different scales and resolutions that contain richer image information;
[0074] The detailed flowchart for step A2 image super-resolution is as follows: Figure 2 As shown, the flowchart of deep feature extraction based on embedded attention is as follows: Figure 3 As shown, it includes deep feature extraction, feature aggregation of deep features and coordinate space, and local weight aggregation.
[0075] Among them, deep feature extraction based on embedded attention: on the basis of traditional attention mechanism, an additional attention mechanism is embedded. After passing through the feature extractor, the latent feature encoding is obtained, and deep feature extraction is performed using the embedded attention mechanism, thereby capturing the global information of image features.
[0076] Feature aggregation based on depth features and coordinate space: After obtaining depth features containing global information, additional coordinate information is added to the depth features and local features of the image to improve the accuracy of predicted point information.
[0077] Local weight aggregation based on implicit attention: It learns the aggregation weight of local regions by using local features and local features with added coordinate information, and combines them with deep features containing global information to finally output reasonable prediction values for prediction points.
[0078] The specific steps of step A2 are as follows:
[0079] A21. Deep Feature Extraction Based on Embedded Attention
[0080] like Figure 3 As shown, SwinIR is first used as the backbone model of the feature network to obtain the latent feature encoding of the input image. Then, in the embedded attention mechanism, query features, key features, and value features are obtained from the latent feature encoding F respectively. The specific formulas are as follows:
[0081]
[0082] In the above formula, F represents the latent feature encoding obtained from the feature extraction network, and Q, K, and V represent the non-local features of query, key, and value obtained from the latent feature encoding F, respectively. , This represents the network in the corresponding attention mechanism.
[0083] Next, the extracted non-local features are used to further calculate global features containing global visual information. The specific formula for obtaining global features is as follows:
[0084]
[0085] In the above formula This represents the global features extracted from the embedded attention mechanism. This represents the concatenation function. This represents the convolutional downsampling operation. The softmax activation function is used to calculate global similarity weights.
[0086] A22. Feature aggregation based on depth features and coordinate space
[0087] Introducing coordinate information into the attention mechanism can effectively enhance the model's ability to learn spatial relationships. Specifically, by calculating the coordinate distance between the query vector and the key and value vectors, the spatial dependency between the target location and other locations is learned. This calculation of coordinate distance integrates spatial information into the model's learning process. The specific formula for calculating coordinate information is as follows:
[0088]
[0089] In the above formula, This represents the coordinate distance between the corresponding key vector, value vector, and query vector. That is, the coordinates of the query vector representing the target location. These represent the coordinate positions corresponding to local and global feature information, respectively.
[0090] By embedding the calculated coordinate information into local and global features respectively, the introduction of coordinate information ensures that the query vector, key vector, and value vector not only contain visual semantic features but also encode the spatial relationship between the target location and other locations. This fusion of dual information significantly enhances the expressive power of the attention mechanism. The calculation formulas for the query vector, key vector, and value vector of the aggregate attention mechanism are as follows:
[0091]
[0092] In the above formula, It is the process of extracting features of the nearest neighbor region of the query from the latent features F. These are the extracted query features. It is the corresponding attention network. It is a local feature that integrates coordinate space information. It is a global feature that integrates coordinate space information.
[0093] A23. Local weight aggregation based on implicit attention
[0094] To adaptively capture similar patterns in global features, an attention mechanism that fuses spatial location information and local visual features is used to better learn the overall weights of local regions. The specific formula is as follows:
[0095]
[0096] In the above formula It is the overall weight of the learned local region. It is the softmax activation function.
[0097] In the process of target location prediction, it is necessary to consider the image's coordinate space information, local information, and similar global information simultaneously. In the final step, information containing global information is utilized... and the overall weights of the learned local regions Matrix multiplication is performed, and the feature aggregation process is further optimized through an attention network to obtain the predicted value of the final target location. The specific formula is as follows:
[0098]
[0099] In the above formula It is the predicted RGB value of the target location. Represents matrix multiplication.
[0100] The industrial image input from A3 is downsampled using a Gaussian convolution kernel, and resolution is reduced by discarding even-numbered rows and columns to obtain an overall structural image containing structural information.
[0101] The specific steps of step A3 are as follows:
[0102] A Gaussian convolution kernel is used to construct the downsampling module. The Gaussian convolution kernel effectively suppresses high-frequency noise interference due to its smoothing properties, while also excellently preserving edge information in the image. To avoid losing key information and obtain clearer structural information, a Gaussian distribution model is used as the convolution kernel for downsampling. Gaussian convolution is applied to the input image to eliminate local texture perturbations while preserving the main geometric structure; subsequently, resolution reduction is achieved by discarding even-numbered rows and columns, compressing the spatial dimension of the feature map. This cascaded operation effectively maintains the continuity of structural features while reducing computational complexity. The Gaussian convolution downsampling formula is as follows:
[0103]
[0104] In the above formula, The image shows the structure after Gaussian convolution. To remove even-numbered rows and columns for downsampling operations, The original input image, It's a convolution operation. It is a Gaussian convolution kernel.
[0105] A4 inputs three depth feature maps at different scales into the multi-kernel feature weighting module.
[0106] The overall flowchart of the multi-core feature weighting module in step A4 is as follows: Figure 4As shown, the multi-kernel feature weighting module contains three parallel branches. Each branch uses heterogeneous convolution kernels, weighted feature modules, and multi-scale feature concatenation for feature enhancement. Finally, 1×1 convolution is used to eliminate redundant information from the multi-branch outputs, ultimately generating multi-scale enhanced features.
[0107] The specific steps of step A4 are as follows:
[0108] To avoid potential information loss during the enhancement-fusing process, this module fully utilizes the complementary characteristics of features at different scales and designs a hierarchical cascaded feature fusion strategy. First, a 1×1 convolutional kernel is used to eliminate redundant information and enhance the expressive power of key features through dimensionality reduction compression. Then, a top-down feature fusion path is used to spatially align high-level texture features with low-level structural features through downsampling. Finally, cross-layer connections are used to preserve the integrity of the original features while injecting texture details, thereby generating new fused features.
[0109] This module first inputs the fused texture features, original features, and structural features into parallel processing branches. Each branch uses heterogeneous convolutional kernels (sizes 1×1, 1×3, and 1×5) to learn features from multiple perspectives on the same region, focusing on enhancing the representation ability of anomaly-sensitive regions. The specific formula is as follows:
[0110]
[0111] In the above formula The 1×1 convolution kernel is intended to enhance the representational power of fused features. and These represent 1×3 and 3×1 symmetric convolution kernels, respectively, which improve the ability to capture image features while maintaining the consistency of feature map spatial dimensions.
[0112] Next, the SEWeight module is introduced into the module for adaptive weight calibration. By element-wise multiplying the learned weights with the feature map, the feature response of key regions is enhanced. A dilated convolution architecture is employed, using dilated convolution operations with 3×3 kernels and dilation rates of 3 and 5 to capture multi-scale contextual information of the feature map. After obtaining multi-scale feature representations through parallel dilated convolution operations, the channel attention-weighted feature map is concatenated with the multi-scale features across channels to obtain weighted information features, as shown in the following formula:
[0113]
[0114] In the above formula These represent the weighted information features obtained from the three branches, respectively. It's the introduced SEWeight weighting module. Represents the concatenation function. and These represent 3×3 dilated convolutions with holes of 3 and 5, respectively.
[0115] The updated multi-scale features are concatenated to construct a fusion feature space with multi-scale representation capabilities. Finally, a 1×1 convolution kernel is used to enhance feature discriminative power. The specific formula is as follows:
[0116] .
[0117] A5 inputs enhanced feature maps of different scales into the normalized flow model.
[0118] Step A5: The overall flowchart of the normalized flow module based on probability distribution is as follows. Figure 5 As shown, a normalization process for enhanced wear-free pixel modeling, improved through a dual-branch approach, is employed to enhance sensitivity to minute probabilities. This framework constructs a dual-path architecture: the global context modeling branch learns the overall semantic distribution of the image through an attention mechanism, capturing the image's global macroscopic features; the local feature distribution learning branch uses a convolutional network to model pixel-level texture probability density, focusing on the image's local features. High-precision anomaly detection and localization are achieved by leveraging the probability distribution differences between normal and abnormal features.
[0119] The specific steps of step A5 are as follows:
[0120] Normalized flow establishes a bidirectional transformation relationship between image space and latent space through an invertible mapping function. The distribution X of high-dimensional image data is transformed into a distribution Z in a latent space using a repeatable invertible mapping function. Maximum likelihood estimation is then used to optimize the invertible transformation parameters, making the simple distribution of the transformed latent space closer to the true distribution of the data. The likelihood function formula for the variable change model distribution is shown below:
[0121]
[0122] In the above formula The probability density function represents the simple distribution of the transformed latent space. This represents an invertible mapping function that transforms a high-dimensional image data distribution X to a latent spatial distribution Z. This represents the Jacobian determinant, used to adjust the probability density. Based on the variable substitution theorem, an optimization objective for probability density estimation is constructed by maximizing the likelihood function of the observed data X. Implement model parameters Optimization.
[0123] The acquired multi-scale enhanced features (texture, structure, and original features) are simultaneously input into the normalized flow network. To improve modeling efficiency, a divide-and-conquer strategy is adopted to optimize the two branches: the local path reduces computational complexity through convolutional kernel parameter sharing, while the global path establishes long-distance dependencies through a multi-head attention mechanism. Finally, adaptive fusion of the probability densities of the two branches is achieved through feature concatenation and an invertible mapping function, further enhancing transformation and expressive capabilities to obtain the final feature distribution probability. The specific formula for the normalized flow two-branch structure is as follows:
[0124]
[0125] In the above formula and These are operations of splitting and splicing along the channel, respectively. To split the enhanced feature into two features along the channel, This involves using Transformer operations to learn the distribution patterns of global structural features. and The system uses 3×3 and 1×1 convolutional layers, with the last layer being fully connected. Local feature distribution patterns are learned through two convolutions. A dual-branch structure is used to ensure the integrity of the normalized flow model space.
[0126] Ultimately, three probability distribution feature blocks at different scales were obtained. These feature blocks were then uniformly adjusted to the original image scale, and their probability distribution was used as the key basis for anomaly classification. Through in-depth analysis of the probability distribution features, anomalies in images can be effectively identified. The specific formula is as follows:
[0127]
[0128] In the above formula This will serve as a key basis for determining the classification and location of anomalies. and Corresponding to downsampling and upsampling operations respectively, this operation adjusts the texture feature distribution and structural feature distribution obtained from the normalized flow to the same size as the original image. By utilizing the complementarity between the three different scales of information, accurate industrial image anomaly detection and localization can be achieved.
[0129] Figure 6 and Figure 7 The visualization results of the anomaly detection and localization results of the super-resolution industrial image anomaly detection and localization system based on normalized flow of this invention are presented in the form of a heatmap. The normal part is blue, and the red and yellow parts are the locations of the anomalies.
[0130] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A super-resolution industrial image anomaly detection and localization system based on normalized flow, characterized in that, This includes an information cascade extension module, a multi-kernel feature weighting module, and a probability distribution-based normalized flow module: Information cascade extension module: To address the issues of blurred imaging and inherent resolution limitations in industrial images, a multi-scale method is used to convert the input industrial images into images of different scales. The different resolutions of the multi-scale images contain different types of image information. Lower resolution images contain the overall structural information of the image, while higher resolution images reflect the details and texture information of the image, thereby obtaining richer image feature information. The multi-kernel feature weighting module contains three parallel branches. Each branch uses heterogeneous convolution kernels, weighted feature modules, and multi-scale feature concatenation for feature enhancement. Finally, 1×1 convolution is used to eliminate redundant information from the multi-branch outputs, ultimately generating multi-scale enhanced features. The probability distribution-based normalization flow module utilizes a dual-branch improved normalization process for enhanced wear-free pixel modeling to improve sensitivity to minute probabilities. The framework constructs a dual-path architecture: the global context modeling branch learns the overall semantic distribution of the image through an attention mechanism, capturing the global macroscopic features of the image; the local feature distribution learning branch uses a convolutional network to model pixel-level texture probability density, focusing on the local features of the image; and high-precision anomaly detection and localization are achieved by utilizing the probability distribution differences between normal and abnormal features.
2. The system according to claim 1, characterized in that, The information cascading expansion module includes: Image super-resolution module: By embedding attention and aggregating visual features and coordinate space information, the input image achieves collaborative optimization of global features, local features and coordinate distance, and together completes the image information representation process, generating a high-quality super-resolution industrial image containing texture detail information; Convolutional downsampling module: The input industrial image is downsampled by a Gaussian convolution kernel, and the resolution is reduced by discarding even-numbered rows and columns to obtain an overall structural image containing structural information.
3. The system according to claim 1, characterized in that, The image super-resolution module includes depth feature extraction, depth feature and coordinate space feature aggregation, and local weight aggregation; Among them, deep feature extraction based on embedded attention: on the basis of traditional attention mechanism, an additional attention mechanism is embedded. After passing through the feature extractor, the latent feature encoding is obtained, and deep feature extraction is performed using the embedded attention mechanism, thereby capturing the global information of image features. Feature aggregation based on depth features and coordinate space: After obtaining depth features containing global information, additional coordinate information is added to the depth features and local features of the image to improve the accuracy of predicted point information. Local weight aggregation based on implicit attention: It learns the aggregation weight of local regions by using local features and local features with added coordinate information, and combines them with deep features containing global information to finally output reasonable prediction values for prediction points.
4. The system according to claim 3, characterized in that, The deep feature extraction based on embedded attention works as follows: First, SwinIR is used as the backbone model of the feature network to obtain the latent feature encoding of the input image. Then, in the embedded attention mechanism, query features, key features, and value features are obtained from the latent feature encoding F, respectively. The specific formulas are as follows: In the above formula, F represents the latent feature encoding obtained from the feature extraction network, and Q, K, and V represent the non-local features of query, key, and value obtained from the latent feature encoding F, respectively. , This represents the network in the corresponding attention mechanism; then, the extracted non-local features are used to further calculate global features containing global visual information.
5. The system according to claim 3, characterized in that, The aforementioned feature aggregation based on deep features and coordinate space: Introducing coordinate information into the attention mechanism can effectively enhance the model's ability to learn spatial positional relationships. Specifically, by calculating the coordinate distance between the query vector and the key vector and value vector, the spatial dependency between the target position and other positions is learned. This calculation of coordinate distance integrates spatial positional information into the model's learning process. The calculated coordinate information is embedded into local and global features, respectively; The introduction of coordinate information enables the query vector, key vector, and value vector to not only contain visual semantic features but also encode the spatial relationship between the target location and other locations. This fusion of dual information significantly enhances the expressive power of the attention mechanism. The calculation formulas for the query vector, key vector, and value vector of the aggregate attention mechanism are as follows: In the above formula, It is the process of extracting features of the nearest neighbor region of the query from the latent features F. These are the extracted query features. It is the corresponding attention network. It is a local feature that integrates coordinate space information. It is a global feature that integrates coordinate space information.
6. The system according to claim 3, characterized in that, The implicit attention-based local weight aggregation aims to adaptively capture similar patterns in global features by fusing spatial location information and local visual features through an attention mechanism to better learn the overall weights of local regions. During target location prediction, it is necessary to simultaneously consider the image's coordinate space information, local information, and similar global information. In the final step, it utilizes information containing global information... and the overall weights of the learned local regions Matrix multiplication is performed, and the feature aggregation process is further optimized through an attention network to obtain the predicted value of the final target location.
7. The system according to claim 1, characterized in that, The convolutional downsampling module employs a Gaussian convolution kernel. The Gaussian kernel, with its smoothing properties, effectively suppresses high-frequency noise interference while excellently preserving edge information in the image. To avoid losing key information and obtain clearer structural information, a Gaussian distribution model is used as the convolution kernel for downsampling. Gaussian convolution processing is applied to the input image to eliminate local texture disturbances while preserving the main geometric structure. Subsequently, resolution reduction is achieved by discarding even-numbered rows and columns, compressing the spatial dimension of the feature map. This cascaded operation effectively maintains the continuity of structural features while reducing computational complexity.
8. The system according to claim 1, characterized in that, The multi-core feature weighting module, in order to avoid the information loss that may occur during the process of enhancement followed by fusion, makes full use of the complementary characteristics of features at different scales and designs a hierarchical cascaded feature fusion strategy. First, a 1×1 convolutional kernel is used to eliminate redundant information and enhance the expressive power of key features through dimensionality reduction and compression. Then, a top-down feature fusion path is used to spatially align high-level texture features with low-level structural features through downsampling. Finally, the integrity of the original features is preserved through cross-layer connections, while injecting texture details, thereby generating new fused features. This module first inputs the texture features, original features and structural features after hierarchical fusion into parallel processing branches. Each branch uses heterogeneous convolutional kernels to learn features from multiple perspectives in the same region, focusing on strengthening the representation ability of abnormal and sensitive regions. Next, the SEWeight module is introduced into the module for adaptive weight calibration. By multiplying the learned weights with the feature map element-wise, the feature response of key regions is enhanced. A dilated convolution architecture is adopted, using dilated convolution operations with 3×3 kernels and dilation rates of 3 and 5 to capture multi-scale contextual information of the feature map. After obtaining multi-scale feature representations through parallel dilated convolution operations, the channel attention-weighted feature map is concatenated with the multi-scale features across channels to obtain weighted information features. The updated multi-scale features are concatenated to construct a fusion feature space with multi-scale representation capabilities. Finally, a 1×1 convolution kernel is used to enhance feature discriminativeness.
9. The system according to claim 1, characterized in that, The aforementioned probability distribution-based normalized flow module establishes a bidirectional transformation relationship between the image space and the latent space through an invertible mapping function. The distribution X of high-dimensional image data is transformed into a distribution Z in a latent space using a repeatable invertible mapping function. Maximum likelihood estimation is then used to optimize the invertible transformation parameters, making the simple distribution of the transformed latent space closer to the true distribution of the data. The likelihood function formula for the variable change model distribution is shown below: In the above formula The probability density function represents the simple distribution of the transformed latent space. This represents an invertible mapping function that transforms a high-dimensional image data distribution X to a latent spatial distribution Z. This represents the Jacobian determinant, used to adjust the probability density; The optimization objective for probability density estimation is constructed based on the variable substitution theorem, which maximizes the likelihood function of the observed data X. Implement model parameters Optimization; The acquired multi-scale enhanced features are synchronously input into the normalized flow network. To improve modeling efficiency, a divide-and-conquer strategy is adopted to optimize the two branches: the local path reduces computational complexity by sharing convolutional kernel parameters, and the global path establishes long-distance dependencies through a multi-head attention mechanism. Finally, the adaptive fusion of the probability densities of the two branches is achieved through feature concatenation and an invertible mapping function, which further enhances the transformation and expressive capabilities, thereby obtaining the final feature distribution probability. Ultimately, three probability distribution feature blocks at different scales were obtained. These feature blocks were then uniformly adjusted to the original image scale, and the probability distribution presented by the feature blocks was used as the key basis for anomaly classification. Through in-depth analysis of the probability distribution features, anomalies in the image can be effectively identified.
Citation Information
Cited By
Hydraulic plunger pump intelligent fault diagnosis method and system based on pressure signals
CN121213559A
Train rail transit forward foreign matter detection method and system based on unsupervised learning
CN121564688A
Industrial image anomaly detection method based on multi-scale feature fusion and domain adaptation
CN121767791A