Method and system for detecting surface defects of a stamped part using ai
By generating root cause labeling results and performing attribution screening, the detection bias caused by non-void anomaly samples in the stamping part surface defect detection model is solved, achieving more accurate defect detection and model updates, and reducing false alarms and retraining costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAIHUA FUKE TECHNOLOGY CO LTD
- Filing Date
- 2026-03-16
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies, the detection model for surface defects of stamped parts is prone to deviation in detection results due to the continuous participation of non-entity-related abnormal samples. It lacks an effective sample root cause purity processing mechanism, which leads to the model learning incorrect features.
By acquiring surface images, anomaly detection results, location markers, time-series image groups, link status records, and contact area records, a candidate sample set is generated. Then, re-image comparison, cross-part comparison, location mapping comparison, and contact area comparison are performed to extract body reproduction markers, fixed pixel reproduction markers, tooling contact markers, and link anomaly markers. Root cause marker results are generated, and attribution screening is performed based on the root cause marker results to generate a clean sample set. A training sample set is constructed and the defect detection model is updated.
It effectively distinguishes between part-body defect samples and non-body anomaly samples, improves the consistency between the training sample set and the real defect distribution, reduces the risk of the model learning erroneous features, reduces false alarms and retraining costs, and enhances the correspondence between defect tracing and process analysis.
Smart Images

Figure CN122265764A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence visual inspection technology, and more specifically, to a method and system for detecting surface defects in stamped parts using AI. Background Technology
[0002] In existing surface defect detection technologies for stamped parts, there is already a technical approach that uses artificial intelligence for anomaly identification and feeds back the anomaly samples obtained from on-site detection to the training dataset to update the image analysis model. For example, the existing technology US20200166909A1 discloses a defect classification and manufacturing process control scheme based on machine learning, which clearly states that the training dataset can be continuously updated using real-time object classification data or real-time manufacturing process control and monitoring data, indicating that the overall idea of feeding back anomaly detection results and using them for model updates has been disclosed.
[0003] Meanwhile, prior art US20220171374A1 discloses a defect profiling and tracking scheme that can be integrated with process control procedures, process monitoring procedures, and quality assurance procedures, indicating that prior art has recognized that defect detection results need to be correlated with production process information and quality management information to support subsequent diagnosis and tracking; prior art CN110084854B discloses a camera calibration error runtime measurement scheme that performs camera self-diagnosis based on historical statistical data of runtime alignment scores of scene objects, indicating that prior art has been able to identify imaging state anomalies in the visual inspection process; prior art US20050068448A1 discloses a scheme for determining dust artifact areas and forming a statistical dust map based on multiple digital images, indicating that prior art has recognized that anomalies recurring in fixed pixel areas may originate from contamination of imaging devices or optical components, rather than defects in the object being inspected.
[0004] However, the aforementioned existing technologies mainly address individual problems in anomaly detection result updates, defect tracking, imaging state anomaly identification, or imaging artifact identification. They generally assume that images judged as abnormal can be directly used as valid training samples in subsequent model update processes. They lack a processing mechanism for establishing root cause purity around reflow samples and do not perform continuous processing of candidate sample generation, root cause labeling, attribution screening, training sample reconstruction, and model update for reflow samples. Therefore, it is difficult to distinguish between part-body defect samples and non-body anomaly samples formed by fixture contact marks, abnormal handling contact, lens contamination, light source flicker, or imaging artifacts. If non-body anomaly samples continue to participate in model updates, the defect detection model is prone to gradually learning erroneous features, leading to deviations in subsequent detection results. Therefore, it is still necessary to propose a method and system for detecting surface defects of stamped parts using AI. Summary of the Invention
[0005] To overcome the aforementioned deficiencies of the prior art and to achieve the above objectives, the present invention provides the following technical solution:
[0006] Methods for detecting surface defects in stamped parts using AI include:
[0007] Step S1: Obtain surface image, anomaly detection result, location marker, time series image group, link status record and contact area record. Based on the position correspondence, morphological correspondence and link correspondence of the anomaly detection result in the time series image group, generate a candidate sample set.
[0008] Step S2: Based on the surface image, perform re-image comparison and cross-part comparison on each candidate return sample in the candidate sample set, perform position mapping comparison based on the position mark, perform link comparison based on the link status record, perform contact area comparison based on the contact area record, extract the body reproduction mark, fixed pixel reproduction mark, tooling contact mark and link anomaly mark, and generate root cause marking results;
[0009] Step S3: Perform attribution screening on the candidate sample set based on the root cause labeling results, and determine the candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels and link anomaly labels as clean samples, and generate a clean sample set.
[0010] Step S4: Construct a training sample set based on the cleaned sample set, update the defect detection model based on the training sample set, and generate an updated model;
[0011] Step S5: The updated model is returned to the surface defect detection process. Based on the newly added anomaly detection results, the candidate sample set, root cause labeling results, and cleanup sample set are repeatedly generated to obtain a defect detection model constrained by the root cause labeling results.
[0012] Furthermore, the method for generating a candidate sample set includes: acquiring surface images and outputting anomaly detection results; writing coordinates of the anomaly region location according to the image coordinate system to generate location markers; reading preceding and subsequent images according to the surface image acquisition time to generate a time-series image group; synchronously reading imaging device parameters, lighting device parameters, sharpness evaluation values, and brightness evaluation values to generate a link status record; reading clamping position, support position, adsorption position, or transport contact position and mapping them to the image coordinate system to generate a contact area record; mapping the anomaly region location to each frame image in the time-series image group according to the location markers; extracting the anomaly region morphological description results and time-series morphological description results; performing time-series comparison with the link status record to determine the position correspondence, morphological correspondence, and link correspondence, and generating a candidate sample set; by incorporating the anomaly region location, morphological changes in the time-series image group, and imaging state changes into the same candidate sample generation process, each candidate sample in the candidate sample set simultaneously carries positional, morphological, and state relationships, thus the subsequent processing object is no longer an isolated anomaly appearance, but anomaly samples with related relationships.
[0013] Furthermore, the methods for performing duplicate image comparison and cross-part comparison, as well as position mapping comparison, include: reading surface images, anomaly detection results, position markers, and time-series image groups from candidate reflow samples; using the location and range of the anomaly region as comparison objects; reading duplicate images according to the time-series image groups and cropping the duplicate regions; performing feature extraction and comparison on the anomaly regions and duplicate regions; recording the reproduction relationship of the anomaly appearance on the same stamped part; reading surface images of adjacent stamped parts and cropping cross-part regions; performing feature extraction and comparison on the anomaly regions and cross-part regions; recording the reproduction relationship of the anomaly appearance between different stamped parts; mapping the anomaly region location to a unified image coordinate based on the position markers; extracting the ontological reproduction marker or fixed pixel reproduction marker; and using the corresponding change relationship of the same anomaly appearance in the same stamped part, different stamped parts, and unified image coordinates to distinguish whether the anomaly appearance is attached to the surface position of the stamped part or fixed to the imaging position, so that the ontological reproduction marker and fixed pixel reproduction marker are based on the judgment of relationship changes, rather than based on the result of a single image recognition.
[0014] Furthermore, the method for generating root cause labeling results includes: performing link comparison based on link status records, reading the link status records corresponding to the surface image, re-image, and adjacent stamped part surface images, comparing the imaging equipment parameters, lighting equipment parameters, sharpness evaluation value, and brightness evaluation value, and extracting link anomaly labels; performing contact area comparison based on contact area records, mapping the contact area records to the image coordinates in the surface image, re-image, and adjacent stamped part surface images, determining the positional relationship between the abnormal area and the corresponding area of the contact area record, and extracting tooling contact labels; summarizing the body reproduction labels, fixed pixel reproduction labels, tooling contact labels, and link anomaly labels, and establishing a correspondence with the corresponding candidate reflow samples to generate root cause labeling results; establishing a correspondence between the abnormal appearance and the changes in imaging status and the changes in contact area position, and then summarizing them together with the body reproduction relationship and the fixed pixel reproduction relationship to form the root cause labeling results, so that the root cause labeling results express the differences in the formation relationship of the abnormal appearance, rather than splicing multiple types of detection information side by side.
[0015] Furthermore, the method for generating a clean sample set includes: reading each candidate reflow sample and its corresponding root cause labeling result, associating them according to the candidate reflow sample number, and generating a labeled candidate sample sequence; reading ontology reproduction label, fixed pixel reproduction label, tooling contact label, and link anomaly label, generating attribution judgment records, and establishing attribution classification results; reading candidate reflow samples with ontology attribution records and their corresponding fixed pixel attribution records, tooling contact attribution records, and link anomaly attribution records, performing exclusion judgment on each candidate reflow sample, determining clean samples, retaining the surface image, anomaly detection result, location label, time series image group, root cause labeling result, and candidate reflow sample number corresponding to the clean sample, generating clean sample records, and summarizing them to generate a clean sample set; first converting ontology reproduction label, fixed pixel reproduction label, tooling contact label, and link anomaly label into attribution classification results, and then determining the clean sample set according to the attribution classification results, so that the clean sample set corresponds to the sample set after relational screening, rather than the sample set directly selected according to anomaly category.
[0016] Furthermore, when performing attribution screening based on root cause labeling results, if the same candidate reflux sample simultaneously possesses at least one of the following: ontology reproduction label, fixed pixel reproduction label, tooling contact label, or link anomaly label, the candidate reflux sample is preferentially written into the corresponding fixed pixel attribution record, tooling contact attribution record, or link anomaly attribution record, and excluded from the cleaned sample set. The case where ontology relations and non-ontology relations coexist in the same candidate reflux sample is separately identified, and the relation pointers in the aforementioned attribution records are used as the basis for priority writing, so that the cleaned sample set retains samples after relation conflict resolution, rather than simply retaining the coexistence of conflict labels.
[0017] Furthermore, the method for constructing the training sample set includes: reading the surface image, anomaly detection result, location marker, time-series image group, root cause marker result, and candidate reflow sample number from each cleaned sample; extracting anomaly sample images from the surface image based on the location and range of the anomaly region to generate anomaly sample records; reading re-taken images and extracting re-taken sample images, and associating them with the anomaly sample records; classifying and grouping the anomaly sample records according to the anomaly category information, and summarizing them according to the anomaly category information, the order of collection time, or the candidate reflow sample number to generate the training sample set; when converting the cleaned sample set into the training sample set, the correspondence between the anomaly sample image, the re-taken sample image, the location of the anomaly region, the range of the anomaly region, and the anomaly category information is retained, so that each anomaly sample record in the training sample set continues the relational constraints formed in the cleaned-up stage.
[0018] Furthermore, the method for generating the updated model includes: reading abnormal sample records from the training sample set and dividing them into a model update subset and a model validation subset; inputting the model update subset into the defect detection model; performing parameter correction on the defect detection model based on the comparison results of the predicted category results, predicted location results, and predicted range results with the abnormal category information, abnormal region location, and abnormal region range; inputting the parameter-corrected defect detection model into the model validation subset for validation and outputting the updated model; when performing parameter correction on the defect detection model, using the correspondence between the abnormal appearance and the surface position of the stamped part that has been retained in the aforementioned training sample set as the update input, so that the updated model is built on the training sample set after relational screening, rather than on the accumulation of undifferentiated abnormal samples.
[0019] Furthermore, the method for obtaining a defect detection model constrained by root cause labeling results includes: writing the updated model into the model configuration record; using the updated model to perform anomaly recognition on newly acquired surface images to generate new detection records; repeatedly generating candidate sample sets, root cause labeling results, and cleaned sample sets based on the new anomaly detection results; incorporating the cleaned sample sets into the next round of training sample sets; performing parameter correction on the updated model to generate the next round of updated models; repeatedly performing sample cleanup and model correction to output the defect detection model; after the updated model is re-entered into the detection process, the new anomaly detection results are reintroduced into the candidate sample set generation, root cause labeling result generation, and cleaned sample set generation processes, so that each round of model correction is again subject to the screening constraints of the relationship changes between the new anomalies in image coordinates, stamping surface position, contact area position, and imaging state, thereby maintaining the same relationship processing standard in the continuous update process.
[0020] A system for detecting surface defects in stamped parts using AI, and a method for detecting surface defects in stamped parts using AI, the system comprising:
[0021] The defect candidate module acquires surface images, anomaly detection results, location markers, time-series image groups, link status records, and contact area records. Based on the positional, morphological, and link correspondences of the anomaly detection results in the time-series image groups, it generates a set of candidate samples.
[0022] The defect marking module performs re-image comparison and cross-part comparison on each candidate reflow sample in the candidate sample set based on the surface image, performs position mapping comparison based on the position mark, performs link comparison based on the link status record, performs contact area comparison based on the contact area record, extracts the body reproduction mark, fixed pixel reproduction mark, tooling contact mark and link anomaly mark, and generates root cause marking results;
[0023] The defect screening module performs attribution screening on the candidate sample set based on the root cause labeling results. Candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels, and link anomaly labels are identified as clean samples, and a clean sample set is generated.
[0024] The defect update module constructs a training sample set based on the cleaned sample set, updates the defect detection model based on the training sample set, and generates an updated model.
[0025] The defect correction module updates the model and returns it to the surface defect detection process. Based on the newly added abnormal detection results, it repeatedly generates a candidate sample set, root cause labeling results, and a cleanup sample set to obtain a defect detection model constrained by the root cause labeling results.
[0026] Compared with related technologies, the present invention has the following advantages:
[0027] First, a candidate sample set is generated by acquiring surface images, anomaly detection results, location markers, time-series image groups, state records, and contact area records. Then, the candidate reflow samples are subjected to re-image comparison, cross-part comparison, position mapping comparison, state comparison, and contact area comparison to extract ontological reproduction markers, fixed pixel reproduction markers, tooling contact markers, and link anomaly markers, thereby forming root cause labeling results. Based on this processing path, it not only directly determines whether a sample is reflowed based on the abnormal appearance in a single frame image, but also incorporates the relationship between the abnormal appearance and changes in the surface position of the stamped part, changes in imaging state, and changes in the contact area into the judgment. Therefore, it can distinguish the ontological defect samples of the part from non-ontological anomaly samples corresponding to fixed pixel artifacts, tooling contact anomalies, and imaging state anomalies. Addressing the problem in existing technologies where abnormal images directly enter the model update process, it can reduce the probability of erroneous samples entering the training process from the source.
[0028] Further attribution screening is performed on the candidate sample set based on the root cause labeling results. Only candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels, and link anomaly labels are identified as clean samples, and a clean sample set is generated. Based on this processing path, the sample retention criterion changes from the traditional anomaly category judgment to anomaly formation relationship judgment. The samples in the clean sample set are no longer an anomaly sample set mixed with artifacts, contact traces, and ontology defects, but rather an ontology defect sample set after attribution screening. Therefore, it can address the problem of insufficient root cause purity of reflow samples in the existing technology, improve the consistency between the training sample set and the real defect distribution, reduce the risk of the model continuously learning erroneous features, and enhance the correspondence in subsequent sample review, defect tracing, and process analysis.
[0029] By constructing a training sample set based on a clean sample set, updating the defect detection model based on the training sample set, and then returning the updated model to the surface defect detection process, the process of generating candidate samples, marking root causes, and screening clean samples is repeated for newly added abnormal detection results, so that subsequent model corrections are continuously based on clean samples. Based on this processing path, the sample source on which the model update depends is constrained by the same attribution rule in each round of processing. Therefore, compared with the existing technology where abnormal samples are directly returned, causing the model to gradually shift, this invention can mitigate the phenomena of false alarm solidification, threshold drift, and repeated rework, enabling the model to maintain an update direction corresponding to the relationship with the real defects in continuous production scenarios, while reducing the retraining cost and manual review burden caused by the accumulation of erroneous samples. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of the method for detecting surface defects in stamped parts using AI provided by the present invention;
[0031] Figure 2 This is a schematic diagram illustrating the generation of root cause labeling results provided by the present invention;
[0032] Figure 3 This is a schematic diagram illustrating the construction and updating of the model using the training sample set provided by the present invention;
[0033] Figure 4 This is a system block diagram for detecting surface defects in stamped parts using AI, as provided by the present invention. Detailed Implementation
[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] Example 1
[0036] Please see Figure 1 As shown, this embodiment provides a method for detecting surface defects in stamped parts using AI, including the following steps:
[0037] Step S1: Obtain surface images, anomaly detection results, location markers, time-series image groups, link status records, and contact area records. Based on the positional correspondence, morphological correspondence, and link correspondence of the anomaly detection results in the time-series image groups, generate a candidate sample set.
[0038] In specific implementation, the methods for acquiring surface images, anomaly detection results, location markers, time-series image sets, link status records, and contact area records include:
[0039] In response to the arrival signal of the stamped part entering the detection area, the imaging device is controlled to acquire the surface image of the current stamped part; the surface image is used to record the surface appearance information of the current stamped part at the time of acquisition.
[0040] The surface image is input into the defect detection model, and the output is the anomaly detection result corresponding to the surface image. The anomaly detection result includes at least the location of the anomaly region, the range of the anomaly region, and the anomaly category information, which are used to characterize the abnormal appearance in the surface image.
[0041] Based on the image coordinate system corresponding to the surface image, the coordinates of the abnormal region in the anomaly detection result are written to generate a location marker; the location marker is used to characterize the coordinate position of the abnormal region in the surface image and the area where it is captured.
[0042] Based on the acquisition time of the surface image, the preceding and subsequent images are read according to a preset time window and arranged in chronological order to generate a time-series image group; the time-series image group is used to characterize the image sequence acquired continuously in adjacent time periods of the detection area.
[0043] Simultaneously read the imaging device parameters and illumination device parameters when acquiring surface images, and extract the sharpness evaluation value and brightness evaluation value of the surface image to generate a link status record; the link status record is used to characterize the imaging status and illumination status of the surface image at the corresponding moment.
[0044] The clamping position, support position, adsorption position, or transport contact position of the stamped part in the detection area are read, and the above positions are mapped to the image coordinate system corresponding to the surface image to generate a contact area record. The contact area record is used to characterize the area range related to the tooling contact. Through the above steps, the corresponding surface images, anomaly detection results, position markers, time series image groups, link status records, and contact area records are obtained. The purpose is to provide a unified input for the subsequent generation of a candidate sample set based on the position correspondence, morphology correspondence, and link correspondence of the anomaly detection results in the time series image group.
[0045] In specific implementation, methods for generating candidate sample sets based on the positional, morphological, and link correspondences of anomaly detection results in a time-series image group include:
[0046] Read the location, range, and category of the abnormal region from the anomaly detection results, and map the location of the abnormal region to each frame in the time-series image group using the location marker as a reference, thereby generating the corresponding search region in each frame.
[0047] Extract the appearance fragments of the abnormal region within the abnormal region of the surface image, and extract contour features, gray-level distribution features, texture direction features and edge morphology features from the appearance fragments of the abnormal region to generate the morphological description results of the abnormal region; at the same time, extract the temporal appearance fragments in the corresponding search area of each frame image, and extract contour features, gray-level distribution features, texture direction features and edge morphology features with the same caliber to generate the temporal morphological description results.
[0048] The abnormal region morphology description results are compared frame by frame with the temporal morphology description results corresponding to each frame image. When the temporal appearance segment in each frame image corresponds to the abnormal region appearance segment in the mapping position, and meets the preset proximity conditions in terms of contour features, gray-level distribution features, texture direction features and edge morphology features, it is determined that the abnormal detection results have a positional correspondence and morphological correspondence in the temporal image group. The preset proximity conditions are set according to the degree of distinction between similar abnormal samples and normal samples.
[0049] Read the link status records corresponding to the surface image and the link status records corresponding to each frame image, and perform time-series comparison on the imaging device parameters, lighting device parameters, sharpness evaluation value and brightness evaluation value. When the time when the anomaly detection result occurs corresponds to the parameter change in the link status record in time, it is determined that there is a link correspondence between the anomaly detection result and the time-series image group.
[0050] Anomaly detection results with positional, morphological, and link correspondence analysis results are associated and stored with corresponding surface images, position markers, time-series image groups, link status records, and contact area records to generate candidate samples. The above processing is repeated for all anomaly detection results to generate a candidate sample set. The purpose is to ensure that each candidate sample in the candidate sample set contains information on the positional changes, morphological changes, and imaging status associations of the anomaly appearance in continuous images, thereby providing direct input for subsequent re-image comparison, cross-part comparison, position mapping comparison, link comparison, and contact area comparison.
[0051] To facilitate understanding of the aforementioned processing methods, the following explanation uses actual processing data from the appliance casing stamping inspection station: When the 1201st appliance casing stamping entered the inspection area, one frame of surface image was acquired. The defect detection model output two anomaly detection results. The anomaly region of anomaly detection result A was located at column 860, row 412 of the image coordinates, with a length of 28 pixels and a width of 6 pixels. The anomaly category information was linear scratch. The anomaly region of anomaly detection result B was located at column 355 of the image coordinates. In line 690, the abnormal area is 34 pixels long and 11 pixels wide, and the abnormality type is sheet-like scratch. Three frames of images are read before and after the acquisition time to form a time-series image group of 7 frames. At the same time, the exposure value of 18, the illumination power of 72, the sharpness evaluation value of 0.83, the brightness evaluation value of 142, and the coordinate range of the clamping position area from column 330 to column 390 and from row 660 to row 730 are recorded as the contact area, so that the subsequent position correspondence, shape correspondence and link correspondence have a unified reference.
[0052] See Figure 2 As shown, in step S2, based on the surface image, re-image comparison and cross-part comparison are performed on each candidate reflow sample in the candidate sample set; position mapping comparison is performed based on the position markers; link comparison is performed based on the link status record; contact area comparison is performed based on the contact area record; body reproduction markers, fixed pixel reproduction markers, tooling contact markers, and link anomaly markers are extracted to generate root cause marking results; in specific implementation, it is as follows:
[0053] Read each candidate reflow sample from the candidate sample set, and extract the surface image, anomaly detection result, location marker, time series image group, link status record and contact area record from each candidate reflow sample; among them, the location and range of the anomaly area in the anomaly detection result are used as the comparison objects for subsequent comparison.
[0054] Based on surface images, a re-image comparison is performed. The re-images corresponding to the surface images are read in chronological order according to the time sequence of the time-series image group. The re-image area is extracted from each re-image according to the location and range of the abnormal area. Contour features, gray-level distribution features, texture direction features, and edge morphology features are extracted from the abnormal area in the surface image and each re-image area, and the corresponding features are compared item by item. When the same abnormal category is detected in both the re-image area and the abnormal area within the corresponding range after position mapping, and the difference in contour features, gray-level distribution, texture direction, and edge morphology is within the corresponding difference range, the reproduction relationship of the abnormal appearance on the same stamping part is recorded.
[0055] Cross-part comparison is performed based on surface images. The surface images of stamping parts adjacent to the current stamping part are read. The abnormal area is mapped to the corresponding area in the surface image of the adjacent stamping part according to the position mark. Cross-part areas are extracted, and the abnormal area and each cross-part area are extracted and compared with the same feature caliber as the re-image comparison. When multiple cross-part areas detect the same abnormal category, and the difference in contour features, gray scale distribution, texture direction, and edge morphology are within the corresponding difference range, the reproduction relationship of the abnormal appearance between different stamping parts is recorded.
[0056] Based on the location markers, a location mapping comparison is performed to map the location of the abnormal area to the unified image coordinates of the time-series image group and the surface images of adjacent stamped parts, and to determine the positional change relationship of the abnormal appearance in the unified image coordinates. When the abnormal appearance changes synchronously with the surface position of the stamped part, the body reproduction marker is extracted. When the abnormal appearance corresponds to the same fixed area in the unified image coordinates in different stamped parts and at different times, the fixed pixel reproduction marker is extracted. The purpose of the above steps is to use re-image comparison, cross-part comparison, and location mapping comparison to distinguish the abnormal appearance that recurs with the surface position of the stamped part from the abnormal appearance that is fixed at the imaging position, so as to form the location basis and reproduction basis for root cause analysis.
[0057] Link comparison is performed based on the link status records. The link status records corresponding to the surface images, as well as the link status records corresponding to the retaken images and the surface images of adjacent stamped parts, are read. The imaging equipment parameters, lighting equipment parameters, sharpness evaluation values, and brightness evaluation values are arranged in chronological order and compared item by item. The time when the abnormal appearance appears is analyzed in relation to the time when the parameters change. When the abnormal area corresponding to the abnormal appearance appears synchronously with the time of parameter change, and shows a distribution relationship consistent with the parameter change in the retaken images or the surface images of adjacent stamped parts, the link abnormality mark is extracted.
[0058] Based on the contact area record, perform contact area comparison, map the contact area record to the image coordinates in the surface image, the retake image and the surface image of the adjacent stamped part, and determine the positional relationship between the abnormal area and the corresponding area of the clamping position, support position, adsorption position or handling contact position; when the abnormal area falls into the area range corresponding to the contact area record, and the abnormal appearance repeatedly appears in the area range corresponding to the contact area record, extract the tooling contact mark.
[0059] The system summarizes the body reproduction markers, fixed pixel reproduction markers, tooling contact markers, and link anomaly markers, and establishes a correspondence between each marker and the corresponding candidate reflow sample to generate root cause labeling results. The root cause labeling results include at least the candidate reflow sample number, marker category, marker value, and marker source. The purpose of the above steps is to transform the abnormal appearance reproduction relationship, location attribute, imaging state association attribute, and contact area association attribute in the candidate reflow sample into root cause labeling results that can be directly used for attribution screening, and to serve as input for subsequent attribution screening of the candidate sample set based on the root cause labeling results.
[0060] To facilitate understanding of the aforementioned processing method, a specific example is provided: After comparing the corresponding search area of anomaly detection result A in the time-series image group frame by frame, it was found that stamping parts 1198 to 1204 consecutively exhibited the same type of linear anomaly in columns 858 to 887 and rows 410 to 418 of the unified image coordinates. The contour feature difference was 2, the grayscale distribution difference was 4, the texture direction difference was 3 degrees, and the edge morphology difference was 1. Moreover, the above anomalies remained in the same area of the unified image coordinates after different stamping parts entered the detection area, without changing with the surface position of the stamping parts. Based on this, fixed pixel reproduction marks are extracted. After comparing the corresponding areas of the anomaly detection result B in the re-shot image and adjacent stamped parts, it is found that the anomaly area on stamped parts 1201 to 1203 corresponds to the area near the clamping position and changes synchronously with the surface position of the stamped parts. Based on this, the body reproduction mark is extracted first, and then the tooling contact mark is extracted by combining the contact area record. It can be seen that, for the same recurring anomaly appearance, the recurrence alone cannot be used to directly enter the subsequent training. It is necessary to further distinguish whether the recurrence relationship is fixed to the image coordinates or attached to the surface position of the stamped parts.
[0061] Step S3: Perform attribution screening on the candidate sample set based on the root cause labeling results, and determine the candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels and link anomaly labels as clean samples, and generate a clean sample set.
[0062] In practice, the attribution screening method for the candidate sample set based on the root cause labeling results includes:
[0063] Read each candidate reflow sample in the candidate sample set and read the root cause labeling result corresponding to each candidate reflow sample; the root cause labeling result includes at least the candidate reflow sample number, the body reproduction label, the fixed pixel reproduction label, the tooling contact label, the link anomaly label, and the label source information. The label source information is used to record that the corresponding label is obtained by re-shot comparison, cross-part comparison, position mapping comparison, contact area comparison, or status record analysis.
[0064] Based on the candidate reflux sample number, the candidate sample set is associated with the root cause labeling result to generate a labeled candidate sample sequence; each candidate reflux sample in the labeled candidate sample sequence retains the corresponding root cause labeling result.
[0065] For each candidate reflow sample in the labeled candidate sample sequence, read the ontology reproduction marker, fixed pixel reproduction marker, tooling contact marker, and link anomaly marker, and write each marker into the attribution determination record corresponding to the candidate reflow sample; the attribution determination record is used to record the determination basis of the same candidate reflow sample in different attribution directions.
[0066] Attribution screening is performed on each candidate reflow sample based on the attribution determination record. The implementation method of attribution screening is as follows: first, it is determined whether the candidate reflow sample has an ontology reproduction mark, then it is determined whether the candidate reflow sample has a fixed pixel reproduction mark, a tooling contact mark, and a link anomaly mark, and the judgment results are written into the ontology attribution record, the fixed pixel attribution record, the tooling contact attribution record, and the status anomaly attribution record, respectively.
[0067] Based on ontology attribution records, fixed pixel attribution records, tooling contact attribution records, and state anomaly attribution records, attribution classification results are established for each candidate reflow sample in the labeled candidate sample sequence. The candidate reflow sample number, anomaly region location, anomaly region range, anomaly category information, and root cause labeling results are retained. The purpose of the above steps is to transform the candidate reflow samples in the candidate sample set into a sample sequence with clear attribution classification results based on the root cause labeling results. This provides a screening basis for subsequently identifying candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels, and link anomaly labels as cleanup samples.
[0068] In specific implementation, candidate reflow samples with ontology reproduction markers but without fixed pixel reproduction markers, tooling contact markers, and link anomaly markers are identified as clean samples, and a clean sample set is generated using the following method:
[0069] Read candidate reflow samples with ontology attribution records from the attribution classification results, and simultaneously read the fixed pixel attribution records, tooling contact attribution records, and state anomaly attribution records corresponding to the same candidate reflow sample.
[0070] For each candidate reflow sample with ontology attribution records, an exclusion decision is made. The exclusion decision is implemented as follows: when a candidate reflow sample has an ontology reproduction mark, and the corresponding fixed pixel reproduction mark is not written in the fixed pixel attribution record, the tooling contact mark is not written in the tooling contact attribution record, and the link anomaly mark is not written in the state anomaly attribution record, the candidate reflow sample is determined as a clean sample.
[0071] For candidate refluxing samples identified as clean samples, retain the surface image, anomaly detection results, location markers, time series image groups, root cause marker results, and candidate refluxing sample number, and generate a clean sample record corresponding to the clean sample; the clean sample record is used to record the source information, abnormal appearance information, and attribution retention basis of the clean sample.
[0072] All cleaned sample records are summarized according to anomaly category information, anomaly area location, or collection time order to generate a cleaned sample set; each cleaned sample in the cleaned sample set has an ontology reproduction mark, but does not have a fixed pixel reproduction mark, tooling contact mark, or link anomaly mark.
[0073] An integrity check is performed on the cleaned sample set. The integrity check is implemented as follows: check whether each cleaned sample contains a surface image, anomaly detection results, location markers, time-series image groups, root cause marker results, and candidate reflow sample numbers. If any item is missing, the corresponding cleaned sample is removed from the cleaned sample set and written into the supplementary sample record. After the integrity check is completed, the cleaned sample set is output and used as input for the subsequent construction of the training sample set. Candidate reflow samples with ontology reproduction attributes and whose fixed pixel reproduction attributes, tooling contact attributes, and state anomaly attributes have been excluded from the candidate sample set, so that the cleaned sample set can be directly used for the construction of the subsequent training sample set.
[0074] To facilitate understanding of the aforementioned processing methods, the following explanation is based on the attribution screening results of candidate samples: In the root cause labeling results corresponding to candidate reflow sample A, the ontology reproduction label is 0, the fixed pixel reproduction label is 1, the tooling contact label is 0, and the link anomaly label is 0. Therefore, candidate reflow sample A is written into the fixed pixel attribution record and does not enter the cleaned sample set. In the root cause labeling results corresponding to candidate reflow sample B, the ontology reproduction label is 1, the fixed pixel reproduction label is 0, the tooling contact label is 1, and the link anomaly label is 0. Therefore, candidate reflow sample B is written into the fixed pixel attribution record and does not enter the cleaned sample set. Tooling contact attribution records are not included in the clean sample set. However, in the 1205th stamped part of the same batch, the newly added candidate reflow sample C has a body reproduction mark value of 1, a fixed pixel reproduction mark value of 0, a tooling contact mark value of 0, and a link anomaly mark value of 0. Therefore, candidate reflow sample C is determined as a clean sample and written into the clean sample set. It can be seen that the attribution screening does not simply retain or remove the anomaly category itself, but reorders the formation relationship corresponding to the anomaly appearance. It first excludes anomalies that are fixed to image coordinates, contact areas, or imaging state changes, and then retains anomalies that are consistent with the position on the surface of the stamped part.
[0075] Step S4: Construct a training sample set based on the cleaned sample set, update the defect detection model based on the training sample set, and generate an updated model.
[0076] In practice, the method for constructing a training sample set based on the purified sample set is as follows:
[0077] Read each clean sample in the clean sample set and extract the surface image, anomaly detection result, location marker, time series image group, root cause labeling result, and candidate reflow sample number from each clean sample; among them, the anomaly region location, anomaly region range, and anomaly category information in the anomaly detection result are used as the training annotation source, and the root cause labeling result is used as the basis for retaining clean samples.
[0078] Based on the location and extent of the abnormal region, an abnormal sample image is extracted from the surface image, and a correspondence is established between the abnormal sample image and the coordinate position in the surface image according to the location marker to generate an abnormal sample record. The abnormal sample record includes at least the abnormal sample image, abnormal category information, abnormal region location, abnormal region extent, and candidate reflow sample number.
[0079] Retaken images corresponding to the cleaned samples are read from the time-series image group. Retaken sample images are extracted from the retaken images based on the location of the abnormal area, and the retaken sample images are associated with the abnormal sample records. When an abnormal category consistent with the abnormal sample image is detected in the retaken sample image, the retaken sample image is written into the abnormal sample record.
[0080] The abnormal sample records are classified and collected according to the abnormality category information, and the number of samples corresponding to each abnormality category is counted. When the number of samples corresponding to a certain abnormality category is lower than the preset sample ratio requirement, the abnormal sample records and retaken sample images corresponding to the same abnormality category are read from the clean sample set and added to the abnormality category. The preset sample ratio requirement is set according to the historical frequency of each abnormality category and the category differentiation requirements.
[0081] After the abnormal sample records have been classified and collected, they are summarized according to the abnormal category information, the collection time order or the candidate return sample number to generate a training sample set. The purpose of the above steps is to transform the cleaned sample set into a training sample set with image content, location content and category content, so as to provide input for subsequent updates of the defect detection model based on the training sample set.
[0082] In practice, the defect detection model is updated based on the training sample set, and the method steps for generating the updated model are as follows:
[0083] Read the training sample set and divide the abnormal sample records in the training sample set into a model update subset and a model verification subset according to a preset ratio. The model update subset is used to perform defect detection model parameter correction, and the model verification subset is used to perform parameter correction result verification. The preset ratio is set according to the number of samples and the distribution of abnormal categories in the training sample set.
[0084] The abnormal sample images, abnormal category information, abnormal region location, and abnormal region range from the model update subset are input into the defect detection model, which outputs the predicted category result, predicted location result, and predicted range result. The predicted category result, predicted location result, and predicted range result are then compared with the abnormal category information, abnormal region location, and abnormal region range, respectively, to generate the category deviation result and the location deviation result.
[0085] Based on the category bias results and location bias results, the defect detection model is modified by parameter adjustment. After each round of parameter adjustment, the model update subset is re-inputted to repeat the prediction and comparison until the category bias results and location bias results enter the corresponding convergence range. The corresponding convergence range is set based on the deviation change records in the historical parameter adjustment process.
[0086] The defect detection model after parameter correction is input into the model validation subset. Prediction is performed on the abnormal sample records in the model validation subset, and the validation category result, validation location result, and validation range result are output. The validation category result, validation location result, and validation range result are compared with the abnormal category information, abnormal area location, and abnormal area range in the corresponding abnormal sample record, respectively. When the validation category result and validation location result fall into the corresponding validation range, the defect detection model after parameter correction is retained as the updated model; otherwise, parameter correction continues.
[0087] Output the updated model and establish a corresponding record between the updated model and the candidate return sample number range, anomaly category distribution and verification results of the training sample set; the purpose is to update the defect detection model based on the training sample set and generate an updated model that can be used to process subsequent new anomaly detection results.
[0088] For specific implementation, please refer to Figure 3 As shown, the defect detection model can be implemented using an object detection model, an image segmentation model, or a classification and localization integrated model. When it is necessary to simultaneously output the anomaly category, anomaly region location, and anomaly region range, an object detection model composed of a convolutional feature extraction network combined with a detection head can be used, or an image segmentation model with an encoder-decoder structure can be used. The object detection model outputs the anomaly category result, predicted location result, and predicted range result, while the image segmentation model outputs the anomaly region mask and further calculates the anomaly region location and range. The error function characterizes the difference between the output result of the defect detection model and the labeled result of the training sample set. The error function includes at least a category error term and a location error term. The category error term constrains the consistency between the predicted category result and the anomaly category information, while the location error term constrains the consistency between the predicted location result, the predicted range result, and the anomaly region location and range. When using an image segmentation model, the error function may also include a region overlap error term to constrain the overlap between the predicted anomaly region and the labeled anomaly region. During parameter correction, the parameters of the defect detection model are iteratively adjusted based on the calculation result of the error function, and the trend of the error function in continuous iterations is used as the basis for whether to continue parameter correction.
[0089] To facilitate understanding of the aforementioned steps of constructing a training sample set from the cleaned sample set and updating the defect detection model, the following explanation uses cleaned samples of stamped parts for home appliance casings after screening based on positional relationships, contact relationships, and imaging state relationships: 120 cleaned samples were read from the cleaned sample set, including 42 linear scratches, 31 indentations, 18 cracks, and 29 sheet-like scratches. These were divided into an 8:2 ratio to obtain 96 abnormal sample records forming the model update subset and 24 abnormal sample records forming the model verification subset. The defect detection model was then subjected to 7 rounds of parameter correction using an error function composed of category error, position error, and region overlap error terms. This reduced the category deviation result on the model verification subset from 0.21 to 0.08 and the position deviation result from 11 pixels to 4 pixels. Here, the samples involved in parameter correction are no longer the results directly summarized based on abnormal appearance, but rather cleaned samples screened based on positional relationships, contact relationships, and imaging state relationships. Therefore, the training sample set expresses the correspondence between abnormal appearance and the surface of the stamped part, rather than a mixed relationship between abnormal appearance and fixed image position or contact area.
[0090] Step S5 involves updating the model and returning it to the surface defect detection process. Based on the newly added anomaly detection results, the candidate sample set, root cause labeling results, and cleanup sample set are repeatedly generated to obtain a defect detection model constrained by the root cause labeling results. The specific implementation steps are as follows:
[0091] Step 1: Read the updated model generated in step S4 and write the updated model into the model configuration record corresponding to the surface defect detection process, so that the surface image of the stamped part entering the detection area is subjected to anomaly recognition by the updated model; at the same time, establish the correspondence between the updated model number, activation time, training sample set number and model verification result, and generate the model activation record.
[0092] Step 2: Use the updated model to perform anomaly recognition on the newly acquired surface images, output the new anomaly detection results, and associate the new anomaly detection results with the corresponding surface images, location markers, time series image groups, link status records, contact area records, and model activation records to generate new detection records.
[0093] Step 3: Using a preset update cycle or a preset number of new samples as the trigger for repeated processing, when the new detection record reaches the repeated processing condition, according to the processing method in step S1, the candidate sample set is repeatedly generated based on the position correspondence, morphological correspondence, and link correspondence of the new abnormal detection results in the time-series image group.
[0094] Step 4: Following the processing method in step S2, repeatedly perform re-image comparison, cross-part comparison, position mapping comparison, link comparison, and contact area comparison on each candidate return sample in the candidate sample set, extract the body reproduction mark, fixed pixel reproduction mark, tooling contact mark, and link anomaly mark, and generate root cause mark results.
[0095] Step 5: Following the processing method in step S3, perform attribution screening on the candidate sample set based on the root cause labeling results. Candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels, and link anomaly labels are identified as clean samples, and a clean sample set is generated.
[0096] Step 6: Incorporate the purified sample set into the next round of training sample set, and perform parameter correction on the updated model based on the training sample set according to the processing method in step S4 to generate the next round of updated model; at the same time, establish a correspondence between the next round of updated model and the corresponding root cause labeling results, purified sample set and training sample set, and generate model correction records.
[0097] Step 7: Rewrite the next round of updated model into the model configuration record, and repeat steps 2 to 6. Output the latest round of updated model at the preset model release time, as the defect detection model constrained by the root cause labeling results. The purpose of the above steps is to ensure that after the updated model returns to the surface defect detection process, the newly added abnormal detection results still participate in the subsequent model correction according to the same caliber of candidate sample set generation, root cause labeling result generation, and cleanup sample set generation, so that the update process of the defect detection model is always constrained by the root cause labeling results.
[0098] To facilitate understanding of the aforementioned steps involving returning the updated model to the surface defect detection process and repeatedly generating candidate sample sets, root cause labeling results, and cleanup sample sets based on the changing relationships between newly added anomalies in image coordinates, stamped part surface positions, contact area positions, and imaging states, the following explanation combines the subsequent screening and correction process for fixed pixel anomalies corresponding to camera protective glass oil marks, contact area anomalies corresponding to release paper wiping, and newly added anomalies with body reproduction: After the updated model is input into the subsequent detection process, 80 newly added detection records are continuously read. Among them, 12 fixed pixel anomalies corresponding to camera protective glass oil marks reappear, 9 contact area anomalies corresponding to release paper wiping, and the remaining anomalies with body reproduction labels are also identified. There were 21 new anomalies with all three markers being 0. Therefore, only the samples corresponding to these 21 new anomalies were incorporated into the next round of training sample set and the second round of parameter correction was completed. This ensured that the latest updated model would no longer write the oil trace artifacts in columns 858 to 887 and rows 410 to 418 of the fixed image coordinates into the clean sample set during the inspection of stamped parts from the 1281st to the 1360th stamped parts. Instead, it would continue to retain new anomalies that changed synchronously with the surface position of the stamped parts and did not fall into the contact area. This demonstrates that the subsequent processing did not simply add up the existing comparison methods, but rather repeatedly screened and corrected the new anomalies based on the relationship between the image coordinates, the surface position of the stamped parts, the position of the contact area, and the imaging state.
[0099] Example 2
[0100] See Figure 4 As shown, this embodiment provides a system for detecting surface defects in stamped parts using AI. Since this system uses the method for detecting surface defects in stamped parts using AI in Embodiment 1, it has the same effect, and will not be described again here. The system includes:
[0101] The defect candidate module acquires surface images, anomaly detection results, location markers, time-series image groups, link status records, and contact area records. Based on the positional, morphological, and link correspondences of the anomaly detection results in the time-series image groups, it generates a set of candidate samples.
[0102] The defect marking module performs re-image comparison and cross-part comparison on each candidate reflow sample in the candidate sample set based on the surface image, performs position mapping comparison based on the position mark, performs link comparison based on the link status record, performs contact area comparison based on the contact area record, extracts the body reproduction mark, fixed pixel reproduction mark, tooling contact mark and link anomaly mark, and generates root cause marking results;
[0103] The defect screening module performs attribution screening on the candidate sample set based on the root cause labeling results. Candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels, and link anomaly labels are identified as clean samples, and a clean sample set is generated.
[0104] The defect update module constructs a training sample set based on the cleaned sample set, updates the defect detection model based on the training sample set, and generates an updated model.
[0105] The defect correction module updates the model and returns it to the surface defect detection process. Based on the newly added abnormal detection results, it repeatedly generates a candidate sample set, root cause labeling results, and a cleanup sample set to obtain a defect detection model constrained by the root cause labeling results.
[0106] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the aforementioned scope.
[0107] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting surface defects in stamped parts using AI, characterized in that, include: Step S1: Obtain surface image, anomaly detection result, location marker, time series image group, link status record and contact area record. Based on the position correspondence, morphological correspondence and link correspondence of the anomaly detection result in the time series image group, generate a candidate sample set. Step S2: Based on the surface image, perform re-image comparison and cross-part comparison on each candidate return sample in the candidate sample set, perform position mapping comparison based on the position mark, perform link comparison based on the link status record, perform contact area comparison based on the contact area record, extract the body reproduction mark, fixed pixel reproduction mark, tooling contact mark and link anomaly mark, and generate root cause marking results; Step S3: Perform attribution screening on the candidate sample set based on the root cause labeling results, and determine the candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels and link anomaly labels as clean samples, and generate a clean sample set. Step S4: Construct a training sample set based on the cleaned sample set, update the defect detection model based on the training sample set, and generate an updated model; Step S5: The updated model is returned to the surface defect detection process. Based on the newly added anomaly detection results, the candidate sample set, root cause labeling results, and cleanup sample set are repeatedly generated to obtain a defect detection model constrained by the root cause labeling results.
2. The method for detecting surface defects in stamped parts using AI according to claim 1, characterized in that, The method for generating a candidate sample set includes: acquiring surface images and outputting anomaly detection results; writing coordinates of the anomaly region location according to the image coordinate system to generate location markers; reading preceding and subsequent images according to the surface image acquisition time to generate a time-series image group; reading imaging device parameters, lighting device parameters, sharpness evaluation values, and brightness evaluation values to generate a link status record; reading clamping positions, support positions, adsorption positions, or transport contact positions and mapping them to the image coordinate system to generate a contact area record; mapping the anomaly region location to each frame image in the time-series image group according to the location markers; extracting the anomaly region morphological description results and time-series morphological description results; performing time-series comparison with the link status record to determine the position correspondence, morphological correspondence, and link correspondence, and generating a candidate sample set.
3. The method for detecting surface defects in stamped parts using AI according to claim 1 or 2, characterized in that, The methods for performing re-image comparison, cross-part comparison, and position mapping comparison include: reading surface images, anomaly detection results, position markers, and time-series image groups from candidate reflow samples; using the location and range of the anomaly region as comparison objects; reading re-images according to the time-series image groups and cropping the re-image regions; performing feature extraction and comparison on the anomaly regions and re-image regions; and recording the reproduction relationship of the anomaly appearance on the same stamped part; reading surface images of adjacent stamped parts and cropping cross-part regions; performing feature extraction and comparison on the anomaly regions and cross-part regions; and recording the reproduction relationship of the anomaly appearance between different stamped parts; mapping the anomaly region location to unified image coordinates based on the position markers; and extracting the ontological reproduction markers or fixed pixel reproduction markers.
4. The method for detecting surface defects in stamped parts using AI according to claim 3, characterized in that, The method for generating root cause labeling results includes: performing link comparison based on link status records, reading the link status records corresponding to the surface image, re-shot image, and adjacent stamped part surface images, comparing the imaging equipment parameters, lighting equipment parameters, sharpness evaluation value, and brightness evaluation value, and extracting link anomaly labels; performing contact area comparison based on contact area records, mapping the contact area records to the image coordinates in the surface image, re-shot image, and adjacent stamped part surface images, determining the positional relationship between the abnormal area and the corresponding area in the contact area record, and extracting tooling contact labels; summarizing the body reproduction label, fixed pixel reproduction label, tooling contact label, and link anomaly label, and establishing a correspondence with the corresponding candidate reflow samples to generate root cause labeling results.
5. The method for detecting surface defects in stamped parts using AI according to claim 1 or 4, characterized in that, The method for generating a clean sample set includes: reading each candidate reflow sample and its corresponding root cause labeling result, associating them according to the candidate reflow sample number, and generating a labeled candidate sample sequence; reading the ontology reproduction label, fixed pixel reproduction label, tooling contact label, and link anomaly label, generating attribution judgment records, and establishing attribution classification results; reading the candidate reflow samples with ontology attribution records and their corresponding fixed pixel attribution records, tooling contact attribution records, and link anomaly attribution records, performing exclusion judgment on each candidate reflow sample, determining clean samples, retaining the surface image, anomaly detection result, location label, time series image group, root cause labeling result, and candidate reflow sample number corresponding to the clean sample, generating clean sample records, and summarizing them to generate a clean sample set.
6. The method for detecting surface defects in stamped parts using AI according to claim 5, characterized in that, When performing attribution screening based on root cause labeling results, if the same candidate reflux sample has at least one of the following: ontology reproduction label, fixed pixel reproduction label, tooling contact label, or link anomaly label, the candidate reflux sample is preferentially written into the corresponding fixed pixel attribution record, tooling contact attribution record, or link anomaly attribution record and excluded from the cleanup sample set.
7. The method for detecting surface defects in stamped parts using AI according to claim 5, characterized in that, The method for constructing the training sample set includes: reading the surface image, anomaly detection results, location markers, time-series image groups, root cause marker results, and candidate reflow sample numbers from each cleaned sample; extracting anomaly sample images from the surface image based on the location and range of the anomaly region to generate anomaly sample records; reading re-taken images and extracting re-taken sample images, and associating them with the anomaly sample records; classifying and grouping the anomaly sample records according to anomaly category information, and summarizing them according to anomaly category information, collection time order, or candidate reflow sample numbers to generate the training sample set.
8. The method for detecting surface defects in stamped parts using AI according to claim 7, characterized in that, Methods for generating updated models include: Read the abnormal sample records in the training sample set and divide them into a model update subset and a model validation subset. Input the model update subset into the defect detection model. Based on the comparison results of the predicted category results, predicted location results, and predicted range results with the abnormal category information, abnormal area location, and abnormal area range, perform parameter correction on the defect detection model. Input the defect detection model with the completed parameter correction into the model validation subset for validation and output the updated model.
9. The method for detecting surface defects in stamped parts using AI according to claim 1 or 8, characterized in that, Methods for obtaining defect detection models constrained by root cause labeling results include: Write the updated model into the model configuration record, use the updated model to perform anomaly recognition on the newly acquired surface images, and generate new detection records; based on the new anomaly detection results, repeatedly generate candidate sample sets, root cause labeling results and cleanup sample sets, and merge the cleanup sample sets into the next round of training sample sets, perform parameter correction on the updated model, and generate the next round of updated model; repeat the sample cleanup and model correction, and output the defect detection model.
10. A system for detecting surface defects in stamped parts using AI, used to implement the method for detecting surface defects in stamped parts using AI as described in any one of claims 1-9, characterized in that, The system includes: The defect candidate module acquires surface images, anomaly detection results, location markers, time-series image groups, link status records, and contact area records. Based on the positional, morphological, and link correspondences of the anomaly detection results in the time-series image groups, it generates a set of candidate samples. The defect marking module performs re-image comparison and cross-part comparison on each candidate reflow sample in the candidate sample set based on the surface image, performs position mapping comparison based on the position mark, performs link comparison based on the link status record, performs contact area comparison based on the contact area record, extracts the body reproduction mark, fixed pixel reproduction mark, tooling contact mark and link anomaly mark, and generates root cause marking results; The defect screening module performs attribution screening on the candidate sample set based on the root cause labeling results. Candidate reflow samples with ontology reproduction labels but without fixed pixel reproduction labels, tooling contact labels, and link anomaly labels are identified as clean samples, and a clean sample set is generated. The defect update module constructs a training sample set based on the cleaned sample set, updates the defect detection model based on the training sample set, and generates an updated model. The defect correction module updates the model and returns it to the surface defect detection process. Based on the newly added abnormal detection results, it repeatedly generates a candidate sample set, root cause labeling results, and a cleanup sample set to obtain a defect detection model constrained by the root cause labeling results.