An industrial product micro-flaw visual detection system and method
By combining image acquisition under multi-angle and multi-light conditions with deep convolutional network fusion technology, the problem of identifying minute defects on highly reflective or complex textured surfaces is solved, achieving high-precision defect detection and localization, and is suitable for online quality control of various industrial products.
Patent Information
- Application Number
- CN202511094952.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-08-06
AI Technical Summary
Existing technologies struggle to accurately identify minute defects on highly reflective or complexly textured industrial product surfaces, leading to high false detection rates and inconsistent product quality.
We employ an image acquisition mechanism under multiple angles and lighting conditions, and combine local texture direction inconsistency and multispectral reflectance anomaly index to construct a deep convolutional network that integrates attention mechanism and residual structure for defect recognition.
It significantly improves the detection rate and location accuracy of minor defects, and is suitable for flexible production lines with multiple product categories and materials. It is particularly useful for online quality control in high-reliability manufacturing scenarios, and has a high degree of automation and scalability.
Smart Images

Figure CN120612327B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of product detection, in particular to an industrial product micro flaw visual detection system and method. BACKGROUND
[0002] In the automatic production process of industrial products, micro flaws (such as fine scratches, micro cracks or slight color difference) are often misjudged or missed by traditional visual detection systems due to their extremely small size, diverse morphology and easy confusion with the background of the product body. Especially on high-reflective or complex-textured surfaces, the characteristics of flaws and noise overlap to a high degree, seriously affecting the robustness and generalization ability of the detection algorithm. The existing technology often relies on static image analysis or single feature extraction method, which is difficult to accurately identify micro defects in complex backgrounds, especially on flexible production lines with multiple product categories and multiple materials, the false detection rate is significantly increased, causing the cost of rework to rise and the product quality to be unstable. SUMMARY
[0003] The purpose of the present application is to provide an industrial product micro flaw visual detection system and method to solve the problems in the background art.
[0004] In order to achieve the above purpose, the present application provides the following technical scheme: an industrial product micro flaw visual detection method, comprising:
[0005] S100, acquiring a multi-source image data set I of a target industrial product under multiple detection angles and illumination conditions, and establishing an image information matrix G according to a preset image acquisition parameter;
[0006] S200, performing region segmentation and texture enhancement processing on the image information matrix G to obtain a local texture direction image group of each sub-region, and extracting a corresponding local texture direction inconsistency degree parameter LTOI;
[0007] S300, performing normalization analysis on the pixel intensity ratio of each sub-region in the image information matrix G under different spectral channels to obtain a multi-spectral reflectance anomaly index MRAI of each region;
[0008] S400, constructing a flaw recognition model W based on the fusion of LTOI and MRAI parameters, wherein W is a deep convolutional network with fusion attention mechanism and residual structure;
[0009] S500, using the model W to infer the multi-source image I, and outputting the corresponding flaw judgment result and flaw confidence P of each sub-region;
[0010] S600, comparing the confidence P with the set threshold value, marking the region position L where the micro flaw exists in the image, and outputting a detection report.
[0011] Preferably, the S100 comprises:
[0012] S101, dynamically adjusting the incident angle and spectral energy distribution of the multi-spectral light source based on the surface material characteristics of the industrial product to generate adaptive lighting configuration parameter groups for high-reflective or complex textured surfaces , the comprising at least three spectral channels and five incident angle combinations;
[0013] S102, synchronously controlling the image acquisition viewing angle under each lighting configuration using a double-axis controllable rotating platform, and acquiring a surround image sequence of the industrial product through a multi-view acquisition mechanism , the sequence covering at least 180 degrees, and an image is acquired every 15 degrees;
[0014] S103, based on the image sequence and the lighting parameter group , each frame of image is time-synchronized coded and position information is injected, and a unified image information matrix G is constructed using multi-scale image fusion technology.
[0015] Preferably, wherein the S200 comprises:
[0016] S201, using a superpixel aggregation method based on a graph neural segmentation network to divide the regions of each image frame in the image information matrix G, the method constructs a similarity graph structure by introducing an inter-region edge gradient and a texture co-occurrence matrix, and uses node embedding features for multi-scale region division to generate a sub-region image group R with boundary preservation capability;
[0017] S202, implementing texture enhancement processing based on a combination of bidirectional guided filtering and direction preserving convolution kernel on each image in the sub-region image group R;
[0018] S203, in the texture enhanced image, by calculating the main direction distribution histogram and direction gradient residual map in each sub-region, extracting the local texture direction inconsistency parameter LTOI; and using Gaussian distribution fitting its local direction deviation degree to obtain the significance score of the texture disturbance existing in each sub-region.
[0019] Preferably, the method for obtaining the significance score is:
[0020] S203-1, extracting the main texture direction vector field in each sub-region and calculating the direction gradient tensor to construct the direction distribution histogram , the histogram statistically analyzes the local direction distribution density according to the angle interval;
[0021] S203-2, based on the direction distribution histogram , a maximum likelihood estimation is used to construct a fitting Gaussian distribution function , where μ represents the mean angle of the dominant direction within the region. The variance of directional offset is represented by a Gaussian probability density function to normalize the deviation score for each directional sample point.
[0022] S203-3. The normalized deviation score is weighted by the directional residual amplification factor γ to generate a perturbation saliency map Smap for each pixel. The local response extreme value regions in Smap are aggregated to form a saliency score SLTOI for texture perturbation in each sub-region.
[0023] Preferably, S300 includes:
[0024] S301. Classify the pixel data of each sub-region in the image information matrix G according to the spectral channels, and construct a regional multispectral reflectance data vector group. , It includes pixel reflectance values in red, green, blue, near-infrared, and ultraviolet spectral channels; and uses a spectral signal intensity normalization method to standardize the response values of each channel.
[0025] S302, Based on the vector group Calculate the cross-reflectance matrix of each sub-region across different spectral channels. By analyzing the variation trend of the intensity ratio of different channel pairs, a multidimensional spectral relationship map was constructed, and principal component analysis was used to extract the rate of change of the first principal component. As a primary trend indicator of regional spectral behavior;
[0026] S303. For each ratio channel pair in the spectral relationship graph, the Mahalanobis distance algorithm is used to calculate its deviation from the characteristic distribution in the standard flawless region, and a comprehensive anomaly index based on the superposition of statistical offset and principal component anomaly is constructed, which is defined as the multispectral reflectance anomaly index MRAI.
[0027] Preferably, the method for obtaining the spectral reflectance anomaly index (MRAI) is as follows:
[0028] S303-1, Cross-reflectance ratio matrix for each image sub-region Principal component analysis was performed to extract the first two principal components. and Calculate the principal component mean of this region relative to the flawless regions in the training set. Covariance Matrix Mahalanobis distance ;
[0029] S303-2. In the original spectral channel ratio space, calculate the local statistical deviation of each pair of spectral ratios within the region. and , and the Z-score standardization is performed on the full image standard distribution to generate an anomaly coefficient vector ZR;
[0030] S303-3, the Mahalanobis distance is superimposed on the maximum response value Zmax in the anomaly coefficient vector ZR in a weighted fusion manner, and a multispectral reflectance anomaly index MRAI is defined , wherein a and β are empirical weight coefficients.
[0031] Preferably, the S400 step comprises:
[0032] S401, the saliency score SLTOI extracted from each image sub-region is positionally aligned and numerically normalized with the multispectral reflectance anomaly index MRAI, and is fused into a two-dimensional feature embedding vector F;
[0033] S402, a deep convolutional recognition model W is constructed, and the model introduces a joint structure of a spatial attention mechanism module and a channel attention module;
[0034] S403, a multi-level residual connection structure is embedded in the backbone network of the model W to retain the low-level semantic information of the original features of SLTOI and MRAI.
[0035] Preferably, the S500 step comprises:
[0036] S501, the image sub-regions in the multi-source image set I are input into the deep convolutional model W, and a hierarchical nested convolutional structure is used for multi-scale feature coding, and a flaw activation response map A of each sub-region is output, wherein A contains a flaw response intensity value corresponding to each pixel point;
[0037] S502, based on the flaw activation response map A, a regional aggregation self-attention mechanism is used to dynamically generate a sub-region level discrimination vector D, which fuses local response extreme value, average activity and edge change rate to construct a comprehensive expression feature for supporting decision-making;
[0038] S503, by training the distribution regression modeling of the labeled data, the regional discrimination vector D is input into a confidence regression module, and the flaw existence probability of each sub-region, i.e. the confidence value P ∈ [0, 1] is output.
[0039] Preferably, the S600 step comprises:
[0040] S601, the confidence value P of each sub-region output by the model is dynamically thresholded, and an adaptive threshold function T(x, y) is set;
[0041] S602, the region whose confidence value P exceeds the threshold function T(x, y) is marked as a flaw candidate region, and a candidate region position set L is constructed.
[0042] S603, record the region set in a structured form, and combine image numbers, time stamps and device configuration parameters to automatically generate a detection report.
[0043] The application also provides an industrial product micro-defect visual detection system, comprising:
[0044] An image acquisition module is configured to acquire a multi-source image data set I of a target industrial product under multiple detection angles and illumination conditions, and establish an image information matrix G according to preset image acquisition parameters;
[0045] An image preprocessing module is configured to perform region segmentation and texture enhancement processing on the image information matrix G, to obtain a local texture direction image group of each sub-region, and extract a corresponding local texture direction inconsistency parameter LTOI;
[0046] A spectrum analysis module is configured to perform normalization analysis on pixel intensity ratios of each sub-region in the image information matrix G under different spectrum channels, to obtain a multi-spectrum reflectance anomaly index MRAI of each region;
[0047] An identification model construction module is configured to construct a defect identification model W based on fusion of the LTOI and MRAI parameters, wherein W is a deep convolutional network with a fusion attention mechanism and a residual structure;
[0048] A model inference module is configured to use the model W to perform inference on the multi-source image I, to output a defect judgment result and a defect confidence P corresponding to each sub-region;
[0049] A defect labeling module is configured to compare the confidence P with a set threshold value, to mark a region position L where a micro-defect exists in the image, and output a detection report.
[0050] In the above technical solution, the application provides the following technical effects and advantages:
[0051] 1. The application fuses two non-traditional feature parameters, i.e., a local texture direction inconsistency (LTOI) and a multi-spectrum reflectance anomaly index (MRAI), which have complementary characteristics, and constructs a deep identification model in combination with an attention mechanism and a multi-layer residual structure, to realize high-precision identification of micro-defects on the surface of an industrial product.
[0052] 2、The application introduces a dynamic threshold judgment and a morphological feature secondary verification mechanism, realizes intelligent judgment and false detection control of the flaw area, and outputs a structured detection report to support visualized traceability and system docking of the detection data. The entire system scheme has the advantages of high automation, strong scalability, and good adaptability to various industrial products, and can be widely applied to the industrial fields such as automobile parts, precision electronics, and aviation composites that have strict requirements for micro-defect control. BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.
[0054] Figure 1 The method flowchart of the present application.
[0055] Figure 2 The system module flowchart of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical scheme and advantages of the embodiments of the present application more clear, the technical scheme in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0057] Embodiment 1, please refer to Figure 1 The industrial product micro-flaw visual detection method described in this embodiment includes:
[0058] S100, acquiring a multi-source image data set I of a target industrial product under multiple detection angles and illumination conditions, and establishing an image information matrix G according to a preset image acquisition parameter;
[0059] S200, performing region segmentation and texture enhancement processing on the image information matrix G to obtain a local texture direction image group of each sub-region, and extracting a corresponding local texture direction inconsistency degree parameter LTOI;
[0060] S300, performing normalization analysis on the pixel intensity ratio of each sub-region in the image information matrix G under different spectral channels to obtain a multispectral reflectance anomaly index MRAI of each region;
[0061] S400, construct a defect identification model W based on the fusion of LTOI and MRAI parameters, wherein W is a deep convolutional network with a fusion attention mechanism and a residual structure;
[0062] S500, infer the multi-source image I using the model W, and output the defect judgment result and the defect confidence P corresponding to each sub-region;
[0063] S600, according to the comparison between the confidence P and the set threshold, mark the region position L where the tiny defect exists in the image, and output a detection report.
[0064] In the present application, in order to effectively realize the accurate visual detection of the tiny defects on the surface of industrial products, an image acquisition mechanism based on multi-angle and multi-illumination conditions is proposed, and an image information matrix G is constructed on this basis. The traditional image acquisition method usually adopts a fixed angle and a fixed light source to acquire a single or a small amount of images for processing, but this method is prone to image occlusion, brightness saturation, texture blur and other problems when dealing with industrial products with high reflectivity, complex texture or weak contrast surface, thereby causing the defect area features to be not obvious and the detection accuracy to be reduced.
[0065] To solve the above problems, in the S100 step, the present application provides an image acquisition system with high flexibility and adaptability, which is integrated and optimized from three aspects of illumination control, view angle construction and image matrix generation through non-conventional means in the field, to ensure that the constructed image information matrix G has high distinguishability, contrast and multi-dimensional information fusion capability.
[0066] Firstly, in the sub-step S101, the present application proposes a multi-spectral dynamic light configuration method based on material self-adaptation. By quickly identifying the surface material type (such as metal, ceramic, plastic, coating composite material, etc.) of the industrial product to be measured before image acquisition, a pre-set spectral-material matching database is called to select a multi-spectral light source parameter group suitable for this type of material. The light source parameter group includes different waveband combinations (such as near-infrared, blue-violet light, green, etc.) and multiple incident angle angles (such as 15°, 30°, 45°, etc.), and the light power and angle of each channel are adjusted in real time by using a programmable multi-channel light source array. This configuration can significantly improve the image quality on high-reflectivity or low-contrast surfaces and improve the visibility of weak textures and defect edges.
[0067] In sub-step S102, the application further proposes a multi-view image acquisition mechanism based on a dual-axis control system. By integrating a set of precise servo control rotating devices on the image acquisition platform, angle adjustment can be performed in the horizontal and pitch directions respectively, so that the camera or imaging module can acquire an image sequence covering more than 180° in the range of one revolution around the product at intervals of every 15°. This wrap-around multi-view image acquisition method not only enhances the ability to capture the edge area and structural concave-convex features of the product, but also provides necessary spatial information support for subsequent image reconstruction and three-dimensional feature extraction, especially for industrial products with complex shape, surface curvature or irregular structure.
[0068] In sub-step S103, to realize effective construction from the image sequence to the image information matrix G, the application adopts an image preprocessing scheme based on multi-scale image fusion and space-time alignment mechanism. The scheme first introduces time coding and shooting position information for each image, which is used for subsequent corresponding and registration of multi-angle images; secondly, for images from different angles and light conditions, image alignment and pixel-level registration operations are performed, and a Laplacian pyramid fusion method is used for multi-scale fusion, so that the final output image information matrix G retains the texture details of the original image, while fusing the light response characteristics and spatial structure information under different angles.
[0069] The image information matrix G is a composite image data structure containing spatial dimension, spectral dimension and angle dimension, which not only stores the original pixel value, but also integrates texture features, spectral characteristics and position information, providing high-quality data support for subsequent local texture inconsistency extraction (LTOI) and multi-spectral reflectance anomaly index (MRAI) calculation. The image matrix significantly improves the robustness, anti-interference ability and perception ability of weak defect features of the deep learning model in subsequent processing.
[0070] In the surface defect detection of industrial products, small cracks, scratches or local direction disturbances are usually manifested as subtle changes in the direction of the texture in the image. Such defects have high similarity with the surrounding normal texture, and are often difficult to distinguish in low contrast and complex background. Therefore, accurately measuring the consistency and abnormality of the local area texture direction is a key factor affecting the recognition effect of small defects.
[0071] Therefore, after the image information matrix G is constructed, the application proposes a multi-level processing method based on graph neural network superpixel segmentation, direction-sensitive texture enhancement and direction inconsistency calculation in step S200, finally extracts the local texture direction inconsistency parameter LTOI, and constructs a significance scoring mechanism based on statistical modeling to improve the detection sensitivity and reliability of the defect area.
[0072] First, in step S201, to achieve accurate capture of structure boundaries and texture changes in the image, a superpixel region division algorithm based on a graph neural network is used. The algorithm takes each frame of image as input, forms graph structure data by constructing inter-region edge gradient graph and texture co-occurrence matrix, and propagates local feature information in the graph structure through node embedding technology, and then completes multi-scale region division. Unlike traditional superpixel algorithms based on color or gray clustering, this method has stronger structure perception ability and boundary preservation characteristics, can effectively avoid defects such as fuzzy edge and region penetration, and provides a fine region division basis for subsequent texture processing.
[0073] Next, in step S202, the application performs direction-sensitive texture enhancement processing on the above-mentioned sub-region image group R. This processing uses a cooperative mechanism of bidirectional guided filtering and direction-preserving convolution kernel: on the one hand, guided filtering is used to suppress noise while preserving edge structure, and on the other hand, a convolution kernel aligned with the main direction of the region is used to enhance the main texture direction structure and weaken non-directional interference terms. Such processing is particularly effective in complex backgrounds and can improve the local distinguishability of minor cracks, blurred scratches and other defects, establishing a high-quality image basis for subsequent direction disturbance analysis.
[0074] In step S203, for each processed sub-region image, the application introduces a texture disturbance saliency analysis method based on direction probability modeling. The specific process is as follows:
[0075] In S203-1, first, the main texture direction vector field of each sub-region image is extracted, and a two-dimensional tensor representation is constructed based on the direction gradient, and then the pixel direction angle histogram is counted. This histogram reflects the concentration and variation trend of the texture direction in the region, and is a core intermediate variable for measuring "direction consistency".
[0076] Subsequently, in S203-2, based on the angle distribution data of the histogram , the maximum likelihood estimation method is used to perform Gaussian fitting on the direction distribution to obtain the expected direction μ and the offset variance , and construct the normal probability density function ; this function is used to calculate the likelihood of each direction sample point deviating from the main direction, generating a normalized direction offset score. Compared with traditional gradient modulus comparison or fixed threshold segmentation, this method statistically captures the degree of direction abnormality and establishes a more reasonable probability description for the defect boundary.
[0077] Finally, in S203-3, to improve the response ability to the perturbation region, a direction residual amplification factor γ is introduced to weight adjust the normalized deviation score, forming a disturbance saliency map Smap. Smap records the anomaly score of each point in pixel units, and extracts the high response region through local extreme value region aggregation technology, and finally forms the overall texture disturbance saliency score SLTOI of each sub-region.
[0078] This score not only quantifies the saliency of the sub-region direction disturbance, but also provides a high-quality input index for the classification and identification model to determine the defect region, solving the bottleneck problem of difficult identification of slight texture disturbance in traditional methods.
[0079] In the field of industrial product surface defect detection, some small defects (such as uneven coating, change of reflective properties caused by material fatigue, and residual pollutants) are difficult to distinguish under visible light, but often show abnormal reflectivity under multispectral conditions. Especially in the near-infrared, ultraviolet and other spectral bands, the energy reflection characteristics of the defect region are significantly different from those of the normal region. Therefore, the present application proposes a comprehensive evaluation method based on spectral reflectance anomaly in S300 step, and constructs a multispectral reflectance anomaly index MRAI to quantify the spectral behavior deviation of the sub-region of the image.
[0080] Specifically, S300 step includes three key processing procedures: spectral channel normalization modeling (S301), cross-channel ratio analysis and main trend extraction (S302), and statistical deviation superposition modeling (S303). This process is based on pixel-level spectral intensity, and integrates various statistical analysis and anomaly detection strategies to build a highly sensitive spectral anomaly identification system.
[0081] In S301, first, the pixel data in the image information matrix G is classified according to the spectral channel to construct a multi-channel spectral vector group . The channels include red, green, blue, near-infrared (NIR), ultraviolet (UV), and other wavebands. The intensity values of the pixels in each sub-region under different wavebands form their multi-dimensional spectral response vectors. In order to eliminate the nonlinear effects introduced by factors such as imaging system gain, channel response difference, and environmental illumination change, the present application adopts a spectral normalization method: by normalizing the reflection values of each channel to the maximum and minimum values, or using local region adaptive normalization (such as Retinex algorithm) to enhance local contrast, so as to obtain standardized and multi-dimensional consistent spectral features.
[0082] Subsequently, in S302 step, a reflectance ratio matrix of cross channels is constructed , that is, for any two different channels and , calculate its pixel-level reflectance ratio (e.g. Rred / NIR), thus obtaining a ratio matrix that better reflects the relative changes in the spectral behavior of the material. This ratio matrix is considered as a high-dimensional map that describes the "spectral relational structure" of the material, no longer relying on single-channel brightness, thus having higher sensitivity in identifying changes in spectral characteristics. To further compress the data dimension and capture the main trend of change, principal component analysis (PCA) is introduced to extract features from the ratio matrix, and the first principal component change rate is recorded as the main trend reference index of the sub-region spectral behavior.
[0083] In S303, the present application proposes a comprehensive anomaly index construction method combining the main trend deviation and local abnormal response. This method is realized through the following three sub-steps:
[0084] In S303-1, after principal component extraction of the cross-reflectance ratio matrix, the Mahalanobis distance between the current sub-region principal component vector and the mean vector μP obtained in the training stage is calculated. The Mahalanobis distance considers the covariance between features and can accurately measure the degree of deviation of the overall spectral pattern of the sub-region from the normal sample, which is an important parameter for measuring global spectral anomalies.
[0085] In S303-2, in the original spectral ratio dimension, the average value ΔμR and the standard deviation ΔσR of each ratio channel in the current sub-region are calculated, and the Z-score standardization processing is performed with the overall image distribution to obtain the abnormal coefficient vector ZR. This vector reflects the local abnormality of the sub-region in each channel in the ratio dimension, and is suitable for identifying microscopic defects with obvious deviation in a specific channel but no change in overall trend.
[0086] In S303-3, the abnormality information in the above two dimensions is integrated to construct the final multispectral reflectance anomaly index MRAI. The specific method is: the Mahalanobis distance and the maximum abnormal response value Zmax in ZR are linearly superimposed by weighting, i.e. . Among them, the weight coefficients α and β can be adjusted according to the actual working condition or the training result, so as to balance the detection between global behavior deviation and local extreme abnormality.
[0087] In the present application, in S400, a deep convolutional neural network W based on the fusion of saliency score SLTOI and multispectral reflectance anomaly index MRAI is constructed to realize high-sensitivity identification of micro-defect regions. This model fully utilizes the complementarity of spatial texture disturbance and spectral response anomaly, and establishes a composite feature expression system for fine-grained defect identification.
[0088] Firstly, in step S401, the SLTOI (a significance score reflecting the local texture direction disturbance) and the MRAI (an index reflecting the spectral reflection anomaly) corresponding to each image sub-region extracted previously are positionally aligned. Specifically, based on the image coordinate system, the two two-dimensional feature maps are interpolated to the same spatial size, and normalized processing is performed to uniformly map the values of the two types of indicators to the range of [0, 1], avoiding numerical bias in model training. Subsequently, the SLTOI and the MRAI are spliced according to the channel dimension to construct a two-dimensional feature embedding vector F, and each image sub-region corresponds to a composite input feature map with a size of (H, W, 2), representing the texture and spectral anomaly responses, respectively.
[0089] In step S402, a defect recognition model W is constructed, and the backbone structure is a multi-layer deep convolutional network (such as an improved ResNet or EfficientNet), and a joint attention mechanism module is embedded after a key convolutional block. The module includes a spatial attention unit and a channel attention unit:
[0090] The spatial attention module generates a weight map by calculating the maximum and average projection features of the input feature map in the spatial dimension using convolutional operations, which is used to dynamically highlight the positions of abnormal areas in the image;
[0091] The channel attention module models the importance of each channel through global average pooling and a fully connected layer, highlighting the more critical feature expression of SLTOI or MRAI in certain areas.
[0092] In step S403, to prevent the deep network from losing weak abnormal signals in early inputs when extracting high-level semantic information, multi-level residual connection structures are introduced at multiple stages of the backbone network. This structure directly fuses the SLTOI and MRAI original value features retained in the shallow network with the deep feature map through a residual path, thereby achieving semantic compensation of low-level texture and spectral anomaly information. This design is particularly suitable for processing small scratches, color difference spots and other fine-grained abnormal areas that are easily “diluted” in deep convolution.
[0093] Through the above composite feature modeling method and structural optimization design, the model W has the ability to perceive dual changes of abnormal texture and spectral response, significantly improves the detection rate of small defects on the surface of industrial products, and has good robustness and adaptability, especially in cross-material and complex background environments, while still maintaining high detection ability.
[0094] In the present application, the S500 step is to infer the sub-regions in the multi-source image set I by using the recognition model W constructed by fusing the SLTOI and MRAI features, so as to realize the recognition and confidence score of the micro defects. This step not only outputs the classification result of whether the defect exists, but also provides the credibility of each detection result through the fine regression mechanism, thereby enhancing the decision reliability of the system.
[0095] In the S501 step, the image sub-regions in the multi-source image set I are first sent into the model W. The model W receives the two-dimensional feature embedding vector F (fused by the SLTOI and the MRAI) as the input, and adopts a hierarchical nested convolution structure for feature coding and spatial perception enhancement. The structure is composed of multiple deep convolution blocks, each of which integrates convolution kernels of different scales inside, and introduces cross-scale skip connections between layers for capturing local and global texture / spectral anomaly features. The finally output defect activation response map A is a group of probability maps consistent with the size of the input image, representing the defect activation intensity corresponding to each pixel.
[0096] In the S502 step, in order to convert the pixel-level response map A into a region-level discriminative feature, a region aggregation self-attention mechanism is introduced. The mechanism first identifies the high-response regions (local extreme points) in A, and extracts the response values, neighborhood average values, boundary gradient changes and other signals of these points as discriminative vectors D. The attention mechanism strengthens the high-confidence information and suppresses the low-stable regions through a dynamic weight adjustment mechanism, so as to construct a region expression feature with better discrimination.
[0097] In the S503 step, in order to realize the credibility quantification of the defect judgment result, the present application constructs a confidence regression module for mapping the region discriminative vector D to the confidence value P in the probability space. The module uses a multi-dimensional Gaussian process regression or a lightweight neural regressor to model based on the defect sample feature distribution obtained in the training phase. In the inference phase, when P exceeds a preset threshold (such as 0.6), it is determined as a potential defect region; if it is lower than the threshold, it enters the region classification gating mechanism to automatically filter the low-confidence response and prevent misjudgment.
[0098] In the present application, the S600 step is used to complete the post-processing of the defect confidence P of each image sub-region output by the model W, including dynamic threshold determination, region position marking, geometric feature filtering and structured result output, so as to finally form a detection report for engineering application and quality management.
[0099] First, in step S601, considering that the background complexity of different regions in the industrial product image differs significantly, especially in places with rich surface texture or light interference, a fixed threshold is prone to cause misjudgment. Therefore, the application proposes a dynamic threshold determination method based on the local statistical characteristics of the image region. This method constructs an adaptive threshold function T(x, y) by analyzing the background mean, brightness standard deviation, and confidence gradient noise of each sub-region, which is used for position-related dynamic judgment of the confidence P of each region. When P≥T(x, y), the sub-region is preliminarily determined as possibly having defects.
[0100] In step S602, all sub-regions with confidence exceeding the adaptive threshold form a candidate defect set L.
[0101] In step S603, to meet the quality control, data recording and traceability requirements in industrial environments, the application designs a structured detection report generation mechanism. This mechanism records the spatial position information L (including image number, pixel coordinates, size, etc.) of each defect region together with the corresponding confidence P, and attaches production information such as collection timestamp, device number, process batch, etc. At the same time, the confidence map of the defect region is superimposed on the original image in the form of a heat map to generate a visual report page. The final detection report is output in JSON or XML format, which is convenient for interfacing with the MES system, quality database or used for manual review process.
[0102] Embodiment 2, please refer to Figure 2 The industrial product micro-defect visual detection system described in the embodiment comprises:
[0103] An image acquisition module is configured to acquire a multi-source image data set I of the target industrial product under multiple detection angles and lighting conditions, and establish an image information matrix G according to preset image acquisition parameters;
[0104] An image preprocessing module is configured to perform region segmentation and texture enhancement processing on the image information matrix G to obtain a local texture direction image group of each sub-region, and extract a corresponding local texture direction inconsistency parameter LTOI;
[0105] A spectral analysis module is configured to perform normalization analysis on the pixel intensity ratio of each sub-region in the image information matrix G under different spectral channels to obtain a multispectral reflectance anomaly index MRAI of each region;
[0106] An identification model construction module is configured to construct a defect identification model W based on the fusion of LTOI and MRAI parameters, wherein W is a deep convolutional network with fusion attention mechanism and residual structure;
[0107] The model inference module is configured to perform inference on the multi-source image I using the model W, and output a defect judgment result and a defect confidence P corresponding to each sub-region.
[0108] The defect labeling module is configured to mark a region position L of the image where the micro defect exists according to a comparison between the confidence P and a set threshold, and output a detection report.
[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application.
Claims
1. A method for visual inspection of small defects in an industrial product, characterized in that: The method comprises the following steps: S100, acquiring a multi-source image data set I of a target industrial product under multiple detection angles and light conditions, and establishing an image information matrix G according to preset image acquisition parameters; S200, performing regional segmentation and texture enhancement processing on the image information matrix G to obtain a local texture direction image group of each sub-region, and extracting a corresponding local texture direction inconsistency parameter LTOI; S201, performing regional division on each image frame in the image information matrix G by using a superpixel aggregation method based on a graph neural segmentation network, constructing a similarity graph structure by introducing an inter-regional edge gradient and a texture co-occurrence matrix, and performing multi-scale regional division by using node embedding features to generate a sub-region image group R with boundary reservation capability; S202, performing texture enhancement processing on each image in the sub-region image group R based on a combination of bidirectional guided filtering and a direction preserving convolution kernel; S203, in the texture enhanced image, extracting a local texture direction inconsistency parameter LTOI by calculating a main direction distribution histogram and a direction gradient residual graph in each sub-region, and obtaining a saliency score of a texture disturbance in each sub-region by fitting a local direction deviation degree thereof with a Gaussian distribution; S300, performing normalization analysis on pixel intensity ratios of each sub-region in the image information matrix G under different spectral channels to obtain a multi-spectral reflectance abnormality index MRAI of each region; S301, classify the pixel data of each sub-region in the image information matrix G according to the spectral channel, and construct a regional multispectral reflection data vector group , contains the pixel reflection values under the red, green, blue, near-infrared and ultraviolet spectral channels; and the spectral signal intensity normalization method is used to standardize the response values of each channel. S302、based on the vector group , calculate the cross reflectance matrix of each sub-region between different spectral channels , by analyzing the intensity ratio change trend of different channel pairs, construct a multi-dimensional spectral relationship atlas, and extract the first principal component change rate ΔP1 as the main trend index of the regional spectrum behavior by principal component analysis. S303, for each ratio channel pair in the spectral relationship graph, calculating a deviation degree thereof under a feature distribution of a standard flawless region by using a Mahalanobis distance algorithm, and constructing a comprehensive abnormality index based on statistical deviation and principal component abnormality superposition, which is defined as the multi-spectral reflectance abnormality index MRAI; The method for obtaining the multi-spectral reflectance abnormality index MRAI comprises the following steps: S303-1, cross reflectance ratio matrix of each image sub-region Perform principal component analysis, extract the first two principal components And And calculate the Mahalanobis distance of the region relative to the principal component mean of the flawless region in the training set And the covariance matrix ; S303-2、In the original spectral channel ratio space, calculate the local statistical deviation of each pair of spectral ratio in the region and , and Z-score standardization is performed with respect to the standard distribution of the whole graph to generate an anomaly coefficient vector ZR; S303-3, superimpose the Mahalanobis distance DM1 and the maximum response value Zmax in the anomaly coefficient vector ZR in a weighted fusion manner, and define a multispectral reflectance anomaly index wherein a and β are empirical weight coefficients. S400, constructing a flaw recognition model W based on fusion of LTOI and MRAI parameters, wherein W is a deep convolutional network with fusion of attention mechanism and residual structure; S500, using the flaw recognition model W to infer the multi-source image I, and outputting a flaw judgment result and a flaw confidence P corresponding to each sub-region; S600, comparing the confidence P with a set threshold value, marking a region position L where a small flaw exists in the image, and outputting a detection report.
2. The method according to claim 1, wherein the method is characterized by: The S100 comprises: S101、based on the surface material characteristics of the industrial product, dynamically adjusting the incident angle and spectral energy distribution of the multi-spectral light source to generate adaptive light configuration parameter groups for high-reflective or complex-textured surfaces , the comprising at least three spectral channels and five incident angle combinations; S102, synchronously control the image acquisition view angle by using a biaxial controllable rotating platform under each illumination configuration, and acquire a surround image sequence of the industrial product by a multi-view acquisition mechanism , the sequence covers at least 180 degrees, and an image is acquired every 15 degrees. S103、based on the image sequence with the illumination parameter group , each frame of image is time-synchronized coded and position information is injected, and a unified image information matrix G is constructed using multi-scale image fusion technology.
3. The method according to claim 1, wherein the method is characterized by: The method for obtaining the saliency score comprises the following steps: S203-1, extract the main texture direction vector field of each pixel point in each sub-region, and calculate the direction gradient tensor to construct a direction distribution histogram The histogram counts the local direction distribution density according to an angle interval. S203-2, based on the direction distribution histogram , using maximum likelihood estimation to construct fitting Gaussian distribution function , wherein μ represents the mean of the dominant direction angle in the region, , represents the variance of the direction deviation, and each direction sample point is normalized and scored using the Gaussian probability density function; S203-3, weighting the normalized deviation score by a direction residual amplification factor γ to generate a disturbance saliency map Smap of each pixel, and aggregating local response extreme regions in Smap to form a saliency score SLTOI of a texture disturbance in each sub-region.
4. The method according to claim 1, wherein the method is characterized by: The S400 step comprises: S401, aligning positions and normalizing values of the saliency score SLTOI extracted from each image sub-region and the multi-spectral reflectance abnormality index MRAI, and fusing them into a two-dimensional feature embedding vector F; S402, constructing a flaw recognition model W, wherein the flaw recognition model introduces a joint structure of a spatial attention mechanism module and a channel attention module; S403, embedding a multi-level residual connection structure in the backbone network of the defect identification model W to retain low-level semantic information of the SLTOI and MRAI original features.
5. The method according to claim 4, wherein the method is used for inspecting the industrial product. The S500 step includes: S501, inputting image sub-regions in the multi-source image set I into the defect identification model W, and using a hierarchical nested convolution structure to perform multi-scale coding of features, and outputting a defect activation response map A for each sub-region, wherein A contains a defect response intensity value corresponding to each pixel point; S502, based on the defect activation response map A, using a region aggregation self-attention mechanism to dynamically generate a discriminant vector D at the sub-region level, the vector fuses local response extreme value, average activity and edge change rate, and constructs a comprehensive expression feature for supporting decision-making; S503, by training the distribution regression model of the labeled data, combining the region discriminant vector D input into the confidence regression module, and outputting the defect existence probability of each sub-region, that is, the confidence value P∈[0, 1].
6. The method according to claim 5, wherein the method is used for inspecting the industrial product. The S600 step includes: S601, performing dynamic threshold comparison processing on the confidence value P of each sub-region output by the model, and setting an adaptive threshold function T(x, y); S602, marking the region whose confidence value P exceeds the threshold function T(x, y) as a defect candidate region, and constructing a candidate region position set L; S603, recording the region set in a structured form, and combining the image number, timestamp and device configuration parameters to automatically generate a detection report.
7. An industrial product micro-defect visual inspection system for implementing the industrial product micro-defect visual inspection method of any one of claims 1-6, characterized in that: It includes: An image acquisition module is configured to acquire a multi-source image data set I of a target industrial product under multiple detection angles and light conditions, and establish an image information matrix G according to preset image acquisition parameters; An image preprocessing module is configured to perform region segmentation and texture enhancement processing on the image information matrix G to obtain a local texture direction image group of each sub-region, and extract corresponding local texture direction inconsistency degree parameters LTOI; A spectral analysis module is configured to perform normalization analysis on the pixel intensity ratio of each sub-region in the image information matrix G under different spectral channels to obtain a multispectral reflectance anomaly index MRAI for each region; An identification model construction module is configured to construct a defect identification model W based on the fusion of LTOI and MRAI parameters, wherein W is a deep convolutional network with fusion attention mechanism and residual structure; A model inference module is configured to use the defect identification model W to infer the multi-source image I, and output the corresponding defect judgment result and defect confidence P of each sub-region; A defect labeling module is configured to compare the confidence P with a set threshold value, mark the region position L where a small defect exists in the image, and output a detection report.
Citation Information
Patent Citations
Image processing method and device and computer readable storage medium
CN113569809A
Radar remote sensing monitoring and evaluating method and device for vegetation recovery degree in arid area or desert area
CN116224272A