An artificial intelligence-based defect detection method
By collecting multi-source data in real time and combining it with artificial intelligence models, the threshold is dynamically adjusted to identify surface defects in automotive parts. This solves the problems of insufficient timeliness and accuracy of detection results in existing technologies, and achieves high sensitivity and early identification of defects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-03-03
AI Technical Summary
Existing cloud-based AI-based defect detection systems rely on image information and ignore key physical parameters during processing, resulting in insufficient timeliness and accuracy of detection results, and an inability to adapt to different processing conditions and defect types.
By collecting multi-source data on the machined surfaces of automotive parts in real time, including images, spindle speed, feed rate, cutting depth, flatness deviation, and 3D contour point cloud deviation, and combining this data with an artificial intelligence model for comprehensive analysis, the threshold is dynamically adjusted to identify abnormal areas and perform defect detection.
It achieves high sensitivity, early identification, and precise positioning of surface defects in automotive parts, enhancing the real-time nature and adaptability of detection, and improving the accuracy and reliability of defect detection.
Smart Images

Figure CN120997818B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of defect detection technology, and in particular to a defect detection method based on artificial intelligence. Background Technology
[0002] The automotive manufacturing industry is increasingly demanding in terms of parts processing quality, especially at corner joints on machined surfaces. These areas are critical locations prone to stress concentration and defects, and their quality directly impacts the safety and performance of the entire vehicle. Traditional defect detection methods rely primarily on manual visual inspection or single image recognition technology, which struggles to comprehensively analyze multi-dimensional information from the manufacturing process, resulting in low efficiency and limited accuracy in defect identification.
[0003] Patent CN110567974B discloses a cloud-based artificial intelligence surface defect detection system. This system includes an edge module and a cloud data processing module. The edge module includes a data acquisition unit and a result feedback unit. The data acquisition unit acquires images of the object to be detected and transmits them to the cloud data processing module. The result feedback unit receives and displays the detection results obtained by the cloud data processing module after processing the acquired images. The cloud data processing module includes an intelligent annotation unit, a training unit, and a detection unit. The intelligent annotation unit first learns from manually annotated images, identifying good, defective, and defective products. Then, it uses the learned results to annotate the images to be annotated, thus determining the good, defective, and defective information. Next, a human checks the annotation results of the intelligent annotation unit and corrects them. Finally, the data on the good, defective, and defective information of the images to be detected, obtained after human inspection, is transmitted to the training unit. The annotation algorithm for annotating the labeled images is fannotation. The calculation formula for the good, defective, and defective information data of the image to be detected is c, ides = fannotation(Xna|θexperts), where c is the good or defective category of the image to be detected, ides is the defect information, including the location, size, and type of defects, Xna is the collected data, and θexperts is expert supervision. The training unit builds a prediction model based on the training data and passes the prediction model to the detection unit. The calculation formula for the parameter L of the prediction model is fmodel, where fmodel is the AI algorithm model, θmodel is the parameter required by the AI algorithm model, and Xp is the good sample of the labeled category c. The detection unit receives the prediction model and uses it to detect the image to be detected, thereby obtaining the detection result of the image to be detected, that is, determining whether the image to be detected is a defective product and the defective product information. Then, the detection unit feeds back the detection result to the result feedback unit for display, thereby realizing the detection of missing items.
[0004] Therefore, the cloud-based AI-based surface defect detection system has the following problems: The system relies on images collected at the edge and uploaded to the cloud for processing, resulting in network transmission delays that prevent true real-time feedback of detection results and affect the timeliness of defect identification; the system relies solely on image data for defect identification, ignoring key physical parameters during processing such as spindle speed, feed rate, and depth of cut, failing to reflect dynamic changes in processing status and limiting the accuracy and comprehensiveness of detection; the system relies on manually labeled training data, and the subjectivity and incompleteness of the labeling may lead to insufficient model generalization ability, making it difficult to adapt to different processing conditions and defect types. Summary of the Invention
[0005] To address this, the present invention provides an artificial intelligence-based defect detection method that overcomes the problem of low defect detection accuracy caused by insufficient response to dynamic interference due to over-reliance on image information and model analysis in existing technologies by real-time acquisition of multi-source data and dynamic threshold adjustment.
[0006] To achieve the above objectives, the present invention provides an artificial intelligence-based defect detection method, comprising:
[0007] The corner connection area of the machined surface of the automotive part to be inspected is divided into several observation areas, and images, spindle speed, feed rate and depth of cut of the machine tool used to process the automotive part to be inspected are collected in real time. The flatness deviation, three-dimensional contour point cloud deviation and roughness of the surface in each observation area are also collected.
[0008] Several first interest regions are determined based on the flatness deviation and the preset flatness tolerance threshold;
[0009] Several second interest areas are determined based on the spindle speed, the roughness of each interest area, and a preset synchronization threshold.
[0010] Based on the positions of all second interest regions within a preset anomaly determination period and the deviation of the three-dimensional contour point cloud, several first anomaly regions are determined. Based on the spindle speed, feed rate, cutting depth, and roughness within the same preset anomaly determination period, the input method is determined. Based on the determined input method, all images within the same preset anomaly determination period are input into a preset artificial intelligence model to obtain several second anomaly regions.
[0011] The regional deviation is determined based on the first abnormal region and the second abnormal region, and the preset synchronization threshold is adjusted based on the regional deviation.
[0012] Based on the adjustment of the preset synchronization threshold, several first abnormal regions are re-determined to obtain several corrected regions, and several defective regions are determined according to the flatness deviation between any two adjacent corrected regions.
[0013] Furthermore, the process of determining several second regions of interest based on the spindle speed, the roughness of each region of interest, and a preset synchronization threshold includes:
[0014] Calculate the standard deviation of all spindle speeds from the initial time to each time within the preset focus period to obtain several spindle speed fluctuation values. Then, perform maximum-minimum normalization on each spindle speed fluctuation value to obtain several normalized spindle speed values.
[0015] Calculate the standard deviation of all roughnesses from the initial time to each time within the preset focus period to obtain several roughness fluctuation values of focus, and perform maximum-minimum normalization on each roughness fluctuation value to obtain several roughness normalization values of focus.
[0016] Calculate the Pearson correlation coefficients of all the normalized spindle speed values and all the normalized roughness values of concern to obtain the fluctuation synchronization degree;
[0017] Based on the comparison between the fluctuation synchronization degree and the preset synchronization degree threshold, several second interest regions are selected from all the first abnormal regions.
[0018] Furthermore, the process of determining several first abnormal regions based on the positions of all second regions of interest within a preset anomaly determination period and the deviation of the three-dimensional contour point cloud includes:
[0019] Obtain the Euclidean distance between the positions of all second areas of interest and preset reference coordinates at each time point within the preset anomaly determination period to obtain the distribution distance;
[0020] Calculate the standard deviation of all the aforementioned distribution distances to obtain several degrees of interest in the distribution;
[0021] Based on the attention distribution degree and the corresponding three-dimensional contour point cloud deviation, a number of marked times in the preset anomaly determination period are determined;
[0022] Several first abnormal regions are determined based on the time distribution characteristics of all the marked times in the preset abnormal determination period.
[0023] Furthermore, the process of determining several marked times in the preset anomaly determination period based on the aforementioned attention distribution degree and the corresponding three-dimensional contour point cloud deviation includes:
[0024] Several temporary timestamps are determined based on the comparison results between the attention distribution degree and the preset attention distribution degree threshold;
[0025] Calculate the standard deviation of the 3D contour point cloud deviation corresponding to all temporary timestamps to determine the 3D deviation variability.
[0026] Based on the comparison results between the three-dimensional deviation volatility and the preset deviation volatility threshold, several marked times are selected from all the temporary timestamps.
[0027] Furthermore, the process of determining several first abnormal regions based on the time distribution characteristics of all the marked times within the preset abnormality determination period includes:
[0028] Obtain the total duration from the initial time to each marked time within the preset anomaly determination period;
[0029] Calculate the standard deviation of the entire duration to obtain the time distribution degree;
[0030] Based on the comparison between the time distribution degree and the preset time distribution degree threshold, several first abnormal regions are determined from all second regions of interest.
[0031] Furthermore, the process of determining the input method based on the spindle speed, feed rate, depth of cut, and surface roughness within the same preset anomaly determination cycle includes:
[0032] Several machining indices are determined based on the spindle speed, feed rate, and depth of cut within the same preset anomaly determination period;
[0033] The degree of variation is determined based on all the aforementioned processing indices and all the aforementioned roughness;
[0034] The input method is determined based on the comparison between the change consistency and the preset consistency threshold.
[0035] Further, the process of determining the regional deviation based on the first abnormal region and the second abnormal region, and adjusting the preset synchronization threshold based on the regional deviation, includes:
[0036] Obtain the Euclidean distance between all first abnormal regions and the corresponding nearest second abnormal region, calculate the average value of all Euclidean distances, and perform maximum value normalization on the average value of all Euclidean distances to obtain the position normalization value.
[0037] Calculate the absolute value of the quantity difference between the first abnormal region and the second abnormal region, and denot it as the quantity deviation;
[0038] Calculate the average of the sum of the number of the first and second abnormal regions;
[0039] Calculate the ratio of the quantity deviation to the average of the quantities to obtain the normalized quantity value;
[0040] The regional deviation is obtained by weighted summation of the location normalization value and the quantity normalization value.
[0041] When the regional deviation is greater than the preset regional deviation threshold, the preset synchronization threshold is reduced according to the relative deviation between the regional deviation and the preset regional deviation threshold.
[0042] Furthermore, the process of determining a plurality of defect regions based on the flatness deviation between any two adjacent correction regions includes:
[0043] The deviation difference value is determined based on the flatness deviation between any two adjacent correction regions;
[0044] Several defect areas are determined based on the comparison results between the deviation difference value and the preset difference threshold.
[0045] Furthermore, the process of determining several first regions of interest based on the flatness deviation and the preset flatness tolerance threshold includes:
[0046] Several first regions of interest are determined based on the comparison results between the flatness deviation and the preset flatness tolerance threshold.
[0047] Furthermore, the corner connection area of the machined surface of the automotive part to be inspected is divided into several observation areas, including:
[0048] The corner connection area of the machined surface of the automotive part to be inspected is divided into two-dimensional grids with a preset grid side length to form several non-overlapping observation areas.
[0049] Compared with existing technologies, the advantages of this invention lie in its ability to achieve comprehensive perception of microscopic changes in surface morphology by meshing the corner connection areas of the machined surfaces of automotive parts and combining real-time acquisition of parameters such as flatness deviation, roughness, and 3D contour point cloud deviation. Simultaneously, it incorporates machining parameters such as spindle speed, feed rate, and depth of cut to reflect the direct impact of process conditions on surface quality. Based on this, it extracts machining consistency features by observing the synchronous fluctuations in roughness and spindle speed, further identifying areas with potential abnormal evolution trends. Subsequently, it utilizes image and machining parameter fusion modeling to extract abnormal distributions from the overall machining cycle, enhancing the ability to identify invisible or early-stage anomalies. Finally, through cross-comparison of abnormal areas and correction of distribution characteristics, it achieves accurate identification of defective areas. Each stage is based on data response relationships, forming a closed-loop detection mechanism from acquisition, identification, to correction, ensuring the accuracy, sensitivity, and practicality of defect detection. This effectively solves the problem of insufficient response and low defect detection accuracy caused by over-reliance on image information and model analysis in the face of dynamic interference.
[0050] Furthermore, by quantifying and correlating the fluctuation characteristics of spindle speed and surface roughness, the response relationship between the machine tool's dynamic state and the workpiece's surface quality can be reflected in real time. The standard deviation of the spindle speed reflects the instability of the machine tool's rotation, while the standard deviation of the roughness reveals the influence of tool cutting on surface texture. The synchronization index obtained by normalizing these two sets of fluctuation values and calculating the Pearson correlation coefficient can accurately characterize the synchronization degree between machining vibration and surface morphology changes. When the synchronization degree exceeds a preset threshold, it indicates that the speed fluctuation and surface roughness fluctuation in this area are highly consistent, often corresponding to defect risk points caused by sudden changes in cutting load or tool wear. Thus, the relevant first abnormal area is further screened as the second area of concern. Based on the inherent coupling relationship between machining parameters and surface features, not only is the accurate positioning rate of defect areas improved, but early warning can also be issued in the early stages of process fluctuations, realizing highly sensitive detection and proactive intervention for minor machining anomalies.
[0051] Furthermore, by analyzing the distribution of Euclidean distances between the second region of interest and preset reference coordinates, the spatial clustering of anomalies can be quantified. The standard deviation of the distance values reflects the dispersion or concentration of anomalies. By combining the deviation of the three-dimensional contour point cloud at each moment, key moments that exhibit both large geometric deviations and spatial clustering can be identified. Furthermore, by filtering the temporal distribution characteristics of these marked moments throughout the anomaly determination period, only continuous or frequently occurring anomalies are retained, thus obtaining the final first anomaly region. By utilizing the synergistic change characteristics of anomalies in space and geometric deviation, it is possible to effectively distinguish between sporadic noise and real defect clusters, significantly improving the detection rate and positioning accuracy of early minor defects.
[0052] Furthermore, by focusing on the distribution degree threshold, temporary timestamps of spatially anomalous clusters are quickly screened out. Then, the volatility threshold of the 3D contour point cloud deviation is used to further extract key moments of continuous or significant change, achieving dual filtering of the anomalous evolution process. The distribution degree reflects the spatial concentration of the anomalous area. Only when this concentration exceeds the set threshold is the corresponding moment included in the temporary candidate. Subsequently, the standard deviation of the point cloud deviation of these candidate moments is calculated to obtain the volatility, which is used to measure the magnitude of change of defect features over time. Finally, only moments with volatility exceeding the threshold are retained as marker moments to eliminate occasional interference and lock in the true defect triggering time. Based on the principle of synchronous change of spatial clustering and geometric deviation, the spatiotemporal characteristics of the initial manifestation of small defects can be accurately captured, thereby significantly improving the defect detection rate and positioning accuracy.
[0053] Furthermore, by calculating the standard deviation of the time intervals between marked moments, the temporal concentration of abnormal events can be quantified: when the fluctuation amplitude of these time intervals is below a threshold, it means that the abnormal phenomenon occurs repeatedly and continuously within a preset period, thus the corresponding second area of interest can be identified as the true first abnormal area. This method utilizes the statistical characteristics of time interval differences and standard deviations to accurately distinguish between occasional fluctuations and persistent defect signals, and can capture anomalies immediately at the initial stage of defect accumulation, significantly improving the detection sensitivity and location accuracy of early signs of processing defects.
[0054] Furthermore, by normalizing and weighting the spindle speed, feed rate, and depth of cut, a machining index is constructed to characterize the working condition at each moment. Then, combined with the corresponding roughness fluctuations at each moment, the standard deviation is calculated and normalized. Finally, the Pearson correlation coefficient is used to reflect whether the trends of the two are consistent, thus scientifically determining whether changes in machining parameters will synchronously cause surface quality fluctuations. When the correlation is weak, it indicates strong nonlinear fluctuations between different working condition stages. In this case, using a batch input method helps the artificial intelligence model learn local change characteristics more precisely. Conversely, when the correlation is strong, it indicates that the overall working condition changes have a stable impact on surface roughness. Overall input can improve the model's recognition efficiency, not only achieving dynamic adaptive switching of the input method but also effectively enhancing the model's adaptability and discrimination ability to multi-source data.
[0055] Furthermore, by calculating the differences in spatial location and quantity between the first and second abnormal regions, the consistency and matching degree of the detection results are comprehensively reflected. The location normalization value reflects the spatial distribution deviation of the abnormal regions, while the quantity normalization value reflects the degree of inconsistency in the number of abnormal regions. The two are weighted together to form the regional deviation, reflecting the overall degree of deviation. When the regional deviation exceeds a preset threshold, it indicates that there is a significant mismatch in the detection data, which may lead to a decrease in recognition accuracy. At this time, by dynamically adjusting the preset synchronization threshold according to the relative magnitude of the regional deviation, the synchronization judgment standard becomes more lenient, thereby adapting to changes in abnormal regions and error fluctuations. This adjustment mechanism relies on the ratio of regional deviation to the threshold, and is smoothly adjusted through a preset adjustment coefficient, effectively improving the adaptability and robustness of the detection system to complex processing conditions, and achieving more accurate defect identification and judgment.
[0056] Furthermore, by calculating the flatness deviation difference between adjacent correction areas, abrupt changes in local surface variations can be effectively captured. The deviation difference value reflects significant changes in flatness between areas. When this value exceeds a preset difference threshold, it indicates the presence of obvious morphological anomalies, i.e., signals of defects or processing defects. By setting a reasonable threshold, normal minor fluctuations can be distinguished from actual defects, thereby accurately locating defect areas.
[0057] Furthermore, by comparing the flatness deviation of the observed area with a preset flatness tolerance threshold, areas where the surface shape deviates from the allowable range can be effectively identified. When the flatness deviation exceeds this threshold, it indicates that the processing quality of that area may be abnormal or defective, and therefore it is identified as the area of first concern. By utilizing changes in surface geometry to reflect minute anomalies during the processing, it ensures that potential defective areas are given priority attention, thereby improving the accuracy and reliability of detection.
[0058] Furthermore, using preset grid side lengths to divide the machined surface into grids helps to refine the observation area and achieve precise monitoring of the corner connection areas of parts. Reasonably setting the grid side lengths ensures both spatial resolution for detection, enabling the capture of minute surface anomalies, and efficient use of computing resources, improving the overall accuracy and real-time performance of defect detection and promoting stable control of processing quality. Attached Figure Description
[0059] Figure 1 This is a flowchart of the artificial intelligence-based defect detection method in this embodiment;
[0060] Figure 2 This embodiment defines the logic diagram for determining the second region of interest.
[0061] Figure 3 This embodiment defines the logic diagram for determining the marking time.
[0062] Figure 4 The determination logic diagram for the first abnormal region in this embodiment is shown. Detailed Implementation
[0063] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0064] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0065] Please see Figure 1 As shown, it is a flowchart of the artificial intelligence-based defect detection method in this embodiment;
[0066] This embodiment provides an artificial intelligence-based defect detection method, including:
[0067] The corner connection area of the machined surface of the automotive part to be inspected is divided into several observation areas, and images, spindle speed, feed rate and depth of cut of the machine tool used to process the automotive part to be inspected are collected in real time. The flatness deviation, three-dimensional contour point cloud deviation and roughness of the surface in each observation area are also collected.
[0068] Several first interest regions are determined based on the flatness deviation and the preset flatness tolerance threshold;
[0069] Several second interest areas are determined based on the spindle speed, the roughness of each interest area, and a preset synchronization threshold.
[0070] Based on the positions of all second interest regions within a preset anomaly determination period and the deviation of the three-dimensional contour point cloud, several first anomaly regions are determined. Based on the spindle speed, feed rate, cutting depth, and roughness within the same preset anomaly determination period, the input method is determined. Based on the determined input method, all images within the same preset anomaly determination period are input into a preset artificial intelligence model to obtain several second anomaly regions.
[0071] The regional deviation is determined based on the first abnormal region and the second abnormal region, and the preset synchronization threshold is adjusted based on the regional deviation.
[0072] Based on the adjustment of the preset synchronization threshold, several first abnormal regions are re-determined to obtain several corrected regions, and several defective regions are determined according to the flatness deviation between any two adjacent corrected regions.
[0073] In this embodiment, the automotive part to be inspected is a front subframe structural component of an automobile, which is a typical load-bearing welded assembly. Its machined surface refers to the milling area located on the process reference side, which is used to ensure the assembly accuracy and connection reliability of the structural component. The corner connection area is the transition connection area formed between adjacent planes in the machined surface, which has the characteristics of large local curvature changes and stress concentration that is prone to defects.
[0074] In this embodiment, an industrial camera is installed on the machine tool. The camera is synchronized with the spindle speed signal of the CNC system via an external trigger line to acquire images of the machined surface at a fixed frame rate. The spindle speed, feed rate, and depth of cut parameters are continuously read and pushed to the data acquisition node at millisecond intervals through the digital bus interface of the machine tool controller. The flatness deviation is cross-scanned at the boundary of each observation area by a laser displacement sensor array, and the scanning results are uploaded in real time through a high-speed motion control card. The three-dimensional contour point cloud deviation is calibrated by a structured light three-dimensional imaging unit before machining starts, and the point cloud is acquired frame by frame in a step-triggered manner in combination with the machining coordinate system and compared with the design model. The surface roughness data is continuously measured by an online miniature contact roughness sensor at the end of the milling toolpath and transmitted synchronously through a fieldbus, thereby realizing the full-process synchronous acquisition of images, machining parameters, and surface quality characteristics.
[0075] The preset flatness tolerance threshold is a standard value used to determine whether the flatness of the machined surface meets the requirements. It depends on the part design specifications and the accuracy requirements of the machining process. It is usually set between 0.01 mm and 0.1 mm. In this embodiment, it is set to 0.03 mm, which can effectively distinguish between normal machining errors and abnormal defects.
[0076] The preset synchronization threshold is used to measure the consistency between machining parameters and surface roughness changes. It depends on the machine tool performance and machining process stability, and is usually set between 0.7 and 0.95. In this embodiment, it is set to 0.85, which can accurately identify abnormal fluctuations in the machining state.
[0077] The preset anomaly determination period refers to the length of the data time window used for anomaly determination. It depends on the processing cycle and process complexity, and is usually set between 5 and 60 seconds. In this embodiment, it is set to 20 seconds, which can comprehensively reflect the dynamic changes in the processing process so as to detect anomalies in a timely manner.
[0078] In this embodiment, the pre-set artificial intelligence model adopts a temporal defect detection architecture based on a two-stage deep network: First, a ResNet-50 pre-trained model is used as the backbone network to extract high-level spatial features for each frame of image; second, the extracted feature sequence is input into a bidirectional long short-term memory network (Bi-LSTM) to capture temporal changes between consecutive frames; finally, a fully connected classification layer is added on top of the LSTM output, and the anomalous probability of each grid is given through Softmax activation, which is then merged into several second anomalous regions. The model is fine-tuned through transfer learning on publicly available metal processing defect image datasets (such as the NEU Surface Defect Database), and further incrementally trained with 1000+ labeled images under typical milling conditions of this method, enabling it to accurately identify various minor defects including cracks, scratches, and dents.
[0079] By meshing the corner connection areas of the machined surfaces of automotive parts and combining real-time acquisition of parameters such as flatness deviation, roughness, and 3D contour point cloud deviation, a comprehensive perception of microscopic changes in surface morphology was achieved. Simultaneously, machining parameters such as spindle speed, feed rate, and depth of cut were introduced to reflect the direct impact of process conditions on surface quality. Based on this, machining consistency features were extracted by observing the synchronous fluctuations in roughness and spindle speed, further identifying areas with potential abnormal evolution trends. Subsequently, image and machining parameter fusion modeling was used to extract abnormal distributions from the overall machining cycle, enhancing the ability to identify invisible or early-stage anomalies. Finally, through cross-comparison of abnormal areas and correction of distribution characteristics, accurate identification of defect areas was achieved. Each stage is based on data response relationships, forming a closed-loop detection mechanism from acquisition, identification, to correction, ensuring the accuracy, sensitivity, and practicality of defect detection. This effectively solves the problem of insufficient response and low defect detection accuracy caused by over-reliance on image information and model analysis in the face of dynamic interference.
[0080] Please continue reading. Figure 2 As shown, this is the logic diagram for determining the second region of interest in this embodiment;
[0081] The process of determining several second regions of interest based on the spindle speed, the roughness of each region of interest, and a preset synchronization threshold includes:
[0082] Calculate the standard deviation of all spindle speeds from the initial time to each time within the preset focus period to obtain several spindle speed fluctuation values. Then, perform maximum-minimum normalization on each spindle speed fluctuation value to obtain several normalized spindle speed values.
[0083] Calculate the standard deviation of all roughnesses from the initial time to each time within the preset focus period to obtain several roughness fluctuation values of focus, and perform maximum-minimum normalization on each roughness fluctuation value to obtain several roughness normalization values of focus.
[0084] Calculate the Pearson correlation coefficients of all the normalized spindle speed values and all the normalized roughness values of concern to obtain the fluctuation synchronization degree;
[0085] When the fluctuation synchronization degree is greater than the preset synchronization degree threshold, the first abnormal region is determined as the second region of interest, so as to select a number of second regions of interest from all the first abnormal regions.
[0086] The preset attention determination period is the length of the time window used to statistically analyze the fluctuations of processing parameters and surface quality characteristics. It depends on the processing cycle and the requirements of defect response speed, and is usually set between 2 and 15 seconds. In this embodiment, it is set to 8 seconds, which can filter out occasional interference while ensuring real-time response and achieve accurate capture of processing anomalies.
[0087] By quantifying and correlating the fluctuation characteristics of spindle speed and surface roughness, the response relationship between the machine tool's dynamic state and the workpiece's surface quality can be reflected in real time. The standard deviation of spindle speed reflects the instability of machine tool rotation, while the standard deviation of roughness reveals the influence of tool cutting on surface texture. The synchronization index obtained by normalizing these two sets of fluctuation values and calculating the Pearson correlation coefficient can accurately characterize the synchronization degree between machining vibration and surface morphology changes. When the synchronization degree exceeds a preset threshold, it indicates that the speed fluctuation and surface roughness fluctuation in this area are highly consistent, often corresponding to defect risk points caused by sudden changes in cutting load or tool wear. Thus, the relevant first abnormal area is further screened as the second area of concern. Based on the inherent coupling relationship between machining parameters and surface features, not only is the accurate positioning rate of defect areas improved, but early warning can also be issued in the early stage of process fluctuations, realizing highly sensitive detection and active intervention of minor machining anomalies.
[0088] Specifically, the process of determining several first abnormal regions based on the positions of all second regions of interest within a preset anomaly determination period and the deviation of the three-dimensional contour point cloud includes:
[0089] Obtain the Euclidean distance between the positions of all second areas of interest and preset reference coordinates at each time point within the preset anomaly determination period to obtain the distribution distance;
[0090] Calculate the standard deviation of all the aforementioned distribution distances to obtain several degrees of interest in the distribution;
[0091] Based on the distribution degree of each concern and the deviation of the three-dimensional contour point cloud at the corresponding time, several marked times in the preset anomaly determination cycle are determined.
[0092] Several first anomaly regions are determined based on the time distribution characteristics of all marked times within a preset anomaly determination period.
[0093] By analyzing the distribution of Euclidean distances between the second region of interest and preset reference coordinates, the spatial clustering of anomalies can be quantified. The standard deviation of the distance values reflects the dispersion or concentration of anomalies. By combining the deviation of the three-dimensional contour point cloud at each moment, key moments that exhibit both large geometric deviations and spatial clustering can be identified. Furthermore, by filtering the temporal distribution characteristics of these marked moments throughout the anomaly determination period, only continuous or frequently occurring anomalies are retained, thus obtaining the final first anomaly region. By utilizing the synergistic changes of anomalies in space and geometric deviation, it is possible to effectively distinguish between sporadic noise and real defect clusters, significantly improving the detection rate and positioning accuracy of early minor defects.
[0094] Please continue reading. Figure 3As shown, this is the logic diagram for determining the marking time in this embodiment;
[0095] The process of determining several marked moments in the preset anomaly determination period based on the aforementioned attention distribution degree and the corresponding three-dimensional contour point cloud deviation includes:
[0096] When the attention distribution degree is greater than the preset attention distribution degree threshold, the corresponding time is determined as a temporary timestamp, so as to determine a number of temporary timestamps;
[0097] Calculate the standard deviation of the 3D contour point cloud deviation corresponding to all temporary timestamps to determine the 3D deviation variability.
[0098] When the three-dimensional deviation fluctuation exceeds the preset deviation fluctuation threshold, the corresponding temporary timestamp is selected from all temporary timestamps and marked to obtain several marked times.
[0099] The preset attention distribution threshold is a standard value used to determine whether anomalies are clustered in space. It depends on the grid density and defect distribution characteristics of the observation area and is usually set between 0.2 and 0.5. In this embodiment, it is set to 0.3, which can effectively distinguish between sporadic noise and real defect clusters.
[0100] The preset deviation fluctuation threshold is a standard value used to measure the magnitude of the change in the deviation of the three-dimensional contour point cloud over time. It depends on the processing accuracy requirements and the point cloud measurement error level, and is usually set between 0.01mm and 0.05mm. In this embodiment, it is set to 0.02mm, which can accurately capture the small geometric changes in the early stage of defects.
[0101] By focusing on a distribution degree threshold to quickly filter out temporary timestamps of spatially anomalous clusters, and then using a fluctuation threshold of 3D contour point cloud deviation to further extract key moments of continuous or significant change, a dual filtering of the anomalous evolution process is achieved. The distribution degree reflects the spatial concentration of the anomalous area; only when this concentration exceeds a set threshold is the corresponding moment included in the temporary candidate. Subsequently, the standard deviation of the point cloud deviation of these candidate moments is calculated to obtain the fluctuation, which is used to measure the magnitude of change of defect features over time. Finally, only moments with fluctuation exceeding the threshold are retained as marker moments to eliminate occasional interference and lock in the true defect triggering time. Based on the principle of synchronous change of spatial clustering and geometric deviation, the spatiotemporal characteristics of the initial manifestation of minor defects can be accurately captured, thereby significantly improving the defect detection rate and localization accuracy.
[0102] Please continue reading. Figure 4 As shown, this is the logic diagram for determining the first abnormal region in this embodiment;
[0103] The process of determining several first abnormal regions based on the temporal distribution characteristics of all the marked times within the preset abnormality determination period includes:
[0104] Obtain the total duration from the initial time to each marked time within the preset anomaly determination period;
[0105] Calculate the standard deviation of the entire duration to obtain the time distribution degree;
[0106] When the time distribution degree is less than the preset time distribution degree threshold, the second region of interest is determined as the first abnormal region, so as to identify several first abnormal regions.
[0107] The preset time distribution threshold is a standard parameter used to measure the degree of time concentration of the marked time within the preset anomaly determination period. It depends on the repetition frequency of abnormal events and the fluctuation tolerance range during the processing. It is usually set between 0.3 seconds and 2 seconds. In this embodiment, it is set to 1 second, which can effectively identify the time period of concentrated distribution of anomalies and eliminate misjudgments caused by occasional fluctuations.
[0108] By calculating the standard deviation of the time intervals between marked moments, the temporal concentration of abnormal events can be quantified: when the fluctuation range of these time intervals is below a threshold, it means that the abnormal phenomenon occurs repeatedly and continuously within a preset period, thus the corresponding second area of interest can be identified as the true first abnormal area. This method utilizes the statistical characteristics of time interval differences and standard deviations to accurately distinguish between occasional fluctuations and persistent defect signals, and can capture anomalies immediately at the initial stage of defect accumulation, significantly improving the detection sensitivity and location accuracy of early signs of processing defects.
[0109] Specifically, the process of determining the input method based on the spindle speed, feed rate, depth of cut, and surface roughness within the same preset anomaly determination cycle includes:
[0110] The maximum-minimum normalization process is performed on all spindle speeds within the same preset anomaly determination period to obtain several spindle speed normalization values.
[0111] The maximum-minimum normalization process is performed on all feed rates within the same preset anomaly determination period to obtain several feed normalization values;
[0112] The maximum-minimum value normalization process is performed on all cutting depths within the same preset anomaly determination period to obtain several cutting normalization values;
[0113] The master rotation normalized value, feed normalized value, and cutting normalized value at each time point are weighted and summed to obtain several machining indices, Qi = a × Ai + b × Bi + c × Ci, where Qi is the machining index at the i-th time point, Ai is the master rotation normalized value at the i-th time point, a is the preset master rotation weight, Bi is the feed normalized value at the i-th time point, b is the preset feed weight, Ci is the cutting normalized value at the i-th time point, and c is the preset cutting weight.
[0114] Calculate the standard deviation of all processing indices from the initial time to each time within the same preset anomaly determination period to obtain several index fluctuation values, and perform maximum-minimum normalization on the index fluctuation values to obtain several index normalization values.
[0115] Calculate the standard deviation of all roughnesses from the initial time to each time within the same preset anomaly determination period to obtain several judgment roughness fluctuation values, and perform maximum-minimum value normalization on the judgment roughness fluctuation values to obtain several judgment roughness normalization values.
[0116] Calculate the Pearson correlation coefficient for all exponential normalized values and all rough normalized values to obtain the consistency of change;
[0117] When the consistency of change is less than a preset consistency threshold, the input method is determined to be batch input;
[0118] When the consistency of change is greater than or equal to the preset consistency threshold, the input method is determined to be the whole input.
[0119] The preset spindle speed weight is a weighting factor used in the calculation of the machining index for the normalized value of the spindle speed. Its value depends on the actual influence of the spindle speed on surface quality changes, and is usually set between 0.2 and 0.5. In this embodiment, it is set to 0.3, which can reflect its representativeness to roughness changes while ensuring spindle stability.
[0120] The preset feed weight is a weighting factor for the normalized feed rate value in the machining index calculation. Its value depends on the contribution of the feed rate to the cutting marks and surface roughness, and is usually set between 0.3 and 0.6. In this embodiment, it is set to 0.5, which can effectively reflect the dominant role of the feed rate in the machining process disturbance.
[0121] The preset cutting weight is a weighting factor used in the calculation of the machining index for the normalized value of the depth of cut. Its value depends on the influence of the depth of cut on the mechanical load and thermal deformation in actual machining, and is usually set between 0.1 and 0.4. In this embodiment, it is set to 0.2, which can better control the micro-profile disturbance caused by the change in the depth of cut.
[0122] The preset consistency threshold is the boundary for determining whether there is a strong correlation between the processing index and roughness fluctuation. Its value is usually set based on historical statistical patterns and is typically between 0.6 and 0.85. In this embodiment, it is set to 0.75, which can effectively distinguish between working conditions with consistent overall trends and those with significant local fluctuations, guiding the adaptive selection of the input method.
[0123] The process of inputting all the images within the same preset anomaly determination period into a preset artificial intelligence model in batches includes:
[0124] All images within the same preset anomaly determination period are input into the preset artificial intelligence model in batches using a sliding window method according to a preset time step, and the inference is completed batch by batch, and the corresponding second anomaly region is output.
[0125] The preset time step refers to the interval between the starting time points of adjacent batches of images when the image sequence is input in batches using the sliding window method. It depends on the frequency of image acquisition during processing, the stability of the processing rhythm, and the sensitivity of the model to continuous information. It is usually set between 0.5 seconds and 3 seconds. In this embodiment, it is set to 1 second, which can improve the model processing efficiency while ensuring the continuous capture of abnormal changes.
[0126] The process of inputting all images within the same preset anomaly determination period into a preset artificial intelligence model includes:
[0127] All images within the same preset anomaly determination period are stitched together in chronological order to form a continuous image sequence, which is then input into a preset artificial intelligence model for unified processing, and the corresponding second anomaly region is output.
[0128] By normalizing and weighting the spindle speed, feed rate, and depth of cut, a machining index is constructed to characterize the working condition at each moment. Then, combined with the corresponding roughness fluctuations at each moment, the standard deviation is calculated and normalized. Finally, the Pearson correlation coefficient is used to reflect whether the trends of the two parameters are consistent, thus scientifically determining whether changes in machining parameters will synchronously cause surface quality fluctuations. When the correlation is weak, it indicates strong nonlinear fluctuations between different working condition stages. In this case, using a batch input method helps the artificial intelligence model learn local change characteristics more precisely. Conversely, when the correlation is strong, it indicates that the overall working condition changes have a stable impact on surface roughness. Overall input can improve the model's recognition efficiency. This not only achieves dynamic adaptive switching of the input method but also effectively enhances the model's adaptability and discrimination ability to multi-source data.
[0129] Specifically, the process of determining the regional deviation based on the first abnormal region and the second abnormal region, and adjusting the preset synchronization threshold based on the regional deviation, includes:
[0130] Obtain the Euclidean distance between all first abnormal regions and the corresponding nearest second abnormal region, calculate the average value of all Euclidean distances, and perform maximum value normalization on the average value of all Euclidean distances to obtain the position normalization value.
[0131] Calculate the absolute value of the quantity difference between the first abnormal region and the second abnormal region, and denot it as the quantity deviation;
[0132] Calculate the average of the sum of the number of the first and second abnormal regions;
[0133] Calculate the ratio of the quantity deviation to the average of the quantities to obtain the normalized quantity value;
[0134] The weighted summation of the position normalization value and the quantity normalization value yields the regional deviation, P = z × Z + m × M, where P is the regional deviation, z is the preset position weight, Z is the position normalization value, m is the preset quantity weight, and M is the quantity normalization value.
[0135] When the regional deviation is greater than the preset regional deviation threshold, the preset synchronization threshold is reduced according to the relative deviation between the regional deviation and the preset regional deviation threshold, U'=U×[1-k×(P-P0) / P0], where U' is the preset synchronization threshold after reduction, U is the preset synchronization threshold before reduction, k is the preset synchronization adjustment coefficient, and P0 is the preset regional deviation threshold.
[0136] The preset position weight is used to measure the influence of the position normalization value in the calculation of regional deviation. It depends on the importance of the spatial distribution difference and is usually set between 0 and 1. In this embodiment, it is set to 0.6, which can reasonably reflect the contribution of position deviation to the overall deviation.
[0137] The preset quantity weight is used to measure the influence of the quantity normalization value in the calculation of regional deviation. It depends on the impact of quantity difference on detection accuracy and is usually set between 0 and 1. In this embodiment, it is set to 0.4, which can effectively balance the combined effect of quantity deviation and position deviation.
[0138] The preset synchronization adjustment coefficient is used to control the magnitude of the synchronization threshold adjustment based on the regional deviation. It depends on the system's requirements for synchronization sensitivity and is usually set between 0 and 1. In this embodiment, it is set to 0.3, which can smoothly adjust the threshold and prevent over-adjustment that could lead to misjudgment.
[0139] By calculating the differences in spatial location and quantity between the first and second abnormal regions, the consistency and matching degree of the detection results are comprehensively reflected. The location normalization value reflects the spatial distribution deviation of the abnormal regions, while the quantity normalization value reflects the degree of inconsistency in the number of abnormal regions. The two are weighted together to form the regional deviation, reflecting the overall degree of deviation. When the regional deviation exceeds a preset threshold, it indicates a significant mismatch in the detection data, which may lead to a decrease in recognition accuracy. At this time, the preset synchronization threshold is dynamically adjusted according to the relative magnitude of the regional deviation, making the synchronization judgment standard more lenient, thereby adapting to changes in abnormal regions and error fluctuations. This adjustment mechanism relies on the ratio of regional deviation to the threshold, and is smoothly adjusted through a preset adjustment coefficient, effectively improving the adaptability and robustness of the detection system to complex processing conditions, and achieving more accurate defect identification and judgment.
[0140] Specifically, the process of determining a number of defect regions based on the flatness deviation between any two adjacent correction regions includes:
[0141] Calculate the difference in flatness deviation between any two adjacent correction regions to obtain the deviation difference value;
[0142] When the deviation difference value is greater than the preset difference threshold, the two corresponding correction areas are determined as defect areas, so as to identify a number of defect areas.
[0143] The preset difference threshold is used to distinguish between normal fluctuations and abnormal abrupt changes in flatness deviation between adjacent correction areas. It depends on the accuracy requirements of the processing technology and the material properties, and is usually set between 0.01 mm and 0.1 mm. In this embodiment, it is set to 0.05 mm, which can effectively identify obvious surface defect areas.
[0144] By calculating the flatness deviation difference between adjacent correction areas, abrupt changes in local surface variations can be effectively captured. The deviation difference value reflects significant changes in flatness between areas. When this value exceeds a preset difference threshold, it indicates the presence of obvious morphological anomalies, i.e., signals of defects or processing defects. By setting a reasonable threshold, normal minor fluctuations can be distinguished from actual defects, thereby accurately locating defect areas.
[0145] Specifically, the process of determining several first areas of interest based on the flatness deviation and the preset flatness tolerance threshold includes:
[0146] When the flatness deviation is greater than the preset flatness tolerance threshold, the observation area is determined as the first area of interest, so as to identify several first areas of interest.
[0147] By comparing the flatness deviation of the observed area with a preset flatness tolerance threshold, areas where the surface shape deviates from the allowable range can be effectively identified. When the flatness deviation exceeds this threshold, it indicates that the processing quality of that area may be abnormal or defective, and therefore it is identified as the area of first concern. Utilizing changes in surface geometry to reflect minute anomalies during the processing ensures that potential defective areas are given priority attention, thereby improving the accuracy and reliability of detection.
[0148] Specifically, the corner connection area of the machined surface of the automotive part to be inspected is divided into several observation areas, including:
[0149] The corner connection area of the machined surface of the automotive part to be inspected is divided into two-dimensional grids with a preset grid side length, forming several non-overlapping observation areas.
[0150] The preset grid side length refers to the fixed side length used when dividing the corner connection area of the machined surface of the automotive part to be inspected into a two-dimensional grid. It depends on the size of the part, the machining accuracy requirements, and the inspection resolution requirements. It is usually set between 1 mm and 10 mm. In this embodiment, it is set to 5 mm, which can effectively divide the fine areas of the machined surface, balancing the precision of the inspection and the computational efficiency.
[0151] Dividing the machined surface into grids with preset grid side lengths helps to refine the observation area and achieve precise monitoring of the corner connection areas of parts. Reasonably setting the grid side lengths ensures both spatial resolution for detection, enabling the capture of minute surface anomalies, and efficient use of computational resources, thereby improving the overall accuracy and real-time performance of defect detection and promoting stable control of machining quality.
[0152] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An artificial intelligence-based defect detection method, characterized by, The method comprises the following steps: dividing the corner connecting area of the machining surface of the vehicle part to be detected into a plurality of observation regions, and collecting the images, spindle speed, feed speed and cutting depth at the machining machine for machining the vehicle part to be detected in real time, the planeness deviation of the surface in each observation region, the three-dimensional profile point cloud deviation and the roughness; determining a plurality of first attention regions according to the planeness deviation and a preset planeness tolerance threshold; determining a plurality of second attention regions according to the spindle speed, the roughness in each of the attention regions and a preset synchronization degree threshold; determining a plurality of first abnormal regions according to the positions of all the second attention regions in a preset abnormal determination period and the three-dimensional profile point cloud deviation, determining the input mode according to the spindle speed, the feed speed, the cutting depth and the roughness in the same preset abnormal determination period, and inputting all the images in the same preset abnormal determination period into a preset artificial intelligence model according to the determined input mode to obtain a plurality of second abnormal regions; determining a region deviation according to the first abnormal region and the second abnormal region, and adjusting the preset synchronization degree threshold according to the region deviation; redetermining a plurality of the first abnormal regions after adjusting the preset synchronization degree threshold to obtain a plurality of corrected regions, and determining a plurality of defect regions according to the planeness deviation of any two adjacent corrected regions. 2.The AI-based defect detection method of claim 1, wherein, The process of determining a plurality of second attention regions according to the spindle speed, the roughness in each of the attention regions and a preset synchronization degree threshold comprises: calculating the standard deviation of all spindle speeds from the initial time to each time in a preset attention determination period to obtain a plurality of spindle speed fluctuation values, and performing maximum-minimum value normalization processing on each spindle speed fluctuation value to obtain a plurality of spindle speed normalized values; calculating the standard deviation of all roughnesses from the initial time to each time in a preset attention determination period to obtain a plurality of attention roughness fluctuation values, and performing maximum-minimum value normalization processing on each roughness fluctuation value to obtain a plurality of attention roughness normalized values; calculating the Pearson correlation coefficient of all the spindle speed normalized values and all the attention roughness normalized values to obtain a fluctuation synchronization degree; comparing the fluctuation synchronization degree with the preset synchronization degree threshold to screen a plurality of second attention regions from all the first abnormal regions. 3.The AI-based defect detection method of claim 2, wherein, The process of determining a plurality of first abnormal regions according to the positions of all the second attention regions in a preset abnormal determination period and the three-dimensional profile point cloud deviation comprises: obtaining the Euclidean distance between the positions of all the second attention regions at each time in a preset abnormal determination period and a preset reference coordinate to obtain a distribution distance; calculating the standard deviation of all the distribution distances to obtain a plurality of attention distribution degrees; determining a plurality of marked time points in the preset abnormal determination period according to each of the attention distribution degrees and the three-dimensional profile point cloud deviation at the corresponding time point; determining a plurality of first abnormal regions according to the time distribution characteristics of all the marked time points in the preset abnormal determination period. 4.The AI-based defect detection method of claim 3, wherein, The process of determining a plurality of marked time points in the preset abnormal determination period according to each of the attention distribution degrees and the three-dimensional profile point cloud deviation at the corresponding time point comprises: Determine several temporary time stamps based on a comparison result of the attention distribution and a preset attention distribution threshold; Calculate a standard deviation of the three-dimensional profile point cloud deviation corresponding to all temporary time stamps to determine a three-dimensional deviation fluctuation degree; Based on a comparison result of the three-dimensional deviation fluctuation degree and a preset deviation fluctuation threshold, filter and mark several marked time points from all the temporary time stamps. 5.The AI-based defect detection method of claim 4, wherein, The process of determining several first abnormal regions according to the time distribution characteristics of all the marked time points in the preset abnormality determination period includes: Obtain all time lengths from the initial time point to each marked time point in the preset abnormality determination period; Calculate the standard deviation of all time lengths to obtain a time distribution degree; Based on a comparison result of the time distribution degree and a preset time distribution threshold, determine several first abnormal regions from all the second attention regions. 6.The AI-based defect detection method of claim 5, wherein, The process of determining an input mode according to the spindle speed, the feed speed, the cutting depth, and the roughness in the same preset abnormality determination period includes: Determine several machining indexes according to the spindle speed, the feed speed, and the cutting depth in the same preset abnormality determination period; Determine a change consistency degree according to all the machining indexes and all the roughnesses; Determine the input mode based on a comparison result of the change consistency degree and a preset consistency threshold. 7.The AI-based defect detection method of claim 6, wherein, The process of determining a region deviation according to the first abnormal region and the second abnormal region, and adjusting the preset synchronization threshold value according to the region deviation includes: Obtain the Euclidean distances between all first abnormal regions and corresponding nearest second abnormal regions, calculate the average value of all Euclidean distances, and perform maximum normalization processing on the average value of all Euclidean distances to obtain a position normalization value; Calculate the absolute value of the number difference between the first abnormal region and the second abnormal region, denoted as a number deviation; Calculate the average value of the sum of the number of the first abnormal region and the number of the second abnormal region; Calculate the ratio of the number deviation to the average value of the sum of the number to obtain a number normalization value; Perform weighted summation calculation on the position normalization value and the number normalization value to obtain a region deviation; When the region deviation is greater than a preset region deviation threshold, decrease the preset synchronization threshold value according to the relative deviation between the region deviation and the preset region deviation threshold. 8.The AI-based defect detection method of claim 7, wherein, The process of determining several defect regions according to the flatness deviation of each arbitrary adjacent two correction regions includes: Determine a deviation difference value according to the flatness deviation of any two adjacent correction regions; Determine several defect regions based on a comparison result of the deviation difference value and a preset difference threshold. 9.The AI-based defect detection method of claim 8, wherein, The process of determining several first attention regions according to the flatness deviation and a preset flatness tolerance threshold includes: Determine several first attention regions based on a comparison result of the flatness deviation and the preset flatness tolerance threshold. 10.The AI-based defect detection method of claim 9, wherein, The process of dividing the corner connecting area of the machining surface of the vehicle to be detected into several observation regions includes: Divide the corner connecting area of the machining surface of the vehicle to be detected into a two-dimensional grid with a preset grid side length to form several non-overlapping observation regions.
Citation Information
Patent Citations
A cloud-based artificial intelligence surface defect detection system
CN110567974B
Screw flaw detection and feeding control method and system based on machine vision
CN119016362A
PCB production line defect detection analysis method and system based on recognition model
CN119559173A