A machine vision-based automatic detection method for defects of parts
By acquiring the three-dimensional geometric parameters and historical defect samples of the parts, performing multispectral feature extraction and multi-level detection network layer scanning, the problem of insufficient accuracy and efficiency in the existing technology for parts inspection is solved, and high-precision inspection of complex parts is achieved.
Patent Information
- Application Number
- CN202511330084.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-09-17
AI Technical Summary
Existing machine vision-based component inspection methods struggle to accurately identify three-dimensional defects when dealing with complex components, and lack effective multispectral feature extraction and adaptive scanning strategies, resulting in insufficient inspection accuracy and efficiency.
By acquiring the three-dimensional geometric parameters of the target component, matching it with a set of historical defect samples, clustering the defect types, performing multispectral feature extraction and multi-level detection network layer scanning, generating a multi-scale defect feature map, and performing cross-level correlation fusion to output a fused defect feature map.
It enables high-precision and comprehensive detection of defects in complex parts, reduces missed and false detections, and improves the systematicness and accuracy of the detection.
Smart Images

Figure CN120833332B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of component detection, in particular to a component defect automatic detection method based on machine vision. BACKGROUND
[0002] In modern manufacturing industry, quality detection of components is an important link to ensure product performance and reliability. With the development of industrial production towards automation and high precision, higher requirements are put forward for the efficiency and accuracy of component defect detection. Traditional component defect detection relies on manual visual inspection, and detection personnel judge the possible defects on the surface and inside of the components through magnifying glass, caliper and other tools. This method not only consumes a lot of labor cost, but also the detection result is easily affected by the experience, fatigue degree and subjective judgment of the detection personnel, resulting in unstable detection accuracy, which is difficult to meet the quality control demand of large-scale production.
[0003] With the rise of machine vision technology, defect detection methods based on two-dimensional images have been gradually applied in industrial detection field. This kind of method acquires two-dimensional images of components through camera, and identifies the defect area in the image by using image processing algorithm. However, two-dimensional images can only reflect the planar information of the component surface, and cannot fully present its three-dimensional geometric characteristics. For some three-dimensional defects caused by structural deformation, size deviation and other reasons, it is often difficult to accurately identify.
[0004] The existing detection method based on machine vision adopts single spectral band for image acquisition when extracting defect features, which is difficult to cope with the differences in spectral characteristics of different types of defects. For example, some fine cracks are not easy to be detected in the visible light band, but obvious features will be presented in the infrared band. In addition, the traditional detection method lacks effective classification and fusion mechanism when dealing with multiple defects on the surface of complex components, which is easy to cause missed detection or false detection, especially when multiple defects exist simultaneously and interfere with each other, the detection accuracy decreases significantly.
[0005] The scanning strategy of the existing detection network model adopts fixed step length, which cannot realize adaptive fine scanning for defects of different sizes and different diffusion ranges, resulting in insufficient resolution when detecting small defects, and low efficiency when detecting large defects. The existence of these problems makes the existing machine vision detection method difficult to achieve ideal detection effect when facing diversified and complex component defects, which restricts the further improvement of manufacturing quality control level. SUMMARY
[0006] The purpose of the present application is to provide a component defect automatic detection method based on machine vision to solve the problems raised in the background.
[0007] To achieve the above object, the application provides a kind of based on machine vision's spare part defect automatic detection method, the method comprises:
[0008] The three-dimensional geometric parameters of the target spare part are acquired, and the historical defect sample set is matched in the vision sample library based on the three-dimensional geometric parameters;
[0009] The historical defect sample set is clustered and divided into defect types, generating a plurality of defect category sub-sets;
[0010] The plurality of defect category sub-sets are processed one by one to perform multispectral feature extraction operation, and the reference detection area and defect diffusion range parameter corresponding to each defect category are obtained;
[0011] The scanning step of the multi-level detection network layer is configured using the defect diffusion range parameter, and the multi-level feature analysis is performed on the target spare part surface scanning image sequence through the multi-level detection network layer, generating a plurality of scale defect feature maps;
[0012] The cross-level correlation fusion operation is performed on the plurality of scale defect feature maps to generate a fusion defect feature map, and the fusion defect feature map is output as the final defect detection result.
[0013] Preferably, the plurality of defect category sub-sets are processed one by one to perform multispectral feature extraction operation, comprising:
[0014] A set of surface deformation image sequences is extracted from each defect category sub-set;
[0015] The local curvature mutation position in the set of surface deformation image sequences is identified, and a set of reference deformation region coordinates is located;
[0016] The texture spectrum analysis operation is performed on the set of reference deformation region coordinates to generate a set of reference defect feature vectors;
[0017] The set of reference defect feature vectors is indexed in the corresponding set of surface deformation image sequences to perform region diffusion calculation, and the defect correlation radius parameter of each reference deformation region is determined, which is used to represent the pixel span from the defect core region to the edge attenuation region.
[0018] Preferably, the set of reference deformation region coordinates is located, comprising:
[0019] The set of surface deformation image sequences is processed in real time using a curvature mutation detection model, and the high curvature fluctuation region coordinates are output;
[0020] The spatial density clustering operation is performed on the high curvature fluctuation region coordinates to generate a candidate reference deformation region;
[0021] Calculate the gray gradient difference value of the candidate reference deformation region and the adjacent region, and when the gray gradient difference value exceeds a preset mutation threshold, the candidate reference deformation region is included in the reference deformation region coordinate set.
[0022] Preferably, the reference defect feature vector set is generated, including:
[0023] Perform feature encoding operation on the reference deformation region coordinate set by using the defect probability prediction model;
[0024] Extract the depth feature tensor output by the defect probability prediction model, and perform channel attention weighting processing on the depth feature tensor;
[0025] Calculate the average value of each channel feature through the weighted feature tensor to generate an initial reference feature vector;
[0026] Based on the preset sliding window, iteratively extract local feature blocks in the depth feature tensor, and when the aggregation density of the local feature blocks is less than the aggregation density of the initial reference feature vector, the initial reference feature vector is taken as a reference defect feature vector set element.
[0027] Preferably, the defect correlation radius parameter of each reference deformation region is determined, including:
[0028] Perform pixel diffusion operation starting from the reference deformation region coordinate set by using region growing algorithm;
[0029] Set a gray similarity tolerance threshold to control the pixel diffusion boundary, and record the diffusion termination position coordinates;
[0030] Calculate the Euclidean distance between the reference deformation region center coordinates and the diffusion termination position coordinates to generate an original defect correlation radius;
[0031] Perform weighted average calculation on all original defect correlation radii to output a corrected defect correlation radius parameter.
[0032] Preferably, the cross-level correlation fusion operation is performed on the multiple scale defect feature maps, including:
[0033] Select coarse-grained defect feature maps and fine-grained defect feature maps from the multi-level detection network layer output;
[0034] Calculate the spatial correlation matrix of the coarse-grained defect feature maps and the fine-grained defect feature maps;
[0035] Perform normalization mapping operation on the spatial correlation matrix to generate a feature correlation weight distribution map;
[0036] Perform weighted fusion operation on the fine-grained defect feature maps using the feature correlation weight distribution map to generate a cross-level enhanced feature map;
[0037] Repeating the iteration of the weighted fusion operation until all scale defect feature maps are fused to generate the fused defect feature map atlas.
[0038] Preferably, the generating the feature correlation weight distribution map comprises:
[0039] Performing an up-sampling operation on the coarse-grained defect feature map using a three-dimensional convolution kernel to match the resolution of the fine-grained defect feature map;
[0040] Calculating the pixel-by-pixel similarity between the up-sampled feature map and the fine-grained defect feature map;
[0041] Constructing an initial correlation weight matrix from the similarity values and performing Gaussian smoothing on the initial correlation weight matrix;
[0042] Normalizing the smoothed weight matrix by dividing it by the maximum weight value to generate the feature correlation weight distribution map.
[0043] Preferably, the method further comprises:
[0044] Analyzing the defect distribution parameters in the fused defect feature map atlas to generate a defect quantification list;
[0045] Performing an external disturbance intensity analysis operation based on the defect quantification list to output multi-level compensation strategy intensity parameters;
[0046] Constructing a defect compensation network containing multi-level adsorption thresholds;
[0047] Dynamically adjusting the adsorption thresholds of the defect compensation network according to real-time collected ambient light parameters;
[0048] Performing a secondary scanning operation on the target part using the adjusted defect compensation network to update the fused defect feature map atlas.
[0049] Preferably, the generating the defect quantification list comprises:
[0050] Counting the number and area of connected regions in the fused defect feature map atlas;
[0051] Calculating the shape irregularity and texture complexity of each connected region;
[0052] Inputting the shape irregularity and texture complexity into a defect level classification model;
[0053] Outputting a structured list containing defect type codes, area weights, and risk coefficients.
[0054] Preferably, the method further comprises:
[0055] A device adaptation layer is constructed to resolve the parameter differences of different optical acquisition devices;
[0056] The output features of the multi-level detection network layer are converted into a coordinate encoding format supported by the target device;
[0057] The spatial correspondence of cross-level features is maintained during the conversion process;
[0058] The distortion correction parameters of the target device are injected to generate a device-independent defect detection protocol.
[0059] Compared with the prior art, the beneficial effects of the present application are:
[0060] By obtaining the three-dimensional geometric parameters of the target part and matching the historical defect sample set, the three-dimensional structural features of the part and the historical defect data can be fully combined to provide more comprehensive reference for subsequent defect detection. The sample matching method based on three-dimensional geometric parameters breaks through the limitation of relying only on planar information in traditional two-dimensional image detection, and can more accurately locate the historical defects related to the structure of the target part, making the detection process more targeted.
[0061] The historical defect sample set is clustered and divided into multiple defect category sub-sets, which helps to systematically classify complex and diverse defects, facilitating subsequent special detection according to the characteristics of different categories of defects. This classification processing method can avoid the mutual interference of different types of defect features, making the detection of each defect more independent and accurate, especially when dealing with complex parts containing multiple defects, it can effectively improve the orderliness of detection.
[0062] Each of the multiple defect category sub-sets is processed to perform a multi-spectral feature extraction operation, obtaining the reference detection area and defect diffusion range parameters corresponding to each defect category, which fully utilizes the feature differences of different defects under multi-spectrum. Through multi-spectral extraction, defect features that are difficult to appear under a single spectrum can be captured, expanding the coverage of defect detection, and the determination of the reference detection area and defect diffusion range parameters provides specific spatial range reference for subsequent accurate scanning, making the detection more targeted.
[0063] The defect diffusion range parameters are used to configure the scanning step of the multi-level detection network layer, realizing the adaptive adjustment of the scanning strategy. For defects with different diffusion ranges, the corresponding scanning step is set, a larger step can be used to improve efficiency when detecting defects with a larger diffusion range, and a smaller step can be used to ensure accuracy when detecting defects with a smaller diffusion range, balancing the efficiency and accuracy of detection, avoiding the problems of resource waste and insufficient accuracy under fixed step scanning.
[0064] The multi-level detection network layer performs hierarchical feature analysis on the target part surface scanning image sequence, generates a plurality of scale defect feature maps, and can capture the feature information of the defects from different levels and different scales. This hierarchical analysis method can simultaneously consider the overall condition and local details of the part surface, neither overlooks the overall defect distribution due to excessive attention to details, nor misses subtle defects due to focusing on the overall, so that the extraction of defect features is more comprehensive.
[0065] The cross-level correlation fusion operation is performed on the plurality of scale defect feature maps to generate a fusion defect feature map, which can organically integrate the defect features of different scales and different levels. Through correlation fusion, the limitations of single-scale feature maps can be eliminated, the effective information of each level can be utilized comprehensively, the correlation between the overall features and local details of the defects is highlighted, the final output defect detection result is more complete and accurate, the missed detection and false detection situations are effectively reduced, and the recognition ability for complex defects is improved. BRIEF DESCRIPTION OF DRAWINGS
[0066] Figure 1 A working principle diagram of the machine vision-based part defect automatic detection method is provided.
[0067] Figure 2 A flowchart of the multispectral feature extraction operation is provided.
[0068] Figure 3 A flowchart of the defect correlation radius parameter calculation is provided.
[0069] Figure 4 A flowchart of the feature correlation weight distribution map generation is provided.
[0070] Figure 5 A flowchart of the defect compensation and secondary scanning is provided. DETAILED DESCRIPTION
[0071] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. 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.
[0072] Please refer to Figure 1 The present application provides a machine vision-based part defect automatic detection method, which comprises:
[0073] The machine vision-based automatic part defect detection method realizes high-precision defect recognition through multi-level feature fusion and dynamic compensation mechanism. The method first acquires the three-dimensional geometric parameters of the target part, and matches the historical defect sample set in the vision sample library. The historical defect sample set is clustered and divided by defect type to generate multiple defect category sub-sets. For each defect category sub-set, multi-spectral feature extraction is performed to obtain the reference detection area and defect diffusion range parameters. The defect diffusion range parameters are used to dynamically configure the scanning step of the multi-level detection network layer, and multi-scale defect feature maps are generated through hierarchical feature analysis. Finally, cross-level correlation fusion is performed on the multi-scale defect feature maps to output the fusion defect feature map as the detection result.
[0074] Embodiment 1: see Figure 2 In the defect feature extraction stage, the system first extracts a set of surface deformation image sequences from each defect category sub-set. These image sequences are derived from historical detection data and contain part surface images under different angles and lighting conditions. After preprocessing, the image sequences are analyzed and processed using a curvature mutation detection model. Based on the principles of surface differential geometry, the model calculates the curvature changes in the pixel neighborhood to identify the coordinate positions where the curvature values in the surface deformation region fluctuate significantly.
[0075] Spatial clustering analysis is performed on the identified high-curvature fluctuation coordinate points using a density-based clustering algorithm. The algorithm first calculates the distance distribution of each coordinate point and its neighboring points, and according to the density accessibility principle, coordinates with similar spatial positions are clustered into the same cluster. After multiple iterations, several candidate reference deformation regions are formed. Each candidate region needs to be further verified for its effectiveness by calculating the gray gradient change of the region and its adjacent regions. The horizontal and vertical gradient components are extracted using an edge detection operator, and the gradient amplitude is calculated. When the gradient amplitude of a certain region exceeds the preset mutation threshold, the region is confirmed as an effective reference deformation region and is included in the final reference deformation region coordinate set.
[0076] The texture spectrum analysis stage performs more in-depth feature extraction on the confirmed reference deformation regions. The system uses a multi-directional and multi-scale filter bank to process the deformation region images, which contains filter kernels of different directions and frequencies. Each filter kernel performs convolution operation with the deformation region image in the spatial domain, outputting the response map of the corresponding frequency band. Through statistical analysis of the response maps of each frequency band, the frequency domain parameters that can represent the defect texture features are extracted. These parameters are processed by dimension reduction to form a compact numerical vector representation, which constitutes the reference defect feature vector set.
[0077] Region diffusion calculation is guided by the benchmark defect feature vector and is performed in the corresponding surface deformation image sequence. The diffusion algorithm starts from the center position of the benchmark deformation region and gradually expands to the surrounding region. During the diffusion process, the algorithm dynamically evaluates the similarity of the current pixel to the seed region, including gray value, texture feature, and other aspects. The similarity evaluation adopts an adaptive threshold strategy, with an initially loose threshold that gradually tightens as the diffusion range expands. The diffusion process continues until a boundary pixel that does not meet the similarity condition is encountered.
[0078] After the diffusion terminates, the system records the farthest boundary position reached by the diffusion. The spatial distance from the center of the deformation region to the diffusion boundary is determined through geometric calculation, and this distance serves as the original defect correlation radius. Due to potential differences in lighting or angle in different image sequences, the directly calculated original radius may exhibit some fluctuations. Therefore, statistical processing of the radius set obtained from multiple image sequences is required, and a weighted average method is used to eliminate the influence of outliers. The weight distribution considers factors such as image quality and lighting conditions, and finally outputs the corrected defect correlation radius parameter.
[0079] The entire feature extraction process adopts a hierarchical and progressive processing strategy. From the initial curvature mutation detection to the benchmark region confirmation, and then to the texture feature extraction and region diffusion calculation, each link is based on the output of the previous link. The system maintains data consistency between links during processing to ensure the accuracy and reliability of feature extraction. Multi-spectral feature extraction not only considers deformation features in the spatial domain but also combines texture information in the frequency domain to form a comprehensive description of the defect region.
[0080] When implementing the system, modular design is adopted, with each processing link encapsulated as an independent functional module. Modules exchange data through standard interfaces, facilitating function extension and algorithm update. The intermediate data generated during processing all have time stamps and version identifiers, supporting traceability and reproducibility of the processing flow. For large-scale data processing needs, the system adopts a parallel computing architecture, fully utilizing the multi-core processor and GPU acceleration capabilities to ensure processing efficiency.
[0081] Quality control mechanisms are implemented throughout the entire implementation process. A confidence threshold is set in the curvature mutation detection stage to filter low-reliability detection results. An artificial review mechanism is introduced in the benchmark region verification link to perform secondary confirmation on boundary cases. During the feature extraction process, data distribution changes are monitored in real time, and automatic re-computation is triggered when abnormal fluctuations are found. The final output of the defect correlation radius parameter is subjected to multiple rounds of cross-validation to ensure its accuracy and stability.
[0082] The system automatically records the processing logs of each link during operation, including detailed information such as input data characteristics, processing parameters, running time, etc. These log data are used for subsequent system optimization and algorithm improvement. The system supports flexible configuration of detection parameters for different types of parts, and users can adjust the sensitivity and accuracy requirements of each link according to actual needs. The entire implementation focuses on practicality and reliability, ensuring detection accuracy while considering system running efficiency and maintainability.
[0083] Example 2: see Figure 3 The defect feature encoding stage uses a deep convolutional neural network architecture to process the reference deformation region image data. The network input is a standardized 256x256 pixel image block, which has undergone preprocessing procedures including grayscale normalization and local contrast enhancement. The main structure of the network contains multiple residual connection blocks, each of which consists of a convolution layer, a normalization layer, and an activation function. During forward propagation, the network gradually extracts multi-scale features from low to high layers, with shallow networks capturing local features such as edges and textures, and deep networks extracting more semantic global features.
[0084] The channel attention mechanism is integrated into the key level of the network, dynamically weighting the intermediate feature tensor. This mechanism first compresses the spatial features into channel descriptors through global average pooling, and then generates the importance weights of each channel through a two-layer fully connected network. The weighting process uses a channel-by-channel multiplication operation to enhance the response of useful feature channels and suppress the interference of noise or irrelevant features. The weighted feature tensor is averaged in the channel dimension to generate a representative initial reference feature vector. This vector integrates multi-level feature information of the deformation region and serves as a reference for subsequent processing.
[0085] The sliding window mechanism performs local feature analysis on the feature tensor, using a fixed-size square window to slide on the feature map. The window moves using an overlap strategy, maintaining a certain proportion of overlapping areas between adjacent windows to avoid losing boundary features. At each window position, the distribution density index of the internal feature points is calculated, which reflects the degree of local feature aggregation. By comparing with the density reference value of the initial reference feature vector, the consistency of the current window region is judged. When the local density is lower than the reference threshold, it indicates that the feature distribution in this region is abnormal, and the reference feature representation needs to be updated.
[0086] The region growing algorithm starts from the center of the reference deformation region and performs pixel-level diffusion analysis. The algorithm initializes a set of seed points, including the core pixel positions of the deformation region. The diffusion process uses an eight-neighbor connection method, and each iteration step examines the adjacent pixels in the eight directions around the current pixel. The similarity judgment considers multiple dimensions, including gray value difference, texture feature distance, and spatial position relationship. The tolerance threshold uses a dynamic adjustment strategy, setting a relatively loose similarity condition in the initial stage, and gradually increasing the similarity requirement as the diffusion range expands.
[0087] The diffusion termination condition is determined by multiple factors, including reaching the maximum number of iterations, the similarity of adjacent pixels being lower than the threshold, or encountering the image boundary. The farthest boundary position reached by the diffusion is recorded when the termination occurs, and the geometric distance from the center of the deformation region is calculated. Due to fluctuations in the directly measured distance under different image conditions, a statistical-based method is used to process the original distance set. The distance correction process considers factors such as image quality score, lighting condition coefficient, and material characteristic parameters, and obtains a stable defect correlation radius parameter through weighted averaging and curve fitting.
[0088] The network training phase uses a large-scale defect sample dataset for supervised learning. The training process uses a combined loss function, including classification loss and feature reconstruction loss. The optimization algorithm uses the adaptive moment estimation method to dynamically adjust the learning rate. To prevent overfitting, multiple regularization techniques are applied during training, including random dropout of some network connections and batch normalization processing. The network parameter update uses the mini-batch gradient descent strategy to balance training efficiency and convergence stability.
[0089] Multiple levels of quality control measures are implemented during feature encoding. The distribution of feature activation values is monitored in real-time during network forward propagation, and the diagnostic process is automatically triggered when abnormal fluctuations are found. The generation process of channel attention weights introduces sparsity constraints to avoid extreme weight allocation. A minimum effective feature point threshold is set during sliding window analysis to filter local regions with insufficient information. The region growing algorithm implements a boundary check mechanism to prevent the diffusion process from exceeding the reasonable image range.
[0090] Detailed processing logs are recorded during system operation, including feature distribution statistics of each layer of the network, attention weight change trend, and region growing process parameters. These running data are used for offline analysis and algorithm optimization. The system supports dynamic adjustment of network parameters for different types of defect features, and can switch between different pre-trained models according to real-time detection requirements. The feature encoding module uses a distributed computing architecture, supporting multi-GPU parallel processing to meet the high-throughput requirements of industrial detection.
[0091] The algorithm implementation focuses on balancing computational efficiency and accuracy. The network structure design uses efficient operation methods such as depth separable convolution to reduce the number of parameters while maintaining feature extraction capability. The channel attention mechanism adopts a lightweight design to improve feature selection performance without significantly increasing computational burden. The sliding window analysis optimizes memory access patterns and uses cache mechanisms to speed up repeated calculations. The region growing algorithm uses a priority queue to manage pending pixels, improving the execution efficiency of the diffusion process.
[0092] The calculation of defect correlation radius takes into account various complex situations in actual industrial detection. For high-reflective surface materials, an optical correction coefficient is introduced to adjust the distance measurement value. For non-uniform material parts, a segmented calculation strategy is adopted, with different parameter settings applied in different regions. The distance correction algorithm is implemented with robustness processing to ensure the stability of parameter estimation through median filtering and outlier rejection. The final output of the defect correlation radius parameter is accompanied by a confidence score for reference in the subsequent processing stage.
[0093] The system maintenance aspect establishes a regular calibration mechanism to verify the performance stability of the feature encoding module through standard test samples. The network model supports online updates, allowing new defect sample data to be continuously integrated to improve detection capability. The algorithm parameter configuration file uses version management, making it easy to trace modification history and revert to previous stable versions. Multiple checkpoints are set in the processing flow, allowing the calculation to be restarted from intermediate links, improving system fault tolerance.
[0094] The module interface design follows the standardization principle, with uniform and standardized input and output data formats. The image data received by the feature encoding module is accompanied by complete meta-information, including acquisition device parameters, lighting conditions, and material properties. The output feature vector and radius parameter are packaged in a structured data format for easy parsing and use by downstream modules. The system provides detailed application program interface documents to support the integration and invocation of third-party systems.
[0095] Real-time monitoring of system running state, dynamic adjustment of computing resource allocation. When detecting the feature encoding module processing delay increases, automatically start load balancing strategy. System resource usage real-time visualization display, help operation and maintenance personnel master the overall running state. Key performance indicators set early warning threshold, abnormal situation trigger alarm notification. Maintenance tools integrated diagnosis function, can quickly locate performance bottleneck or abnormal reason.
[0096] The experience data accumulated in the implementation process forms a knowledge base, which is used to guide parameter configuration in new scenarios. For different industry part detection needs, the system provides verified parameter templates. When deploying new production lines, migration learning can be used to quickly adapt to local feature distribution. The knowledge base supports continuous updating, constantly enriching defect feature models and optimal processing strategies. System version upgrade adopts gray release mechanism, gradually expanding the application range of new algorithms.
[0097] Example 3: refer to Figure 4 The cross-level feature fusion stage extracts feature representations from different depths of the multi-level detection network. The network architecture contains five main levels, and the feature maps output by each level have different receptive fields and spatial resolutions. The coarse-grained feature map output by the fourth level has a size of 1 / 16 of the input image, contains high-level semantic information but loses fine spatial details. The fine-grained feature map output by the second level has a size of 1 / 4 of the input image, retains more local features but has lower semantic abstraction. The goal of feature fusion is to integrate these two complementary feature representations to form a fused feature representation that combines semantic accuracy and spatial precision.
[0098] The coarse-grained feature map is upscaled in spatial resolution through an upsampling operation, implemented using a learnable deconvolution kernel. The deconvolution kernel size is set to 4x4, the stride is 2, and the padding method is chosen to be symmetric padding. The upsampling process can be represented as:
[0099] ;
[0100] wherein, represents the coarse-grained feature map, is the learnable upsampling kernel parameter, represents the upsampling operation, is the feature map after upsampling. The upscaled feature map is spatially aligned with the fine-grained feature map, and the coordinate offset is fine-tuned through bilinear interpolation.
[0101] The spatial correlation calculation uses a local window matching strategy, which calculates the feature similarity position by position in a local area of 64x64 pixels. The similarity measure uses an improved cosine similarity, which introduces a spatial weight coefficient to balance the importance difference between the center and the edge area. Boundary processing is implemented during the generation of the correlation matrix, and the edge area of the feature map is extended using mirror padding. The initial generated weight matrix has noise interference, which is smoothed through two-dimensional Gaussian filtering, with a Gaussian kernel standard deviation of 1.5 pixel units.
[0102] Normalization maps the weight values to a standard interval, using the maximum and minimum value scaling method. The relative size relationship of the original values is preserved during the weight distribution adjustment process, avoiding changes to the structural relationships between features. The normalized weight map is multiplied by the fine-grained feature map at the channel level, enhancing the response of regions with high correlation to coarse-grained features. The fusion operation uses an element-wise weighted sum method to retain useful information from both levels of features.
[0103] The pyramid fusion architecture starts from the deepest network layer and transmits the fusion results step by step. After each fusion, the channel dimension is adjusted by 1x1 convolution to maintain the compatibility of the feature tensor. The deep feature fusion focuses on semantic information transmission, and the shallow feature fusion focuses on detail supplement. The fusion process adopts a progressive strategy, gradually reducing the feature difference between adjacent layers to avoid discontinuity caused by information jumping.
[0104] Feature map resolution matching uses multi-scale alignment technology to solve the problem of different sampling rates between different levels of features. The alignment process considers the receptive field changes of each layer of the network and adapts to feature position shifts through deformable convolution. When the channel number is inconsistent, use projection connection to unify the feature dimension using linear transformation. Spatial position correction introduces an attention mechanism to dynamically adjust the correspondence of feature points.
[0105] The fusion process implements dynamic quality control to monitor the transmission efficiency of feature information in real time. Set the feature energy threshold to filter useless information in low response areas. The channel selection mechanism automatically adjusts the fusion weight of each channel according to the task requirements to highlight key feature expression. The spatial attention map guides the area focus in the fusion process, enhancing the feature strength in defect dense areas.
[0106] Computing resource allocation uses an adaptive strategy to dynamically adjust the processing precision according to the feature complexity. High information content areas use full-precision calculation, and flat areas appropriately reduce the computational overhead. Memory management uses a block processing mechanism to divide large size feature maps into multiple sub-blocks for separate processing. Parallel computing architecture makes full use of multi-core processor resources to accelerate the fusion process of large-scale feature data.
[0107] Fusion result verification uses a multi-angle evaluation method, including feature consistency check and information integrity test. Consistency check compares the statistical distribution difference between fused features and original features, and controls within a reasonable range. Information integrity test verifies the retention degree of key features to ensure that no important information is lost. Abnormal situations trigger a re-fusion process, and after adjusting the parameters, the fusion operation is executed again.
[0108] The system is implemented using modular design, with each fusion stage encapsulated as an independent processing unit. Units are connected through high-speed data bus to support pipeline operation mode. Intermediate results are cached to dedicated memory to reduce data transfer overhead. Hardware accelerators optimize matrix operation performance to improve the efficiency of large-scale feature fusion.
[0109] Maintenance tools provide complete debugging functions, allowing single-step execution of the fusion process and viewing of intermediate states. Performance analysis tools identify computing hotspots to guide optimization direction. Visualization tools display feature map change processes to help understand fusion effects. Remote diagnosis function supports online analysis of problems by experts to shorten troubleshooting time.
[0110] Version management adopts strict change control processes, and any algorithm update is thoroughly tested and verified. Version rollback mechanisms ensure quick recovery to a stable state. Compatibility tests cover various edge cases to prevent new issues introduced by updates. Documentation updates are synchronized with code changes to maintain the accuracy of system descriptions.
[0111] The user interface provides an intuitive operation experience, allowing real-time adjustment of fusion parameters and observation of effect changes. Parameter adjustment ranges are set with reasonable constraints to prevent invalid input values. The effect preview function helps users quickly understand the impact of parameters. Preset parameter templates simplify configuration work in common scenarios, reducing the use threshold.
[0112] System integration supports multiple industrial communication protocols, allowing easy access to existing production lines. Data interfaces are compatible with industry standard formats, reducing custom development workload. Performance indicators meet real-time processing requirements, maintaining stable frame rates in typical industrial scenarios. Reliability design takes into account continuous operation loads to ensure long-term stability.
[0113] Security mechanisms protect the system from malicious attacks and misoperations. Data input implements strict verification to prevent malicious data injection. The calculation process performs integrity checks to detect abnormal calculation behavior. Access control is based on role-based permission management, limiting unauthorized operations. Audit logs record key operations to support security incident investigations.
[0114] Example 4: Refer to Figure 5 , the dynamic compensation stage extracts quantitative indicators from the fusion defect feature map to establish a complete description system of defect features. Taking the detection of a certain type of engine turbine blade as an example, the system first performs connected region analysis on the fusion feature map. The analysis process uses an 8-neighborhood labeling algorithm to traverse all foreground pixel points and assign region numbers. Each connected region records its minimum bounding rectangle coordinates, pixel area, and perimeter value. Shape irregularity is obtained by calculating the ratio of perimeter square to area, reflecting the complexity of the defect edge. Texture complexity analysis uses the local binary pattern operator to calculate the texture feature entropy value in a 16x16 pixel sub-window.
[0115] The defect quantification list contains multiple dimensional feature parameters, and the following table shows typical defect features in turbine blade detection.
[0116] Table 1: Shows typical defect features in turbine blade detection.
[0117] Defect Number Type Code Area (mm2) Irregularity Texture Entropy Risk Level D-1024 C-3 2.56 1.87 4.32 2 D-1025 B-1 0.93 3.45 5.21 3 D-1026 A-2 5.12 2.13 3.78 1 D-1027 C-1 1.24 4.56 6.02 4 The defect level classification model adopts the gradient boosting decision tree algorithm, and the input features include all the parameters in the quantization list. The model is trained using historical detection samples and their corresponding repair records to establish a mapping relationship between feature parameters and actual risk levels. For the turbine blade application scenario, the model output is divided into five risk levels, and the higher the level value, the higher the defect hazard level. The special nature of different defect types is considered in the classification process, for example, even if the area of a crack defect is small, it may still obtain a high risk level.
[0118] The external interference analysis module monitors the changes in the detection environment in real time. In the case of turbine blade detection, the system collects parameters such as ambient light intensity, color temperature, vibration amplitude, and temperature. The light sensor is installed around the detection station, and the reading is updated every 500 ms. The interference intensity analysis uses multi-dimensional parameter joint evaluation, mapping the environmental parameters to an interference index interval of 0-100. According to the interference index, the compensation strategy strength is automatically selected, and the compensation strength is divided into three levels: mild compensation only adjusts the image enhancement parameters; moderate compensation activates the noise reduction algorithm; severe compensation triggers the system to reacquire data.
[0119] The defect compensation network adopts a multi-threshold adsorption mechanism, and each adsorption threshold corresponds to an environmental interference level. In the case of turbine blade detection, three adsorption thresholds are set: the basic threshold is suitable for standard laboratory environments; the medium threshold is used for regular detection in the workshop; and the relaxed threshold is used to deal with harsh working conditions such as strong vibration and high dust. Threshold parameters are stored in a configurable file, which can be adjusted according to specific application scenarios. When the ambient light parameters change, the system dynamically calculates the matching degree of the current environment and each threshold, and selects the closest threshold configuration.
[0120] The secondary scanning operation is started immediately after the compensation network is adjusted. For defect areas with a risk level ≥ 3, the system uses a multi-angle reinspection strategy to collect supplementary images from different angles. The scanning path planning algorithm automatically calculates the optimal viewing angle sequence based on the defect location to ensure that all key areas are covered. The reinspection images are registered and fused with the original data to update the parameter information in the defect feature map. In the case of turbine blade edge area defect detection, the system specifically adds a 45-degree inclined scanning angle to solve the blind area problem under the conventional normal viewing angle.
[0121] The quality control subsystem monitors the effectiveness of the entire compensation process. After each threshold adjustment, a standard sample test is performed to verify whether the system sensitivity remains within a reasonable range. The detection data version management system records all correction records, including original data, compensation parameters, and correction results. Automatic alarms are triggered in abnormal situations, such as when the risk level of multiple consecutive defect areas changes significantly, indicating possible system bias.
[0122] The maintenance interface provides a visual configuration tool for the compensation network. Users can intuitively view the relative position relationship between the current environmental parameters and the adsorption thresholds, and manually adjust the threshold boundaries. The historical data trend chart shows the change law of the environmental disturbance index, which helps to develop a reasonable threshold strategy. The parameter adjustment effect is displayed through the real-time preview window, and users can directly observe the image difference before and after compensation.
[0123] In the actual deployment of the aircraft engine maintenance workshop, the system shows good environmental adaptability. When the workshop crane operation causes the detection platform vibration to increase, the disturbance index rises from the normal value of 25 to 68, and the system automatically switches to the medium compensation mode. In this mode, the adsorption threshold is relaxed by 15%, and the high-frequency vibration compensation algorithm is activated to maintain stable detection accuracy. During night shift detection, due to the reduction of environmental light to 30% of the standard value, the system activates auxiliary lighting and adjusts exposure parameters to ensure that image quality is not affected.
[0124] The data management system establishes a complete file for each part's detection process. The file contains raw image data, fused feature maps, quantitative lists, environmental parameter logs, and compensation records. The data storage uses a hierarchical structure, with raw data retaining complete information and analysis results saved in multiple precision versions. The retrieval system supports multi-dimensional queries based on defect features, environmental conditions, time ranges, etc., facilitating quality tracing and analysis.
[0125] In terms of hardware configuration, the environmental sensor network includes four optical sensors and two vibration sensors, evenly arranged around the detection area. The data acquisition unit uses an industrial-grade analog-to-digital converter with a sampling precision of 16 bits. The real-time processing unit is equipped with a dedicated image processing accelerator card to ensure that compensation calculation does not introduce additional delay. The mechanical structure design considers dust and oil prevention requirements, and all optical components have self-cleaning functions.
[0126] The user operation process is carefully designed to minimize the need for human intervention. The standard detection process is fully automated, and only requires human confirmation when the system suggests review or when controversial defects occur. The operation interface displays simple and clear status indicator lights, with green indicating normal detection conditions, yellow indicating environmental changes that need attention, and red warning of serious interference requiring human intervention. The voice prompt system provides clear guidance at key operation nodes to avoid operation errors.
[0127] The system calibration establishes a strict specification process. A quick calibration is performed before starting work every day, using a standard defect sample to verify basic functions. A complete calibration is performed every week to check the accuracy of all sensors and algorithm parameters. Calibration data is entered into the management system to form a complete calibration history record. Third-party certification agencies periodically verify the system to ensure that the detection results meet industry standard requirements.
[0128] The abnormal handling scheme covers various possible failure scenarios. When the sensor fails, it automatically switches to the backup sensor or estimation mode. When the computing unit times out and does not respond, it triggers an automatic restart process. Network interruption enables local caching to continue working, and synchronizes data after connection is restored. For the special requirements of turbine blade detection, the system is additionally configured with an emergency detection mode to maintain the minimum defect recognition ability in extreme cases.
[0129] The software architecture adopts a micro-service design, with each functional module deployed independently. The compensation network, as the core service, runs in a dedicated container and enjoys the highest priority in resource allocation. The environmental monitoring service is designed to be lightweight to reduce interference with the main system. The message bus uses a publish / subscribe mode to ensure efficient communication between modules. The service health status is monitored in real time, and abnormal services are automatically restarted or switched to backup instances.
[0130] Performance optimization is carried out for the special needs of industrial scenarios. The data processing pipeline uses zero-copy technology to reduce memory transfer overhead. Real-time computing tasks are allocated to dedicated computing cores to avoid context switching overhead. Memory management uses an object pool mode to reduce the overhead of frequent object creation and destruction. Disk IO uses an asynchronous buffering mechanism to prevent data writing from blocking real-time processing.
[0131] Example 5: The device adaptation layer realizes the standardized access and data processing of multi-source heterogeneous acquisition devices. The core function of this module is to convert the data output by optical acquisition devices of different manufacturers and models into a unified internal representation form while preserving the complete information of the original data. In the industrial camera access scenario, the system first reads the device's physical parameter configuration file, including sensor size, pixel pitch, lens focal length, and other basic information. These parameters are used to build the conversion relationship from the device coordinate system to the world coordinate system, taking into account the installation position and angular offset of the device.
[0132] The coordinate system normalization process uses quaternions to represent rotation parameters, avoiding the gimbal lock problem that may exist with Euler angles. The translation vector records the precise position of the device's optical center in the world coordinate system, with an accuracy of 0.01 millimeters. For scenarios where multiple cameras work together, the system establishes the relative position relationship graph between all devices and optimizes global coordinate consistency through the least squares method. Distortion correction processing supports multiple mathematical models, including radial distortion, tangential distortion, and the combined effect of thin prism distortion. Correction parameters are obtained through the device's calibration process and stored in a centralized parameter database.
[0133] Data format conversion processes adapt to the output characteristics of different devices. For high dynamic range cameras, the system merges multi-exposure image sequences into linear response images. For polarization cameras, component images of specific polarization directions are extracted. Multispectral camera data is decomposed into discrete wavebands, each processed individually before being recombined. The conversion process preserves the bit depth and color accuracy of the original data without introducing additional quantization errors. Metadata information, including acquisition timestamps, environmental parameters, and device states, is fully retained and attached to the converted data.
[0134] Real-time processing pipelines are dynamically optimized for different device performance. For high-frame-rate industrial cameras, zero-copy memory mapping techniques are used to reduce data transfer latency. Large-array camera data is divided into multiple blocks for parallel processing, utilizing multi-core CPUs and GPU acceleration. During processing, device data stream stability is monitored in real time, and when frame rate fluctuations or data packet loss are detected, buffer queue size and timeout parameters are automatically adjusted. Device abnormal states such as excessive temperature or insufficient memory trigger a warning mechanism, prompting the operator to intervene in a timely manner.
[0135] Device characteristic compensation modules eliminate performance differences between different sensors. Dark current noise is suppressed through real-time background subtraction algorithms, and gain inconsistencies are eliminated using flat field correction techniques. Pixel response non-uniformity is dynamically compensated using calibration templates, and compensation coefficients are regularly updated to adapt to sensor aging. Color restoration differences are calibrated using standard color cards, establishing device-specific color feature files. When lighting conditions change, the system automatically adjusts the color space conversion matrix based on white balance parameters.
[0136] Protocol conversion engines support the interoperability of multiple industrial communication standards. GigEVision protocol devices are connected through dedicated network interface cards to ensure the stability of large bandwidth data transmission. USB3Vision devices enable isochronous transmission mode to reduce host CPU load. CameraLink devices configure frame grabber parameters to optimize image acquisition timing. During protocol conversion, data integrity is strictly maintained, and CRC checksum and retransmission mechanisms are used to ensure reliable delivery of critical instructions. Device control commands are translated into standardized function calls, hiding the specific differences of underlying protocols.
[0137] Device management services provide a unified control interface. Common functions such as exposure time, gain parameters, and white balance settings are accessed through standardized APIs. Advanced functions such as trigger mode, ROI region settings, and device firmware updates are also included in unified management. Asynchronous event handling mechanisms monitor device state changes, such as temperature alarms, excessive vibration, and other abnormal conditions. Device discovery services automatically identify available acquisition devices on the network, maintaining device lists and topology relationships. The permission control system restricts the modification rights of critical parameters for different users, preventing system failures caused by misoperation.
[0138] The runtime adaptation layer dynamically adjusts processing parameters. The optimal algorithm configuration, such as demosaicing, noise reduction strength, and sharpening parameters, is automatically selected based on the current device type in use. The allocation of computing resources considers the device data characteristics, with higher resolution images being allocated more memory and processor resources. The cache strategy is optimized for device data stream patterns, with a pre-read mechanism enabled for sequential acquisition devices and a least recently used strategy for random access devices. Energy management adjusts power supply strategies based on device power consumption characteristics, balancing performance and heat dissipation needs.
[0139] The calibration maintenance system ensures long-term measurement accuracy. Regular calibration plans automatically remind operators to perform standard procedures, and calibration data is stored in association with the device serial number. On-site rapid calibration uses portable calibration targets to simplify daily maintenance work. Deep calibration is performed in a laboratory environment, using high-precision optical reference equipment to establish compensation curves. Calibration history records form trend analysis charts to help predict sensor performance degradation. Abnormal calibration results trigger device repair recommendations to avoid using unreliable acquisition data.
[0140] The fault recovery mechanism ensures system reliability. When device connections are interrupted, automatic reinitialization is attempted, preserving current configuration parameters. Data transmission errors enable backup channels or degraded modes to maintain basic functionality. Firmware crashes trigger automatic recovery processes, rolling back to stable versions. In the event of hardware failure, the system automatically switches to a backup device, ensuring uninterrupted detection processes. All fault events are logged with detailed logs, including occurrence time, error codes, and recovery measures, supporting post-mortem analysis.
[0141] Multiple device collaboration enables composite detection capabilities. Master-slave device synchronization ensures temporal consistency in multi-view image acquisition. Data fusion processing integrates the strengths of different sensors, such as combined analysis of high-resolution cameras and infrared thermal imagers. Device workload balancing algorithms dynamically allocate acquisition tasks to avoid overloading a single device. Collaborative calibration techniques establish spatial correspondence between devices, supporting three-dimensional point cloud reconstruction and other advanced applications.
[0142] The user interface hides device complexity. The device selection interface displays available devices and their connection status in an intuitive topological graph. Parameter configuration wizards guide users through necessary setup steps, automatically applying recommended values. Real-time preview windows display acquisition images from each device, supporting side-by-side comparison and overlay display. The device status panel summarizes key indicators such as frame rate, temperature, and memory usage, with abnormal values highlighted. The operation record function tracks all device configuration changes, supporting undo and redo operations.
[0143] The deployment scheme adapts to different scale requirements. Small detection stations use an integrated machine integration scheme, pre-installed with commonly used device drivers and configuration templates. Large production line deployments distribute distributed acquisition nodes, connected to central processing servers through high-speed networks. Mobile detection devices support wireless access, suitable for field operation scenarios. Cloud deployment schemes provide virtual device interfaces, supporting remote data acquisition and analysis. Hybrid deployment mode allows local devices to work with cloud resources, flexible expansion of processing capacity.
[0144] Security mechanisms protect the integrity of the device system. Device communication enables encryption and authentication to prevent unauthorized access. The firmware update package is digitally signed and verified to block malicious code injection. Parameter modification requires secondary confirmation, and key parameter changes are forced to record operator information. Network isolation measures separate acquisition devices from office networks to reduce security risks. Audit logs record all sensitive operations, supporting security event investigation and traceability.
[0145] The knowledge base system accumulates device management experience. Typical configuration schemes are stored in categories, supporting quick retrieval and application. The fault handling case library records common problems and solutions to assist in rapid troubleshooting. Performance optimization suggestions are based on historical data analysis to guide device parameter tuning. Best practice documents detail the use of various devices and points for attention. User community functions allow experience sharing and problem discussion, forming a collaborative learning mechanism.
[0146] The continuous update mechanism keeps the system advanced. The device driver library is updated regularly to support new models of acquisition devices. Algorithm optimization packages are incrementally released to improve the processing effect of specific devices. Security patches are applied in a timely manner to fix known vulnerabilities. Function extension modules are loaded on demand to meet individual needs. The update process supports rollback to ensure system stability is not affected. Update content details help users understand improvements and plan upgrade time reasonably.
[0147] The training system reduces the threshold for use. Device basic courses explain the working principle and operation points of various acquisition devices. Advanced configuration training deeply analyzes the mutual influence and optimization methods between parameters. Fault diagnosis exercises cultivate practical problem solving ability. Certification examination ensures that operators meet job requirements. The online help system integrates context-sensitive prompts to answer operation questions in real time. The simulation training environment allows risk-free practice of various operation scenarios.
[0148] Industry standard compatibility design ensures wide applicability. Data formats support industry standard formats such as DICONDE, TIFF / EP, making data exchange convenient. Measurement result reports contain all elements and formats required by standards. Interface protocols comply with industry specifications such as GenICam to ensure device interoperability. Certification qualifications cover major industry standard requirements, such as NADCAP certification in the aerospace field. Test case libraries include all verification items required by standards to ensure compliance.
[0149] Environmentally adaptive design tackles complex working conditions. Industrial-grade hardware design withstands dust, oil, and electromagnetic interference. Wide-temperature components ensure reliable operation in extreme temperatures. Shock-resistant mounting structures reduce the impact of mechanical vibrations. Redundant power supply design tackles voltage fluctuations. Protective enclosures reach IP54 and above, adapting to harsh industrial environments. Automatic adjustment mechanisms compensate for measurement deviations caused by environmental changes, such as temperature-induced focal length changes.
[0150] Scalable architecture supports future needs. Modular design allows flexible addition of new device types and processing algorithms. Abstract interface layer isolates hardware differences, simplifying new device integration. Configuration management tools support custom device parameter templates and processing flows. Scripting interfaces allow advanced users to develop specialized functions. Plugin mechanisms facilitate third-party functionality extensions, maintaining core system stability. Hardware expansion slots are reserved, supporting future interface standard upgrades.
[0151] Data analysis tools tap into device potential. Long-term tracking of device performance indicators identifies performance degradation trends. Collection data quality assessment generates quantitative reports, guiding device maintenance plans. Usage pattern analysis optimizes device scheduling strategies, improving resource utilization. Energy efficiency monitoring identifies high-energy consumption segments, guiding energy-saving optimization. Predictive maintenance models analyze operational data to provide early warnings of potential failures.
[0152] Cross-platform support enhances deployment flexibility. Windows systems provide high-performance native applications, fully utilizing hardware resources. Linux versions meet the stability needs of industrial control systems. Mobile applications support on-site quick checks and device status monitoring. Web interfaces facilitate remote access and management. Virtual machine images simplify test environment deployment. Containerized packaging ensures consistent running environments, facilitating migration across different platforms.
[0153] Interoperability design enables system integration. Standard industrial bus interfaces support direct communication with PLC control systems. OPCUA servers expose key data and interfaces, enabling integration with MES systems. REST APIs provide programmatic access, supporting customized integration solutions. Data export formats are compatible with mainstream analysis software, such as MATLAB and Python toolchains. SDK development kits provide sample code and detailed documentation, accelerating secondary development processes.
[0154] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting; it is not intended to exclude myriad other embodiments of the present application that other inventors can develop based on the same general inventive concepts embodied by the described embodiments. That is, although the present application is described in terms of particular embodiments and illustrative figures, it should be apparent that the scope of the present application is not limited to these specific embodiments.
[0155] While the embodiments of the application have been shown and described herein, it will be understood by those skilled in the art that many changes, modifications, substitutions and alterations to these embodiments can be made without departing from the principles and spirits of the application, and it is intended that the scope of the application be limited solely by the scope of the appended claims and the equivalents thereof.
Claims
1. A method for automatic detection of defects in parts based on machine vision, characterized in that, The method comprises the following steps: acquiring three-dimensional geometric parameters of a target part, and matching a historical defect sample set in a visual sample library based on the three-dimensional geometric parameters; performing defect type clustering division on the historical defect sample set to generate a plurality of defect category sub-sets; processing the plurality of defect category sub-sets one by one to perform multispectral feature extraction operations, and obtaining a reference detection area and a defect correlation radius parameter corresponding to each defect category; configuring a scanning step of a multi-level detection network layer by using the defect correlation radius parameter, performing layered feature analysis on a target part surface scanning image sequence by the multi-level detection network layer, and generating a plurality of scale defect feature maps; performing cross-level correlation fusion operations on the plurality of scale defect feature maps to generate a fusion defect feature map, and outputting the fusion defect feature map as a final defect detection result; the processing of the plurality of defect category sub-sets one by one to perform multispectral feature extraction operations comprises: extracting a surface deformation image sequence set from each defect category sub-set; identifying local curvature mutation positions in the surface deformation image sequence set to locate a reference deformation region coordinate set; performing texture spectrum analysis operations on the reference deformation region coordinate set to generate a reference defect feature vector set; using the reference defect feature vector set as an index to perform region diffusion calculation in the corresponding surface deformation image sequence set to determine a defect correlation radius parameter of each reference deformation region, and the defect correlation radius parameter is used to represent the pixel span from the defect core region to the edge attenuation region; the determination of the defect correlation radius parameter of each reference deformation region comprises: performing pixel diffusion operations from the reference deformation region coordinate set by using a region growing algorithm; setting a gray similarity tolerance threshold to control the pixel diffusion boundary, and recording the diffusion termination position coordinates; calculating the Euclidean distance between the reference deformation region center coordinates and the diffusion termination position coordinates to generate an original defect correlation radius; performing weighted average calculation on all original defect correlation radii to output a corrected defect correlation radius parameter; the cross-level correlation fusion operations on the plurality of scale defect feature maps comprise: selecting a coarse-grained defect feature map and a fine-grained defect feature map from the multi-level detection network layer output; calculating the spatial correlation matrix of the coarse-grained defect feature map and the fine-grained defect feature map; performing normalization mapping operations on the spatial correlation matrix to generate a feature correlation weight distribution map; performing weighted fusion operations on the fine-grained defect feature map by using the feature correlation weight distribution map to generate a cross-level enhanced feature map; repeating the weighted fusion operations until all scale defect feature maps are fused to generate the fusion defect feature map.
2. The machine vision based automatic detection method of defects in parts as claimed in claim 1 wherein, the locating of the reference deformation region coordinate set comprises: performing real-time processing on the surface deformation image sequence set by using a curvature mutation detection model to output high-curvature fluctuation region coordinates; performing spatial density clustering operations on the high-curvature fluctuation region coordinates to generate candidate reference deformation regions; The gray gradient difference value of the candidate reference deformation region and the adjacent region is calculated, and when the gray gradient difference value exceeds a preset mutation threshold, the candidate reference deformation region is included in the reference deformation region coordinate set.
3. The machine vision based automatic detection method of defects in parts as claimed in claim 2 wherein, The reference defect feature vector set is generated, including: The reference deformation region coordinate set is subjected to feature coding operation by using a defect probability prediction model; The deep feature tensor output by the defect probability prediction model is extracted, and channel attention weighting processing is performed on the deep feature tensor; The initial reference feature vector is generated by calculating the mean value of each channel feature of the weighted feature tensor; Based on the preset sliding window, local feature blocks are iteratively extracted in the deep feature tensor, and when the aggregation density of the local feature blocks is less than the aggregation density of the initial reference feature vector, the initial reference feature vector is taken as an element of the reference defect feature vector set.
4. The machine vision based automatic detection of defects in parts method as claimed in claim 1, wherein, The feature correlation weight distribution map is generated, including: The up-sampling operation is performed on the coarse-grained defect feature map by using a three-dimensional convolution kernel, so that the resolution matches the fine-grained defect feature map; The pixel-by-pixel similarity between the up-sampled feature map and the fine-grained defect feature map is calculated; The initial correlation weight matrix is constructed by using the similarity value, and the initial correlation weight matrix is subjected to Gaussian smoothing processing; The weight matrix after smoothing processing is divided by the maximum weight value to generate the feature correlation weight distribution map.
5. The machine vision based automatic detection of defects in parts method as claimed in claim 1, wherein, Further comprising: The defect distribution parameters in the fusion defect feature map are analyzed to generate a defect quantization list; Based on the defect quantization list, an external field interference strength analysis operation is performed to output a multi-level compensation strategy strength parameter; A defect compensation network containing multi-level adsorption thresholds is constructed; The adsorption threshold of the defect compensation network is dynamically adjusted according to the real-time collected ambient light parameters; The target part is subjected to a secondary scanning operation by using the adjusted defect compensation network, and the fusion defect feature map is updated.
6. The machine vision-based automatic detection method of defects in parts as claimed in claim 5 wherein, The generation of the defect quantization list includes: The number and area of connected regions in the fusion defect feature map are counted; The shape irregularity and texture complexity of each connected region are calculated; The shape irregularity and texture complexity are input into a defect level classification model; A structured list containing defect type codes, area weights, and risk coefficients is output.
7. The machine vision based automatic detection of defects in parts method as claimed in claim 1, wherein, Further comprising: An equipment adaptation layer is constructed to analyze the parameter differences of different optical acquisition equipment; The output features of the multi-level detection network layer are converted into a coordinate coding format supported by the target equipment; The spatial correspondence of cross-level features is maintained during the conversion process; The distortion correction parameters of the target equipment are injected to generate a device-independent defect detection protocol.
Citation Information
Patent Citations
Insulator defect detection method and device for a power transmission line
CN109872323A
Cigarette appearance quality detection method based on three-dimensional and multispectral fusion
CN120563466A