Intelligent detection method for defects of precision parts based on deep learning
By extracting defect features from multifocal image sequences using deep learning methods, and combining stereo matching and optical flow tracing, the problems of accuracy and dynamic tracking in precision parts inspection are solved, achieving efficient and accurate defect detection and 3D positioning, which is applicable to aerospace, automotive and high-end manufacturing fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EURASIA HIGH TECH DIGITAL TECH CO LTD
- Filing Date
- 2026-04-21
- Publication Date
- 2026-06-23
AI Technical Summary
Existing methods for detecting surface defects in precision parts suffer from insufficient detection accuracy, inaccurate three-dimensional positioning, and limited dynamic tracking capabilities, making it difficult to meet the detection needs of high-end manufacturing.
By employing a deep learning-based approach, multi-scale feature extraction and attention mechanism fusion of multi-focal image sequences, combined with stereo matching algorithm and optical flow tracking method, the three-dimensional localization, width measurement, and dynamic tracking of defects are achieved. Image acquisition parameters are optimized to adapt to different surface structures and lighting conditions.
It improves the accuracy and robustness of defect detection, ensures the accuracy of three-dimensional spatial position measurement, reduces the influence of lighting and surface texture interference, is suitable for online production environments, and improves detection efficiency and automation level.
Smart Images

Figure CN122265263A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of precision parts inspection technology, and in particular to a deep learning-based intelligent defect detection method for precision parts. Background Technology
[0002] Precision components are widely used in aerospace, automotive, and high-end manufacturing industries. Surface defects such as cracks, scratches, and holes can directly affect the performance and safety of these components. Therefore, high-precision and rapid detection of surface defects in precision components has always been a crucial technical challenge in the manufacturing and quality control fields.
[0003] Traditional defect detection of precision parts mainly relies on manual visual inspection or optical microscopy. These methods suffer from low efficiency, high subjectivity, and difficulty in achieving real-time online monitoring. With the development of machine vision and image processing technologies, image analysis-based defect detection methods are gradually being applied. For example, edge detection, texture analysis, or morphological processing techniques can achieve automated detection to a certain extent, but the detection accuracy still falls short of industrial requirements under conditions of complex surface structures, micro-cracks, and varying lighting.
[0004] In recent years, deep learning has made significant progress in the field of computer vision, and its feature extraction and pattern recognition capabilities have provided new solutions for defect detection. Deep convolutional neural networks can automatically learn defect features from multi-scale, multi-feature image data, which helps improve detection accuracy. However, existing methods still face the following technical challenges in the surface inspection of precision parts: the feature fusion and defect candidate region localization of multi-focal surface images are not precise enough, making it difficult to comprehensively characterize the edges and texture details of microcracks; the measurement accuracy of the three-dimensional spatial position of defects is insufficient, failing to accurately reflect the depth and spatial distribution of cracks; and the tracking ability of crack width and dynamic evolution is limited, making it difficult to achieve defect stability judgment and online acquisition parameter optimization.
[0005] Therefore, there is an urgent need for a deep learning-based intelligent detection method that can extract defect features with high precision from multifocal image sequences, and realize three-dimensional defect localization, width measurement and dynamic tracking to meet the actual needs of precision parts production and quality control. Summary of the Invention
[0006] This invention addresses the technical problems in existing precision parts surface defect detection methods, such as insufficient detection accuracy, inaccurate 3D positioning, and limited dynamic tracking capabilities. It proposes a deep learning-based intelligent defect detection method for precision parts. This method can extract defect features with high precision from multi-focal image sequences, enabling 3D spatial positioning of cracks, width measurement, and dynamic evolution tracking, thereby effectively improving the detection efficiency and reliability of precision parts.
[0007] This application provides a deep learning-based intelligent defect detection method for precision parts, the method comprising: Step 1: Obtain a multi-focus image sequence of the surface of the part to be inspected, and perform multi-scale decomposition on each image using the pyramid decomposition method to generate a multi-scale feature map set; Step 2: Extract defect edges and texture details based on multi-scale feature maps, and combine edge and texture information to determine candidate defect regions; Step 3: Using the candidate defect region as the region of interest, fuse the multi-scale feature map set through an attention mechanism to obtain an enhanced defect feature representation; Step 4: Extract the defect projection coordinates from the enhanced defect feature representation, and use a stereo matching algorithm to calculate the defect depth value to determine the three-dimensional spatial location of the defect; Step 5: Based on the three-dimensional spatial location of the defect, the surface geometry model of the part is reconstructed using the surface fitting method, and the defect boundary curve is extracted from the geometry model in combination with the three-dimensional spatial location of the defect. Step 6: Calculate the defect width based on the intersection of the defect boundary curve and the geometric model to obtain the width measurement result; Step 7: Extract abnormal width segments from the width measurement results and use optical flow tracing to track defect changes in order to determine defect stability; Step 8: Adjust the image acquisition parameters based on the defect stability judgment results to generate an optimized multifocal image sequence.
[0008] Compared with the prior art, the beneficial effects of the technical solution of this application are at least as follows: 1. By fusing multi-scale feature extraction and attention mechanisms, the edge and texture features of micro-cracks can be effectively identified, improving the accuracy, precision and robustness of defect detection.
[0009] 2. By combining stereo matching algorithms, sequence continuity optimization, and feedback adjustment of acquisition parameters, the three-dimensional spatial location of cracks can be accurately obtained, ensuring the continuity of the three-dimensional point cloud and providing reliable data for defect spatial distribution analysis.
[0010] 3. A measurement method based on the intersection of the defect boundary curve and the geometric model of the part, combined with image resolution and focal plane optimization, was developed to achieve high-precision measurement of crack width and reduce width measurement error.
[0011] 4. By using optical flow tracing to dynamically track abnormal width segments, the trend of crack changes over time can be evaluated, the stability of defects can be judged, and a decision-making basis can be provided for the quality control of precision parts.
[0012] 5. Through noise suppression and illumination compensation, the impact of surface texture interference and illumination changes on the detection results is effectively reduced, ensuring the reliability of defect feature extraction.
[0013] 6. Through image acquisition parameter optimization and automated processing, it can adapt to the detection needs of different surface structures and lighting conditions, making it suitable for online production environments and improving detection efficiency and automation level. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a flowchart of the deep learning-based intelligent defect detection method for precision parts according to this application; Figure 2 This is a flowchart of the method for generating multi-scale feature maps in this application; Figure 3 This is a flowchart of the method for obtaining defect candidate regions in this application. Detailed Implementation
[0016] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0017] For ease of understanding, the specific process of the embodiments of this application is described below. Figure 1 The diagram shows a flowchart of the intelligent defect detection method for precision parts based on deep learning provided by this invention. The flowchart specifically includes the following steps: Step 1: Obtain a multi-focus image sequence of the surface of the part to be inspected, and perform multi-scale decomposition on each image using the pyramid decomposition method to generate a multi-scale feature map set.
[0018] In one specific embodiment, the process of performing step 1 may specifically include the following steps: For each image in a multifocal image sequence, a pyramid decomposition method is used to generate a feature map containing low-frequency and high-frequency components; The low-frequency components are fused based on the information from each focal plane to highlight the crack depth distribution; High-frequency components are fused according to image resolution to enhance boundary curvature and texture variation features; The fused low-frequency components are integrated with the high-frequency components to generate a multi-scale feature map, which represents the feature distribution of cracks at different scales.
[0019] A flowchart of the method for generating multi-scale feature maps, as follows: Figure 2 As shown.
[0020] Specifically, an image acquisition system scans the surface of a part along the focal length direction to obtain a sequence of multiple images of the same area under different focal planes. For each image in the sequence, a Gaussian pyramid decomposition method is used for multiple downsampling and filtering to extract low-frequency components representing the overall structure of the image and high-frequency components representing the details and edges layer by layer, and each component is stored as an independent feature layer.
[0021] In the low-frequency component processing, the focal plane position parameters of each image in the multi-focus image sequence are acquired. Based on these parameters, the low-frequency components of different focal planes are weighted and fused. The focal plane position is calculated from the camera focal length and object distance. The fusion process weights and superimposes the low-frequency components based on the offset of adjacent focal planes, and merges the low-frequency information of adjacent focal planes through linear interpolation. Simultaneously, the difference in low-frequency pixel values along the focal plane sequence is calculated to quantify the depth gradient, thereby highlighting the continuous distribution of cracks in the depth direction. This effectively addresses the variation of cracks at different depths in part inspection.
[0022] Resolution enhancement is achieved through super-resolution techniques, such as using bicubic interpolation to magnify pixel details, allowing for a clearer representation of minute curvature variations and texture features at the crack edge at the pixel level. The enhanced high-frequency components are then fused with the original high-frequency components to ensure the continuity and consistency of boundary curvature and texture information at different scales, thereby reducing edge blurring or feature loss caused by surface texture, noise, or resolution limitations. This process enables accurate characterization of the crack edge's curvature, sharpness, and local texture features, enhancing the representation of crack edge curvature. For example, increasing the resolution from 512×512 to 1024×1024 increases the boundary curvature from 0.05 to 0.15, achieving a boundary point coordinate accuracy of 0.01mm, significantly reducing the blurring effect of surface texture on the crack boundary.
[0023] The fused low-frequency and high-frequency components are superimposed and integrated layer by layer to generate a multi-scale feature map set representing the feature distribution of cracks at different scales. Each scale corresponds to a specific feature distribution of the crack, ensuring that the features of the crack at different sizes, depths, and morphologies can be effectively represented.
[0024] By layering low-frequency and high-frequency components, optimizing the focal plane and resolution, and integrating multiple scales, the problem of simultaneously taking into account the depth distribution and boundary details of micro-cracks has been solved. This enables complete characterization of cracks on planes of different scales and depths, laying a reliable foundation for high-precision defect detection, three-dimensional positioning, and width measurement, thereby significantly improving the accuracy and robustness of intelligent detection of surface defects in precision parts.
[0025] Step 2: Extract defect edges and texture details based on multi-scale feature maps, and combine edge and texture information to determine candidate defect regions.
[0026] In one specific embodiment, the process of performing step 2 may specifically include the following steps: Convolutional neural networks are used to extract features from low-frequency and high-frequency components in a multi-scale feature map set to obtain preliminary feature representations that reflect defect edges and texture details. Based on the frame rate information of the multi-focus image sequence, the defect edge is subjected to sequence frame rate optimization processing to reduce surface texture and noise interference; Lighting compensation is applied to texture details to reduce texture feature deviations caused by changes in lighting or uneven crack widths. Defect candidate regions are determined based on the optimized defect edges and the compensated texture details, where the defect candidate regions are used to initially locate cracks.
[0027] Flowchart of the method for obtaining defect candidate regions, as follows: Figure 3 As shown.
[0028] Specifically, a convolutional neural network (CNN) is used to extract features from low-frequency and high-frequency components in a multi-scale feature map set, thereby obtaining preliminary feature representations reflecting defect edges and texture details. Low-frequency components primarily capture the overall structural information of the part surface, while high-frequency components highlight the edge and detail changes of cracks or other defects. Through multi-level convolutional operations of the CNN, the contour information of crack edges and surrounding subtle texture changes can be effectively extracted. The CNN employs a residual connection structure to ensure that features are not lost after multi-scale decomposition. For example, with an input image sequence resolution of 1024x1024 pixels, the network extracts edges using 3x3 convolutional kernels, obtaining response maps with edge intensity values between 0 and 1. This highlights crack boundaries, improves subsequent localization accuracy, and helps reduce false detections. Pooling layers are applied to low-frequency components to smooth global features, while activation functions are applied to high-frequency components to enhance local contrast. The two outputs are then fused to form a gradient map of defect edges and a pattern map of texture details.
[0029] Optimizing defect edges based on frame rate information from multi-focus image sequences involves optimizing the gradient map corresponding to the aforementioned defect edges. By analyzing the sequence frame rate and adjusting the frame sampling interval, and applying temporal smoothing to average the edge response of adjacent frames, it is possible to effectively reduce metal surface texture noise and other high-frequency interference. Specifically, by reducing the frame rate, the edge response of each frame can be output more stably, thereby reducing false positives caused by high-frequency noise. This optimization measure effectively solves the edge blurring problem caused by surface texture and metal surface reflection, enhancing the traceability of defect edges. Especially in crack detection scenarios for aerospace fasteners or other precision parts, it can significantly improve the stability and accuracy of detection. For example, at a production line speed of 2 meters per second, optimizing the frame rate from 30 frames per second to 15 frames per second can reduce the interference response caused by metal surface texture by 30%, enhancing crack tracking stability.
[0030] Illumination compensation for texture details is a correction process applied to the pattern map corresponding to those details. By calculating the image illumination distribution and applying histogram equalization to compensate for uneven illumination, crack width deviations caused by uneven illumination or variations in surface texture are mitigated. This compensation process ensures visual consistency of crack width by adjusting image contrast, effectively avoiding crack detection errors caused by illumination variations or different focal points. Specifically, illumination compensation can reduce crack width variation from 0.2 mm to 0.1 mm, ensuring detail consistency in multi-focal sequences and improving measurement reliability.
[0031] In the process of determining candidate defect regions, a binary mask is generated by combining optimized defect edges and compensated texture details to identify the candidate defect regions. The boundary coordinates of this region are accurately calibrated, which can effectively support subsequent depth analysis. By fusing defect edges and texture details, the generated candidate regions can accurately characterize the location and extent of cracks or other defects. For example, for an aerospace fastener with a diameter of 10 mm, after processing by this invention, the positioning error of the candidate region can be accurate to less than 0.05 mm, significantly improving the efficiency and accuracy of the inspection process.
[0032] By integrating convolutional neural networks, sequence frame rate optimization, illumination compensation, and defect edge and texture detail processing, accurate defect candidate regions can be effectively extracted, and the false detection and false negative detection problems caused by surface texture, illumination changes, and other factors can be overcome, significantly reducing the false detection and false negative detection rates.
[0033] Step 3: Using the candidate defect region as the region of interest, fuse the multi-scale feature map through an attention mechanism to obtain an enhanced defect feature representation.
[0034] In one specific embodiment, the process of performing step 3 may specifically include the following steps: For the defect candidate region, continuous edge response is detected, and edge features and local texture features reflecting the defect morphology are extracted; An attention mechanism is used to weight and fuse continuous edge responses to generate an initial enhanced defect feature representation. The initial enhanced defect feature representation is refined based on the noise suppression level to optimize the curve length measurement accuracy. The initial enhanced defect feature representation after refinement is adjusted according to the focal depth range, and the boundary point coordinates are optimized on different depth planes to improve the accuracy of the boundary point coordinates. The refined and adjusted initial enhancement defect feature representation is defined as the enhancement defect feature representation, which is used to characterize the fine morphological features and spatial distribution of cracks.
[0035] Specifically, the multi-scale feature set contains structural information from low-frequency components and detailed information from high-frequency components. Once a candidate region is determined, continuous edge responses need to be extracted from that region to reflect the morphological characteristics of the crack, and combined with local texture details to form a complete description. The detection of continuous edge responses is accomplished by analyzing the connectivity between edge points at different scales. When an edge exhibits consistency across multiple scale sets, it is considered a continuous edge response, and regions with continuous responses are marked as valid features.
[0036] Based on the above results, an attention mechanism is used to calculate the weight distribution of features at each scale. The weights are then used to weight and fuse continuous edge responses to obtain an initial enhanced defect feature representation. In this process, the feature vector is normalized using a softmax function to generate attention weights, which are used to highlight features related to crack depth distribution and boundary curvature changes. These attention weights are applied to continuous edge responses and weighted summation is performed to obtain the enhanced defect feature representation. For example, high-frequency texture details and low-frequency structural features are assigned weights of 0.6 and 0.4 respectively, and the weighted summation forms the initial enhanced defect feature representation, which strengthens morphological features such as crack boundary curvature changes. This weighting process strengthens key features related to the crack, suppresses irrelevant texture interference, and enables the generated feature representation to simultaneously reflect the changes in depth distribution and boundary curvature.
[0037] After obtaining the initial enhanced defect feature representation, it needs to be refined to reduce the impact of sequential noise on the accuracy of feature measurement, taking into account the noise suppression level. Specifically, the noise level in the enhanced defect feature representation is first evaluated. This noise level can be determined by a preset threshold; for example, in the defect boundary response, if the gradient change is below the threshold of 0.05, it is considered a high-frequency noise component. Based on the evaluation results, appropriate filtering parameters are selected, such as using a Gaussian filter and adjusting its standard deviation. When the standard deviation is set to 1.5, small-amplitude random fluctuations can be effectively smoothed out. This process reduces random noise through smoothing filtering while maintaining the continuity of crack edges and curvature, significantly reducing the deviation of the curve length calculated from the enhanced defect feature representation, thereby optimizing the stability and reliability of length measurement. After noise suppression, the defect curve length is extracted from the refined enhanced defect feature representation by accumulating the curve length by integrating the coordinates of boundary points, which are determined by the gradient change in the refined representation. Because the refinement process reduces false edge points caused by noise, the deviation in curve length calculation is significantly reduced. In application scenarios, such as crack detection of precision parts on high-speed production lines, after refining, the error in curve length measurement can be reduced from 5% to 2%, effectively supporting the judgment of crack propagation direction and subsequent dynamic evolution analysis.
[0038] Furthermore, considering the differences in focal depth ranges inherent in multifocal image sequence acquisition, the refined initial enhanced defect feature representation needs depth adjustment to ensure optimized coordinate accuracy of crack boundary points on different focal planes. By introducing focal depth information and correcting the spatial depth values included in the feature representation, linear interpolation or fusion calculations are performed between multifocal sequences within a set focal depth range. This ensures that the projections of the same crack boundary on different focal planes are aligned, forming a consistent spatial representation. This process achieves repositioning and refinement of crack boundary points in multiple depth dimensions, reducing boundary coordinate offsets caused by differences in imaging depth, thereby improving the positioning accuracy of boundary point coordinates.
[0039] In this technical solution, a convolutional neural network is used to extract edge and texture features within the candidate region, providing basic input for the attention mechanism. The weighted fusion of the attention mechanism enhances the edge continuity and texture details related to cracks, providing high-quality features for subsequent refinement and depth adjustment. Noise suppression and focal plane adjustment ensure the stability and accuracy of the enhanced features in both spatial and measurement dimensions. These features interact and collaboratively solve the technical problems of blurred crack boundaries, incomplete depth information, and large measurement errors in precision part defect detection.
[0040] Step 4: Extract the defect projection coordinates from the enhanced defect feature representation, and use a stereo matching algorithm to calculate the defect depth value to determine the three-dimensional spatial location of the defect.
[0041] In one specific embodiment, the process of performing step 4 may specifically include the following steps: Extract the projected coordinates of the defect on different focal planes from the enhanced defect feature representation; A stereo matching algorithm is used to calculate the depth of the projected coordinates to obtain the defect depth value of each defect point and acquire the initial three-dimensional point cloud. Based on the constraints of sequence continuity and spatial smoothness, the initial 3D point cloud is optimized to obtain an optimized 3D point cloud. Based on the image acquisition parameters and optical geometric model, the optimized 3D point cloud is adjusted to optimize the defect propagation direction and spatial tracking accuracy, and the 3D spatial location of the defect is obtained.
[0042] Specifically, the projected coordinates of the defect on different focal planes are extracted from the enhanced defect feature representation, and a stereo matching algorithm is used to calculate the defect depth value to determine the defect's position in three-dimensional space. The enhanced defect feature representation includes crack boundary and texture information obtained by fusing convolutional neural networks and attention mechanisms. This information is represented in the form of continuous edge responses and texture patterns, which can highlight the spatial consistency of the defect. During processing, for feature points of the crack edge, the corresponding two-dimensional projected coordinates are extracted from image sequences of different focal planes to form a projected coordinate set. This projected coordinate set represents the spatial projection distribution of the crack on each focal plane with pixel-level precision. Based on this projected coordinate set, a stereo matching algorithm is used to calculate the depth. Stereo matching determines the correspondence of the same crack point by comparing the similarity of local regions in images of different focal planes, and calculates the defect depth value based on the parallax between projection points, combined with the baseline distance of the acquisition system and the optical focal length, thus obtaining the initial three-dimensional point cloud. Here, the baseline refers to the physical distance between two imaging systems (or two focal planes), that is, the straight-line distance between two imaging points in the optical measurement system. This initial point cloud directly reflects the morphology and extension path of the defect in three-dimensional space, but it is still subject to errors due to noise and acquisition conditions. For example, based on the principle of triangulation, the parallax is converted into a depth value, that is, the depth value is equal to the focal length multiplied by the baseline divided by the parallax. For example, for a pair of points with projection coordinates from (100, 150) to (105, 155), the parallax is calculated to be 2 pixels. Combined with a baseline of 10mm and a focal length of 5mm, a depth value of 25mm is obtained, which effectively reduces the measurement error caused by surface curvature.
[0043] To reduce depth deviation caused by random noise and surface reflection interference, the initial 3D point cloud is optimized by introducing sequential continuity and smoothness constraints. Temporal filtering of depth values in each frame of the image sequence is applied, and isolated points are eliminated by combining spatial neighborhood consistency constraints. The optimized depth values are then combined with 2D projected coordinates to construct a 3D point cloud, making the spatial distribution of the 3D point cloud more continuous and thus enhancing the overall representation of crack boundaries. The optimized point cloud exhibits stability in the depth direction, effectively supporting subsequent crack length and curvature calculations and solving the problem of 3D reconstruction being susceptible to noise fluctuations. For example, a depth value sequence of 25mm, 26mm, and 24mm is optimized to 25.2mm, 25.4mm, and 25.3mm, significantly improving the continuity of the 3D position representation.
[0044] Based on this, the optimized 3D point cloud is adjusted by combining image acquisition parameters and optical geometric models to further improve the reliability of the 3D spatial position. Image acquisition parameters such as focal plane spacing, exposure time, or camera baseline affect the accuracy of depth calculation. By feeding back these parameters and recalibrating the point cloud coordinates, optimized tracking of crack propagation direction can be achieved. For example, when the focal plane spacing is too large, leading to inaccurate depth estimation, reducing the spacing and recalculating based on stereo matching results can reduce depth deviation, making the 3D point cloud more consistent with the actual spatial morphology of the crack. After feedback adjustment, the 3D position of the crack can not only represent the surface orientation but also reflect the trend of crack propagation into depth, supporting accurate tracking of crack evolution direction. For example, when the detected propagation direction deviation reaches 2mm, the exposure time is adjusted from 1 / 100 second to 1 / 200 second, reducing the direction deviation to 0.3mm. Through iterative feedback, the tracking error is kept below a threshold (e.g., 0.5mm), ensuring that the 3D spatial position accurately represents the crack distribution.
[0045] In the context of precision parts inspection, this technology enables cracks in complex backgrounds to be stably transformed into three-dimensional coordinate distributions, and allows for the tracking of crack propagation paths with millimeter-level or even sub-millimeter-level precision on the production line.
[0046] Step 5: Based on the three-dimensional spatial location of the defect, the surface geometric model of the part is reconstructed using the surface fitting method, and the defect boundary curve is extracted from the geometric model in combination with the three-dimensional spatial location of the defect.
[0047] In one specific embodiment, the process of performing step 5 may specifically include the following steps: Based on the three-dimensional spatial location of the defect, a surface fitting method is used to generate a geometric model of the part surface; Identify defect regions and extract initial boundary curves on the geometric model; The initial boundary curve is optimized based on curve smoothness and boundary curvature constraints to refine the curvature variation of the crack boundary. The optimized initial boundary curve is adjusted based on the crack depth distribution information to enhance the boundary curvature representation and obtain the defect boundary curve, which characterizes the geometric features of the crack on the part surface.
[0048] Specifically, based on the three-dimensional spatial location of the defect, a surface fitting method is used to generate a geometric model of the part surface. This is a technical means to reconstruct the tight part surface and support the extraction of defect boundaries. The spatial correspondence between the part surface and the crack location is realized by modeling the three-dimensional point cloud data.
[0049] Based on the 3D spatial location data of defects, a surface fitting method is used to generate a geometric model of the part surface. This method iteratively optimizes the fitting parameters through least squares optimization or high-order polynomial fitting to adapt to the local geometric features of the fastener surface, fitting the 3D point cloud into a surface that reflects the local morphology of the part surface. This ensures that the surface model accurately fits the cylindrical, spherical, or complex surface features of the part, while maintaining the correspondence with the spatial distribution of cracks. When identifying defect regions on this model, edge detection operators, such as the Canny operator or gradient operator, are applied to the geometric model to extract the initial defect boundary point set, forming a continuous curve. This curve directly corresponds to the location of the crack on the part surface and retains spatial depth information, thus matching the boundary features with the 3D crack propagation morphology.
[0050] During boundary curve optimization, spline interpolation or polynomial smoothing is applied to the initial boundary curve based on curve smoothness indices and boundary curvature constraints. By calculating the second derivative of the curve to quantify curvature changes and applying smoothing constraints, abrupt curvature changes caused by surface texture interference and noise are reduced, thereby refining the curvature changes at the crack boundary and achieving continuity and stability of the boundary curve in length, direction, and curvature. Simultaneously, the depth distribution of the crack at different focal planes is obtained from the enhanced defect feature representation and mapped onto the optimized boundary curve. For example, depth weights are assigned to each point on the curve, and the local curvature of the curve is adjusted using weighting. This makes the curvature representation of deeper regions more prominent, enhancing the depth sensitivity of the curve and ensuring that the boundary curve not only reflects the location of the crack on the part surface but also characterizes its depth distribution and potential fracture risk points.
[0051] This process is achieved based on multi-focus image sequences and multi-scale feature fusion. The depth distribution information obtained through an attention mechanism forms a closed loop with the surface model and boundary curve optimization, enabling surface fitting, boundary extraction, and curvature optimization functions to support each other and jointly address issues such as surface texture interference, crack depth variations, and insufficient boundary curve accuracy. In real-time production line monitoring, this reduces misjudgments and noise interference, improves the accuracy and stability of crack location and assessment, and ultimately generates high-precision boundary curves that can be used for defect assessment and safety decision-making.
[0052] Step 6: Calculate the defect width based on the intersection of the defect boundary curve and the geometric model to obtain the width measurement result.
[0053] In one specific embodiment, the process of performing step 6 may specifically include the following steps: Determine the intersection points of the defect boundary curve and the geometric model, and identify the start and end boundaries of the defect; Calculate the spatial distance between intersections and compare it with a preset distance threshold to determine whether it is necessary to calculate the defect width. For the defect area that needs to be calculated, curve interpolation or spline fitting methods are used to calculate the defect width and obtain the initial measurement results; The initial measurement results are adjusted based on the focal plane information and image resolution to reduce crack width variation and surface texture interference deviation, and the width measurement results are obtained. The width measurement results characterize the width distribution of the crack along the defect boundary.
[0054] Specifically, each point is traversed along the defect boundary curve to determine the intersection points between the defect boundary curve and the geometric model of the part surface. These intersection points correspond to the actual mapping points of the crack boundary on the 3D model and are used to identify the start and end boundaries of the defect. For the spatial distance between adjacent intersection points, it is compared with a preset threshold (e.g., 0.5 mm) to determine whether the crack segment belongs to a significant defect area, eliminating the interference of small and irrelevant intersection points, ensuring that the width measurement only applies to the effective crack area, thereby improving data reliability.
[0055] For the defect region requiring calculation, curve interpolation or spline fitting methods are used to calculate the defect width and obtain initial measurement results. This process involves interpolating and reconstructing the crack curve segment defined by adjacent intersection points on both sides of the crack boundary curve and uniformly sampling (e.g., sampling 5 intermediate points) to generate two sets of spatial coordinate points. The three-dimensional Euclidean distance between the sampling point on one side and the corresponding point on the other side is calculated and used as the local width value at that point. The local width values of all sampling point pairs are averaged to obtain the average width of the curve segment. Finally, the width values of all curve segments are summarized to form an array representing the width distribution of the crack along its path; this array is the initial measurement result.
[0056] To further reduce the impact of crack width variation and surface texture interference, the initial measurement results are adjusted and corrected using focal plane information and image resolution. For example, offset compensation is performed using focal plane parameters from a multifocal image sequence, reducing the width measurement error from ±0.05 mm to ±0.01 mm. Simultaneously, image resolution enhancement methods, such as bilinear interpolation, are used to increase the resolution from 512×512 to 1024×1024, further reducing texture interference deviations such as metal scratches, achieving a high degree of spatial consistency between the width measurement value and the actual crack morphology. These corrected measurement data are then fused to generate an array of width measurement results, reflecting the crack width variation along the defect boundary. This array can be directly used to identify abnormal width segments, assess crack stability, and guide optical flow tracking algorithms for continuous defect monitoring.
[0057] The technical solution of this invention can effectively compensate for uneven illumination and surface texture interference, and reduce misjudgments and measurement deviations, providing a reliable basis for crack propagation direction judgment and defect evolution analysis. During the width measurement process, surface fitting, intersection point extraction, interpolation calculation, and focal plane and resolution correction form a mutually supportive technical chain, jointly solving the problems of insufficient crack width measurement accuracy and surface interference, and improving the stability and reliability of precision part defect detection.
[0058] Step 7: Extract abnormal width segments from the width measurement results and use optical flow tracing to track defect changes in order to determine defect stability.
[0059] In one specific embodiment, the process of performing step 7 may specifically include the following steps: Based on a preset width threshold, abnormal width segments are identified and extracted from the width measurement results; In a multifocal image sequence, an optical flow tracing method is used to dynamically track the abnormal width segment, generate the defect change trajectory, and record the spatial change information of the crack over time. The defect change trajectory is optimized by sequence frame rate and illumination compensation to enhance the continuity of boundary point coordinates and measurement accuracy. Defect stability is determined by the change trajectory of the treated defects, and the crack propagation trend and dynamic evolution characteristics are evaluated.
[0060] Specifically, based on a preset width threshold (e.g., 0.05 mm), the width measurement results along the crack path are filtered. Measurement segments exceeding the standard crack width limit of the part are marked as abnormal width segments, and their spatial location and length information are recorded to form an abnormal segment list. For example, when the width measurement results include 0.03 mm, 0.06 mm, and 0.04 mm, the 0.06 mm segment is extracted as an abnormal width segment, ensuring focus on high-risk areas. This marking step functionally supports the subsequent optical flow tracing method. By identifying high-risk areas of potential cracks, optical flow tracing can focus on abnormal segments, reducing computational redundancy, while ensuring dynamic tracking covers critical areas where crack propagation may occur.
[0061] In multifocal image sequences, optical flow tracing is employed to dynamically track abnormal width segments and generate defect change trajectories. Specifically, the Lucas-Kanade optical flow algorithm is used to calculate the pixel displacement of the abnormal segment between consecutive frames. This algorithm estimates the motion vector by minimizing the gray-level difference of neighboring pixels and iteratively solves the displacement vector using an image pyramid structure. The displacement vectors are then used to connect the abnormal width segments within the sequence, generating defect change trajectories and achieving fine tracking at different scales. The displacement information of the abnormal width segment corresponds to its spatial coordinates in the width measurement results, forming a continuous trajectory curve that describes the spatial changes of the crack over time, enabling dynamic capture of crack evolution. The continuity and accuracy of the trajectory directly depend on the accuracy of the width measurement and the robustness of the optical flow algorithm. This demonstrates the functional interaction between measurement features and the dynamic tracking algorithm, jointly addressing the problems of noise interference and micro-motion detection in dynamic crack monitoring.
[0062] Sequence frame rate optimization and illumination compensation are applied to the defect trajectory to further enhance the continuity of boundary point coordinates and measurement accuracy. Sequence frame rate optimization uses interpolation to fill gaps in low frame rates, ensuring a smooth and uniform trajectory over time. Illumination compensation employs histogram equalization to correct uneven image brightness, guaranteeing continuity of boundary points under varying illumination and enhancing the stability of optical flow tracking. The trajectory optimization and anomaly width segment identification functions support each other; the former provides dynamically consistent spatial location data, while the latter provides information on high-risk areas. Together, they improve crack tracking accuracy and reduce misjudgments caused by surface texture or illumination changes.
[0063] Based on the processed defect trajectory, the dynamic evolution characteristics of the crack are evaluated, including calculating the rate of change of curvature and the degree of length variation of the trajectory. The stability of the crack is determined by analyzing the continuity of the trajectory, the change of curvature, and the fluctuation of length. For example, if the rate of change of curvature is lower than a preset threshold (e.g., 5%) and the degree of length variation is less than a standard limit (e.g., 10%), the crack is considered stable; otherwise, it is considered unstable, indicating that the crack may propagate or contract.
[0064] The stability assessment interacts with the aforementioned trajectory generation and optimization functions to ensure that crack propagation trends and dynamic evolution characteristics can be reliably captured, providing a technical basis for production line defect monitoring and parameter adjustment, while reducing the risk of human intervention and misjudgment, and achieving accurate monitoring of the defect evolution process.
[0065] Step 8: Adjust the image acquisition parameters based on the defect stability judgment results to generate an optimized multifocal image sequence.
[0066] Specifically, crack stability information is linked to the acquisition and control system to achieve adaptive adjustments to parameters such as focal plane interval, exposure time, light source intensity parameters, and acquisition rate. For stable crack regions, the original acquisition parameters are maintained to ensure data consistency, while for unstable or expanding crack regions, image resolution and contrast are improved by reducing the focal plane interval, increasing the acquisition frame rate, or adjusting the exposure time, thereby enhancing the clarity and continuity of defect boundaries. For example, adjusting the focal plane interval from 5 mm to 3 mm or the exposure time from 1 / 100 second to 1 / 200 second reduces the impact of illumination variations and motion blur on image quality through parameter optimization. The adjusted parameters are fed back to the image acquisition system in real time, re-acquiring images of the part surface and generating an optimized multifocal image sequence with higher contrast and resolution, providing improved input data for iterative detection.
[0067] This adjustment process supports the aforementioned width measurement, trajectory tracking, and optical flow analysis functions. It uses the stability judgment results to guide the acquisition optimization, achieving complete coverage and high-precision recording of crack boundaries in multi-focal image sequences. This ensures that minute crack changes are accurately captured during dynamic monitoring, while reducing the impact of illumination changes and noise on image quality. It is also beneficial for continuous tracking and intelligent monitoring of defect propagation directions.
[0068] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for intelligent defect detection of precision parts based on deep learning, characterized in that, The method includes: Step 1: Obtain a multi-focus image sequence of the surface of the part to be inspected, and perform multi-scale decomposition on each image using the pyramid decomposition method to generate a multi-scale feature map set; Step 2: Extract defect edges and texture details based on the multi-scale feature map set, and determine candidate defect regions by combining edge and texture information; Step 3: Using the candidate defect region as the region of interest, fuse the multi-scale feature map set through an attention mechanism to obtain an enhanced defect feature representation; Step 4: Extract the defect projection coordinates from the enhanced defect feature representation, and use a stereo matching algorithm to calculate the defect depth value to determine the three-dimensional spatial location of the defect; Step 5: Based on the three-dimensional spatial location of the defect, reconstruct the surface geometric model of the part using a surface fitting method, and extract the defect boundary curve from the geometric model in combination with the three-dimensional spatial location of the defect; Step 6: Calculate the defect width based on the intersection of the defect boundary curve and the geometric model to obtain the width measurement result; Step 7: Extract the abnormal width segment from the width measurement results, and use the optical flow tracing method to track the defect changes in order to determine the defect stability; Step 8: Adjust the image acquisition parameters based on the defect stability judgment results to generate an optimized multifocal image sequence.
2. The method according to claim 1, characterized in that, Step 1 includes: For each image in the multifocal image sequence, a feature map containing low-frequency and high-frequency components is generated using the pyramid decomposition method; The low-frequency components are fused based on the information of each focal plane to highlight the crack depth distribution; The high-frequency components are fused according to the image resolution to enhance the boundary curvature and texture variation features; The fused low-frequency components are integrated with the high-frequency components to generate the multi-scale feature map set, wherein the multi-scale feature map set represents the feature distribution of cracks at different scales.
3. The method according to claim 1, characterized in that, Step 2 includes: The low-frequency and high-frequency components in the multi-scale feature map set are extracted using a convolutional neural network to obtain a preliminary feature representation reflecting the defect edges and texture details. Based on the frame rate information of the multi-focus image sequence, the defect edge is subjected to sequence frame rate optimization processing to reduce surface texture and noise interference; The texture details are subjected to illumination compensation processing to reduce texture feature deviations caused by changes in illumination or uneven crack width; The defect candidate region is determined based on the optimized defect edge and the compensated texture details, wherein the defect candidate region is used to initially locate the crack.
4. The method according to claim 1, characterized in that, Step 3 includes: For the candidate defect region, continuous edge responses are detected, and edge features and local texture features reflecting the defect morphology are extracted; The continuous edge responses are weighted and fused using an attention mechanism to generate an initial enhanced defect feature representation. The initial enhanced defect feature representation is refined based on the noise suppression level to optimize the curve length measurement accuracy. The initial enhanced defect feature representation after refinement is adjusted according to the focal depth range, and the boundary point coordinates are optimized on different depth planes to improve the accuracy of the boundary point coordinates. The refined and adjusted initial enhancement defect feature representation is defined as the enhancement defect feature representation, used to characterize the fine morphological features and spatial distribution of cracks.
5. The method according to claim 1, characterized in that, Step 4 includes: Extract the projected coordinates of the defect on different focal planes from the enhanced defect feature representation; A stereo matching algorithm is used to calculate the depth of the projected coordinates to obtain the defect depth value of each defect point, thereby obtaining an initial three-dimensional point cloud. Based on sequence continuity and spatial smoothness constraints, the initial 3D point cloud is optimized to obtain an optimized 3D point cloud. Based on the image acquisition parameters and optical geometric model, the optimized 3D point cloud is adjusted to optimize the defect propagation direction and spatial tracking accuracy, thereby obtaining the 3D spatial position of the defect.
6. The method according to claim 1, characterized in that, Step 5 includes: Based on the three-dimensional spatial location of the defect, a geometric model of the part surface is generated using a surface fitting method; Defect regions are identified and initial boundary curves are extracted from the geometric model. The initial boundary curve is optimized based on curve smoothness and boundary curvature constraints to refine the curvature variation of the crack boundary. The optimized initial boundary curve is adjusted based on the crack depth distribution information to enhance the boundary curvature representation and obtain the defect boundary curve, wherein the defect boundary curve characterizes the geometric features of the crack on the surface of the part.
7. The method according to claim 1, characterized in that, Step 6 includes: Determine the intersection point between the defect boundary curve and the geometric model, and identify the start and end boundaries of the defect; Calculate the spatial distance between the intersection points and compare it with a preset distance threshold to determine whether it is necessary to calculate the defect width; For the defect area that needs to be calculated, curve interpolation or spline fitting methods are used to calculate the defect width and obtain the initial measurement results; The initial measurement results are adjusted based on the focal plane information and image resolution to reduce crack width variation and surface texture interference deviation, thereby obtaining the width measurement results, wherein the width measurement results characterize the width distribution of the crack along the defect boundary.
8. The method according to claim 1, characterized in that, Step 7 includes: Based on a preset width threshold, the abnormal width segments are identified and extracted from the width measurement results; In the multifocal image sequence, the abnormal width segment is dynamically tracked using an optical flow tracing method to generate a defect change trajectory and record the spatial change information of the crack over time. The defect change trajectory is subjected to sequence frame rate optimization and illumination compensation processing to enhance the continuity of boundary point coordinates and measurement accuracy; Defect stability is determined by the change trajectory of the treated defects, and the crack propagation trend and dynamic evolution characteristics are evaluated.