Product defect detection method and device, computer equipment and storage medium

Through the automated product defect detection method, the target model is called sequentially for defect detection using the target image and model flow chart, and the post-processing parameters are used to filter the results, the problems of high labor costs and low detection efficiency in the existing technology are solved, and efficient and accurate defect detection is achieved.

CN119832396APending Publication Date: 2025-04-15SHENZHEN SMARTMORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411784046.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing product defect detection methods have problems such as high labor costs and low detection efficiency.

Method used

By obtaining the target image of the product to be detected, querying the identification and dependencies of the target model based on the image identification, combining the model identification to generate a model flow chart, calling the target model in sequence for defect detection, and filtering the initial detection results using post-processing parameters to achieve an automated defect detection process.

Benefits of technology

It improves the efficiency and accuracy of product defect detection, reduces manual operation, and reduces inspection costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832396A_ABST
    Figure CN119832396A_ABST
Patent Text Reader

Abstract

The invention relates to a product defect detection method and device, computer equipment and a storage medium. The method comprises the steps of obtaining a target image of a to-be-detected product; on the basis of the image identifier of the target image, querying a model identifier of each target model and a dependency relationship between the target models, and querying a post-processing parameter identifier corresponding to each target model; combining the model identifiers based on the dependency relationship to obtain a model flow chart; based on the model flow chart, orderly calling each target model from a model library to carry out product defect detection on the target image, and obtaining an initial defect detection result output by each target model; and performing product defect filtering on each initial defect detection result based on a target post-processing parameter corresponding to each post-processing parameter identifier to obtain a target defect detection result corresponding to the to-be-detected product. According to the invention, the efficiency of product defect detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a product defect detection method, device, computer equipment and storage medium. Background Art

[0002] With the development of computer technology, the level of industrialization is getting higher and higher, and various products can be manufactured for people. Defect detection is an important part of ensuring product quality and production efficiency in industrial scenarios.

[0003] The current product defect detection method is usually that professionals manually formulate a product defect detection process for the product to be inspected, and the staff manually call the model to perform defect detection on the product to be inspected according to the product defect detection process, and manually filter the model reasoning results.

[0004] The current product defect detection methods have the problems of high labor costs and low detection efficiency. Summary of the invention

[0005] Based on this, it is necessary to provide a product defect detection method, apparatus, computer equipment, computer readable storage medium and computer program product to address the above technical problems, which can improve the efficiency of product defect detection.

[0006] In a first aspect, the present application provides a product defect detection method, comprising:

[0007] Acquire a target image of the product to be inspected;

[0008] Based on the image identification of the target image, query the model identification of each target model and the dependency relationship between each target model, and query the post-processing parameter identification corresponding to each target model;

[0009] Combine the model identifiers based on the dependency relationship to obtain a model flow chart;

[0010] Based on the model flow chart, each target model is sequentially called from the model library to perform product defect detection on the target image, and the initial defect detection results output by each target model are obtained;

[0011] Based on the target post-processing parameters corresponding to each post-processing parameter identifier, each initial defect detection result is subjected to product defect filtering to obtain a target defect detection result corresponding to the product to be detected.

[0012] In a second aspect, the present application provides a product defect detection device, comprising:

[0013] An acquisition module, used to acquire a target image of a product to be inspected;

[0014] A query module, used to query the model identifiers of each target model and the dependency relationship between each target model based on the image identifier of the target image, and query the post-processing parameter identifiers corresponding to each target model;

[0015] A combination module is used to combine the model identifiers based on dependency relationships to obtain a model flow chart;

[0016] The detection module is used to sequentially call each target model from the model library to perform product defect detection on the target image based on the model flow chart, and obtain the initial defect detection results output by each target model;

[0017] The filtering module is used to identify the corresponding target post-processing parameters based on the respective post-processing parameters, filter the product defects of the initial defect detection results, and obtain the target defect detection results corresponding to the products to be detected.

[0018] In a third aspect, the present application provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method when executing the computer program.

[0019] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.

[0020] In a fifth aspect, the present application provides a computer program product, which includes a computer program, and the computer program implements the steps in the above method when executed by a processor.

[0021] The above-mentioned product defect detection method, device, computer equipment, computer-readable storage medium and computer program product, when it is necessary to perform defect detection on the product to be detected, obtain the target image of the product to be detected, retrieve data to generate a model flow chart for processing the target image according to the image identification of the target image, and call the target model from the model library in order according to the model flow chart to perform product defect detection on the target image, so that the model can be automatically assigned to perform product defect detection on the image according to the image identification, without manual operation, effectively improving the detection efficiency. In addition, according to the image identification of the target image, the post-processing parameter identification corresponding to the target model can also be retrieved, and the target post-processing parameters can be obtained through the post-processing parameter identification. Based on the target post-processing parameters, the initial defect detection result output by the target model is filtered for product defects, so that the target post-processing parameters for filtering the initial defect detection results can be automatically assigned according to the image identification, without manual operation, further effectively improving the detection efficiency. Based on each target post-processing parameter, each initial defect detection result is filtered for product defects, which can further filter out invalid product defects, thereby obtaining the target defect detection result corresponding to the product to be detected, effectively improving the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 An application environment diagram of a product defect detection method provided in an embodiment of the present application;

[0023] Figure 2 A schematic diagram of a process for detecting product defects provided in an embodiment of the present application;

[0024] Figure 3 An overall architecture diagram of a product defect detection method provided in an embodiment of the present application;

[0025] Figure 4 A schematic diagram of a post-processing filtering process provided in an embodiment of the present application;

[0026] Figure 5 A structural block diagram of a product defect detection device provided in an embodiment of the present application;

[0027] Figure 6 An internal structure diagram of a computer device provided in an embodiment of the present application;

[0028] Figure 7 An internal structure diagram of another computer device provided in an embodiment of the present application;

[0029] Figure 8 An internal structure diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0031] The product defect detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through a communication network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0032] like Figure 2 As shown, the embodiment of the present application provides a product defect detection method, which is applied to Figure 1 The terminal 102 or the server 104 in the example is used for explanation. It is understandable that the computer device may include at least one of the terminal and the server. The method comprises the following steps:

[0033] S202: Acquire a target image of the product to be inspected.

[0034] The product to be inspected refers to a product to be inspected for defects. It is understood that the product to be inspected may be any product. The target image of the product to be inspected is a product image of the product to be inspected. The target image is obtained by photographing the product to be inspected. For example, the target image may be obtained by photographing the appearance of the product to be inspected.

[0035] Specifically, the computer device can analyze the target image of the product to be inspected to determine whether the product to be inspected has product defects.

[0036] S204 , based on the image identifier of the target image, query the model identifiers of the respective target models and the dependency relationship between the target models, and query the post-processing parameter identifiers corresponding to the respective target models.

[0037] S206. Combine the model identifiers based on the dependency relationship to obtain a model flow chart.

[0038] Among them, the image identifier is used to uniquely identify the image. For example, the image identifier can be the image name. The target model retrieved based on the image identifier of the target image is an algorithm model used to process the target image. It can be understood that there are multiple target models for processing the target image. For example, the multiple target models include an algorithm model for detecting whether the product has scratches, an algorithm model for detecting whether the product is dirty, an algorithm model for detecting whether the product is bruised, and other algorithm models. Different products can be processed using different algorithm models, and different types of images of the same product can also be processed using different algorithm models. The model identifiers corresponding to the various image identifiers can be pre-configured, that is, the algorithm models that match the various images can be pre-configured.

[0039] The model identifier is used to uniquely identify the algorithm model. For example, the model identifier can be the model name. The dependency relationship between models refers to whether a single model needs to rely on other models to complete data processing. The dependency relationship between models can be divided into parallel and serial. Parallel means that the models can process data independently. Serial means that a single model needs to rely on other models to complete data processing. For example, model A and model B are in a serial relationship, and the data output by model A needs to be input into model B so that model B can output data. The model flow chart is a flow chart obtained by combining the model identifiers of multiple models according to the dependency relationship between models.

[0040] The model has corresponding post-processing parameters, and the post-processing parameters are used to filter the detection results output by the model. The post-processing parameter identifier is used to uniquely identify the post-processing parameter. For example, the post-processing parameter identifier can be a post-processing parameter name. It can be understood that the post-processing parameter identifiers corresponding to various models can be pre-configured, that is, the post-processing parameters matching various models can be pre-configured.

[0041] In some embodiments, the computer device may display a model flow chart to the user. If the user wants to add a new model to the model flow chart, the computer device may display a candidate model list to the user, and the user may select a desired model from the candidate model list to add to the model flow chart. The candidate model list includes model identifiers of multiple models in the model library.

[0042] S208. Based on the model flow chart, each target model is sequentially called from the model library to perform product defect detection on the target image, and the initial defect detection results output by each target model are obtained.

[0043] The model library includes multiple models. Algorithm engineers can register the developed algorithm models into the model library so that other engineers can call the algorithm models developed by algorithm engineers.

[0044] Product defect detection is used to detect defects in products. The target model is used to perform product defect detection on the target image of the product to be detected. The target image is input into the target model, and the target model outputs the initial defect detection result. The initial defect detection result may include defect attribute information of at least one product defect identified by the target model. For example, if the target model is used to detect whether the product has scratches, the initial defect detection result output by the target model may include attribute information such as the size, position, area, and color of the scratches in the product image.

[0045] Specifically, the target image can pass through each target model in order according to the model flowchart. When each target model is running, it will implement serial and parallel reasoning according to the dependency relationship indicated by the model flowchart to save reasoning time.

[0046] S210 , based on the target post-processing parameters corresponding to the respective post-processing parameter identifiers, perform product defect filtering on the respective initial defect detection results to obtain the target defect detection results corresponding to the product to be detected.

[0047] Among them, product defect filtering is used to filter defects detected by the model. The target post-processing parameters are the post-processing parameters corresponding to the target model. The target post-processing parameters are used to filter the initial defect detection results output by the target model. For example, the target image is input into the target model, and the target model outputs the existence of scratches in the target image and the size, position, and area of ​​the scratches. The target post-processing parameters corresponding to the target model are used to filter minor scratches that have no effect on product performance. According to the target post-processing parameters, it is determined whether the scratches output by the target model belong to minor scratches that have no effect on product performance. If they do, the model detection results are filtered. If not, the model detection results are retained.

[0048] The target defect detection result corresponding to the product to be inspected is the result obtained by filtering the initial defect detection results of the target image of the product to be inspected. For example, the retained initial defect detection results are combined to obtain the target defect detection result.

[0049] Specifically, after the computer device queries each post-processing parameter identifier, it can obtain the target post-processing parameters corresponding to each post-processing parameter identifier; based on each target post-processing parameter, each initial defect detection result is filtered for product defects, and the initial defect detection results that need to be retained are determined from each initial defect detection result; based on the retained initial defect detection results, the target defect detection results corresponding to the product to be inspected are obtained.

[0050] It can be seen that in the embodiment of the present application, when it is necessary to perform defect detection on the product to be detected, the target image of the product to be detected is obtained, and according to the image identification of the target image, the data is retrieved to generate a model flow chart for processing the target image, and the target model is orderly called from the model library according to the model flow chart to perform product defect detection on the target image, so that the model can be automatically assigned to perform product defect detection on the image according to the image identification, without manual operation, which effectively improves the detection efficiency. In addition, according to the image identification of the target image, the post-processing parameter identification corresponding to the target model can also be retrieved, and the target post-processing parameters are obtained through the post-processing parameter identification. Based on the target post-processing parameters, the initial defect detection result output by the target model is filtered for product defects, so that the target post-processing parameters for filtering the initial defect detection results can be automatically assigned according to the image identification, without manual operation, which further effectively improves the detection efficiency. Based on each target post-processing parameter, each initial defect detection result is filtered for product defects, which can further filter out invalid product defects, thereby obtaining the target defect detection result corresponding to the product to be detected, which effectively improves the detection accuracy.

[0051] In some embodiments, based on the image identifier of the target image, querying the model identifiers of the respective target models and the dependency relationship between the respective target models, and querying the post-processing parameter identifiers corresponding to the respective target models include:

[0052] Extracting target shooting information from the image identifier of the target image;

[0053] From the configuration table, query the target model information configured for the target shooting information; the target model information includes the model identification of each target model, the dependency relationship between each target model, and the post-processing parameter identification corresponding to each target model.

[0054] The image identification of a product image generally includes a variety of information, such as image timestamp, project information of the project to which the product belongs, material information of the material used in the product, product shooting information, and the like.

[0055] The target shooting information is product shooting information extracted from the image identifier of the target image. The product shooting information includes at least one element related to shooting, such as shooting location, shooting angle, shooting light source, etc.

[0056] The configuration table includes model information configured for different product shooting information. For example, the product shooting information is a shooting station (i.e., shooting location), the product is produced on an assembly line, and product images are shot at multiple stations on the assembly line. Different models can be configured for different shooting stations to detect product defects, that is, different model information can be configured for different shooting stations. The model information includes the model identification of each of the multiple models used to process the product image, the dependency relationship between each model, and the post-processing parameter identification corresponding to each model. The target model information is the model information configured for the target shooting information. The target model information includes the model identification of each target model, the dependency relationship between each target model, and the post-processing parameter identification corresponding to each target model.

[0057] Specifically, the computer device can retrieve the model identifier of the target model to be used, the dependency relationship between the target models, and the post-processing parameter identifier corresponding to the target model from the configuration table based on the special field in the image identifier of the target image.

[0058] The computer device can extract the target shooting information from the image identifier of the target image, and query the target model information configured for the target shooting information from the configuration table. The target model information includes the model identifiers of each target model, the dependency relationship between each target model, and the post-processing parameter identifiers corresponding to each target model.

[0059] It can be seen that in this embodiment, different models and post-processing parameters are assigned to different shooting information, and the assignment information is stored in the configuration table, and the assignment information can be quickly queried from the configuration table as needed. If it is necessary to perform defect detection on the product to be inspected, the target image of the product to be inspected is obtained, the target shooting information is extracted from the image identifier of the target image, and the target model information configured for the target shooting information is queried from the configuration table. According to the target model information, the model flow chart and the corresponding post-processing parameters can be quickly obtained.

[0060] In some embodiments, the product defect detection method further includes:

[0061] Obtain the model code of the newly added model for the target shooting information and the current post-processing parameters corresponding to the newly added model;

[0062] Register the model code into the model library to obtain the model identifier of the newly added model, register the current post-processing parameters into the parameter library to obtain the post-processing parameter identifier of the current post-processing parameters;

[0063] In the configuration table, the model identifier of the newly added model and the post-processing parameter identifier of the current post-processing parameter are written into the target model information configured for the target shooting information.

[0064] Among them, the newly added model refers to the newly added algorithm model. The user can assign a new model to the shooting information as needed. The model code of the newly added model refers to the running code of the newly added model. The current post-processing parameters refer to the post-processing parameters corresponding to the newly added model.

[0065] If the user selects a new model from the existing models in the model library, the model identifier of the new model and the post-processing parameter identifier of the post-processing parameters corresponding to the new model can be directly obtained, and the model identifier of the new model and the post-processing parameter identifier of the post-processing parameters corresponding to the new model can be directly added to the configuration table. If the user wants to add a new model to the model library, the new model needs to be registered in the model library and the post-processing parameters need to be registered in the parameter library. The model library includes multiple registered algorithm models. The parameter library includes multiple registered post-processing parameters.

[0066] Specifically, the user can register a new model for the target shooting information as needed, assign the newly registered model to the target shooting information, and subsequently use the newly registered model to process the product image obtained through the target shooting information. The user can submit the model code of the newly added model in order to register the new model, and submit the current post-processing parameters corresponding to the newly added model in order to register the post-processing parameters corresponding to the new model.

[0067] The computer device obtains the model code of the newly added model for the target shooting information, registers the model code of the newly added model into the model library, and obtains the model identifier of the newly added model. For example, a class is created in the model library, the model code of the newly added model is used as the class definition, and the model identifier is used as the class name. The front end can call the newly added model of the back end through the model identifier. The computer device obtains the current post-processing parameters corresponding to the newly added model, registers the current post-processing parameters into the parameter library, and obtains the post-processing parameter identifier of the current post-processing parameters.

[0068] After successful registration, the computer device further writes the model identifier of the newly added model and the post-processing parameter identifier of the current post-processing parameters into the target model information configured for the target shooting information in the configuration table, so that when subsequently processing the product image whose image identifier contains the target shooting information, the model identifier of the newly added model and the corresponding post-processing parameter identifier can be queried from the configuration table.

[0069] It can be seen that in this embodiment, the algorithm model can be modularized through the registration mechanism, and the algorithm model can be used as an algorithm module in the algorithm library (i.e., module library), and the front end can quickly call the corresponding algorithm module through the model identifier. The post-processing parameters can also be modularized through the registration mechanism, and the front end can quickly call the corresponding post-processing parameters through the post-processing parameter identifier.

[0070] In some embodiments, based on the target post-processing parameters corresponding to the respective post-processing parameter identifiers, product defect filtering is performed on the respective initial defect detection results to obtain the target defect detection results corresponding to the product to be detected, including:

[0071] Obtaining target post-processing parameters corresponding to respective post-processing parameter identifiers; the target post-processing parameters include at least one of post-processing parameters corresponding to known static regions of interest and post-processing parameters corresponding to unknown dynamic regions of interest;

[0072] Determine defect attribute detection results and dynamic region detection results from each of the initial defect detection results;

[0073] According to the dynamic region class detection result, determine the dynamic region of interest in the target image;

[0074] Determine the target region of interest to which the defect attribute class detection result belongs from the known static regions of interest and dynamic regions of interest;

[0075] Based on the post-processing parameters corresponding to the target region of interest, the defect attribute detection results are filtered for product defects to obtain the target detection result labels corresponding to the defect attribute detection results;

[0076] Based on the target detection result label, determine the target defect detection result corresponding to the product to be detected.

[0077] Among them, the region of interest refers to the special inspection area and the key focus area in the image. The region of interest is divided into static region of interest and dynamic region of interest. The static region of interest is a region of interest with a fixed position, and the static region of interest does not change with the image content. The user can set the static region of interest as needed. The dynamic region of interest is a region of interest with a non-fixed position, and the dynamic region of interest changes with the image content. The dynamic region of interest is a region of interest that needs to be located by an algorithm model. Therefore, at the beginning, the static region of interest is a known region of interest, and the dynamic region of interest is an unknown region of interest. It can be understood that some target models are used to detect product defects in product images, and some algorithm models are used to identify dynamic regions of interest in product images.

[0078] Corresponding post-processing parameters can be set for static regions of interest and dynamic regions of interest, respectively. The post-processing parameters corresponding to a single model include at least one of the post-processing parameters corresponding to known static regions of interest and the post-processing parameters corresponding to unknown dynamic regions of interest. That is, a single model can be used specifically to detect product defects in product images, or to identify dynamic regions of interest in product images, or to simultaneously detect product defects in product images and identify dynamic regions of interest in product images.

[0079] The initial defect detection results output by the target model can be divided into defect attribute detection results and dynamic area detection results. The defect attribute detection results are the detection results of the defect attributes of the product defects output by the model. For example, if the target model is used to detect whether the product has scratches, the initial defect detection results output by the target model may belong to the defect attribute detection results, specifically including the size, position, area, color and other attribute information of the scratches in the product image. The dynamic area detection results are the detection results of the dynamic region of interest output by the model. For example, if the target model is used to identify the dynamic region of interest, the initial defect detection results output by the target model may belong to the dynamic region detection results, specifically including the size and position of the dynamic region of interest in the image. It can be understood that there can be multiple defect attribute detection results and multiple dynamic region detection results.

[0080] It can be understood that the post-processing parameters corresponding to a single region of interest may include at least one post-processing parameter corresponding to a product defect. For example, product defects are divided into various types of defects such as scratches, dirt, crushing, fractures, corrosion, etc., and the post-processing parameters corresponding to the static region of interest may include the post-processing parameters corresponding to various product defects. The post-processing parameters corresponding to product defects include the filtering criteria of product defects, which are used to determine whether the product defects detected by the model need to be filtered out.

[0081] If the defect attribute class detection result falls into a certain region of interest, it is necessary to filter the defect attribute class detection result for product defects based on the post-processing parameters corresponding to the region of interest to determine whether the defect attribute class detection result needs to be filtered. For example, if the overlap rate between the product defect position in the defect attribute class detection result and the region position of the region of interest is greater than a preset threshold, it is determined that the defect attribute class detection result falls into the region of interest. The target region of interest to which the defect attribute class detection result belongs refers to the region of interest into which the defect attribute class detection result falls. The target region of interest to which the defect attribute class detection result belongs can be a static region of interest or a dynamic region of interest.

[0082] The target detection result labels are divided into defect labels and normal labels. Defect labels are used to indicate that there are product defects that affect product performance, that is, the defect attribute detection results need to be retained. Normal labels are used to indicate that there are no product defects or that there are product defects that do not affect product performance, that is, the defect attribute detection results need to be filtered out.

[0083] Specifically, the computer device can determine the defect attribute class detection results and the dynamic area class detection results from the initial defect detection results output by each target model. The target post-processing parameters corresponding to the post-processing parameter identifier include at least one of the post-processing parameters corresponding to the known static region of interest and the post-processing parameters corresponding to the unknown dynamic region of interest. For the dynamic region class detection results, the dynamic region of interest in the target image can be determined according to the dynamic region class detection results, thereby obtaining the known dynamic region of interest. For the defect attribute class detection results, it is necessary to further determine whether to retain them based on the target post-processing parameters. The computer device can match the defect attribute class detection results with the known static region of interest and the known dynamic region of interest, respectively, and from the known static region of interest and the dynamic region of interest, the region of interest into which the defect attribute class detection results fall is used as the target region of interest to which the defect attribute class detection results belong. Furthermore, the computer device performs product defect filtering on the defect attribute class detection results based on the post-processing parameters corresponding to the target region of interest, and obtains the target detection result label corresponding to the defect attribute class detection result. For example, the post-processing parameters corresponding to the target region of interest stipulate that if the size of the scratch is greater than a preset threshold, the detection result is retained; if the size of the scratch is less than or equal to the preset threshold, the detection result is filtered; the defect attribute detection result includes the size of the scratch in the product image; if the size of the scratch in the defect attribute detection result is found to be greater than the preset threshold, the target detection result label corresponding to the defect attribute detection result may be a defect label for the product defect of the scratch. Finally, the computer device determines the target defect detection result corresponding to the product to be detected based on the target detection result label. For example, various defect labels are obtained from each target detection result label as the target defect detection result.

[0084] It can be understood that if there is no dynamic region detection result, the target region of interest to which the defect attribute detection result belongs is determined from the known static regions of interest.

[0085] It can be seen that in this embodiment, not only can product defects in static regions of interest be identified, but product defects in dynamic regions of interest can also be identified, thereby ensuring the comprehensiveness of detection. The static region of interest can be located through post-processing parameters, the dynamic region of interest in the product image can be located through the algorithm model, and the defect attribute information of the product defects in the product image can also be identified through the algorithm model. From the known static regions of interest and dynamic regions of interest, the target region of interest to which the product defects identified by the algorithm model belong is determined, and based on the post-processing parameters corresponding to the target region of interest, the product defects identified by the algorithm model are filtered to obtain the target detection result label. The target detection result label can be used to determine whether the product defects identified by the algorithm model need to be retained, thereby filtering out invalid product defects and ensuring the accuracy of the final target defect detection result.

[0086] In some embodiments, a target region of interest to which a defect attribute detection result belongs is determined from known static regions of interest and dynamic regions of interest; based on post-processing parameters corresponding to the target region of interest, the defect attribute detection result is subjected to product defect filtering to obtain a target detection result label corresponding to the defect attribute detection result, including:

[0087] Get the filtering priority corresponding to each area of ​​interest;

[0088] According to the filtering priority, the defect attribute detection results are matched with each area of ​​interest in turn;

[0089] When a match is successful, the successfully matched region of interest is used as the target region of interest to which the defect attribute class detection result belongs; based on the post-processing parameters corresponding to the target region of interest, the defect attribute class detection result is subjected to product defect filtering to obtain the target detection result label corresponding to the defect attribute class detection result;

[0090] When the target detection result label is a defect label, the matching ends; otherwise, the matching continues.

[0091] Among them, the filtering priority corresponding to the region of interest refers to the priority of product defect filtering based on the post-processing parameters corresponding to the region of interest. It can be understood that there are multiple regions of interest, and the importance of different regions of interest is different. For regions of interest with high importance, a higher filtering priority is set, so that if there are defect attribute detection results that fall into important regions of interest, the defect attribute detection results that fall into important regions of interest can be preferentially filtered based on the post-processing parameters corresponding to the important regions of interest. Once it is found that the target detection result label obtained after product defect filtering is a defect label, it is determined that there must be a product defect. Users can set the filtering priority corresponding to the region of interest as needed. For example, for regions of interest with stricter classification standards for product defects, set a higher filtering priority; for regions of interest with a higher frequency of product defects, set a higher filtering priority; and so on.

[0092] Specifically, for any defect attribute class detection result, when determining the target region of interest to which the defect attribute class detection result belongs from the known static regions of interest and dynamic regions of interest, the computer device can match the defect attribute class detection result with each region of interest in turn according to the filtering priority corresponding to each region of interest. Once a successfully matched region of interest is found, the defect attribute class detection result is first filtered for product defects based on the post-processing parameters corresponding to the successfully matched region of interest to obtain the target detection result label corresponding to the defect attribute class detection result. Once it is found that the target detection result label is a defect label, there is no need to match the defect attribute class detection result with the remaining regions of interest, and the matching operation for the defect attribute class detection result can be terminated. If the target detection result label is a normal label, the defect attribute class detection result continues to be matched with the remaining regions of interest. Once a defect label is found, the matching operation for the defect attribute class detection result is terminated.

[0093] It can be seen that in this embodiment, according to the filtering priority corresponding to the region of interest, the target region of interest to which the defect attribute class detection result belongs is determined from the known static region of interest and dynamic region of interest. Each time a target region of interest is found, the matching operation is suspended, and the defect attribute class detection result is first filtered for product defects based on the post-processing parameters corresponding to the target region of interest to obtain the target detection result label corresponding to the defect attribute class detection result, thereby avoiding blind matching and wasting computer resources. If the target detection result label is a defect label, the matching is terminated, which can effectively avoid wasting computer resources. If the target detection result label is a normal label, the matching continues to determine the next target region of interest.

[0094] In some embodiments, based on the post-processing parameters corresponding to the target region of interest, the defect attribute detection results are subjected to product defect filtering to obtain the target detection result labels corresponding to the defect attribute detection results, including:

[0095] Determine the attribute threshold and filtering logic corresponding to the defect type in the defect attribute class detection result from the post-processing parameters corresponding to the target area of ​​interest;

[0096] When the data relationship between the attribute value and the attribute threshold in the defect attribute class detection result satisfies the filtering logic, the target detection result label corresponding to the defect attribute class detection result is determined to be a normal label; or,

[0097] When the data relationship between the attribute value and the attribute threshold in the defect attribute class detection result does not satisfy the filtering logic, it is determined that the target detection result label corresponding to the defect attribute class detection result is a defect label.

[0098] Among them, defect type refers to the type of product defect. A single defect attribute class detection result may include defect attribute information corresponding to at least one defect type. For example, the defect attribute class detection result output by a single target model may only include defect attribute information corresponding to scratch-type product defects, or may include defect attribute information corresponding to multiple product defects such as scratch types and crush types. Similarly, the post-processing parameters corresponding to a single region of interest may include attribute thresholds and filtering logic corresponding to at least one defect type. The attribute threshold is used to compare the size with the attribute value in the defect attribute information, and the filtering logic is used to determine under what circumstances the comparison result of the attribute threshold and the attribute value needs to be filtered.

[0099] Specifically, the computer device can determine the attribute threshold and filtering logic corresponding to the defect type in the defect attribute class detection result from the post-processing parameters corresponding to the target area of ​​interest, and filter the defect attribute class detection result based on the attribute threshold and filtering logic corresponding to the defect type in the defect attribute class detection result to obtain the target detection result label corresponding to the defect attribute class detection result. Specifically, the attribute value in the defect attribute class detection result can be compared with the corresponding attribute threshold. If the data relationship between the attribute value and the attribute threshold satisfies the corresponding filtering logic, it means that the corresponding product defect needs to be filtered, and then the target detection result label corresponding to the defect attribute class detection result is determined to be a normal label. If the data relationship between the attribute value and the attribute threshold does not satisfy the corresponding filtering logic, it means that the corresponding product defect needs to be retained, and then the target detection result label corresponding to the defect attribute class detection result is determined to be a defect label.

[0100] For example, the defect attribute detection result includes the length, width and area corresponding to the dirty type product defect, and the post-processing parameters corresponding to the target area of ​​interest to which the defect attribute detection result belongs include the length threshold, width threshold and area threshold corresponding to the dirty type product defect, and the filtering logic corresponding to the dirty type product defect is that the length is less than the length threshold, the width is less than the width threshold, and the area is less than the area threshold. If in the defect attribute detection result, the length corresponding to the dirty type product defect is less than the length threshold, the width is less than the width threshold, and the area is less than the area threshold, then the target detection result label corresponding to the defect attribute detection result is determined to be a normal label, otherwise, the target detection result label corresponding to the defect attribute detection result is determined to be a defect label.

[0101] It can be seen that in this embodiment, the post-processing parameters corresponding to the region of interest include the attribute threshold and filtering logic corresponding to at least one defect type, and the defect attribute class detection result includes the defect attribute information corresponding to at least one defect type. Based on the post-processing parameters corresponding to the region of interest, the corresponding defect attribute class detection result is subjected to product defect filtering, and the target detection result label corresponding to at least one defect type can be obtained. By comparing the defect attribute information and the attribute threshold corresponding to the same defect type, and judging whether the comparison result satisfies the filtering logic, the target detection result label corresponding to the defect type can be quickly determined.

[0102] In some embodiments, the product defect detection method further includes:

[0103] Display target post-processing parameters and current product defect filtering results determined based on the target post-processing parameters;

[0104] In response to an editing operation on the displayed target post-processing parameters, displaying updated post-processing parameters obtained through the editing operation and updated product defect filtering results determined based on the updated post-processing parameters;

[0105] In response to a save operation on the updated post-processing parameters, the updated post-processing parameters are converted from a pseudo-code form to a code form, and the updated post-processing parameters in the code form are stored in a parameter library to replace the target post-processing parameters.

[0106] Among them, the updated post-processing parameters are new post-processing parameters obtained by editing the target post-processing parameters. The current product defect filtering result is the product defect filtering result determined based on the target post-processing parameters. The updated product defect filtering result is the product defect filtering result determined based on the updated post-processing parameters. The pseudocode form refers to the description of the post-processing parameters in a non-programming language. The code form refers to the description of the post-processing parameters in a programming language.

[0107] Specifically, after the computer device obtains each target post-processing parameter based on each post-processing parameter identifier, the computer device can display each target post-processing parameter to the user. The computer device performs product defect filtering on each initial defect detection result based on each target post-processing parameter, and after obtaining each product defect filtering result, the computer device can display each product defect filtering result to the user. The user can edit the target post-processing parameter in real time on the interface, adjust the target post-processing parameter in real time, and the interface can display the product defect filtering result determined based on the adjusted target post-processing parameter in real time. For example, the user can enter a new post-processing parameter in the text box; the user can modify the post-processing parameter by adjusting the slider. The computer device can respond to the user's editing operation on the displayed target post-processing parameter and display the updated post-processing parameter obtained by the editing operation to the user. In addition, the computer device performs product defect filtering on the corresponding initial defect detection result based on the updated post-processing parameter to obtain an updated product defect filtering result, and displays the updated product defect filtering result to the user. If the user obtains a satisfactory product defect filtering result by adjusting the post-processing parameter, the user can save the satisfactory post-processing parameter on the interface. For example, the user can click the save control to save. In response to the user's save operation on the updated post-processing parameters, the computer device automatically converts the updated post-processing parameters from pseudo-code form to code form, and stores the updated post-processing parameters in code form in the parameter library to replace the original target post-processing parameters. For example, the user modifies the post-processing parameters displayed in natural language into new post-processing parameters in the text box of the front end, and the back end terminal converts the new post-processing parameters expressed in natural language into code, and stores the new post-processing parameters in code form in the parameter library to replace the old post-processing parameters.

[0108] It is understandable that the user may modify the existing target post-processing parameters, may add new post-processing parameters, or may delete the existing target post-processing parameters.

[0109] It can be seen that in this embodiment, the user can view the post-processing parameters and the corresponding product defect filtering results in real time on the interface, and the user can adjust the post-processing parameters in real time on the interface, which effectively improves the convenience and flexibility of product defect filtering. The post-processing parameters edited by the user on the interface can be automatically converted into code and stored in the back-end parameter table, without the need for algorithm engineers to manually write code, which improves the storage efficiency of post-processing parameters.

[0110] In a specific embodiment, the method of the present application can be applied to multi-station / multi-point product defect detection tasks in an industrial environment. In the industrial field, it is often necessary to customize algorithm reasoning processes for multiple different stations to meet customer detection needs, and it is necessary to accurately filter the algorithm reasoning results. Through the method of the present application, different algorithm reasoning processes can be automatically assigned according to the image names of different images, and post-processing parameters can be flexibly customized to achieve accurate filtering.

[0111] refer to Figure 3 , the application method comprises the following steps:

[0112] 1. Intelligent allocation

[0113] Algorithm engineers can register algorithm models in the database through the registration mechanism, thereby modularizing the algorithm models. The corresponding algorithm model in the database can be called through the model name of the algorithm model. The present application method adopts a table to manage the algorithm model, and configures the model names of the algorithm models required for various workstations, the dependencies between the algorithm models, and the parameter tables corresponding to the algorithm models (i.e., post-processing parameters) in the table. When it is necessary to perform defect detection on a product, obtain the product image of the product, extract the workstation information from the image name of the product image, index the model name of the algorithm model to be used from the table according to the workstation information, and combine the model names of the algorithm models into a model flow (i.e., a model flow chart) according to the dependencies between the algorithm models.

[0114] 2. Model Reasoning

[0115] The algorithm models in the database are called in order through the model flow. The product images will pass through the algorithm models in turn. When each algorithm model is running, it will implement serial and parallel reasoning based on the dependency relationship between the models to save reasoning time. The reasoning results of each model are merged to obtain the initial detection results.

[0116] 3. Post-processing filtration

[0117] According to the parameter table corresponding to the algorithm model, the inference results of the algorithm model are filtered and the filtered detection results (i.e., the filtering results) are output. The filtering results can be displayed to the user, and the user can also adjust the parameter table in real time to adjust the filtering results.

[0118] refer to Figure 4 , post-processing filtering can be further refined into the following steps:

[0119] 1. Initialization

[0120] Extract the workstation information from the image name of the product image, index the table name of the parameter table corresponding to the algorithm model from the table according to the workstation information, and obtain the parameter table according to the table name. The parameter table contains attribute thresholds and filtering logic for multiple ROIs for multiple defect types. ROIs are divided into known static ROIs and unknown dynamic ROIs. Allocate space for each ROI and instantiate the static ROI.

[0121] 2. Run

[0122] Initialize the result variable for each non-ROI instance in the model's reasoning results. For example, if the model's reasoning results include defect attribute information for three types of product defects, the result variables for the three types of product defects can be uniformly initialized to normal labels or defect labels. Subsequently, determine whether the result variables need to be modified based on the parameter table.

[0123] The inference result of the model includes at least one of an ROI instance and a non-ROI instance. The ROI instance is the ROI identified by the model from the product image. The non-ROI instance is the defect attribute information of the product defect identified by the model from the product image. The ROI instance output in the inference result of the model is converted into a dynamic ROI area.

[0124] The parameter table records the priority information of each ROI. According to the priority order, the non-ROI instances in the inference results of the model are compared with the known ROIs in turn to determine whether the non-ROI instances fall into the known ROI area. If the non-ROI instance falls into the known ROI area, the non-ROI instance is logically judged based on the attribute threshold and filtering logic corresponding to the ROI area to determine whether the non-ROI instance needs to be filtered. If filtering is required, the non-ROI instance is marked with a filter label, and if it needs to be retained, the non-ROI instance is marked with a retain label. For example, if the result variable of the non-ROI instance is initialized as a defect label, the parameter table is used to determine whether the defect label needs to be modified to a normal label. If it does not need to be modified, the retain label is marked. If it needs to be modified, the filter label is marked and the defect label is modified to a normal label. All non-ROI instances are subjected to the above-mentioned regional comparison and logical judgment process to obtain the filtering results of all non-ROI instances. Finally, all filtering results are counted and output.

[0125] 3. Parameter adjustment

[0126] During operation, users can add, delete, check and modify post-processing parameters (including ROI, filtering logic and threshold parameters) in real time. The changes will be updated to the memory in real time and take effect. Users can modify post-processing parameters by entering pseudocode, and the backend will automatically modify the post-processing parameters in pseudocode form to post-processing parameters in code form. Users can modify the parameter table multiple times to get the filtering results in real time. After the user is satisfied with the filtering results, the corresponding parameter table can be saved to the reference library for next use.

[0127] A large amount of data will be used in an industrial environment. Different data usually require different reasoning processes, and there are situations where reasoning modules (i.e., algorithm modules) are shared. In the present application method, different reasoning processes and post-processing parameters can be assigned to different workstations by assigning model streams and parameter tables in a named manner, which facilitates the realization of customer customization needs. Different data may share the same post-processing parameters. In the present application method, product images at different workstations can reuse the same post-processing parameters, and users can edit the post-processing parameters in real time. The reused post-processing parameters only need to be adjusted once, without the need for multiple manual adjustments. In the present application method, the registration mechanism can facilitate the front-end to call the algorithm module.

[0128] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0129] Based on the same inventive concept, the embodiment of the present application also provides a product defect detection device. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more product defect detection device embodiments provided below can refer to the limitations of the product defect detection method above, and will not be repeated here.

[0130] like Figure 5 As shown, the embodiment of the present application provides a product defect detection device 500, including:

[0131] An acquisition module 502 is used to acquire a target image of a product to be inspected;

[0132] A query module 504 is used to query the model identifiers of each target model and the dependency relationship between each target model based on the image identifier of the target image, and query the post-processing parameter identifiers corresponding to each target model;

[0133] A combination module 506, used to combine the model identifiers based on the dependency relationship to obtain a model flow chart;

[0134] The detection module 508 is used to sequentially call each target model from the model library to perform product defect detection on the target image based on the model flow chart, and obtain the initial defect detection results output by each target model;

[0135] The filtering module 510 is used to perform product defect filtering on each initial defect detection result based on the target post-processing parameters corresponding to each post-processing parameter identifier, so as to obtain a target defect detection result corresponding to the product to be detected.

[0136] In some embodiments, based on the image identification of the target image, querying the model identifications of each target model and the dependency relationship between each target model, and querying the post-processing parameter identifications corresponding to each target model, the query module 504 is specifically used to:

[0137] Extracting target shooting information from the image identifier of the target image;

[0138] From the configuration table, query the target model information configured for the target shooting information; the target model information includes the model identification of each target model, the dependency relationship between each target model, and the post-processing parameter identification corresponding to each target model.

[0139] In some embodiments, the product defect detection device further includes a new module, and the new module is used to:

[0140] Obtain the model code of the newly added model for the target shooting information and the current post-processing parameters corresponding to the newly added model; register the model code to the model library, obtain the model identifier of the newly added model, register the current post-processing parameters to the parameter library, and obtain the post-processing parameter identifier of the current post-processing parameters; in the configuration table, write the model identifier of the newly added model and the post-processing parameter identifier of the current post-processing parameters into the target model information configured for the target shooting information.

[0141] In some embodiments, in terms of filtering product defects on each initial defect detection result based on each corresponding target post-processing parameter identifier, and obtaining a target defect detection result corresponding to the product to be detected, the filtering module 510 is specifically used to:

[0142] Obtaining target post-processing parameters corresponding to respective post-processing parameter identifiers; the target post-processing parameters include at least one of post-processing parameters corresponding to known static regions of interest and post-processing parameters corresponding to unknown dynamic regions of interest;

[0143] Determine defect attribute detection results and dynamic region detection results from each of the initial defect detection results;

[0144] According to the dynamic region class detection result, determine the dynamic region of interest in the target image;

[0145] Determine the target region of interest to which the defect attribute class detection result belongs from the known static regions of interest and dynamic regions of interest;

[0146] Based on the post-processing parameters corresponding to the target region of interest, the defect attribute detection results are filtered for product defects to obtain the target detection result labels corresponding to the defect attribute detection results;

[0147] Based on the target detection result label, determine the target defect detection result corresponding to the product to be detected.

[0148] In some embodiments, in terms of determining a target region of interest to which a defect attribute class detection result belongs from known static regions of interest and dynamic regions of interest; and filtering the defect attribute class detection result for product defects based on post-processing parameters corresponding to the target region of interest to obtain a target detection result label corresponding to the defect attribute class detection result, the filtering module 510 is specifically used to:

[0149] Get the filtering priority corresponding to each area of ​​interest;

[0150] According to the filtering priority, the defect attribute detection results are matched with each area of ​​interest in turn;

[0151] When a match is successful, the successfully matched region of interest is used as the target region of interest to which the defect attribute class detection result belongs; based on the post-processing parameters corresponding to the target region of interest, the defect attribute class detection result is subjected to product defect filtering to obtain the target detection result label corresponding to the defect attribute class detection result;

[0152] When the target detection result label is a defect label, the matching ends; otherwise, the matching continues.

[0153] In some embodiments, in terms of filtering product defects on defect attribute detection results based on post-processing parameters corresponding to the target region of interest to obtain target detection result labels corresponding to the defect attribute detection results, the filtering module 510 is specifically used to:

[0154] Determine the attribute threshold and filtering logic corresponding to the defect type in the defect attribute class detection result from the post-processing parameters corresponding to the target area of ​​interest;

[0155] When the data relationship between the attribute value and the attribute threshold in the defect attribute class detection result satisfies the filtering logic, the target detection result label corresponding to the defect attribute class detection result is determined to be a normal label; or,

[0156] When the data relationship between the attribute value and the attribute threshold in the defect attribute class detection result does not satisfy the filtering logic, it is determined that the target detection result label corresponding to the defect attribute class detection result is a defect label.

[0157] In some embodiments, the product defect detection device further includes a display module, and the display module is used to:

[0158] Display target post-processing parameters and current product defect filtering results determined based on the target post-processing parameters;

[0159] In response to an editing operation on the displayed target post-processing parameters, displaying updated post-processing parameters obtained through the editing operation and updated product defect filtering results determined based on the updated post-processing parameters;

[0160] In response to a save operation on the updated post-processing parameters, the updated post-processing parameters are converted from a pseudo-code form to a code form, and the updated post-processing parameters in the code form are stored in a parameter library to replace the target post-processing parameters.

[0161] Each module in the above-mentioned product defect detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0162] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to product defect detection. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the above-mentioned product defect detection method are implemented.

[0163] In some embodiments, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, the steps in the above-mentioned product defect detection method are implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen; the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0164] Those skilled in the art will understand that Figure 6 or Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0165] In some embodiments, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps in the above method embodiments are implemented.

[0166] In some embodiments, Figure 8 The figure shows an internal structure diagram of a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0167] In some embodiments, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0168] 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, stored data, displayed data, 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 relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0169] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0170] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0171] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A product defect detection method, characterized in that: include: Acquire a target image of the product to be inspected; Based on the image identifier of the target image, query the model identifiers of the respective target models and the dependency relationship between the respective target models, and query the post-processing parameter identifiers corresponding to the respective target models; Combining the model identifiers based on the dependency relationship to obtain a model flow chart; Based on the model flow chart, the target models are sequentially called from the model library to perform product defect detection on the target image, and initial defect detection results output by each target model are obtained; Based on the target post-processing parameters corresponding to the respective post-processing parameter identifiers, product defect filtering is performed on the respective initial defect detection results to obtain the target defect detection results corresponding to the product to be detected.

2. The method according to claim 1, characterized in that The querying of the model identifiers of the respective target models and the dependency relationship between the respective target models based on the image identifier of the target image, and the querying of the post-processing parameter identifiers corresponding to the respective target models include: Extracting target shooting information from the image identifier of the target image; The target model information configured for the target shooting information is queried from the configuration table; the target model information includes model identifiers of respective target models, dependencies between the target models, and post-processing parameter identifiers corresponding to the target models.

3. The method according to claim 2, characterized in that The method further comprises: Obtaining a model code of a newly added model for the target shooting information and current post-processing parameters corresponding to the newly added model; Registering the model code into the model library to obtain the model identifier of the newly added model, registering the current post-processing parameter into the parameter library to obtain the post-processing parameter identifier of the current post-processing parameter; In the configuration table, the model identifier of the newly added model and the post-processing parameter identifier of the current post-processing parameter are written into the target model information configured for the target shooting information.

4. The method according to claim 1, characterized in that: The method of filtering product defects on each initial defect detection result based on the target post-processing parameters corresponding to each post-processing parameter identifier to obtain the target defect detection result corresponding to the product to be detected includes: Acquire target post-processing parameters corresponding to respective post-processing parameter identifiers; the target post-processing parameters include at least one of post-processing parameters corresponding to known static regions of interest and post-processing parameters corresponding to unknown dynamic regions of interest; Determine defect attribute detection results and dynamic region detection results from each of the initial defect detection results; Determining a dynamic region of interest in the target image according to the dynamic region class detection result; Determine the target region of interest to which the defect attribute class detection result belongs from the known static region of interest and the dynamic region of interest; Based on the post-processing parameters corresponding to the target region of interest, the defect attribute detection result is subjected to product defect filtering to obtain a target detection result label corresponding to the defect attribute detection result; Based on the target detection result label, a target defect detection result corresponding to the product to be detected is determined.

5. The method according to claim 4, characterized in that Determining the target region of interest to which the defect attribute class detection result belongs from the known static region of interest and the dynamic region of interest; Based on the post-processing parameters corresponding to the target region of interest, the defect attribute detection result is subjected to product defect filtering to obtain a target detection result label corresponding to the defect attribute detection result, including: Get the filtering priority corresponding to each area of ​​interest; According to the filtering priority, the defect attribute detection result is matched with each of the regions of interest in sequence; When a match is successful, the successfully matched region of interest is used as the target region of interest to which the defect attribute class detection result belongs; based on the post-processing parameters corresponding to the target region of interest, the defect attribute class detection result is subjected to product defect filtering to obtain a target detection result label corresponding to the defect attribute class detection result; When the target detection result label is a defect label, the matching is terminated; otherwise, the matching is continued.

6. The method according to claim 4, characterized in that The filtering of product defects on the defect attribute detection result based on the post-processing parameters corresponding to the target region of interest to obtain the target detection result label corresponding to the defect attribute detection result includes: Determine the attribute threshold and filtering logic corresponding to the defect type in the defect attribute class detection result from the post-processing parameters corresponding to the target region of interest; When the data relationship between the attribute value in the defect attribute class detection result and the attribute threshold satisfies the filtering logic, determining that the target detection result label corresponding to the defect attribute class detection result is a normal label; or, When the data relationship between the attribute value in the defect attribute class detection result and the attribute threshold value does not satisfy the filtering logic, it is determined that the target detection result label corresponding to the defect attribute class detection result is a defect label.

7. The method according to claim 1, characterized in that The method further comprises: displaying the target post-processing parameters and a current product defect filtering result determined based on the target post-processing parameters; In response to an editing operation on a displayed target post-processing parameter, displaying an updated post-processing parameter obtained by the editing operation and an updated product defect filtering result determined based on the updated post-processing parameter; In response to a save operation on the updated post-processing parameters, the updated post-processing parameters are converted from a pseudo-code form to a code form, and the updated post-processing parameters in the code form are stored in a parameter library to replace the target post-processing parameters.

8. A product defect detection device, characterized in that: include: An acquisition module, used to acquire a target image of a product to be inspected; A query module, used to query the model identifiers of the respective target models and the dependency relationships between the respective target models based on the image identifier of the target image, and query the post-processing parameter identifiers corresponding to the respective target models; A combination module, used for combining the model identifiers based on the dependency relationship to obtain a model flow chart; A detection module, configured to sequentially call each target model from a model library to perform product defect detection on the target image based on the model flow chart, and obtain initial defect detection results output by each target model; The filtering module is used to filter the product defects of each initial defect detection result based on the target post-processing parameters corresponding to each post-processing parameter identifier, so as to obtain the target defect detection result corresponding to the product to be detected.

9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.