Appearance defect detection method and device, computer device and storage medium
By configuring data acquisition parameters in the configuration file, the system automatically collects and standardizes the data to be inspected, and then uses an appearance defect detection model for inspection. This solves the problem of low efficiency in traditional methods and achieves efficient and universal appearance defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN SMARTMORE TECH CO LTD
- Filing Date
- 2022-10-09
- Publication Date
- 2026-07-10
AI Technical Summary
Traditional methods for detecting appearance defects require manual coding and data processing, resulting in low efficiency and making them unsuitable for various project scenarios.
By configuring data acquisition parameters in the configuration file, the system automatically collects and standardizes the data to be inspected, and uses an appearance defect detection model to perform the inspection and output the inspection results. It is suitable for appearance defect detection scenarios in different projects.
It eliminates the need for manual coding and data input, improving the efficiency and versatility of appearance defect detection and saving significant manpower and time.
Smart Images

Figure CN115829925B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, and storage medium for detecting appearance defects. Background Technology
[0002] With the development of computer technology, the use of artificial intelligence methods to detect appearance defects in products or workpieces produced on production lines is becoming increasingly common, providing convenience for improving product appearance quality. For example, image data of printed circuit boards (PCBs) can be collected, and artificial intelligence models can be used for image recognition to detect defects in the PCBs.
[0003] Traditional methods for detecting cosmetic defects require manual coding for each project to collect data, as well as manual data processing. Furthermore, a specific cosmetic defect detection model needs to be trained for that project, and then the processed data is manually input into this model for detection. This results in a significant investment of time and effort in cosmetic defect detection for each project, leading to low efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, storage medium, and computer program product for detecting appearance defects, which can improve the efficiency of appearance defect detection.
[0005] Firstly, this application provides a method for detecting appearance defects, including:
[0006] Based on the configuration file, the target data acquisition parameters for the appearance defect detection scenario corresponding to the target object are determined from the data acquisition parameters configured for each preset appearance defect detection scenario.
[0007] Based on the target data acquisition parameters, collect the initial data to be detected for the target object;
[0008] The initial data to be tested is standardized to obtain standardized data to be tested.
[0009] Standardized data to be tested is input into the appearance defect detection model for detection, and the detection results are output.
[0010] Based on the detection results, determine the type of appearance defect of the target object.
[0011] Secondly, this application also provides an appearance defect detection device, comprising:
[0012] The determination module is used to determine the target data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object from the data acquisition parameters configured for each preset appearance defect detection scenario according to the configuration file.
[0013] The acquisition module is used to acquire the initial data to be detected of the target object according to the target data acquisition parameters;
[0014] The standardization processing module is used to perform data standardization processing on the initial data to be tested, so as to obtain standardized data to be tested;
[0015] The detection module is used to input standardized data to be detected into the appearance defect detection model for detection and output the detection results.
[0016] The identification module is used to determine the type of appearance defect of the target object based on the detection results.
[0017] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described appearance defect detection method.
[0018] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described appearance defect detection method.
[0019] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps in the above-described appearance defect detection method.
[0020] The aforementioned appearance defect detection method, apparatus, computer equipment, storage medium, and computer program products, by configuring corresponding data acquisition parameters for each preset appearance defect detection scenario in the configuration file, can be applied to appearance defect detection scenarios of different projects. This eliminates the need for manual coding for data acquisition for each specific project. The initial data to be detected is standardized to obtain standardized data, allowing data from different data sources collected in different projects to be detected by the appearance defect detection model. There is no need to train a specific appearance defect detection model applicable only to that specific project. Furthermore, the entire process is automated, eliminating the need for manual input of the collected data into the appearance detection model for appearance detection. This saves significant manpower and time, improving the efficiency of appearance defect detection. Attached Figure Description
[0021] Figure 1An application environment diagram for a method for detecting appearance defects provided in this application embodiment;
[0022] Figure 2 A schematic flowchart illustrating a method for detecting appearance defects provided in an embodiment of this application;
[0023] Figure 3 This is a schematic diagram of the overall process of an appearance defect detection method provided in an embodiment of this application;
[0024] Figure 4 A structural block diagram of an appearance defect detection device provided in an embodiment of this application;
[0025] Figure 5 A structural block diagram of another appearance defect detection device provided in the embodiments of this application;
[0026] Figure 6 An internal structural diagram of a computer device provided in an embodiment of this application;
[0027] Figure 7 This is an internal structural diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0029] The appearance defect detection method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, computer device 102 communicates with server 104 via a communication network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on the cloud or other network servers. Users can configure configuration files through computer device 102, and server 104 can execute the appearance defect detection methods in the embodiments of this application to detect appearance defects in target objects. Computer device 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.
[0030] In some embodiments, such as Figure 2 As shown, a method for detecting appearance defects is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0031] Step 202: Based on the configuration file, determine the target data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object from the data acquisition parameters configured for each preset appearance defect detection scenario.
[0032] In this context, the appearance defect detection scenario refers to the equipment environment in which appearance defect detection is performed. The target object is the object whose appearance defects need to be detected. The data acquisition parameters are the parameters used to collect the initial data to be detected. The target data acquisition parameters refer to the data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object.
[0033] In some embodiments, the appearance defect detection scenario may include at least one of a machine tool and a camera.
[0034] It is understandable that different appearance defect inspection items can be different appearance defect inspection scenarios or the same appearance defect inspection scenario. For example, different appearance defect inspection items may use different machine models or camera models, which is equivalent to different appearance defect inspection scenarios.
[0035] In some embodiments, the target object may be a product or workpiece manufactured on a production line. For example, the target object may be a printed circuit board (PCB).
[0036] In some embodiments, different preset appearance defect detection scenarios can correspond to different data acquisition parameters in the configuration file.
[0037] In some embodiments, data acquisition parameters may include at least one of the following: machine model, camera model, and file path.
[0038] In some embodiments, the correspondence between different preset appearance defect detection scenarios and their corresponding data acquisition parameters can be stored in the configuration file. When performing appearance defect detection, the server can determine the target data acquisition parameters corresponding to the appearance defect detection scenario of the target object based on the correspondence in the configuration file, and then obtain the stored target data acquisition parameters.
[0039] In some embodiments, a user can select target data acquisition parameters configured for a visual defect detection scenario corresponding to a target object using a computer device. In other embodiments, the server can automatically match the target data acquisition parameters configured for the visual defect detection scenario corresponding to the target object.
[0040] Step 204: Collect the initial data to be detected for the target object according to the target data acquisition parameters.
[0041] The initial data to be detected consists of unprocessed images related to the target object.
[0042] In some embodiments, the initial data to be detected may include at least one of the following: a cutaway diagram, a solid diagram, and a design diagram of the target object.
[0043] In some embodiments, the server can perform production task monitoring, image data acquisition, and machine information reading based on target data acquisition parameters. Production task monitoring refers to the process of monitoring whether the equipment has acquired image data. Image data acquisition is the process of obtaining the acquired image data from the equipment. Machine information reading is the process of retrieving machine information.
[0044] Specifically, the server can determine the corresponding equipment based on the target data acquisition parameters, monitor the production tasks of the corresponding equipment, and after monitoring that the equipment has acquired image data, the server can acquire image data from the equipment based on the target data acquisition parameters and read the machine information.
[0045] In some embodiments, the server may classify the initial data to be detected, or classify the initial data to be detected according to multiple classification criteria.
[0046] In some embodiments, the server can classify and store the initial data to be detected according to the classification type.
[0047] In some embodiments, the server can classify the initial data to be detected according to the data source type, obtaining one or more data source types corresponding to the initial data to be detected. Here, data source type refers to the type categorized based on the source of the initial data to be detected. For example, data source type may include color image type and black and white image type, etc. Or, data source type may include slice image type, entity image type, and design draft type, etc.
[0048] In other embodiments, the server may also classify the initial data to be detected according to at least one of the following classification criteria: the target object to which the initial data to be detected belongs, the model of the target object, the components of the target object, and the device from which the initial data to be detected originates.
[0049] In some embodiments, after classification, the server can orchestrate the initial data to be tested, divide the initial data to be tested into multiple batches, and perform data standardization processing on each batch of the initial data to be tested in the order of the orchestrated batches to obtain standardized data to be tested and subsequent steps.
[0050] In some embodiments, the server can add batch numbers to the initial data to be tested in each batch, and perform data standardization processing on the initial data to be tested in each batch in the order of the batch numbers to obtain standardized data to be tested and subsequent steps.
[0051] Step 206: Perform data standardization processing on the initial data to be tested to obtain standardized data to be tested.
[0052] Data standardization is the process of standardizing the initial data to be tested so that it is suitable for the appearance defect detection model.
[0053] In some embodiments, the server can perform data standardization processing on the initial data to be detected according to data parsing rules to obtain standardized data to be detected.
[0054] In some embodiments, the server may determine one or more data source types corresponding to the initial data to be detected, and perform data standardization processing on the initial data to be detected according to the data parsing rules corresponding to the determined one or more data source types to obtain standardized data to be detected.
[0055] Step 208: Input the standardized data to be tested into the appearance defect detection model for detection and output the detection results.
[0056] The appearance defect detection model is a model used for detecting appearance defects. The detection result is the information related to the defects of the target object output by the appearance defect detection model.
[0057] In some embodiments, the appearance defect detection model can be a machine learning model or a deep learning model.
[0058] Specifically, the server can input standardized data to be detected into the appearance defect detection model, which can then perform appearance defect detection on the standardized data and output the detection results.
[0059] In some embodiments, the server may determine one or more data source types corresponding to the initial data to be detected, and input the standardized data to be detected into the appearance defect detection model corresponding to the determined one or more data source types.
[0060] In some embodiments, the detection results may include at least one of the following: the appearance of the defect, the defect type, the defect shape, and the defect location.
[0061] Step 210: Based on the detection results, determine the type of appearance defect of the target object.
[0062] In some embodiments, the server can parse the detection results to obtain the type of appearance defect of the target object.
[0063] In some embodiments, the server can determine one or more data source types corresponding to the initial data to be detected, and parse the detection results according to the result parsing rules corresponding to the determined one or more data source types to obtain the appearance defect type of the target object.
[0064] The aforementioned appearance defect detection method, by configuring corresponding data acquisition parameters for each preset appearance defect detection scenario in the configuration file, can be applied to appearance defect detection scenarios of different projects. This eliminates the need for manual coding for data acquisition for each specific project. The initial data to be detected is standardized, resulting in standardized data that can be detected from different data sources across different projects using the appearance defect detection model. This eliminates the need to train a specific appearance defect detection model applicable only to that project, and the entire process is automated. The manual input of the collected data into the appearance detection model saves significant manpower and time, improving the efficiency of appearance defect detection. Furthermore, its applicability to various appearance defect detection scenarios enhances the versatility of the appearance defect detection method.
[0065] In some embodiments, before acquiring initial data to be detected of the target object according to target data acquisition parameters, the method further includes:
[0066] If the configuration file does not contain target data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object, then the data acquisition parameters input for the appearance defect detection scenario corresponding to the target object will be used as the target data acquisition parameters, and the configuration file will be updated based on the target data acquisition parameters.
[0067] In some embodiments, when performing appearance defect detection, if the configuration file does not contain target data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object, the user can input the corresponding data acquisition parameters for the appearance defect detection scenario corresponding to the target object through a computer device as target data acquisition parameters. The server can update the correspondence between the appearance defect detection scenario corresponding to the target object and the target data acquisition parameters in the configuration file so that it can be used in the same appearance defect detection scenario in the future.
[0068] In the above embodiments, users can input corresponding data acquisition parameters for appearance defect detection scenarios. The server can update the configuration file based on the target data acquisition parameters. As more projects are executed, a large number of data acquisition parameters for appearance defect detection scenarios can be gradually accumulated. Therefore, in subsequent projects, there is no need to write specific data acquisition code for each project; instead, the corresponding data acquisition parameters can be directly selected from the configuration file, improving the efficiency of appearance defect detection. Since the types of equipment and cameras on the market are limited, data acquisition parameters for most appearance defect detection scenarios can be quickly accumulated, improving the versatility and efficiency of the appearance defect detection method.
[0069] In some embodiments, data standardization processing is performed on the initial data to be detected to obtain standardized data to be detected, including:
[0070] Determine one or more data source types corresponding to the initial data to be detected;
[0071] Based on the target data parsing rules configured in the configuration file for one or more data source types, the initial data to be detected is parsed to obtain standardized data to be detected.
[0072] Standardized data to be inspected is input into the appearance defect detection model for inspection, and the output inspection results include:
[0073] Standardized data to be detected is input into the target appearance defect detection model configured in the configuration file for one or more data source types, and the detection results are output.
[0074] Among them, the target data parsing rules are data parsing rules configured for the data source type of the initial data to be tested. Data parsing rules are processing rules used to parse the initial data to be tested to obtain standardized data to be tested.
[0075] In some embodiments, the initial data to be detected can be data from the same data source type or data from multiple data source types.
[0076] In some embodiments, the server can store the correspondence between data source types and data parsing rules in a configuration file. When performing visual defect detection, the server can determine the corresponding target data parsing rules from the configuration file based on one or more data source types of the initial data to be detected, and parse the initial data to be detected according to the target data parsing rules.
[0077] It is understandable that there is a one-to-one correspondence between the data source type of the initial data to be tested and the target data parsing rule. If there is only one data source type for the initial data to be tested, then there is only one target data parsing rule; if there are multiple data source types for the initial data to be tested, then there are multiple target data parsing rules.
[0078] In some embodiments, the server can store the correspondence between data source types and appearance defect detection models in a configuration file. When performing appearance defect detection, the server can determine the corresponding target appearance defect detection model from the configuration file based on one or more data source types of the initial data to be detected, input the standardized data to be detected into the target appearance defect detection model for detection, and output the detection results.
[0079] It is understandable that there is a one-to-one correspondence between the data source type of the initial data to be detected and the target appearance defect detection model. If there is only one data source type for the initial data to be detected, then there is only one corresponding target appearance defect detection model; if there are multiple data source types for the initial data to be detected, then there are multiple corresponding target appearance defect detection models.
[0080] In the above embodiments, by configuring corresponding data parsing rules and appearance defect detection models for different data source types in the configuration file, appearance defect detection can be performed on the data to be detected for different data source types, which improves the versatility of the appearance defect detection method. Moreover, it eliminates the need to train a specific appearance defect detection model for each specific project, saving a lot of time and manpower and improving the efficiency of appearance defect detection.
[0081] In some embodiments, the method further includes:
[0082] If the configuration file does not contain data parsing rules and appearance defect detection models configured for one or more data source types, then the data parsing rules and appearance defect detection models input for one or more data source types will be used as the target data parsing rules and target appearance defect detection models, respectively, and the configuration file will be updated based on the target data parsing rules and target appearance defect detection models.
[0083] In some embodiments, when performing appearance defect detection, if the configuration file does not contain data parsing rules and appearance defect detection models corresponding to one or more data source types, the user can input the corresponding data parsing rules and appearance defect detection models for one or more data source types via a computer device, which will serve as the target data parsing rules and target appearance defect detection models, respectively. The server can update the correspondence between the one or more data source types and the target data parsing rules and target appearance defect detection models in the configuration file for subsequent use when detecting initial data to be detected for the same data source type. Here, there is a one-to-one correspondence between the data source type, the data parsing rules, and the appearance defect detection models.
[0084] In the above embodiments, users can input corresponding data parsing rules and appearance defect detection models for one or more data source types, which serve as target data parsing rules and target appearance defect detection models, respectively. As more projects are executed, data parsing rules and appearance defect detection models corresponding to many types of data sources can be gradually accumulated. Thus, in subsequent projects, it is not necessary to train specific appearance defect detection models for specific projects, which improves the versatility of the appearance defect detection method, saves a lot of manpower and time, and improves the efficiency of appearance defect detection.
[0085] In some embodiments, determining the type of appearance defect of the target object based on the detection results includes:
[0086] Determine the target detection result parsing rules configured in the configuration file for one or more data source types;
[0087] Based on the target detection result parsing rules, the detection results are parsed to obtain the appearance defect type corresponding to the target object.
[0088] Among them, the target detection result parsing rules are the detection result parsing rules configured for one or more data source types corresponding to the initial data to be detected. The detection result parsing rules are the processing rules for parsing the detection results to determine the type of appearance defect.
[0089] In some embodiments, the server can store the correspondence between data source types and detection result parsing rules in a configuration file. When performing appearance defect detection, the server can determine the target detection result parsing rules corresponding to one or more data source types to which the initial data to be detected belongs from the configuration file, parse the detection results according to the target detection result parsing rules, and obtain the appearance defect type corresponding to the target object.
[0090] It is understandable that there is a one-to-one correspondence between the data source type of the initial data to be detected and the parsing rule of the target detection result. If there is only one data source type for the initial data to be detected, then there is only one corresponding parsing rule for the target detection result; if there are multiple data source types for the initial data to be detected, then there are multiple corresponding parsing rule models for the target detection result.
[0091] In the above embodiments, target detection result parsing rules are determined in the configuration file for one or more data source types. Based on the target detection result parsing rules, the detection results are parsed to obtain the appearance defect type corresponding to the target object. This enables the appearance defect type to be parsed from the detection results obtained by the appearance defect detection model under different data source types, thereby improving the versatility of the appearance defect detection method.
[0092] In some embodiments, the method further includes:
[0093] If the configuration file does not contain target detection result parsing rules for one or more data source types, then the detection result parsing rules input for one or more data source types will be used as target detection result parsing rules, and the configuration file will be updated based on the target detection result parsing rules.
[0094] In some embodiments, when performing appearance defect detection, if the configuration file does not contain target detection result parsing rules configured for one or more data source types, the user can input the corresponding detection result parsing rules for one or more data source types via a computer device. These rules will then serve as target detection result parsing rules. The server can update the mapping between one or more data source types and target detection result parsing rules in the configuration file for subsequent detection of initial data of the same data source type. There is a one-to-one correspondence between data source types and target detection result parsing rules.
[0095] In the above embodiments, users can input corresponding detection result parsing rules for one or more data source types. As more projects are executed, detection result parsing rules corresponding to many types of data sources can be gradually accumulated. In subsequent projects, it is not necessary to train specific appearance defect detection models for specific projects and write corresponding detection result parsing rules, which improves the versatility of appearance defect detection methods, saves manpower and time, and improves appearance defect detection efficiency.
[0096] In some embodiments, the method further includes:
[0097] Obtain the manual annotation results of the appearance defect type annotation for the initial data to be inspected;
[0098] Based on the identified appearance defect types, manual annotation results, and standardized data to be inspected, the appearance defect detection model is optimized.
[0099] Among them, appearance defect type labeling refers to the manual operation of labeling the appearance defect types in the initial data to be inspected. The manual labeling result is the appearance defect types labeled in the initial data to be inspected.
[0100] Specifically, users can use computer devices to label the initial data to be inspected with appearance defect types. The computer devices can then send the manually labeled results to the server. The server can input the appearance defect types determined based on the detection results of the appearance defect detection model, the manually labeled results, and the standardized data to be inspected into the appearance defect detection model to optimize the model parameters.
[0101] In some embodiments, after each appearance defect detection, the appearance defect detection model can be optimized based on the determined appearance defect type, manual annotation results, and standardized data to be detected. Then, the optimized appearance defect detection model can be used in the next appearance defect detection process.
[0102] In some embodiments, after determining the type of appearance defect, the computer device may display a prompt message to encourage users to annotate the appearance defect type. Users can trigger the prompt message to display a page for annotating the appearance defect type. The computer device may display initial data to be inspected on the page for annotating the appearance defect type, and users can annotate the appearance defect type on the displayed initial data to be inspected using the computer device.
[0103] In the above embodiments, after determining the type of appearance defect, the initial data to be inspected can be manually labeled with the appearance defect type to obtain the manual labeling result. Then, based on the determined appearance defect type, the manual labeling result, and the standardized data to be inspected, the appearance defect detection model is optimized. In subsequent appearance defect detection, the optimized appearance defect detection model can be used, thereby forming a closed-loop process and quickly optimizing and iterating the appearance defect detection model. There is no need to manually organize the appearance defect types and manual labeling results obtained by the model detection and then manually optimize the appearance defect detection model again, which improves the efficiency of appearance defect detection model optimization. By rapidly optimizing and iterating the appearance defect detection model, the accuracy of appearance defect detection is improved.
[0104] In some embodiments, the method further includes:
[0105] Based on the difference between the determined appearance defect type and the manual annotation result, the accuracy statistical analysis of the detection results corresponding to each group of initial data to be detected was carried out to obtain the statistical analysis results.
[0106] Based on the statistical analysis results, generate visual charts.
[0107] Accuracy statistical analysis involves statistically analyzing the accuracy of appearance defect types determined based on the inspection results of the appearance inspection model. Visual charts are used to represent the results of this accuracy statistical analysis.
[0108] In some embodiments, visualizations may include at least one of tables and statistical charts.
[0109] In some embodiments, the server can group the detection results based on the initial data to be detected, and then perform an accuracy statistical analysis on the detection results of each group based on the difference between the appearance defect type corresponding to the detection results and the manual annotation results. Then, based on the statistical analysis results of each group of detection results, a visualization chart corresponding to the detection results of each group of initial data to be detected is generated.
[0110] In some embodiments, the server can group the detection results of the initial data to be detected according to the batch of appearance defect detection, and the server can generate a visualization chart corresponding to the detection results of the initial data to be detected in each batch.
[0111] In some embodiments, the server can group the detection results of the initial data to be detected according to the type of appearance defect, and the server can generate a visualization chart corresponding to the detection results of each type of appearance defect.
[0112] In some embodiments, the server can group the detection results of the initial data to be detected according to the different appearance defect detection models used, and the server can generate visualization charts corresponding to each appearance defect detection model.
[0113] In the above embodiments, the accuracy of appearance defect detection can be automatically statistically analyzed and a visual chart can be generated to quickly and intuitively display the accuracy of appearance defect detection.
[0114] like Figure 3The diagram illustrates the overall flow of the appearance defect detection method in various embodiments of this application. First, the server collects initial data to be detected based on configured data acquisition parameters. This initial data can be from different data sources (including data sources A, B, and C in the diagram). The acquisition process specifically includes production task monitoring, image data acquisition, and machine information reading. The server can also classify the collected initial data and store it according to the classification results. Next, the server can perform task orchestration, dividing the initial data into multiple batches, and then sequentially process each batch of initial data. The server can perform image preprocessing on the initial data, including parsing the data to obtain standardized data and using conventional preprocessing methods. Then, the server can use an appearance defect detection model to detect the standardized data (i.e., AI detection in the diagram) to obtain detection results. Different data source types correspond to different appearance defect detection models. Next, the server can parse the detection results, as shown in the diagram, different data source types correspond to different detection result parsing rules, obtaining the appearance defect type. The server can then store the detection results. Next, the initial data to be detected can be manually reviewed (i.e., manual review in the figure). Based on the review results, the initial data to be detected is labeled with appearance defect types (i.e., manual labeling in the figure). The server can perform statistical analysis based on the manual labeling results and the appearance defect types determined based on the detection results, and export the manual labeling results and the determined appearance defect types (i.e., data export in the figure). The exported manually labeled data, the determined appearance defect types, and the data to be detected are used as training data to train the appearance defect detection model through deep learning to optimize the appearance defect detection model. The optimized appearance defect detection model can be applied to subsequent appearance defect detection to form a closed-loop process.
[0115] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0116] Based on the same inventive concept, this application also provides an appearance defect detection device. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in the appearance defect detection device embodiments provided below can be found in the limitations of the appearance defect detection method above, and will not be repeated here.
[0117] In some embodiments, such as Figure 4 As shown, a visual defect detection device 400 is provided, comprising:
[0118] The determination module 402 is used to determine the target data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object from the data acquisition parameters configured for each preset appearance defect detection scenario according to the configuration file.
[0119] The acquisition module 404 is used to acquire the initial data to be detected of the target object according to the target data acquisition parameters;
[0120] The processing module 406 is used to perform data standardization processing on the initial data to be detected to obtain standardized data to be detected.
[0121] The detection module 408 is used to input standardized data to be detected into the appearance defect detection model for detection and output the detection results.
[0122] The identification module 410 is used to determine the type of appearance defect of the target object based on the detection results.
[0123] In some embodiments, the determining module 402 is further configured to, if there are no target data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object in the configuration file, use the data acquisition parameters input for the appearance defect detection scenario corresponding to the target object as the target data acquisition parameters, and update the configuration file based on the target data acquisition parameters.
[0124] In some embodiments, in terms of performing data standardization processing on the initial data to be detected to obtain standardized data to be detected, the processing module 406 is specifically used for:
[0125] Determine one or more data source types corresponding to the initial data to be detected;
[0126] Based on the target data parsing rules configured in the configuration file for one or more data source types, the initial data to be detected is parsed to obtain standardized data to be detected.
[0127] The detection module 408 is also used to input standardized data to be detected into the target appearance defect detection model configured in the configuration file for one or more data source types, and output the detection results.
[0128] In some embodiments, the determining module 402 is further configured to, if there are no data parsing rules and appearance defect detection models configured for one or more data source types in the configuration file, take the data parsing rules and appearance defect detection models input for one or more data source types as target data parsing rules and target appearance defect detection models respectively, and update the configuration file based on the target data parsing rules and target appearance defect detection models.
[0129] In some embodiments, in determining the type of appearance defect of a target object based on the detection results, the identification module 410 is specifically used for:
[0130] Determine the target detection result parsing rules configured in the configuration file for one or more data source types;
[0131] Based on the target detection result parsing rules, the detection results are parsed to obtain the appearance defect type corresponding to the target object.
[0132] In some embodiments, the determining module 402 is further configured to, if there is no target detection result parsing rule configured for one or more data source types in the configuration file, use the detection result parsing rule input for one or more data source types as the target detection result parsing rule, and update the configuration file based on the target detection result parsing rule.
[0133] In some embodiments, such as Figure 5 As shown, the device also includes:
[0134] The optimization module 412 is used to obtain the manual annotation results of the appearance defect type annotation for the initial test data; and optimize the appearance defect detection model based on the determined appearance defect type, the manual annotation results and the standardized test data.
[0135] In some embodiments, such as Figure 5 As shown, the device also includes:
[0136] Analysis module 414 is used to perform accuracy statistical analysis on the detection results corresponding to each group of initial data to be detected based on the difference between the determined appearance defect type and the manual annotation results, and to obtain statistical analysis results; based on the statistical analysis results, a visualization chart is generated.
[0137] The aforementioned appearance defect detection device, by configuring corresponding data acquisition parameters for various preset appearance defect detection scenarios in the configuration file, can be applied to appearance defect detection scenarios of different projects. This eliminates the need for manual coding for data acquisition for each specific project. The initial data to be detected is standardized, resulting in standardized data that can be detected from different data sources across different projects using the appearance defect detection model. This eliminates the need to train a specific appearance defect detection model applicable only to that project, and the entire process is automated. The elimination of manual input of the collected data into the appearance detection model saves significant manpower and time, improving the efficiency of appearance defect detection. Furthermore, its applicability to various appearance defect detection scenarios enhances the versatility of appearance defect detection.
[0138] Each module in the aforementioned appearance defect detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0139] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The communication interface allows communication with external terminals via a network. When the computer program is executed by the processor, it performs the steps in the aforementioned method for detecting cosmetic defects.
[0140] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0141] In some embodiments, a computer-readable storage medium 700 is provided, on which a computer program 702 is stored. When executed by a processor, the computer program 702 implements the steps in the above method embodiments. Its internal structure diagram is shown below. Figure 7 As shown.
[0142] In some embodiments, a computer device is provided, the computer device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above method embodiments.
[0143] In some embodiments, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0145] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0146] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0147] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for detecting appearance defects, characterized in that, include: Based on the configuration file, the target data acquisition parameters for the appearance defect detection scenario corresponding to the target object are determined from the data acquisition parameters configured for each preset appearance defect detection scenario. Based on the target data acquisition parameters, the initial data to be detected of the target object is acquired; The initial data to be detected is an unprocessed image related to the target object; Determine one or more data source types corresponding to the initial data to be detected; Based on the target data parsing rules configured in the configuration file for the one or more data source types, the initial data to be detected is parsed to obtain standardized data to be detected. The standardized data to be detected is input into the target appearance defect detection model configured in the configuration file for the one or more data source types, and the detection results are output. Based on the detection results, the type of appearance defect of the target object is determined.
2. The method according to claim 1, characterized in that, Before collecting the initial data to be detected of the target object according to the target data acquisition parameters, the method further includes: If the configuration file does not contain the target data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object, then the data acquisition parameters input for the appearance defect detection scenario corresponding to the target object will be used as the target data acquisition parameters, and the configuration file will be updated based on the target data acquisition parameters.
3. The method according to claim 1, characterized in that, The method further includes: If the configuration file does not contain data parsing rules and appearance defect detection models configured for the one or more data source types, then the data parsing rules and appearance defect detection models input for the one or more data source types will be used as the target data parsing rules and the target appearance defect detection models, respectively, and the configuration file will be updated based on the target data parsing rules and the target appearance defect detection models.
4. The method according to claim 1, characterized in that, Determining the type of appearance defect of the target object based on the detection results includes: Determine the target detection result parsing rules configured in the configuration file for the one or more data source types; According to the target detection result parsing rules, the detection results are parsed to obtain the appearance defect type corresponding to the target object.
5. The method according to claim 4, characterized in that, The method further includes: If the configuration file does not contain a target detection result parsing rule configured for the one or more data source types, then the detection result parsing rule input for the one or more data source types will be used as the target detection result parsing rule, and the configuration file will be updated based on the target detection result parsing rule.
6. The method according to claim 1, characterized in that, The method further includes: Obtain the manual annotation results for the appearance defect type labeling of the initial data to be inspected; The appearance defect detection model is optimized based on the determined appearance defect type, the manual annotation results, and the standardized data to be detected.
7. The method according to claim 6, characterized in that, The method further includes: Based on the difference between the determined appearance defect type and the manual annotation result, the accuracy statistical analysis of the detection results corresponding to each group of initial data to be detected is performed to obtain the statistical analysis results; Based on the statistical analysis results, a visualization chart is generated.
8. A device for detecting appearance defects, characterized in that, include: The determination module is used to determine the target data acquisition parameters configured for the appearance defect detection scenario corresponding to the target object from the data acquisition parameters configured for each preset appearance defect detection scenario according to the configuration file. The acquisition module is used to acquire the initial data to be detected of the target object according to the target data acquisition parameters; The initial data to be detected is an unprocessed image related to the target object; The processing module is used to determine one or more data source types corresponding to the initial data to be detected; Based on the target data parsing rules configured in the configuration file for the one or more data source types, the initial data to be detected is parsed to obtain standardized data to be detected. The detection module is used to input the standardized data to be detected into the target appearance defect detection model configured in the configuration file for the one or more data source types, and output the detection results. The identification module is used to determine the type of appearance defect of the target object based on the detection results.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.