Appearance defect detection method and system
By combining generative adversarial networks and ResNet50 residual networks, a mixed training dataset of defective samples and real samples is generated, enabling high-precision adaptive detection of various types of e-cigarette accessories. This solves the problems of insufficient detection accuracy and poor flexibility in existing technologies and improves detection efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 广东弗我智能制造有限公司
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-26
AI Technical Summary
Existing machine vision inspection technology in e-cigarette production suffers from limited inspection accuracy, insufficient parallel inspection capability for multiple components, and weak online model update capability. In particular, it is poorly adaptable and lacks flexibility when faced with complex and diverse appearance defects.
A training dataset is constructed by mixing defect samples generated by a generative adversarial network with real samples. An adversarial loss constraint is applied to the convolutional neural network using a pre-trained model with fixed parameters. By combining a feature pyramid network and a ResNet50 residual network, adaptive detection of various types of workpieces to be inspected is achieved, and parallel detection is performed through at least two independent image acquisition devices.
It improves detection accuracy and flexibility, can adapt to online detection of various component types, significantly improves detection efficiency, and meets the needs of large-scale industrial production.
Smart Images

Figure CN122289196A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision inspection technology, and in particular to a method and system for detecting appearance defects. Background Technology
[0002] In the e-cigarette manufacturing process, the appearance quality of components such as the e-liquid cup, mouthpiece, and base cap directly affects the product's brand image and user experience. Traditional manual inspection methods suffer from low efficiency, inconsistent accuracy, and susceptibility to subjective factors, making them unsuitable for large-scale industrial production.
[0003] Existing machine vision inspection technologies mostly employ rule-based image processing algorithms, such as edge detection and threshold segmentation. These methods are effective for detecting simple, single-type defects, but they have poor adaptability and high false negative rates when faced with complex and diverse appearance defects (such as minor scratches, irregular missing materials, color differences, cracks, etc.). When the product model or defect type changes, the algorithm parameters need to be readjusted, resulting in high maintenance costs.
[0004] Existing technologies include solutions for applying deep learning to the detection of appearance defects in industrial components. These solutions use convolutional neural network models to identify defects in workpiece images, improving detection efficiency to some extent. However, these solutions still have the following shortcomings in practical industrial applications: First, insufficient training samples lead to limited detection accuracy, especially in scenarios where defect samples are naturally scarce in actual production, thus limiting the model's generalization ability. Second, existing solutions are mostly designed for single accessory types and cannot effectively support simultaneous online detection of multiple accessory types, making it difficult to adapt to the actual needs of mixed-product production lines for e-cigarette accessories. Third, there is a lack of an effective online update mechanism after the model is deployed. When new defects appear or product models change, it is necessary to re-collect samples and retrain the entire dataset offline, resulting in insufficient flexibility.
[0005] Therefore, there is an urgent need for a method for detecting appearance defects to overcome the above-mentioned technical problems. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for detecting appearance defects, so as to solve the technical problems in the prior art, such as insufficient defect training samples leading to limited detection accuracy, insufficient parallel detection capability of multiple parts, and weak online continuous updating capability of the model.
[0007] To achieve this objective, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for detecting appearance defects, comprising: S1. Place the workpiece to be inspected on the inspection platform and acquire image data of the outer surface of the workpiece through an image acquisition device. S2. Preprocess the image data to obtain the image to be inspected; S3. Generate defect samples using a generative model, mix the defect samples with real defect samples to form a training dataset, apply adversarial loss constraints to the convolutional neural network using a pre-trained model with fixed parameters, train the convolutional neural network based on the training dataset, and obtain detection sub-models corresponding to various types of workpieces to be inspected. S4. Identify the type of workpiece to be inspected that has entered the inspection area, and call the inspection sub-model corresponding to the type; S5. Simultaneously perform image acquisition and defect detection on different workpieces to be inspected independently using at least two sets of image acquisition devices, and output the detection results.
[0008] Preferably, the pre-trained model with fixed parameters is a discriminator of a generative adversarial network. After pre-training, the discriminator fixes all parameters and calculates the adversarial loss between the output of the convolutional neural network and the discriminator's discriminative output. The adversarial loss is then backpropagated to the convolutional neural network to iteratively update the parameters of the convolutional neural network.
[0009] In some preferred embodiments, the convolutional neural network employs a ResNet50 residual network, on which a feature pyramid network is superimposed. The feature pyramid network is used to extract defect features at different scales in the image to be inspected.
[0010] Preferably, the type of the workpiece to be inspected is identified by extracting the shape and contour features of the workpiece to be inspected from the image to be inspected. The detection sub-models use the same network structure and hyperparameters and are trained with the corresponding type of workpiece's dedicated defect sample dataset.
[0011] Furthermore, the appearance defect detection method also includes: Perform multiple defect inspections on each of the aforementioned workpieces to be inspected; The confidence intervals of the mean values of multiple test results were calculated based on the assumption of a normal distribution, with a confidence level of 95% to 99%. The workpiece is deemed qualified if the mean of multiple test results falls within the mean confidence interval; otherwise, it is deemed unqualified.
[0012] Furthermore, the appearance defect detection method also includes: When a new defect sample is received, a subset is extracted from the historical defect samples according to a preset sampling strategy; The subset is mixed with the new defective samples to form an updated dataset; The importance weights of each parameter of the detection sub-model to historical tasks are calculated using an elastic weight solidification algorithm. The parameters of the detection sub-model are updated based on the updated dataset, and elastic penalty constraints proportional to the importance weights of each parameter of the detection sub-model are applied.
[0013] In some preferred embodiments, the at least two sets of image acquisition devices include a first acquisition group and a second acquisition group. The first acquisition group performs image acquisition and defect detection on the first batch of workpieces to be inspected in the detection area, and the second acquisition group simultaneously performs image acquisition and defect detection on the second batch of workpieces to be inspected. After the first acquisition group and the second acquisition group have completed the detection of their respective batches, they exchange detection batches to complete the detection of all workpieces to be inspected.
[0014] In some preferred embodiments, a composite lighting device including a ring-shaped shadowless light source and a coaxial light source is used to illuminate the workpiece to be inspected. The programmable logic controller controls a relay to automatically switch the lighting mode between the ring-shaped shadowless light source and the coaxial light source according to the type of the workpiece to be inspected.
[0015] In some preferred embodiments, the defects on the outer surface of the workpiece to be inspected include at least one of scratches, cracks, missing material, color mixing, and deformation.
[0016] In a second aspect, the present invention provides an appearance defect detection system, comprising: The inspection platform is used to hold the workpiece to be inspected; The result output unit is used to output the defect detection results. The model training module is configured to generate defect samples using a generative model, mix the defect samples with real defect samples to form a training dataset, apply adversarial loss constraints to the convolutional neural network using a pre-trained model with fixed parameters, and train the convolutional neural network based on the training dataset to obtain detection sub-models corresponding to various types of workpieces to be inspected. The multi-component inspection module includes the inspection sub-models corresponding to various types of workpieces to be inspected; The accessory identification and scheduling unit is used to identify the type of the workpiece to be inspected and call the detection sub-model corresponding to the type in the multi-accessory detection module; The parallel inspection unit includes at least two sets of independent image acquisition devices for simultaneously performing image acquisition and defect detection on different batches of workpieces to be inspected. The lighting unit is used to illuminate the workpiece to be inspected, and the lighting unit automatically switches the lighting mode according to the type of the workpiece to be inspected.
[0017] Compared with the prior art, the present invention has the following beneficial effects: This invention addresses several key issues. First, it introduces a generative model to generate defect samples and mixes them with real samples to form a training dataset. Simultaneously, it employs a pre-trained model with fixed parameters to apply stable adversarial loss constraints to the convolutional neural network, effectively mitigating the problems of naturally scarce defect samples and insufficient model generalization in industrial inspection scenarios. This allows the detection sub-model to maintain high recognition accuracy even with limited real samples. Second, by identifying the type of workpiece entering the inspection area and automatically calling the corresponding detection sub-model, it achieves adaptive and accurate detection of multiple accessory types, overcoming the limitation of existing solutions that only support a single accessory type. Third, by having at least two sets of image acquisition devices independently perform image acquisition and defect detection on different workpieces simultaneously, it achieves true parallel operation, significantly improving overall inspection efficiency and effectively meeting the cycle time requirements of large-scale industrial production.
[0018] The present invention has other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of the appearance defect detection method in Embodiment 1 of the present invention.
[0021] Figure 2 This is a structural block diagram of the appearance defect detection system in Embodiment 2 of the present invention. Detailed Implementation
[0022] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.
[0023] Example 1 Please see Figure 1The appearance defect detection method in this embodiment is based on deep learning principles and is suitable for detecting appearance defects in product components, thus preventing defective products caused by appearance defects. This embodiment uses the appearance inspection of electronic cigarette accessories, such as oil cups, mouthpieces, and bottom caps, as an application scenario to describe the appearance defect detection method in detail. The appearance defect detection method specifically includes the following steps: Step S1: Place the workpiece to be inspected on the inspection platform and acquire image data of the outer surface of the workpiece through the image acquisition device.
[0024] It is understood that this embodiment uses a composite lighting device including a ring-shaped shadowless light source and a coaxial light source to illuminate the workpiece to be inspected. The programmable logic controller (PLC) controls the relay to automatically switch the lighting mode between the ring-shaped shadowless light source and the coaxial light source according to the type of the current workpiece to be inspected.
[0025] The ring-shaped shadowless light source effectively eliminates reflections and shadows on the surface of parts, making it suitable for capturing defects such as color differences and surface textures. The coaxial light source helps highlight subtle height differences on the surface, making it suitable for capturing defects such as scratches and missing materials. During model changeovers, the PLC automatically controls the relays to switch the light source combination without manual intervention. The image acquisition device is typically a high-resolution CCD industrial camera. Each inspection channel is equipped with multiple (e.g., five) high-resolution CCD industrial cameras to capture multi-angle images of the part's outer surface from different angles, ensuring no blind spots.
[0026] It should be noted that in other implementations, light sources with other parameters can be selected and matched according to the product type, and no limitation is made here.
[0027] Step S2: Preprocess the image data to obtain the image to be inspected.
[0028] Specifically, the preprocessing operations in this embodiment include one or more combinations of methods such as denoising, filtering, cropping, rotation, stretching, brightness correction, color conversion, image segmentation, resolution adjustment, binarization, region marking, and contour extraction, to eliminate environmental interference during the acquisition process, improve image quality, and provide stable and standardized input images for subsequent detection sub-models. The specific combination of preprocessing operations can be selected according to common product defect types and is not limited here.
[0029] Step S3: Generate defect samples using a generative model, mix the defect samples with real defect samples to form a training dataset, apply adversarial loss constraints to the convolutional neural network using a pre-trained model with fixed parameters, train the convolutional neural network based on the training dataset, and obtain detection sub-models corresponding to various types of workpieces to be inspected.
[0030] The generative model described in this embodiment is specifically a generative adversarial network (GAN). The convolutional neural network and the generative adversarial network together constitute the detection model of this embodiment. For ease of description, the detection model composed of the convolutional neural network and the generative adversarial network is referred to as DefectDetect-GAN in this embodiment.
[0031] Specifically, step S3 includes sub-steps such as dataset construction, model training, sub-model specialization, and model evaluation. The following will provide a detailed explanation of each sub-step in conjunction with actual experiments and operational data: (1) Dataset construction: 10,000 normal samples and 10,000 defective samples were collected for three types of accessories: oil cup, cigarette holder, and bottom cover. Defect types included scratches, cracks, missing materials, color mixing, and deformation. A generative adversarial network (GAN) generator was used to expand the defect samples, adding 5,000 new samples for each defect type, ultimately forming a training dataset of 45,000 samples. The defective samples and generated samples were directly mixed without any selection threshold.
[0032] (2) Model training: The dataset was divided into training, validation, and test sets in a 7:2:1 ratio. The convolutional neural network of the detection sub-model adopted a ResNet50 residual network, on which a Feature Pyramid Network (FPN) was superimposed. The ResNet50 residual network is a 50-layer deep convolutional neural network that introduces "shortcut connections" to allow data to be directly passed across layers, making it suitable for solving the problem of training extremely deep networks and becoming a milestone model in the field of computer vision.
[0033] The feature pyramid network is used to extract defect features of different scales in the image to be inspected, thereby simultaneously covering small-scale defects such as minor scratches and small missing materials as well as large-scale defects such as large-area color differences and cracks.
[0034] The convolutional neural network is trained using a transfer learning method based on a pre-trained ResNet50 model. During training, the pre-trained model with fixed parameters serves as the discriminator of the generative adversarial network. After pre-training, the discriminator has all its parameters fixed and no longer participates in subsequent joint training. The adversarial loss between the output of the convolutional neural network and the discriminator's discriminative output is calculated and backpropagated to the convolutional neural network to iteratively update the parameters of the convolutional neural network.
[0035] Understandably, this sub-step, which uses a pre-trained discriminator with fixed parameters, provides a more stable adversarial loss signal for the convolutional neural network, effectively avoiding problems such as training instability and overfitting in small sample scenarios. The total loss function is a combination of the cross-entropy loss function and the adversarial loss function. The optimizer is Adam, the initial learning rate is set to 0.001, and the number of training iterations is 100 rounds.
[0036] (3) Sub-model specialization: For three types of accessories—oil cup, cigarette holder, and bottom cover—corresponding detection sub-models are constructed. The detection sub-models use the same network structure and hyperparameters and are trained with a dedicated defect sample dataset of the corresponding type of workpiece to be inspected, so as to adapt to the differences in appearance characteristics of different accessories.
[0037] (4) Model evaluation: The trained detection sub-models were evaluated on the test set. Experiments showed that the overall accuracy of the model in this embodiment reached 99.6%, with scratch detection accuracy of 99.2%, crack detection accuracy of 99.5%, material shortage detection accuracy of 99.7%, color mixing detection accuracy of 99.4%, and deformation detection accuracy of 99.3%.
[0038] Step S4: Identify the type of workpiece to be inspected entering the inspection area, and call the inspection sub-model corresponding to the type.
[0039] Specifically, the type of the workpiece to be inspected is identified by extracting the shape and contour features of the workpiece in the image to be inspected. It can be understood that the system extracts the shape and contour features of the workpiece image entering the inspection area in real time, matches them with pre-stored contour templates of various components, automatically determines the current workpiece type (oil cup, cigarette holder, or bottom cover), and then calls the corresponding inspection sub-model in the multi-component inspection module to perform subsequent defect detection.
[0040] Step S5: Simultaneously perform image acquisition and defect detection on different workpieces to be inspected independently using at least two sets of image acquisition devices, and output the detection results.
[0041] Specifically, the at least two sets of image acquisition devices include a first acquisition group and a second acquisition group. The workpiece fixing mechanism loads 10 workpieces to be inspected at a time. The first gripper cylinder and the second gripper cylinder work together to clamp all 10 workpieces to be inspected simultaneously. The upper light source and the lower light source are turned on synchronously.
[0042] The first acquisition group includes 5 cameras (first acquisition group cameras), which are set above the inspection platform to acquire images and detect defects in the first batch of workpieces to be inspected (such as odd-numbered workpieces numbered 1, 3, 5, 7, and 9 from left to right in the fixed mechanism).
[0043] The second acquisition group includes 5 cameras (second acquisition group cameras), which are set below the inspection platform to simultaneously acquire images and detect defects in the second batch of workpieces to be inspected (such as even-numbered workpieces numbered 2, 4, 6, 8, and 10 from left to right for the fixed mechanism).
[0044] After the first acquisition group and the second acquisition group have completed their respective batches of inspection, the misclassification cylinders of the first acquisition group and the second acquisition group are activated respectively, and the first acquisition group and the second acquisition group exchange inspection batches. The first acquisition group continues to inspect even-numbered workpieces, and the second acquisition group continues to inspect odd-numbered workpieces, thus completing the inspection of all 10 workpieces to be inspected.
[0045] Thus, within one inspection cycle, full coverage of appearance defect detection was achieved for both the cigarette nozzle and the bottom cover of all workpieces to be inspected.
[0046] After the inspection is completed, the gripper cylinder releases, and the external robot arm removes all the workpieces to be inspected. According to the inspection results, the unqualified workpieces are sorted into the defective product area, and the qualified workpieces are placed in the designated blister box for storage. An inspection report containing information such as the location, type and severity of defects is generated and synchronized to the production management system.
[0047] Furthermore, this embodiment also includes the following steps: For each workpiece to be inspected, multiple defect inspections are performed. The mean confidence interval of the multiple inspection results is calculated based on the assumption of a normal distribution, with a confidence level of 95% to 99%. The workpiece is deemed qualified if the mean of multiple test results falls within the mean confidence interval; otherwise, it is deemed unqualified.
[0048] Understandably, compared with a single fixed threshold judgment method, making a comprehensive judgment by statistically analyzing the distribution characteristics of multiple detection results can effectively reduce misjudgments caused by fluctuations in a single detection and further improve the reliability of the judgment.
[0049] Furthermore, in order to continuously adapt to changes in product models and the emergence of new defect types, the method in this embodiment also includes an incremental learning step, which specifically includes: When a new defect sample is received, a subset is extracted from the historical defect samples according to a preset sampling strategy (i.e., a balanced extraction is made from representative samples stored in historical tasks of various types according to categories), and the subset is mixed with the new defect sample to form an updated dataset. The importance weights of each parameter of the detection sub-model to historical tasks are calculated using an elastic weight solidification algorithm. The parameters of the detection sub-model are updated based on the updated dataset, and elastic penalty constraints proportional to the importance weights of each parameter of the detection sub-model are applied.
[0050] Understandably, this step, through the dual mechanism of historical sample playback and elastic weight solidification algorithm, enables the detection sub-model to acquire the ability to identify new types of defects while retaining the ability to identify historical defect types. This allows it to continuously adapt to changes in product models and the emergence of new defect types without the need for retraining on all historical data.
[0051] Example 2 Please see Figure 2 The appearance defect detection system of this embodiment is used to execute the appearance defect detection method described in Embodiment 1. The appearance defect detection system includes: The inspection platform 10 includes a workpiece fixing mechanism, a first gripper cylinder, and a second gripper cylinder, used to hold the workpieces to be inspected. The two gripper cylinders work together to reliably fix and release a batch of workpieces to be inspected.
[0052] The lighting unit 20 includes an upper light source and a lower light source, which are respectively designed to meet the working requirements of the first acquisition group and the second acquisition group. The programmable logic controller automatically switches the lighting mode between the ring shadowless light source and the coaxial light source according to the type of the workpiece to be inspected by the relay.
[0053] The model training module 30 is configured to generate defect samples using a generative model, mix the defect samples with real defect samples to form a training dataset, apply adversarial loss constraints to the convolutional neural network using a pre-trained model with fixed parameters, train the convolutional neural network based on the training dataset, and obtain detection sub-models corresponding to various types of workpieces to be inspected.
[0054] The multi-component detection module 40 includes detection sub-models corresponding to various types of workpieces to be inspected, and stores the corresponding trained detection sub-models for the three types of components: oil cup, cigarette holder, and bottom cover.
[0055] The accessory identification and scheduling unit 50 is used to identify the type of the workpiece to be inspected and call the detection sub-model corresponding to the type in the multi-accessory detection module to complete the automatic identification of workpiece type and dynamic scheduling of detection sub-model.
[0056] The parallel inspection unit 60 includes at least two independent image acquisition devices: a first acquisition group positioned above the inspection platform and a second acquisition group positioned below the inspection platform. These devices simultaneously perform image acquisition and defect detection on different batches of workpieces to be inspected, enabling parallel operation. Specifically, the first acquisition group includes a first acquisition group camera and a first acquisition group misalignment cylinder, while the second acquisition group includes a second acquisition group camera and a second acquisition group misalignment cylinder. Each camera group acquires images of the outer surface of the workpiece from different angles, ensuring no blind spots. After each acquisition group completes its batch inspection, the misalignment cylinder drives a mechanism to perform batch exchange, achieving staggered parallel inspection.
[0057] The result output unit 70 is used to output defect detection results, and synchronize information such as detection conclusions, defect locations, and defect types to the production management system to support subsequent process optimization and quality traceability.
[0058] In this embodiment, the technical features of each system component strictly correspond to the corresponding method steps in Embodiment 1. The functions of each module are detailed in the relevant descriptions in Embodiment 1, and will not be repeated here.
[0059] Combination Figure 1 and Figure 2 This invention addresses several key issues. First, it introduces a generative model to generate defect samples and mixes them with real samples to form a training dataset. Simultaneously, it employs a pre-trained model with fixed parameters to apply stable adversarial loss constraints to the convolutional neural network, effectively mitigating the problems of naturally scarce defect samples and insufficient model generalization in industrial inspection scenarios. This allows the detection sub-model to maintain high recognition accuracy even with limited real samples. Second, by identifying the type of workpiece entering the inspection area and automatically calling the corresponding detection sub-model, it achieves adaptive and accurate detection of multiple accessory types, overcoming the limitation of existing solutions that only support a single accessory type. Third, by having at least two sets of image acquisition devices independently perform image acquisition and defect detection on different workpieces simultaneously, it achieves true parallel operation, significantly improving overall inspection efficiency and effectively meeting the cycle time requirements of large-scale industrial production.
[0060] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting appearance defects, characterized in that, include: The workpiece to be inspected is placed on the inspection platform, and image data of the outer surface of the workpiece to be inspected is acquired by an image acquisition device. The image data is preprocessed to obtain the image to be inspected; Defect samples are generated using a generative model. These defect samples are then mixed with real defect samples to form a training dataset. An adversarial loss constraint is applied to the convolutional neural network using a pre-trained model with fixed parameters. The convolutional neural network is then trained based on the training dataset to obtain detection sub-models corresponding to various types of workpieces to be inspected. Identify the type of workpiece to be inspected entering the inspection area, and call the inspection sub-model corresponding to the type; At least two sets of image acquisition devices independently perform image acquisition and defect detection on different workpieces to be inspected simultaneously, and output the inspection results.
2. The appearance defect detection method as described in claim 1, characterized in that, The pre-trained model with fixed parameters is the discriminator of the generative adversarial network. After pre-training, the discriminator fixes all parameters and calculates the adversarial loss between the output of the convolutional neural network and the discriminator's discriminative output. The adversarial loss is then backpropagated to the convolutional neural network to iteratively update the parameters of the convolutional neural network.
3. The appearance defect detection method as described in claim 1, characterized in that, The convolutional neural network uses a ResNet50 residual network, on which a feature pyramid network is superimposed. The feature pyramid network is used to extract defect features at different scales in the image to be inspected.
4. The appearance defect detection method as described in claim 1, characterized in that, The type of the workpiece to be inspected is identified by extracting the shape and contour features of the workpiece to be inspected from the image to be inspected. The detection sub-model adopts the same network structure and hyperparameters and is trained with the corresponding type of workpiece's exclusive defect sample dataset.
5. The appearance defect detection method as described in claim 1, characterized in that, Also includes: Perform multiple defect inspections on each of the aforementioned workpieces to be inspected; The confidence intervals of the mean values of multiple test results were calculated based on the assumption of a normal distribution, with a confidence level of 95% to 99%. The workpiece is deemed qualified if the mean of multiple test results falls within the mean confidence interval; otherwise, it is deemed unqualified.
6. The appearance defect detection method as described in claim 1, characterized in that, Also includes: When a new defect sample is received, a subset is extracted from the historical defect samples according to a preset sampling strategy; The subset is mixed with the new defective samples to form an updated dataset; The importance weights of each parameter of the detection sub-model to historical tasks are calculated using an elastic weight solidification algorithm. The parameters of the detection sub-model are updated based on the updated dataset, and elastic penalty constraints proportional to the importance weights of each parameter of the detection sub-model are applied.
7. The appearance defect detection method as described in claim 1, characterized in that, The at least two sets of image acquisition devices include a first acquisition group and a second acquisition group. The first acquisition group performs image acquisition and defect detection on the first batch of workpieces to be inspected in the detection area, and the second acquisition group simultaneously performs image acquisition and defect detection on the second batch of workpieces to be inspected. After the first acquisition group and the second acquisition group have completed the detection of their respective batches, they exchange the detection batches to complete the detection of all workpieces to be inspected.
8. The appearance defect detection method as described in claim 1, characterized in that, The workpiece to be inspected is illuminated by a composite lighting device including a ring-shaped shadowless light source and a coaxial light source. The programmable logic controller controls a relay to automatically switch the lighting mode between the ring-shaped shadowless light source and the coaxial light source according to the type of the workpiece to be inspected.
9. The appearance defect detection method as described in claim 1, characterized in that, The defects on the outer surface of the workpiece to be inspected include at least one of scratches, cracks, missing material, color mixing, and deformation.
10. A system for detecting appearance defects, characterized in that, include: The inspection platform is used to hold the workpiece to be inspected; The result output unit is used to output the defect detection results. The model training module is configured to generate defect samples using a generative model, mix the defect samples with real defect samples to form a training dataset, apply adversarial loss constraints to the convolutional neural network using a pre-trained model with fixed parameters, and train the convolutional neural network based on the training dataset to obtain detection sub-models corresponding to various types of workpieces to be inspected. The multi-component inspection module includes the inspection sub-models corresponding to various types of workpieces to be inspected; The accessory identification and scheduling unit is used to identify the type of the workpiece to be inspected and call the detection sub-model corresponding to the type in the multi-accessory detection module; The parallel inspection unit includes at least two sets of independent image acquisition devices for simultaneously performing image acquisition and defect detection on different batches of workpieces to be inspected. The lighting unit is used to illuminate the workpiece to be inspected, and the lighting unit automatically switches the lighting mode according to the type of the workpiece to be inspected.