Intelligent detection system and method for surface defects of industrial parts

By coordinating the adjustment of the rotating carrier and the light source camera, and combining the graph convolutional attention model and the adversarial generative network, the problems of uneven lighting and reflection interference on curved parts were solved, achieving high-precision defect detection and verification, and meeting the needs of high-end equipment manufacturing.

CN122089652APending Publication Date: 2026-05-26SUZHOU ZHENGTU INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU ZHENGTU INTELLIGENT TECH CO LTD
Filing Date
2026-01-19
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technologies struggle to adapt to uneven lighting and reflection interference on curved parts, resulting in low defect detection accuracy and a lack of effective result verification mechanisms, making it difficult to meet the stringent requirements of high-end equipment manufacturing.

Method used

By rotating the carrier to drive the full-angle scanning of the parts, the incident light field distribution of the light source array is dynamically evaluated. By combining the graph convolutional attention model and the adversarial generative network, the adaptive adjustment of the light source and camera is achieved, the dispersed defect areas are aggregated, and the classification and grading results are verified.

Benefits of technology

It improves the accuracy and stability of defect detection for curved parts, ensures uniform illumination and image quality, and enhances the completeness of defect identification and the accuracy of defect classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122089652A_ABST
    Figure CN122089652A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial part surface defect intelligent detection system and method, and relates to the technical field of defect detection. When a part is fixed on a rotating carrier for full-angle scanning, a surrounding type industrial camera and a light source array cooperate, a light field is dynamically evaluated by combining part curved surface reflection characteristics, and the light source intensity and direction and camera exposure and gain are adjusted; obtaining a uniform initial image; a global image of the part is reconstructed through brightness standardization, denoising interference suppression, multi-scale texture enhancement, distortion correction, normal expansion and cross-view alignment splicing; the method comprises the following steps: extracting cross-scale features by adopting a graph convolution attention model, constructing a fusion feature vector based on geometric morphology parameters and texture features by virtue of defect regions segmented by regional reconstruction aggregation curved surface reflection to finish classification and grading, generating a simulated graph through an adversarial generative network, comparing and verifying, and outputting a detection report. The defect detection precision and efficiency are effectively improved, and the industrial high-quality detection requirement is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, specifically to an intelligent detection system and method for surface defects of industrial parts. Background Technology

[0002] In the field of industrial parts manufacturing, surface defect detection is a crucial step in ensuring product quality and safety, especially for parts with complex curved surfaces. Existing detection technologies have long faced multiple technical bottlenecks. On the one hand, mainstream machine vision inspection solutions often employ fixed lighting and imaging parameters. However, due to differences in tilt angles, different areas of curved parts exhibit varying incident light reflection paths, easily forming highly reflective areas, low-reflection dark areas, and shadows. This results in unbalanced brightness in the acquired images and loss of surface details, creating potential problems for subsequent defect identification. On the other hand, due to interference from surface reflections, the features of the same defect are often segmented into multiple discrete pixel blocks. Traditional feature extraction algorithms struggle to identify the correlation between these discrete regions, easily leading to missed defects or misclassification as multiple independent defects. Furthermore, existing solutions lack effective verification mechanisms for classification and grading results. The reliability of detection results is significantly affected by environmental fluctuations and differences in part materials, making it difficult to meet the stringent requirements for defect detection accuracy and stability in fields such as high-end equipment manufacturing. Therefore, there is an urgent need for an intelligent detection technology that can adaptively adapt to curved surface characteristics, accurately aggregate defect features, and possess result verification capabilities. Summary of the Invention

[0003] The purpose of this invention is to provide an intelligent detection system and method for surface defects of industrial parts, which achieves accurate defect detection through light field optimization, feature aggregation, and classification and grading verification.

[0004] The technical solution to achieve the objective of this invention is as follows:

[0005] On the one hand, the intelligent detection method for surface defects of industrial parts includes the following steps:

[0006] The rotating carrier drives the full-angle scanning of the parts, dynamically evaluates the incident light field distribution of the light source array based on the reflection characteristics of the curved surface of the parts, executes the adaptive adjustment strategy of the light source and links the dynamic exposure and gain optimization algorithm of the industrial camera to obtain the initial image set.

[0007] Preprocessing is performed on the initial image set, and distortion correction, normal unwrapping and cross-view feature alignment are performed by combining the part surface geometric model. A global image of the part is generated by geometric stitching.

[0008] Based on the global image of the part, a graph convolutional attention model is used to extract cross-scale local features. A region reconstruction algorithm is used to aggregate scattered defect regions to form a set of isomorphic regions. Defect blocks within the isomorphic regions are selected and their coordinates and bounding boxes are determined. The geometric morphological parameters of the defect blocks are calculated and texture features are extracted based on the gray-level co-occurrence matrix. A fused feature vector is constructed and input into a pre-trained defect classification model to identify and classify defect types. A generative adversarial network is used to generate simulated defect images and compare them with real defect block images to generate a detection report.

[0009] Furthermore, when dynamically evaluating the incident light field distribution based on the surface reflection characteristics of a part, the part to be tested is first fixed on a rotating carrier, which rotates at a constant angular velocity along a preset axis. The real-time rotation angle of the part is obtained through a built-in angle sensor. Combined with a preset three-dimensional surface geometric model of the part, the three-dimensional coordinates of each sampling point on the surface of the part at the current angle are extracted. Then, the gradient of the surface equation of the surface model is calculated and normalized to obtain the normal vector of each sampling point. The spatial position of each light source is determined based on the surrounding arrangement parameters of the light source array. The light direction vector from the light source to the sampling point is calculated and normalized. The incident angle is determined by the inverse cosine value of the vector dot product operation. The reflection angle is obtained according to the law of reflection of light, combined with the specular reflection of the part material. The reflection intensity is decomposed into diffuse and specular components using a reflection model, considering the coefficients, diffuse reflection coefficient, and specular index. The diffuse reflection component is determined by the product of the material's diffuse reflection coefficient, the light source intensity, and the cosine of the angle between the ray and the surface. The specular reflection component is calculated by combining the material's specular reflection coefficient, the light source intensity, the specular index, and the power of the specular index of the cosine of the angle between the reflected ray and the viewing direction. These components are then superimposed to obtain the theoretical reflection intensity. The theoretical reflection intensity is then corrected by incorporating the surface undulations, local tilt angles, and inherent surface texture information of the part. Positive deviations are superimposed on raised areas, and negative deviations are superimposed on recessed areas. Surface roughness is used to smooth out the deviation values, ultimately yielding the predicted actual reflection intensity values ​​for each area, using an ideal average... The uniform reflection intensity is set to a preset threshold. Based on the difference between the predicted actual reflection intensity and the threshold, high-reflection, low-reflection, and shadow regions are defined. An interpolation algorithm is then used to complete the intensity values ​​of unsampled regions, generating an incident light field distribution map. When implementing the adaptive light source adjustment strategy, the output intensity adjustment is calculated for different light field regions: intensity is reduced in high-reflection regions and increased in low-reflection and shadow regions. Simultaneously, the light source's output angle is fine-tuned based on the difference between the incident angle and the ideal incident angle to ensure the coaxiality of the optical axis remains within acceptable limits. The adjustment is based on a response period set according to the part's rotation frequency. The reflection intensity is inferred from real-time image brightness acquisition to correct the next adjustment amount, synchronously linking with the industrial camera's dynamic exposure and gain optimization. The algorithm calculates the average brightness by statistically analyzing the mean of the image brightness histogram. It then compares this average brightness with the preset target brightness to calculate the deviation. If the brightness is too bright, the exposure time is shortened and the gain coefficient is reduced; if the brightness is too dark, the exposure time is extended and the gain coefficient is increased. Simultaneously, it ensures that the exposure time does not exceed the motion blur threshold and the gain coefficient does not exceed the noise suppression threshold. The timing prediction model predicts the change in incident light intensity at the next rotation angle and adjusts the exposure and gain in advance. Under high gain, a multi-scale noise filtering algorithm is used to process noise. The industrial camera acquires images at a preset frame rate, and the acquisition time is synchronized with the data from the rotating carrier angle encoder. The images are named according to the rule that includes the part ID, rotation angle, camera number, and timestamp, and are then compiled to form an initial image set.

[0010] Furthermore, when using a graph convolutional attention model to extract features and aggregate defect regions, the entire image of the part is first input into a feature pyramid network. Layered convolution operations are performed using convolutional kernels of different sizes to construct three feature levels: fine-scale, medium-scale, and coarse-scale. Fine-scale features are extracted using small-sized convolutional kernels, focusing on minute texture details on the part's surface. Medium-scale features are extracted using medium-sized convolutional kernels, capturing the main outline information of the defect. Coarse-scale features are extracted using large-sized convolutional kernels, reflecting the global correlation between the defect and the background. Each feature level maintains the spatial dimension ratio with the original image. The feature maps at each scale are divided into feature blocks according to preset rules, determined based on the feature map resolution and defect density statistics. Each feature block serves as an independent node in the graph structure. The node feature vector is generated by performing mean pooling on all pixel features within the feature block. The feature similarity and normalized spatial distance between nodes are calculated to determine the association strength. Feature similarity is calculated using cosine similarity, with a value ranging from -1 to 1; the closer to 1, the more similar the features. Spatial distance is first calculated using the Euclidean distance of the node center coordinates. Normalization is achieved by dividing by the diagonal length of the feature map; a smaller value indicates a closer spatial location. The association strength is obtained by weighted fusion of feature similarity and normalized spatial distance. After performing Softmax normalization on the association strength, a threshold is set to filter the set of neighboring nodes. The threshold is determined by statistical analysis of defect-free samples. An attention mechanism is introduced to dynamically adjust node weights, including neighborhood attention weights and self-attention weights. The neighborhood attention weight is calculated based on the matching degree of the neighborhood features between the neighboring node and the current node after Softmax normalization; the higher the matching degree, the greater the weight. The self-attention weight is determined based on the node's own feature response strength. If the response strength is higher than the average of the neighboring nodes, a high-weight interval is used; otherwise, a low-weight interval is used. The node updates its features by integrating its own and its neighboring information through graph convolution operations. The updated feature vector of the node is the element-wise product of the self-attention weight and its own initial feature vector, plus the sum of the element-wise products of the neighborhood attention weights of all neighboring nodes and their respective initial feature vectors. This aggregates the scattered defective regions affected by surface reflection interference, forming a semantically consistent and structurally complete isomorphic region set.

[0011] Furthermore, when using adversarial generative networks to verify the classification and grading results, the process includes: selecting a defect-free image that matches the model and specifications of the currently inspected part; if no matching image is available, generating a virtual defect-free image using the three-dimensional surface geometry model of the part; inputting the defect type, grade, and defect block coordinate information into the adversarial generative network, where the generator produces a simulated defect image based on the defect characteristics, and the discriminator evaluates the realism and provides feedback for adjustment; and calculating the similarity between the simulated defect image and the real defect block image from both structural and feature similarity perspectives to verify the accuracy of the classification and grading results.

[0012] Furthermore, transposed convolution is used to perform upsampling on the fine-scale feature maps, and bilinear interpolation is used to perform upsampling on the medium-scale feature maps, so that the resolution of the two-scale feature maps is similar to that of the coarse-scale feature maps. Figure 1 The three-level scale feature maps are spliced ​​according to the channel dimension to form a multi-channel multi-channel fusion feature map. The multi-channel fusion feature map is reduced in channel dimension by using convolution kernels to achieve semantic fusion of features at different scales and output cross-scale local feature maps.

[0013] Furthermore, when aggregating scattered defect regions to form isomorphic regions, suspected defective local regions are first screened based on the feature response intensity of feature blocks in the cross-scale local feature map. The feature response intensity is represented by the square root of the sum of the squares of the elements of each dimension of the feature vector corresponding to the feature block. Feature blocks with intensity values ​​higher than a preset threshold are identified as suspected defective local regions. The feature vector of each suspected defective local region is generated by performing mean calculation on all pixel features within the feature block according to the channel dimension. The feature similarity and spatial correlation between each suspected defective local region are calculated. The feature similarity is quantified based on the cosine distance between the feature vectors of the two regions. The spatial correlation is obtained by weighted fusion of coordinate overlap and positional continuity. The coordinate overlap is the ratio of the intersection area to the union area of ​​the two regions, and the positional continuity is the ratio of the Euclidean distance between the center coordinates of the two regions to the average size of the two regions. Feature similarity thresholds and spatial correlation thresholds are set to screen out scattered regions representing the same defect to be aggregated. The feature integrity of each scattered region is quantified by information entropy and the fusion weight is determined. The feature vectors of each scattered region are first standardized, and then calculated... The information entropy is obtained by summing the negative values ​​of the products of each element of the feature vector with the natural logarithm. The higher the information entropy, the stronger the feature integrity. The fusion weight is the ratio of the information entropy of a single scattered region to the sum of the information entropies of all scattered regions to be aggregated. To ensure weight normalization, the feature vectors of the scattered regions are weighted and fused. That is, after performing element-wise multiplication on the feature vector of each scattered region and the corresponding fusion weight, all results are summed to obtain the fused feature vector. The spatial coordinates of the scattered regions are merged. The spatial position of each scattered region is represented by the coordinates of the upper left and lower right corners of the feature blocks. The minimum x-coordinate and minimum y-coordinate of the upper left corner coordinates of all scattered regions are selected as the upper left corner coordinates of the merged continuous region. The maximum x-coordinate and maximum y-coordinate of the lower right corner coordinates of all scattered regions are selected as the lower right corner coordinates of the merged continuous region, forming the minimum continuous spatial range that can completely cover all scattered regions. Isomorphic regions are constructed. Noise filtering is performed on all generated isomorphic regions. A minimum defect area threshold is preset, and pseudo-defect regions with a physical area smaller than the threshold are removed, finally forming a set of isomorphic regions.

[0014] Furthermore, when extracting the texture features of the defect block, the pixel grayscale matrix of the defect block is first obtained. Based on this matrix, a grayscale co-occurrence matrix is ​​constructed. The frequency of occurrence of pixel pairs of different grayscale levels is statistically analyzed in a preset horizontal, vertical, and two diagonal orthogonal directions, combined with a dynamic step size. The dynamic step size is flexibly set according to the size of the defect block. The frequency matrix obtained by the statistics is normalized so that the sum of all elements in the matrix is ​​one. Four types of core texture features are extracted from the normalized grayscale co-occurrence matrix, namely contrast, correlation, energy, and entropy. Contrast is the weighted sum of the squares of the grayscale differences of the matrix elements, correlation is the covariance of the matrix elements and the mean of the grayscale values ​​of the rows and columns, energy is the sum of the squares of the matrix elements, and entropy is the information entropy of the matrix elements. The four types of extracted texture features are integrated to form a set of texture features of the defect block.

[0015] Furthermore, in the process of generating a full-domain image of the part through geometric stitching, a scale-invariant feature transformation algorithm is used to extract feature points from adjacent viewpoint images. Reliable matching pairs are selected by the nearest neighbor and second nearest neighbor ratio method. The optimal transformation matrix is ​​fitted by a random sampling consensus algorithm. Pixels in the overlapping areas of the images are weighted inversely proportional to their distance and then weighted and averaged. All fused images are stitched together according to the coordinates of the part parameter domain. Texture continuity is verified to generate a full-domain image of the part.

[0016] Furthermore, during preprocessing of the initial image set, brightness standardization is first performed. Brightness features of all images in the initial image set are extracted, and the grayscale mean and standard deviation of each image are calculated. The grayscale mean and standard deviation of each image are multiplied by the surface area of ​​the corresponding covered part to obtain weighted brightness parameters. After summing all weighted brightness parameters, the global brightness mean and global brightness standard deviation are calculated and used as the standardization benchmark. For a single image, the grayscale value of each pixel is first subtracted from the image's own grayscale mean, then divided by the image's own grayscale standard deviation to obtain a standardized median value. This median value is then multiplied by the global brightness standard deviation and added to the global brightness mean to obtain the corrected grayscale value. A standardized image with consistent brightness distribution is output. A noise density detection algorithm identifies the noise type and proportion in the image. Based on the noise proportion, the neighborhood size for median filtering is dynamically set. Median filtering is performed on the image, replacing the original pixel value with the median grayscale value within the neighborhood of each pixel, removing salt-and-pepper noise, and... The image is processed using bilateral filtering. A spatial weight factor is constructed based on the Euclidean distance between pixels, and a gray-level similarity weight factor is constructed based on the pixel gray-level difference. The product of the two is used as the weight of the filter kernel. The decay rate of the spatial weight factor is adjusted according to the local texture complexity of the image. The more complex the texture, the faster the decay rate. While eliminating Gaussian noise, the surface texture details of the parts are preserved, and a denoised image is output. The denoised image is decomposed into multiple scales through Gaussian pyramid. Inter-layer downsampling is achieved through Gaussian convolution to obtain a set of sub-images. The Laplacian operator is applied to each sub-image to extract high-frequency texture components. The texture energy of the high-frequency components of each sub-image is calculated. For regions with energy below a preset threshold, the gain coefficient is increased inversely proportional to the energy difference. For regions with energy above the threshold, the gain coefficient is kept at one. The enhanced high-frequency components are fused with the low-frequency components of the corresponding scale at the pixel level. Then, the image is reconstructed through inverse Gaussian pyramid transformation to obtain a texture-enhanced image. The texture-enhanced images from all perspectives together constitute the preprocessed image set.

[0017] Secondly, the intelligent detection system for surface defects of industrial parts includes an image acquisition module, a preprocessing module, and a defect detection module.

[0018] The image acquisition module drives the part to scan the entire angle by rotating the carrier, dynamically evaluates the incident light field distribution of the light source array based on the reflection characteristics of the curved surface of the part, executes the adaptive adjustment strategy of the light source and links the dynamic exposure and gain optimization algorithm of the industrial camera to obtain the initial image set.

[0019] The preprocessing module performs preprocessing on the initial image set, combines the part surface geometric model to perform distortion correction, normal unfolding and cross-view feature alignment, and generates a global image of the part through geometric stitching.

[0020] The defect detection module extracts cross-scale local features based on the global image of the part using a graph convolutional attention model. It aggregates scattered defect regions into a set of isomorphic regions through a region reconstruction algorithm, filters defect blocks within the isomorphic regions and determines their coordinates and bounding boxes, calculates the geometric morphology parameters of the defect blocks and extracts texture features based on the gray-level co-occurrence matrix, constructs a fused feature vector input to a pre-trained defect classification model for defect type identification and level classification, and uses an adversarial generative network to generate simulated defect images and compare them with real defect block images to generate a detection report.

[0021] Compared with the prior art, the significant advantages of this invention are:

[0022] 1. An adaptive adjustment strategy that coordinates the light source and camera is adopted to dynamically evaluate the light field distribution and optimize the light source parameters, camera exposure, and gain, thereby solving the problem of uneven imaging of curved parts.

[0023] 2. By combining graph convolutional attention model and region reconstruction algorithm, scattered defect regions affected by surface reflection interference are aggregated, and then the classification and grading results are verified by adversarial generative network, which greatly improves the completeness of defect identification and the accuracy of defect grading. Attached Figure Description

[0024] Figure 1 Flowchart of an intelligent detection method for surface defects in industrial parts;

[0025] Figure 2 This is a flowchart of the image acquisition and light field adjustment process in this invention;

[0026] Figure 3 This is a flowchart of the multi-scale feature fusion and region reconstruction process in this invention;

[0027] Figure 4 This is a flowchart of the defect detection and verification process in this invention. Detailed Implementation

[0028] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0029] Example 1

[0030] like Figure 1 As shown, this invention discloses an intelligent detection method for surface defects in industrial parts, comprising the following steps:

[0031] The imaging link is controlled in a coordinated manner by an industrial camera and light source array arranged in a ring. During the full-angle scanning of the part driven by the rotating carrier, the incident light field distribution is dynamically evaluated based on the reflection characteristics of the part's curved surface. The light source adaptive adjustment strategy is executed to adjust the output intensity and direction of the light source in real time. At the same time, the dynamic exposure parameters and gain optimization algorithm of the industrial camera are synchronized to enable the imaging system to maintain stable brightness and balanced contrast under different viewing angles, thereby obtaining a uniform illumination image covering the detection area and forming an initial image set.

[0032] The initial image set is subjected to unified preprocessing, including brightness normalization, noise reduction and suppression and multi-scale texture enhancement, in order to reduce the illumination difference and enhance the surface details. On this basis, the multi-view images are subjected to distortion correction, normal unwrapping and cross-view feature alignment in combination with the preset part surface geometry model. The continuous texture distribution of the part surface is reconstructed through the geometric stitching strategy to generate the full-domain image of the part.

[0033] Based on the global image of the part, a graph convolutional attention model is used to extract cross-scale local features. A region reconstruction algorithm is used to aggregate features of local regions that are segmented into different pixel blocks but represent the same defect due to surface reflection interference, forming semantically consistent and structurally complete isomorphic regions. All isomorphic regions are integrated into an isomorphic region set, so that each isomorphic region can fully express the corresponding defect. An adaptive edge extraction algorithm is used to filter defect blocks within the isomorphic regions and determine their coordinates and bounding boxes. Then, geometric morphological parameters are calculated for each defect block and texture features are extracted based on the gray-level co-occurrence matrix. A fused feature vector containing geometric and texture features is constructed. The fused feature vector is input into a pre-trained defect classification model for defect type identification and level classification. An adversarial generative network is used to generate corresponding defect simulation images on defect-free images based on defect type, level and defect block coordinates. The similarity of the defect simulation images and real defect block images is compared to verify the accuracy of classification and level, and a detection report is generated.

[0034] Furthermore, the industrial camera is a field array camera adapted to the inspection requirements, which is uniformly arranged around the circumference of the rotating carrier. The optical axis of the camera is at a preset reasonable angle with the rotation center axis of the part. The fields of view of adjacent cameras maintain a preset overlap rate to eliminate blind spots in inspection and reserve a matching area for image stitching features. The light source array adopts adjustable LED light source, which is coaxially arranged in a one-to-one correspondence with the industrial camera. The optical axis of each camera is completely coincident with the light output axis of the corresponding light source. The light output angle of the light source is continuously adjustable and the spectral range covers the visible light band.

[0035] like Figure 2 As shown, further, by working in conjunction with an industrial camera and a light source array, exposure and gain are synchronously controlled during the rotation of the part to equalize the acquisition and detection area, thereby obtaining an initial image set, including the following steps:

[0036] The part to be inspected is fixed on a rotating carrier, which rotates along a preset rotation axis at a constant angular velocity. Using a pre-set rotation angle step and scanning frequency, the part is continuously scanned across its entire surface. During this full-angle scan, the incident light field distribution at each rotation angle is dynamically evaluated based on a pre-set 3D surface geometry model and the known material reflection characteristics of the part. First, the rotation angle of the part is acquired using a built-in angle sensor. Combined with the pre-set 3D surface geometry model, the 3D coordinates and normal vectors of each sampling point on the part surface at that angle are extracted. The normal vector is obtained by normalizing the gradient of the surface equation of the surface model. Second, the spatial position of each light source in the light source array is determined based on pre-set surround arrangement parameters. The ray direction vector from each light source to the sampling point on the part surface is calculated. This vector is obtained by normalizing the direction from the sampling point coordinates to the light source coordinates. Finally, the incident angle is calculated using a vector dot product operation, where the incident angle is the sum of the ray direction vector and the normal vector. The angle between the normal vectors of the sampling points is determined by the inverse cosine of the dot product of the two vectors. According to the law of reflection, the reflection angle is equal in magnitude to the incident angle and lies on opposite sides of the normal. Therefore, the reflection angle is determined by combining the incident angle value with directional symmetry. The reflective properties of the part material include specular reflection coefficient, diffuse reflection coefficient, and specular index. Based on these properties, a reflection model is used to decompose the reflection intensity into specular reflection and diffuse reflection components. The diffuse reflection component is determined by the product of the material's diffuse reflection coefficient, the light source intensity, and the cosine of the angle between the ray and the surface, where the angle between the ray and the surface is the complementary angle of the incident angle. The specular reflection component is determined by the material's specular reflection coefficient, the light source intensity, the specular index, and the power of the specular index of the cosine of the angle between the reflected ray and the viewing direction. The viewing direction is the direction of the camera's optical axis. Thus, the theoretical reflection intensity can be obtained, which is the superposition value of the diffuse reflection and specular reflection components. By integrating the undulation shape of the part's surface, local tilt angles, and inherent surface texture information, the theoretical reflection intensity is corrected. The undulation shape is determined by the three-dimensional coordinates of the sampling points. Axis difference quantization, where the local tilt angle is the angle between the surface tangent and the horizontal plane, determined by the normal vector and... The angle between the axes is derived, and the inherent surface texture information is characterized by the roughness parameters of the preset texture model. For raised areas, due to the light converging effect, a positive deviation is superimposed on the theoretical reflection intensity. For recessed areas, due to the light blocking effect, a negative deviation is superimposed on the theoretical reflection intensity. Combining the scattering effect of surface roughness on reflection, the deviation value is smoothed and corrected. The higher the roughness, the smaller the deviation fluctuation. Finally, the actual reflection intensity prediction value of each area is obtained, and the ideal uniform reflection intensity is taken as the preset threshold. The difference between the actual reflection intensity prediction value and this threshold is the local reflection intensity deviation. Based on this, high reflection areas, low reflection areas, and shadow areas are divided. When the local reflection intensity deviation is positive and the positive value is greater than the preset deviation threshold, the deviation is considered positive. When the value is negative, the corresponding area is a high-reflection area. When the absolute value of the local reflection intensity deviation is negative, and the absolute value of the negative value is greater than the preset deviation threshold and less than the preset shadow determination threshold, the corresponding area is a low-reflection area. When the local reflection intensity deviation is negative, and the absolute value of the negative value is greater than or equal to the preset shadow determination threshold, the corresponding area is a shadow area. The deviation threshold is used to distinguish whether the reflection intensity deviates from the ideal range, and the shadow determination threshold is used to distinguish the boundary between low reflection and shadow. Both are preset based on the needs of part surface detection. The actual reflection intensity prediction value of each sampling point is mapped to a two-dimensional pixel grid according to its spatial coordinates. The intensity value of the unsampled area is completed by the interpolation algorithm to generate the incident light field distribution map corresponding to the current rotation angle.

[0037] Based on the incident light field distribution map, the adaptive adjustment strategy of the light source array is initiated. First, the adjustment amount of the light source output intensity is calculated. For high-reflection areas in the incident light field distribution map, the adjustment amount is a negative correlation function between the current light source intensity and the deviation of the local reflection intensity. The larger the deviation, the smaller the adjustment amount; that is, if the reflection is too strong, the output intensity needs to be reduced to ensure that the reflection intensity in this area returns to the ideal range after adjustment. For low-reflection areas and shadow areas, the adjustment amount is a positive correlation function between the current light source intensity and the deviation of the local reflection intensity. The larger the absolute value of the deviation, the smaller the adjustment amount. The larger the reflection intensity, the less reflection there is, requiring an increase in output intensity to ensure the reflection intensity in this area reaches the lower limit of the effective sensing range of the industrial camera. Based on the angle deviation between the surface normal vector and the light direction vector, the adjustment amount of the light source's emission angle is calculated. The angle deviation is the difference between the incident angle and the ideal incident angle. If the current incident angle is greater than the ideal incident angle (i.e., the light is too steep), the light source angle is slightly adjusted towards the normal direction to reduce the incident angle. If the current incident angle is less than the ideal incident angle (i.e., the light is too gentle), the light source angle is slightly adjusted away from the normal direction to increase the incident angle. To optimize illumination uniformity, the incident angle is brought close to the ideal value. The ideal incident angle is determined by calculating the proportion of specular reflection and diffuse reflection of the material based on the material's reflectivity parameters, thereby determining the main propagation direction of the reflected light. The light-sensing performance parameters of the industrial camera are used to determine the minimum to maximum light intensity range that the camera can clearly image. Finally, combined with the imaging target where the reflected light intensity stably falls in the middle of the light-sensing dynamic range, the corresponding incident angle values ​​are determined for different tilt angles of the curved surface of the part through pre-experiments, forming an ideal incident angle dataset covering the entire surface of the part. This dataset is associated with and stored in conjunction with the preset three-dimensional curved surface geometric model of the part. During the adjustment process, the angle between the optical axis of the light source and the camera is monitored in real time to ensure that the coaxial relationship is always kept within the preset allowable range. The response cycle of the light source adjustment is set based on the rotation frequency of the part. Within each cycle, a closed loop of light field evaluation, adjustment amount calculation, output execution, and effect feedback is completed. The current reflection intensity is inferred from the image brightness acquired in real time by the industrial camera, and the adjustment amount is corrected after comparison with the target value to ensure the illumination stability of the field of view at each angle.

[0038] While the light source adaptively adjusts, the industrial camera initiates dynamic parameter optimization. First, brightness deviation calculation and exposure gain adjustment are performed. The industrial camera acquires the current frame image in real time, analyzes the pixel grayscale distribution of its brightness histogram, and calculates the mean of the histogram, i.e., the average brightness of the current image. The difference between the current average brightness and the preset target brightness is obtained as the brightness deviation value. The preset target brightness is set based on the surface material characteristics of the part. If the deviation value is positive (too bright), the exposure time is shortened and the gain coefficient is reduced proportionally. If the deviation value is negative (too dark), the exposure time is extended and the gain coefficient is increased proportionally. The gain coefficient is a parameter used by the industrial camera to adjust the amplification of the image signal. Its initial value is based on the reflectivity of the part surface material and the camera's photosensitivity, ensuring that when there is no brightness deviation, the image signal avoids both noise surges caused by over-amplification and detail loss caused by under-amplification. During the adjustment process, it is ensured that the exposure time does not exceed the motion blur threshold caused by part rotation. The motion blur threshold is derived from the rotation angular velocity and pixel size, while ensuring that the gain coefficient does not exceed the noise suppression threshold. Based on historical multi-frame light field distribution data and the incident light intensity at the corresponding moment, a temporal prediction model is trained. Taking the rotation angle as input, the trend function of the incident light intensity changing with the angle is obtained through polynomial fitting. This trend function is used to predict the change in incident light intensity at the next rotation angle. The next rotation angle is determined according to a preset angular step size. The change is converted into a look-ahead adjustment amount for exposure time and gain coefficient. When the change is positive, the exposure time and gain coefficient are reduced in advance. When the change is negative, the exposure time and gain coefficient are increased in advance to avoid image ghosting or exposure inconsistency caused by parameter adjustment delay. For image noise under high gain, a multi-scale noise filtering algorithm is adopted. First, Gaussian filtering is used to smooth high-frequency noise, and then bilateral filtering is used to preserve edge details. The filtering intensity is dynamically adjusted according to the gain coefficient. The higher the gain coefficient, the greater the filtering intensity, ultimately improving the clarity of surface micro-defects.

[0039] With the light source and industrial camera parameters optimized in tandem, the industrial camera continuously acquires images at a preset frame rate. The acquisition time of each frame is synchronized with the angle encoder data of the rotating carrier, ensuring that the image corresponds one-to-one with the rotation angle of the part. The acquired images are named according to preset rules, which include part ID, rotation angle, camera number, and timestamp. The rotation angle is recorded in real time by the encoder, and the timestamp ensures the spatiotemporal correlation of multi-view images. All images are aggregated to form an initial image set covering the entire surface of the part. This image set has the characteristics of uniform illumination, stable brightness, and balanced contrast due to the tandem optimization of the light field and parameters.

[0040] Furthermore, the initial image set undergoes unified preprocessing, and multi-view images are corrected, aligned, and geometrically stitched based on the part's surface geometry model. Finally, a global image of the part is reconstructed, including the following steps:

[0041] Brightness features are extracted from all images in the initial image set. The grayscale mean and standard deviation of each image are calculated. The grayscale mean and standard deviation of each image are multiplied by the surface area of ​​the part covered by the corresponding image to obtain weighted brightness parameters. After summing the weighted brightness parameters of all images, the global brightness mean and global brightness standard deviation are calculated. These are used as the brightness standardization benchmark. Based on the brightness standardization benchmark, standardization calculation is performed on a single image. First, the grayscale value of each pixel in the image is subtracted from the grayscale mean of that image, and then divided by the grayscale standard deviation of that image to obtain the standardized intermediate value. Then, the standardized median value is multiplied by the global brightness standard deviation and added to the global brightness mean to obtain the corrected grayscale value of the pixel. After all pixels are corrected, a standardized image with a consistent brightness distribution is output. Using the standardized image as input, a noise density detection algorithm identifies the noise type and noise ratio in the image. Based on the noise ratio, the neighborhood size of the median filter is dynamically set, and median filtering is performed on the image. The median grayscale value in the neighborhood of each pixel is taken to replace the original pixel value, completing the removal of salt-and-pepper noise. The median-filtered image is then input into a bilateral filtering module, using the Euclidean distance between pixels... A spatial weighting factor is constructed, and a gray-level similarity weighting factor is constructed based on the pixel gray-level difference. The product of the spatial weighting factor and the gray-level similarity weighting factor is used as the filter kernel weight to smooth the image. The decay rate of the spatial weighting factor is adjusted according to the local texture complexity of the image. The more complex the texture, the faster the decay rate, ensuring that the surface texture details of the parts are preserved while eliminating Gaussian noise. The output is a denoised image. Using the denoised image as input, a Gaussian pyramid is constructed to decompose the image at multiple scales. Inter-layer downsampling is achieved through Gaussian convolution to obtain a set of sub-images. The Laplacian operator is applied to each sub-image to extract high-frequency texture components. The texture energy of the high-frequency components of each sub-image is calculated. For regions with texture energy below a preset threshold, the gain coefficient is increased inversely proportional to the energy difference to achieve adaptive amplification of the high-frequency components. For regions with texture energy above or equal to the threshold, the gain coefficient is kept at 1 to avoid over-enhancement and noise recurrence. The enhanced high-frequency components are fused with the low-frequency components of the corresponding scale at the pixel level, and the image is reconstructed through inverse Gaussian pyramid transformation to obtain a texture-enhanced image. The texture-enhanced images from all perspectives together constitute the preprocessed image set.

[0042] Using a preprocessed image set, a pre-defined 3D surface geometry model of the part, and industrial camera calibration parameters as input, the system outputs distortion-free images through camera distortion correction and surface geometry adaptation. It calls the calibration parameter file of the industrial camera to extract intrinsic and extrinsic parameters. The intrinsic parameters include focal length, principal point coordinates, radial distortion coefficient, and tangential distortion coefficient. The extrinsic parameters include the camera's position and orientation in the world coordinate system. Based on the radial and tangential distortion models, coordinate correction formulas are constructed. For each pixel in the preprocessed image, its ideal coordinates before distortion are calculated using the correction formulas. The radial distortion correction term incorporates the square and fourth power factors of the distance from the pixel to the principal point, and the tangential distortion correction term incorporates the cross factor of the pixel's horizontal and vertical coordinates, mapping the distorted pixel coordinates to ideal coordinates. The distortion correction caused by the camera optical system outputs a preliminary corrected image. This preliminary corrected image is then associated with a preset 3D curved surface geometric model of the part. Using the angle encoder data of the rotating carrier, the 3D coordinates of the sampling point on the part surface corresponding to each pixel in the image are determined. The surface normal vector and curvature value of the sampling point are calculated. Based on the principle of perspective projection, a mapping relationship between the 3D coordinates of the sampling point and the image pixel coordinates is established. For perspective distortion caused by image stretching due to surface protrusions and image compression due to surface depressions, the corrected coordinates of the pixels are calculated through coordinate inverse projection. The surface sampling points are projected onto the virtual imaging plane along their normal direction, so that the pixel spacing after projection is consistent with the actual arc length of the part surface. This completes the distortion correction caused by the curved surface shape and outputs a distortion-free image.

[0043] Using a distortion-free image and a 3D surface geometric model of a part as input, the surface image is unfolded into a planar image through surface parameterization and planar mapping, providing a unified benchmark for cross-view stitching. The isoparametric method is used to parameterize the 3D surface geometric model of the part, defining a two-dimensional parameter domain. ,in, The range of values ​​corresponding to the rotation direction of the part is linearly related to the rotation angle of the part. The value range corresponding to the axial direction of the part is linearly related to the axial length of the part, ensuring that each sampling point on the surface model uniquely corresponds to a parameter within the parameter domain. Coordinates, and the ratio of the distance between any two points in the parameter domain to the actual arc length of the surface remains constant, establishing the three-dimensional coordinates of the sampling points and... The parameter mapping table is used to extract the sampling points on the part surface corresponding to each pixel in the distortion-free image. Parameters, mapping them to two-dimensional coordinates of the planar unfolded diagram. , Coordinates are determined by parameters Multiply by the expansion scaling factor to obtain, Coordinates are determined by parameters Multiply by the unfolding scale factor to obtain the result, where the unfolding scale factor is determined based on the maximum axial length and maximum circumferential length of the part, ensuring that the unfolded planar image is free from stretching or compression distortion, according to planar coordinates. The pixels are rearranged to obtain a single-view planar unfolded image. The planar unfolded images from all views together constitute an unfolded image set.

[0044] Using an expanded image set as input, image spatial alignment is achieved by leveraging the overlapping regions of adjacent viewpoints through feature matching and transformation matrix fitting. For the planar expanded images from adjacent viewpoints, a scale-invariant feature transformation algorithm is used to extract feature points. Each feature point is characterized by a high-dimensional descriptor, the dimension of which is set according to the representation requirements of the local texture features. Feature point selection must meet two conditions: high contrast and low edge response. The high contrast condition is achieved by determining whether the pixel grayscale gradient value is greater than a preset threshold. The low edge response condition is used to avoid the erroneous extraction of noise points. The Euclidean distance between the feature point descriptors of the images to be matched is calculated, and the nearest neighbor and second nearest neighbor ratios are used. The matching pair is selected by value method. For each feature point, if the ratio of its nearest neighbor distance to its second nearest neighbor distance is less than a preset threshold, which is set based on the feature matching accuracy requirements, it is determined to be a reliable matching pair. After removing false matching pairs, the feature matching result is output. The coordinates of the reliable matching pairs are input into the random sampling consensus algorithm. The rigid transformation matrix is ​​fitted to the subset of sampled feature points iteratively. After each iteration, the reprojection error of the matrix on the remaining feature points is calculated. The matrix with the smallest reprojection error is retained as the optimal transformation matrix. All pixel coordinates of one image are substituted into the optimal transformation matrix to calculate its alignment coordinates in the coordinate system of the other image. The spatial alignment of adjacent images is completed, and the aligned image set is output.

[0045] Using an aligned image set as input, a global image covering the entire surface of the part is generated through overlapping region fusion and global integration. The overlapping regions of adjacent aligned images are identified. For each pixel within the overlapping region, its distance to the edges of the two images is calculated. A weighting coefficient is used, where the closer a pixel is to the edge of image A, the smaller the weight of image A and the larger the weight of image B; conversely, the farther apart the pixels are, the larger the weight of image A and the smaller the weight of image B. The fused pixel grayscale value is calculated using a weighted average method. Specifically, the fused pixel grayscale value is equal to the grayscale value of the corresponding pixel in image A and the weight of the pixel in image A. The product of the weights is added to the product of the grayscale value of the corresponding pixel in image B and the weight of image B. The grayscale values ​​of the corresponding pixels in image A and image B are taken from the grayscale data of pixels at the same spatial location within the overlapping area of ​​adjacent aligned images. The weights of image A and image B are coefficients determined based on pixel position, and their sum is 1. The specific value is determined by the distance from the pixel to the edge of the corresponding image; the closer the distance, the smaller the weight of the corresponding image. This method achieves a smooth transition in the overlapping area, eliminates splicing gaps, and outputs a fused image set. All fused images are then sorted according to the rotation angle of the parts. The parameter domain coordinates are stitched together to form a preliminary global image of the part. The texture continuity of the preliminary global image is checked by calculating the variance of the gray-level difference between adjacent pixels. If the variance is greater than a preset threshold, it is determined to be a texture breakage area. For the texture breakage area, the corresponding aligned image is backtracked, and the transformation matrix parameters and fusion weights are re-optimized until the variance of the gray-level difference in all areas is less than the preset threshold. Finally, a textured and geometrically complete global image of the part is output.

[0046] like Figure 3 As shown, further, based on the global image of the part, a graph convolutional attention model is used to extract cross-scale local features, and a region reconstruction algorithm is used to aggregate the defect regions segmented by surface reflection to form a semantically consistent isomorphic region set, including the following steps:

[0047] The entire image of the part is input into a pre-defined feature pyramid network. Layered convolution operations are performed using convolution kernels of different sizes to construct three feature levels: fine-scale, medium-scale, and coarse-scale. Fine-scale features are extracted using small-sized convolution kernels to focus on the minute texture details on the part surface. Medium-scale features are extracted using medium-sized convolution kernels to capture the outline information of the defect. Coarse-scale features are extracted using large-sized convolution kernels to reflect the global relationship between the defect and the background. Each feature level maintains the spatial dimension ratio with the original image to ensure accurate correspondence of feature positions.

[0048] For each feature level, the feature map is divided into several feature blocks according to a preset spatial partitioning rule. The partitioning rule is determined based on the feature map resolution and defect density statistics to ensure that each feature block can fully carry local defect information without containing too much redundant background. Each feature block is an independent node in the graph structure. The node feature vector is generated by performing mean pooling on all pixel features within the feature block, covering the channel dimension information and spatial attributes of the feature block. Feature similarity is calculated based on the cosine similarity of the node feature vectors, which reflects the consistency of texture, grayscale, and other features of the corresponding regions of two nodes. The calculation formula is as follows:

[0049] ,

[0050] in, For nodes With nodes Feature similarity, with values ​​ranging from 1 to 10. , They are nodes With nodes The feature vector is generated by performing mean pooling on all pixel features within the corresponding feature block. Its vector dimension is consistent with the number of channels in the feature level, and it contains the channel dimension information and spatial attributes of the feature block. The dot product of two eigenvectors represents the fundamental operational result reflecting feature consistency. These are the L2 norms of the two eigenvectors, calculated as the square root of the sum of the squares of the elements in each dimension of the vector. They are used to normalize the eigenvectors and eliminate the influence of differences in vector scale. The closer This indicates that the more similar the features of two nodes, the closer they are. The greater the difference, the more the degree of feature correlation between nodes can be quantified through this calculation;

[0051] Spatial distance is calculated based on the Euclidean distance of the node's coordinates in the feature map, reflecting the physical location correlation between the corresponding regions of two nodes. The calculation formula is shown below:

[0052] ,

[0053] ,

[0054] in, For nodes With nodes The original spatial distance is an initial physical distance index calculated based on coordinates. They are nodes With nodes The center coordinates in the feature map coordinate system are calculated from the spatial position of the feature block after establishing a two-dimensional coordinate system with the upper left corner of the feature map as the origin. For normalized nodes With nodes Spatial distance, with a range of values. It is a standardized metric after eliminating resolution differences. , where are the width and height of the feature map at the current feature level, and are the inherent parameters of the feature pyramid network when generating feature maps at various scales. The length of the feature map's diagonal is used for distance normalization. The smaller the value, the closer the two nodes are in space, which can accurately reflect the physical location relationship between the nodes;

[0055] The correlation strength between nodes is obtained by weighted fusion of feature similarity and normalized spatial distance. The fusion weight is calibrated based on the characteristics of the defect detection scenario. Feature similarity is more critical for determining defect correlation, so it is assigned a higher weight coefficient. Spatial distance allocation weight coefficient ,and The calculation formula is as follows:

[0056] ,

[0057] in, For nodes With nodes The strength of the association is the basic weight value of the edge connecting two nodes in a graph structure. , respectively, are the weighting coefficients for feature similarity and spatial correlation, and are empirical parameters calibrated based on the characteristics of the defect detection scenario, satisfying . ,and Values ​​higher than To highlight the role of feature similarity, Spatial correlation is the degree of spatial association; the closer the spatial distance, the higher the spatial correlation, which is consistent with the trend of feature similarity. This applies to nodes. Association strength with all other nodes Performing Softmax normalization ensures that the sum of the association strengths between a given node and all its neighboring nodes equals 1. This normalized strength value represents the connection between nodes in the graph structure. With nodes The final weights of the edges are used to set a threshold for the association strength based on the normalized edge weights. This threshold is determined through statistical analysis of defect-free samples, filtering out non-background associations that meet the criteria. nodes Classified as a node The neighboring nodes form a set of neighboring nodes. And it is used as the core input for attention weight calculation and graph convolution operation;

[0058] An attention mechanism is introduced to dynamically adjust node weights, with the core objective of strengthening defect-related node features and suppressing background node features. Specifically, the calculation consists of two parts: neighborhood attention weights and self-attention weights. The neighborhood attention weight calculation is based on the neighborhood feature matching degree, which is the matching degree of neighboring nodes. eigenvectors With the current node eigenvectors The cosine similarity is calculated in the same way as the feature similarity mentioned above, yielding the neighborhood feature matching degree. The neighborhood feature matching degree of all neighboring nodes is processed by Softmax normalization. Relative to the current node Attention weights The calculation formula is as follows:

[0059] ,

[0060] in, For neighboring nodes Relative to the current node Attention weights are quantitative indicators of the contribution of features of neighboring nodes. For neighboring nodes With the current node The neighborhood feature matching degree is calculated using the cosine similarity of the feature vectors of the two nodes. To improve the matching degree of neighborhood features Perform exponential operations to amplify differences in matching degree. For the current node The set of neighboring nodes is the range of node associations determined based on the graph structure. For any neighboring node in the set, The sum of the feature matching index values ​​of all neighboring nodes is used to normalize the weights. This calculation ensures that the sum of the attention weights of all neighboring nodes is 1. The higher the matching degree of a neighboring node, the greater its weight, thus focusing attention on nodes with similar features. The self-attention weight is calculated based on the node's own feature response strength, which is represented by the L2 norm of the feature vector. The calculation formula is shown below:

[0061] ,

[0062] in, For nodes The characteristic response intensity is a core indicator for measuring the probability that the region corresponding to a node contains defects. They are nodes Corresponding feature vector The 1st to the 1st The element value is the inherent dimensional data of the node's feature vector. The dimension of the node feature vector is the same as the channel dimension when the feature vector is generated. A higher value indicates a greater probability that the region corresponding to that node contains defects. Compare with the average response intensity of all neighboring nodes, if If it is higher than the mean, then the self-attention weight The preset high-weight interval calibration value is taken. If it is lower than the mean, the preset low-weight interval calibration value is taken. The interval range and specific calibration value are determined based on the statistical results of a large number of defect detection samples to ensure that nodes with high defect probability receive higher self-weights. Finally, the neighborhood attention weight and self-attention weight are normalized to form the final weight allocation scheme of the nodes.

[0063] Graph convolution operations are used to update the features of the graph structure at each scale feature level, integrating node information with neighborhood association information. The feature vector updated after graph convolution The calculation formula is as follows:

[0064] ,

[0065] in, For nodes The feature vector updated after graph convolution is a refined feature representation that integrates information from multiple sources. For nodes The self-attention weights are based on the feature response strength. Distributed For nodes The initial feature vector generated by mean pooling of feature blocks before the update. This is the element-wise multiplication operator for vectors, representing the element-wise multiplication of weights and feature vectors. For neighboring nodes Relative to node Attention weights For neighboring nodes The initial feature vector, For nodes The set of neighboring nodes is used, and the summation operation represents the accumulation of weighted features of all neighboring nodes to achieve neighborhood information integration. This calculation ensures that node features retain their core information while incorporating neighboring features, achieving refined feature updates. The feature maps updated at three scales are fused across scales through targeted upsampling and concatenation operations. The fine-scale feature map is upsampled using transposed convolution, and the stride and kernel size of the transposed convolution are determined based on the resolution ratio between the fine and coarse scales to ensure that the resolution is consistent with the coarse scale after upsampling. The mesoscale feature map is upsampled using bilinear interpolation. The upsampling algorithm fills in new pixel values ​​by weighted averaging of neighboring pixels, avoiding feature distortion. Coarse-scale feature maps do not require upsampling. Cross-scale fusion uses the resolution of the coarse-scale feature map as a benchmark. Based on the global correlation information between defects and background provided by the coarse-scale feature map, whose resolution is already suitable for global feature representation needs, the coarse-scale feature map resolution is chosen as the unified standard. Fine and medium-scale feature maps are upsampled to this scale, ensuring the reasonable resolution of the fused feature map while maximizing the preservation of the core value of features at each scale. Let the fine-scale feature map be... Mesoscale feature map Coarse-scale feature map Among them, the fine-scale feature map and the mesoscale feature map are obtained after upsampling. , Their resolutions are all the same as Consistent, the feature maps are stitched together along the channel dimension to form a multi-channel fused feature map, and the stitching relationship is shown below:

[0066] ,

[0067] in, This is the fused feature map after graph convolution operations on feature levels at each scale. These are the results after upsampling the fine-scale and meso-scale feature maps, respectively, and the outputs of the original feature maps after transpose convolution or bilinear interpolation. This is a channel-dimensional concatenation operator used to merge multi-scale feature maps along their channel dimensions. The number of channels is , The sum of the number of channels, to eliminate channel redundancy, adopts Convolution kernel pair Channel dimensionality reduction is performed, with the number of convolution kernels matching the number of channels in a single-scale feature map. Semantic fusion of features at different scales is achieved through convolution operations, ultimately outputting a cross-scale local feature map containing multi-scale detailed information and global correlation information. This cross-scale local feature map has achieved multi-scale feature fusion and defect feature enhancement. However, due to interference from the actual detection scenario of part surface reflection and uneven illumination, the features of the same defect are still scattered in multiple independent feature blocks. The response intensity of these feature blocks all meet the criteria for suspected defect judgment, but when they exist alone, they can only represent the local defect and cannot fully reflect the spatial morphology and semantic attributes of the defect. Therefore, it is necessary to use region reconstruction to connect the cross-scale local feature map and complete the aggregation of scattered suspected regions into complete defect regions.

[0068] Suspected defective local regions are screened based on the feature response intensity of cross-scale local feature maps. This is achieved by representing the region using the L2 norm of the feature vector corresponding to the feature block. The calculation formula is the square root of the sum of the squares of the elements in each dimension of the feature vector; a higher value indicates a greater probability that the region contains a defect. For each feature block in the cross-scale local feature map, its feature response intensity is calculated and compared with a threshold. Comparison, those with strength values ​​higher than Feature blocks are identified as suspected defective local regions. The threshold is determined based on the statistical results of feature responses from defect-free samples. The feature vector of each suspected defective local region is generated through mean pooling. The feature data of all pixels within the feature block are averaged along the channel dimension. The resulting vector contains the texture details, grayscale distribution patterns, and spatial correlation features of the region. Pairwise correlation analysis is performed on all suspected defective local regions. A judgment system is constructed using two dimensions: feature similarity and spatial correlation. When calculating feature similarity, quantification is achieved based on the cosine distance between the feature vectors of two regions. First, the cosine similarity between the two vectors is calculated using the same method as described above. Then, the cosine distance is obtained by subtracting the cosine similarity from 1. When calculating spatial correlation, a weighted fusion of coordinate overlap and positional continuity is used. This is the ratio of the intersection area to the union area of ​​two regions in the image coordinate system. A larger value indicates greater spatial overlap and improved positional continuity. This is the ratio of the Euclidean distance between the center coordinates of two regions to the average size of the two regions. The smaller the value, the more continuous the location and the stronger the spatial correlation. The expression is as follows:

[0069] ,

[0070] in, , Let be the weighting coefficient, satisfying By combining linear regression with the actual detection scenario of prioritizing overlap for curved parts and continuity for planar parts, fine-tuning was performed to finally determine the feature similarity threshold and spatial correlation threshold, both of which were determined based on the statistical characteristics of similar defect samples. Local region pairs that meet the criteria of feature similarity greater than the feature similarity threshold and spatial correlation greater than the spatial correlation threshold are identified as scattered regions to be aggregated, representing the same defect.

[0071] Feature aggregation is performed using a region reconstruction algorithm. This feature aggregation process consists of two parallel technical steps: feature vector weighted fusion and spatial coordinate merging. In the feature vector weighted fusion step, the fusion weight allocation for each dispersed region is based on feature integrity as the core criterion. Feature integrity is quantified and evaluated using the information entropy index. For the feature vector corresponding to each dispersed region to be aggregated, the elements of each dimension of the feature vector are first standardized, mapping all element values ​​to the numerical range [0,1] to obtain the standardized feature vector. The quantification of feature integrity is achieved through the information entropy index. The information entropy is calculated by multiplying each element of each dimension of the standardized feature vector by its natural logarithm, then summing the results of the above products for all dimensions, and finally taking the negative value of the summation result, which is the information entropy representing the feature integrity of the region. The summation operation covers all dimensions of the standardized feature vector. The magnitude of information entropy is positively correlated with the richness of effective information contained in regional features. That is, the higher the information entropy value, the more comprehensive the defect feature information carried by the region, and the stronger the feature integrity. The fusion weight of each dispersed region is determined based on information entropy calculation. The fusion weight of a dispersed region is obtained by comparing its information entropy value with the sum of the information entropy values ​​of all dispersed regions corresponding to the same defect. The sum of the fusion weights of all dispersed regions satisfies the normalization constraint. The generation process of the fused feature vector involves performing element-wise multiplication on the fusion weight of each dispersed region and the original feature vector of that region, and then summing the results of the multiplication on all dispersed regions. Finally, a fused feature vector that can completely represent the semantic information of the defect is obtained. This fusion logic ensures that regions with better feature integrity are included in the fusion result. The contribution of the fusion features is higher, which improves the accuracy of the defect attribute representation. In the spatial coordinate merging stage, all scattered regions corresponding to the same defect are traversed first. The spatial position of each scattered region is uniquely represented by the upper left and lower right corner coordinates of its corresponding feature block. During the coordinate merging process, the minimum horizontal and vertical coordinate values ​​among the upper left corner coordinates of all scattered regions are selected as the upper left corner coordinates of the merged continuous region. At the same time, the maximum horizontal and vertical coordinate values ​​among the lower right corner coordinates of all scattered regions are selected as the lower right corner coordinates of the merged continuous region. Through this coordinate extreme value screening and integration method, the minimum continuous spatial range that can completely cover all scattered regions is formed, ensuring that the aggregated region completely covers the entire distribution range of the same defect in the physical space dimension, avoiding the omission or breakage of the defect spatial morphology.

[0072] The continuous regions formed after feature vector weighted fusion and spatial coordinate merging are defined as isomorphic regions. Each isomorphic region possesses the dual core characteristics of semantic consistency and structural integrity. Semantic consistency specifically means that all scattered regions within the same isomorphic region correspond to the same type of defect, and their fused feature vectors can uniformly reflect the core semantic attributes of the defect. Structural integrity specifically means that the spatial range of the isomorphic region completely covers the entire physical form of the defect, with no missing local regions. Noise filtering is performed on all generated isomorphic regions. A minimum defect area threshold is preset. This threshold is based on the minimum acceptable physical size of the defect in the part design specification and is calculated by combining image calibration parameters. Isomorphic regions with a physical area smaller than this threshold are removed to eliminate false defect regions caused by noise interference. The effective isomorphic regions retained after filtering are arranged in an orderly manner according to their coordinate order in the two-dimensional coordinate system of the part's global image. Finally, they are integrated to form a set of isomorphic regions with regular structure and clear semantics.

[0073] like Figure 4 As shown, further, based on each isomorphic region in the isomorphic region set, defect blocks are located and fusion features are extracted to complete classification and grading. Finally, the results are verified through a generative adversarial network, and a detection report is output, including the following steps:

[0074] For each isomorphic region, the gray-level distribution characteristics of its internal pixels are statistically analyzed, and the gray-level mean and variance are calculated. An edge detection threshold is dynamically generated based on the gray-level mean and variance. A larger gray-level variance results in a threshold closer to the gray-level mean, while a smaller gray-level variance adjusts the threshold to the median value between the gray-level mean and the background gray-level mean, ensuring the adaptability of edge detection. A gradient operator is used to perform edge detection on the isomorphic region, calculating the gray-level gradient value for each pixel. The gray-level gradient value includes the rate of gray-level change in both the horizontal and vertical directions. Pixels with gray-level gradient values ​​higher than a local threshold are identified as edge pixels. Connectivity analysis is performed on the defective elements to remove isolated edge pixels. Morphological closure operations are then used to fill the edge gaps, forming a continuous and complete defect edge contour. Based on the defect edge contour, the minimum bounding rectangle of the defect block is calculated, which is the bounding box of the defect block. A two-dimensional Cartesian coordinate system is established with the upper left corner of the global image of the part as the origin. The coordinates of the defect block are represented by the coordinates of the upper left and lower right vertices of the bounding box. At the same time, the relative pixel distribution of the defect block within the bounding box is recorded to form the complete position information of the defect block. Each defect block is associated with a corresponding isomorphic region.

[0075] For each defect block, a series of geometric parameters are calculated based on its edge contour and bounding box information. The defect area is the total number of pixels within the defect block, converted to its actual area using the mapping ratio between image pixels and actual physical dimensions (determined based on camera calibration parameters). The defect perimeter is the number of pixels on the defect edge contour, converted to its actual perimeter based on pixel spacing. The aspect ratio is the ratio of the bounding box's length to its width, where the length is the number of pixels horizontally and the width is the number of pixels vertically. Circularity is calculated based on the perimeter and area, with the calculation logic as follows: Multiplying by the area and then dividing by the square of the perimeter reflects the degree to which the defect shape closely resembles a circle. The defect eccentricity is the ratio of the major semi-axis to the minor semi-axis of the smallest circumscribed ellipse of the defect. The major and minor semi-axis are extracted from the defect contour using an ellipse fitting algorithm. All geometric parameters are normalized to eliminate scale differences between defects of different sizes. A gray-level co-occurrence matrix is ​​constructed from the pixel gray-level matrix of the defect block. The frequency of occurrence of pixel pairs of different gray levels is counted according to a preset direction and step size. The preset direction includes horizontal, vertical, and two oblique orthogonal directions. The step size is dynamically set based on the size of the defect block. After normalizing the frequency matrix, the gray-level co-occurrence matrix is ​​obtained. Core texture features, including contrast and correlation, are extracted from the gray-level co-occurrence matrix. The model incorporates three parameters: contrast, energy, and entropy. Contrast is the weighted sum of squared differences in gray levels of matrix elements; correlation is the covariance of matrix elements with the mean gray levels of rows and columns; energy is the sum of squared values ​​of matrix elements; and entropy is the information entropy of matrix elements, reflecting texture complexity. Each texture feature maintains its original numerical range to ensure feature discriminability. Normalized geometric morphology parameters and texture features are concatenated in a preset order to form a one-dimensional fused feature vector. The concatenation order is based on the contribution of features to defect classification, where the contribution is determined based on the feature importance analysis results of the pre-trained model. Geometric morphology parameters reflect the spatial structural characteristics of defects, while texture features reflect the surface material characteristics of defects. The two complement each other to form a comprehensive defect representation.

[0076] Using a fused feature vector as input, a pre-trained defect classification model is used to identify and classify defect types. First, the pre-trained defect classification model is loaded. This model is trained on a large dataset of labeled defect samples. The training process uses gradient descent to optimize model parameters, enabling the model to classify and classify common defect types, including cracks, dents, scratches, and impurities. The model input is the fused feature vector, and the output is the probability distribution of defect type and the probability distribution of defect level. The fused feature vector is then input into the defect classification model, which calculates the probability value of each defect type through fully connected layers and activation functions. The defect type with the highest probability value is the identification result of the defect block. If the highest probability value is lower than the preset confidence threshold, it is marked as a suspected defect and needs to be verified and confirmed later. Based on the defect type identification result, the corresponding level evaluation standard for that type of defect is called. The level evaluation standard is divided according to the degree of impact of the defect on the performance of the part, including minor, moderate and severe levels. The model calculates the probability value of each level according to the key parameters in the fused feature vector. The level with the highest probability value is the level classification result of the defect block. The key parameters include defect area and depth-related texture features. The preset confidence threshold is determined based on the accuracy statistics of model training.

[0077] A defect-free image matching the model and specifications of the currently inspected part is selected from a pre-set defect-free part image library. If no perfectly matching image is found in the library, a virtual defect-free image is generated using the part's 3D surface geometry model, ensuring that the geometry of the defect-free image matches the currently inspected part. The defect type, grade, and defect block coordinates are input into a trained Generative Adversarial Network (GAN). This GAN includes a generator and a discriminator. The generator generates a simulated defect image at the corresponding coordinates of the defect-free image based on the input defect information. This includes determining the morphological features of the simulated defect based on the defect type (cracks are linear, pits are circular), and determining the size, depth, and grayscale contrast of the simulated defect based on the defect grade (higher grades result in larger size, greater depth, and more pronounced contrast), ensuring that the features of the simulated defect match the real defect. The discriminator evaluates the realism of the generated simulated defect image. If the evaluation result does not meet the requirements... If a preset realism standard is set, the generator will adjust the generation parameters until the generated defect simulation image meets the realism standard. The preset realism standard is determined based on the feature statistics of real defect images. The similarity between the defect simulation image and the real defect block image is calculated. The similarity is evaluated from two aspects: structural similarity and feature similarity. Structural similarity is calculated based on the matching degree of gray-level distribution and edge contours of the two images. Feature similarity is calculated based on the cosine similarity of the fused feature vectors of the two images. The two are weighted and averaged to obtain the final similarity value. If the final similarity value is higher than the preset similarity threshold, the classification and grading results are considered accurate. If the similarity value is lower than the threshold, the fused feature vector of the defect block is re-extracted, the model parameters are adjusted, and the classification and grading are performed again. At the same time, the reasons for the error are recorded for model iteration and optimization. The detection report is generated with the defect classification results, grading results, verification results, and defect block location information as inputs.

[0078] Example 2

[0079] Based on the same inventive concept as Embodiment 1, this invention discloses an intelligent detection system for surface defects of industrial parts, including an image acquisition module, a preprocessing module, and a defect detection module:

[0080] The image acquisition module achieves coordinated control of the imaging link through a surrounding industrial camera and light source array. During the full-angle scanning of the part driven by the rotating carrier, the incident light field distribution is dynamically evaluated based on the reflection characteristics of the part's curved surface, and an adaptive adjustment strategy for the light source is executed to adjust the output intensity and direction of the light source in real time. At the same time, the dynamic exposure parameters and gain optimization algorithm of the industrial camera are synchronously linked to ensure that the imaging system maintains stable brightness and balanced contrast under different viewing angles, thereby acquiring a uniform illumination image covering the detection area and forming an initial image set.

[0081] The preprocessing module performs unified preprocessing on the initial image set, including brightness normalization, noise reduction and suppression and multi-scale texture enhancement, to reduce illumination differences and enhance surface details. On this basis, it combines the preset part surface geometry model to perform distortion correction, normal unwrapping and cross-view feature alignment on the multi-view images. The continuous texture distribution of the part surface is reconstructed through a geometric stitching strategy to generate a global image of the part.

[0082] The defect detection module is based on the global image of the part and uses a graph convolutional attention model to extract cross-scale local features. A region reconstruction algorithm aggregates features from local regions segmented into different pixel blocks but representing the same defect due to surface reflection interference, forming semantically consistent and structurally complete isomorphic regions. All isomorphic regions are integrated into an isomorphic region set, ensuring that each isomorphic region fully expresses the corresponding defect. An adaptive edge extraction algorithm filters defect blocks within the isomorphic regions and determines their coordinates and bounding boxes. Then, geometric morphological parameters are calculated for each defect block, and texture features are extracted based on the gray-level co-occurrence matrix, constructing a fused feature vector containing both geometric and texture features. This fused feature vector is input into a pre-trained defect classification model for defect type identification and grading. An adversarial generative network is used to generate corresponding simulated defect images on defect-free images based on defect type, grade, and block coordinates. The simulated defect images are compared with real defect block images to verify the accuracy of classification and grading, and a detection report is generated.

[0083] This invention discloses an intelligent detection system and method for surface defects in industrial parts. The part to be inspected is fixed on a rotating carrier and continuously scans its entire surface at a constant angular velocity. An industrial camera arranged in a surrounding pattern works in conjunction with an adjustable LED light source array. The incident light field distribution is dynamically evaluated based on the reflective characteristics of the part's curved surface. The output intensity, direction, camera exposure parameters, and gain of the light source are adjusted in real time to ensure that the initial image set has uniform illumination, stable brightness, and balanced contrast. Brightness standardization is performed on the initial image to eliminate differences in viewing angle illumination. Denoising is achieved and texture details are preserved through a combination of median filtering and bilateral filtering. Multi-scale texture enhancement strengthens the surface micro-defect features. Then, distortion correction, normal unfolding, and cross-view feature alignment are completed by combining a preset three-dimensional curved surface geometric model of the part. Through weighted fusion of overlapping areas and texture continuity verification, a geometrically complete and textured full-domain image of the part is reconstructed. A feature pyramid network is used to construct a three-level feature hierarchy of fine, medium, and coarse. Combined with a graph convolutional attention model, cross-scale local features are extracted. Through feature similarity and spatial correlation analysis, a region reconstruction algorithm is used to aggregate discrete defect regions segmented by surface reflection, forming a semantically consistent and structurally complete set of isomorphic regions. Then, geometric morphological parameters are calculated for defect blocks within the isomorphic regions, and texture features are extracted based on the gray-level co-occurrence matrix. A fusion feature vector is constructed and input into a pre-trained model to complete defect type identification and level classification. An adversarial generative network is used to generate simulated defect images at the corresponding locations of defect-free images. The accuracy of classification and leveling results is verified by comparing structural similarity and feature similarity. A detection report containing defect location, type, and level is generated, which effectively solves the problems of uneven imaging of curved parts, scattered defect features, and lack of verification of detection results, and significantly improves the accuracy, efficiency, and reliability of defect detection.

[0084] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. An intelligent detection method for surface defects in industrial parts, characterized in that, Includes the following steps: The rotating carrier drives the full-angle scanning of the parts, dynamically evaluates the incident light field distribution of the light source array based on the reflection characteristics of the curved surface of the parts, executes the adaptive adjustment strategy of the light source and links the dynamic exposure and gain optimization algorithm of the industrial camera to obtain the initial image set. Preprocessing is performed on the initial image set, and distortion correction, normal unwrapping and cross-view feature alignment are performed by combining the part surface geometric model. A global image of the part is generated by geometric stitching. Based on the global image of the part, a graph convolutional attention model is used to extract cross-scale local features. A region reconstruction algorithm is used to aggregate scattered defect regions to form a set of isomorphic regions. Defect blocks within the isomorphic regions are selected and their coordinates and bounding boxes are determined. The geometric morphological parameters of the defect blocks are calculated and texture features are extracted based on the gray-level co-occurrence matrix. A fused feature vector is constructed and input into a pre-trained defect classification model to identify and classify defect types. A generative adversarial network is used to generate simulated defect images and compare them with real defect block images to generate a detection report.

2. The intelligent detection method for surface defects of industrial parts as described in claim 1, characterized in that, The incident light field distribution is dynamically evaluated based on the reflection characteristics of the curved surface of the part. The three-dimensional coordinates and normal vectors of the sampling points on the surface of the part are extracted to calculate the incident angle. The reflection intensity is decomposed by combining the reflection characteristics of the part material. The reflection intensity deviation is corrected to divide the light field region. The light source adaptive adjustment strategy is executed to adjust the output intensity and direction of the light source in real time. The dynamic exposure parameters and gain optimization algorithm of the industrial camera are linked synchronously to obtain the initial image set.

3. The intelligent detection method for surface defects of industrial parts as described in claim 1, characterized in that, By using a graph convolutional attention model to extract features and aggregate defect regions, a three-level feature hierarchy of fine, medium, and coarse scales is constructed. The feature maps at each scale are divided into feature blocks as graph structure nodes. The feature similarity and normalized spatial distance between nodes are calculated to determine the association strength. Neighborhood node sets are selected, and an attention mechanism is introduced to dynamically adjust node weights. The node itself and its neighborhood information are integrated through graph convolution operations to update features. Scattered defect regions affected by surface reflection interference are aggregated to form a semantically consistent and structurally complete isomorphic region set.

4. The intelligent detection method for surface defects of industrial parts as described in claim 1, characterized in that, When using adversarial generative networks (GANs) to verify classification and grading results, the process includes: selecting a defect-free image that matches the model and specifications of the currently inspected part; if no matching image is available, generating a virtual defect-free image using the part's 3D surface geometry model; inputting the defect type, grade, and defect block coordinates into the GAN, where the generator produces a simulated defect image based on the defect characteristics, and the discriminator evaluates the realism and provides feedback for adjustment; and calculating the similarity between the simulated defect image and the real defect block image from both structural and feature similarity perspectives to verify the accuracy of the classification and grading results.

5. The intelligent detection method for surface defects of industrial parts as described in claim 3, characterized in that, Upsampling is performed on the fine-scale feature map using transposed convolution, and upsampling is performed on the medium-scale feature map using bilinear interpolation, so that the resolution of the two-scale feature maps is consistent with that of the coarse-scale feature map. The three-level scale feature maps are concatenated according to the channel dimension to form a multi-channel fusion feature map. Convolution kernels are used to reduce the channel dimension of the multi-channel fusion feature map, realizing the semantic fusion of features at different scales and outputting a cross-scale local feature map.

6. The intelligent detection method for surface defects of industrial parts as described in claim 3, characterized in that, Aggregating scattered defect regions to form isomorphic regions includes: screening suspected defective local regions based on feature response intensity; calculating the spatial correlation between region features, including coordinate overlap and positional continuity; quantifying the integrity of region features according to information entropy and determining fusion weights; weighting and fusing the feature vectors of scattered defect regions; merging the spatial coordinates of scattered defect regions; selecting coordinate extrema to form the smallest continuous spatial range; and constructing isomorphic regions.

7. The intelligent detection method for surface defects of industrial parts as described in claim 1, characterized in that, When extracting texture features of defect blocks, a gray-level co-occurrence matrix is ​​constructed from the pixel gray-level matrix of the defect blocks. The occurrence frequency of pixel pairs of different gray levels is counted according to preset horizontal, vertical and diagonal orthogonal directions and dynamic step size. Normalization processing is performed on the gray-level co-occurrence matrix, and texture features of contrast, correlation, energy and entropy are extracted from the matrix to form a texture feature set of defect blocks.

8. The intelligent detection method for surface defects of industrial parts as described in claim 1, characterized in that, In generating a full-domain image of a part through geometric stitching, a scale-invariant feature transformation algorithm is used to extract feature points from adjacent viewpoint images. Reliable matching pairs are selected by the nearest neighbor and second nearest neighbor ratio method. The optimal transformation matrix is ​​fitted using a random sampling consensus algorithm. Pixels in the overlapping areas of the images are weighted inversely proportional to their distance and then weighted and averaged. All fused images are stitched together according to the coordinates of the part's parameter domain. Texture continuity is verified to generate a full-domain image of the part.

9. The intelligent detection method for surface defects of industrial parts as described in claim 1, characterized in that, Preprocessing is performed on the initial image set, including: brightness standardization based on the global brightness mean and standard deviation; setting the median filter neighborhood size through noise density detection to remove salt-and-pepper noise; constructing spatial weights and gray-level similarity weights using bilateral filtering to eliminate Gaussian noise and preserve texture details; and enhancing texture features through Gaussian pyramid multi-scale decomposition and Laplacian operator.

10. An intelligent detection system for surface defects of industrial parts, used to implement the intelligent detection method for surface defects of industrial parts as described in any one of claims 1-9, characterized in that, Includes an image acquisition module, a preprocessing module, and a defect detection module: The image acquisition module drives the part to scan the entire angle by rotating the carrier, dynamically evaluates the incident light field distribution of the light source array based on the reflection characteristics of the curved surface of the part, executes the adaptive adjustment strategy of the light source and links the dynamic exposure and gain optimization algorithm of the industrial camera to obtain the initial image set. The preprocessing module performs preprocessing on the initial image set, combines the part surface geometric model to perform distortion correction, normal unfolding and cross-view feature alignment, and generates a global image of the part through geometric stitching; The defect detection module extracts cross-scale local features based on the global image of the part using a graph convolutional attention model. It aggregates scattered defect regions into a set of isomorphic regions through a region reconstruction algorithm, filters defect blocks within the isomorphic regions and determines their coordinates and bounding boxes, calculates the geometric morphology parameters of the defect blocks and extracts texture features based on the gray-level co-occurrence matrix, constructs a fused feature vector input to a pre-trained defect classification model for defect type identification and level classification, and uses an adversarial generative network to generate simulated defect images and compare them with real defect block images to generate a detection report.