Product detection model management method and device, equipment and storage medium
By obtaining the detection data of the target product from the detection data of the product detection model, classifying and training branch detection models, the problem of long development cycle of product detection model in industrial production is solved, and efficient multi-model adaptation and production efficiency improvement are achieved.
Patent Information
- Application Number
- CN202411989236.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-13
AI Technical Summary
In industrial production, with the shortening of product iteration cycles, it is difficult for the existing technology to effectively shorten the development cycle of product testing models, resulting in low production efficiency.
By obtaining the target detection data corresponding to the updated target product from the detection data of the product detection model, classifying the target detection data based on the product model, training the branch detection model to which the target product belongs, and determining the updated product detection model.
It has achieved shortening the development cycle of product testing models, adapted to the iteration speed of multiple models, and improved the quality and efficiency of industrial production.
Smart Images

Figure CN119989076A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial detection technology, and in particular to a management method, device, equipment and storage medium for a product detection model. Background Art
[0002] With the development of industrial technology, the demand for flexible production has become stronger and the product iteration cycle has been significantly shortened. In order to improve production efficiency and reduce costs, it is often necessary to process multiple models of products on the same production line.
[0003] In the production of industrial products, it is often necessary to test the products before they leave the factory. Currently, when dealing with products with fast iteration speed, the corresponding development cycle is long, which leads to low production efficiency of the products. Summary of the invention
[0004] Based on this, it is necessary to provide a product inspection model management method, device, equipment and storage medium to address the above-mentioned technical problems, which can shorten the development cycle of the inspection model corresponding to the product update, thereby improving the quality and efficiency of industrial production.
[0005] In a first aspect, the present application provides a method for managing a product detection model, comprising:
[0006] Obtain target detection data corresponding to the updated target product from the detection data of the product detection model; the product detection model is composed of multiple branch detection models;
[0007] Classify the target detection data based on the product model to obtain the detection data corresponding to each model of the target product;
[0008] Based on the detection data corresponding to each model of the target product, the branch detection model to which the target product belongs is trained respectively to obtain a trained branch detection model;
[0009] Based on the trained branch detection models corresponding to each target product, an updated product detection model is determined; the updated product detection model is used to detect defects of multiple models of products.
[0010] In a second aspect, the present application provides a management device for a product detection model, including:
[0011] An acquisition module is used to acquire target detection data corresponding to the updated target product from the detection data of the product detection model; the product detection model is composed of multiple branch detection models;
[0012] A classification module is used to classify the target detection data based on the product model to obtain the detection data corresponding to each model of the target product;
[0013] A training module is used to train the branch detection models to which the target products belong based on the detection data corresponding to the target products of various models, so as to obtain the trained branch detection models;
[0014] The updating module is used to determine an updated product detection model based on the trained branch detection models corresponding to each target product; the updated product detection model is used to detect defects of multiple models of products.
[0015] 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.
[0016] 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.
[0017] 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.
[0018] The above-mentioned product detection model management method, device, computer equipment, computer-readable storage medium and computer program product obtain the target detection data corresponding to the updated target product, classify the target detection data based on the product model, and obtain the detection data corresponding to each model of the target product. Then, the branch detection model to which the target product belongs can be trained based on the detection data corresponding to each model of the target product to obtain the branch detection model corresponding to the updated target product. In this way, by training the branch detection model to which the target product belongs, it is possible to optimize the branch detection model corresponding to the updated target product and quickly obtain the product detection model matching the updated target product. Compared with the method of establishing a detection model for each model of product and training the detection model based on the product data of each model, it can shorten the development cycle of the product detection model and adapt to the iteration speed of multiple model changes, thereby improving the quality and efficiency of industrial production. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a method for managing a product detection model provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a flow chart of a trained branch detection model provided in an embodiment of the present application;
[0021] Figure 3 A flowchart of another method for managing a product detection model provided in an embodiment of the present application;
[0022] Figure 4 A structural block diagram of a management device for a product detection model provided in an embodiment of the present application;
[0023] Figure 5 An internal structure diagram of a computer device provided in an embodiment of the present application;
[0024] Figure 6 An internal structure diagram of another computer device provided in an embodiment of the present application;
[0025] Figure 7 An internal structure diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] 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.
[0027] like Figure 1 As shown, the embodiment of the present application provides a method for managing a product detection model, and the method is described by taking the method applied to a terminal or a server as an example. It can be understood that the computer device can include at least one of a terminal and a server. The method includes the following steps:
[0028] S102: Acquire target detection data corresponding to the updated target product from the detection data of the product detection model.
[0029] Among them, the product detection model is used to detect defects in products of multiple models. The product detection model can be composed of multiple branch detection models, each of which can detect one or more models of products. If the branch detection model can detect multiple models of products, the differences between these models of products need to meet the preset standards. The differences between products can be the differences between product images obtained by the detection equipment taking pictures of these products. The differences between product images can include differences in the number and position of small components, color differences, grayscale differences, and size differences.
[0030] Among them, the updated target products may include target products with updated models and target products with updated product features without updated models. For products with old models and new features, for example, the old features are marker marks, oil stains, corrosion, fingerprints, etc., and the new oxidation feature appears, oxidation is the new feature. For another example, for products with existing models, the image captured by the detection equipment is black, that is, the old feature is black. If the image is captured as white or black and white under certain conditions, then black and white is the new feature.
[0031] The product inspection model takes a picture of the product and inspects the image to obtain the inspection result corresponding to the product. Therefore, the inspection data may include the inspection result (such as defect information, qualified information) obtained by the product inspection model after inspecting the product and the image taken by the product inspection model.
[0032] In some embodiments, a model table may be stored in the server. The model table records the product models that the product detection model can detect. Before the trained branch detection model corresponding to the target product of the new model is obtained, the product model of the new model is not recorded in the model table. For the updated target product, before obtaining the corresponding trained branch detection model, the server can select a matching target branch detection model from the multiple branch detection models included in the product detection model to detect the target product, so as to obtain the target detection data corresponding to the updated target product, and then obtain the trained branch detection model for detecting the target product based on the target detection data corresponding to the updated target product. For products whose product models are not recorded in the model table, that is, new model products, the server can determine the initial branch detection model corresponding to the new model product through the user's instructions. For products whose product models are recorded in the model table but have new features, that is, old model new feature products, the server can use the branch detection model belonging to the old model as the initial branch detection model corresponding to the product.
[0033] For the updated target products, the product detection model may not be well adapted, so over-killing or under-killing may occur. In the over-killing case, qualified products may be detected as unqualified products. In the under-killing case, unqualified products may be detected as qualified products.
[0034] To solve these problems, in this embodiment, the target detection data obtained by detecting the target product using the initial branch detection model corresponding to the target product is used to optimize the product detection model. For example, the target detection data can be used to determine whether the target product is still detected using the initial branch detection model, or whether a new branch detection model needs to be created to detect the target product, and the initial branch detection model is optimized and trained by combining the target detection data. Since the target detection data may not match the actual detection data corresponding to the target product, after obtaining the target detection data, the target detection data can be processed to obtain the correct training set corresponding to the target product.
[0035] In some embodiments, before obtaining the target detection data corresponding to the updated target product from the detection data of the product detection model, the method also includes: determining the branch detection model to which the target product belongs based on the received selection instruction; inputting the image data of the target product into the branch detection model to which the target product belongs, and obtaining the target detection data corresponding to the target product.
[0036] The target detection data may include image information and detection results. The selection instruction may be an instruction received after the user makes a preliminary judgment on the product information of the new model. The user may be a backend worker such as a developer or an algorithmic person.
[0037] S104: classify the target detection data based on the product model to obtain detection data corresponding to each model of the target product.
[0038] As mentioned above, the target detection data may include new model products and old model products with new features. For new and old models, the corresponding methods of obtaining branch detection models and training branch detection models are different. Therefore, the server can first classify the target detection data based on the product model to obtain the detection data corresponding to each model of the target product. Then, the branch detection model to which the target product belongs can be trained based on the detection data corresponding to each model of the target product.
[0039] S106: Based on the detection data corresponding to each model of the target product, the branch detection model to which the target product belongs is trained to obtain a trained branch detection model.
[0040] The branch detection model to which the target product belongs may refer to the model used to obtain the target detection data. For a new model product, the branch detection model to which the target product belongs may be a user-specified branch detection model that already exists in the product detection model and is used to detect other models of products.
[0041] S108. Determine an updated product detection model based on the trained branch detection models corresponding to each target product.
[0042] Among them, the updated product inspection model is used to detect defects in multiple models of products.
[0043] The updated product inspection model in this embodiment can perform high-quality inspection on the updated target product and detect defects of the target product.
[0044] It can be seen that in the embodiment of the present application, by obtaining the target detection data corresponding to the updated target product, the target detection data is classified based on the product model to obtain the detection data corresponding to the target products of each model. Then, the branch detection model to which the target product belongs can be trained based on the detection data corresponding to the target products of each model to determine the branch detection model corresponding to the updated target product. In this way, by training the branch detection model to which the target product belongs, it is possible to not only optimize the branch detection model corresponding to the updated target product, but also quickly obtain a product detection model that matches the updated target product. Compared with the method of establishing a detection model for each model of product and training the detection model based on the product data of each model, it is possible to shorten the development cycle of the product detection model and adapt to the iteration speed of multiple model changes, thereby improving the quality and efficiency of industrial production.
[0045] In some embodiments, Figure 2 As shown, the test results of the product test model before the update on the target product can be analyzed to determine how to update the product test model. Based on the test data corresponding to each model of the target product, the branch test model to which the target product belongs is trained respectively to obtain the trained branch test model, including:
[0046] S202: Based on the detection data corresponding to each model of the target product, the detection results of the branch detection models to which each model of the target product belongs are determined respectively.
[0047] Exemplarily, after the target detection data is classified based on the product model, the detection data corresponding to each model of the product can be obtained. The detection data corresponding to each model of the product is analyzed to determine the detection results of the branch detection model to which each model of the product belongs. The detection result can be the detection result of the branch detection model to which each model of the product belongs, which is obtained based on the image data corresponding to each model of the product.
[0048] In some embodiments, the detection result can be obtained by comparing the image data between the products: obtaining the target product information of the target model detected by the branch detection model to which the target product belongs; if the difference between the target product information and the product information is within a preset range, determining that the detection result meets the preset standard; otherwise determining that the detection result does not meet the preset standard. Wherein, the target model is the model detected by the branch detection model to which the target product belongs other than the model of the target product.
[0049] S204: Based on the detection results corresponding to the target products of various models, the branch detection models to which the target products belong are trained respectively to obtain trained branch detection models.
[0050] Exemplarily, based on the test results corresponding to each model of product, determine whether the target product can reuse the branch detection model to which the target product belongs. If the target product cannot reuse the initially assigned branch detection model, a new branch detection model needs to be created as the branch detection model to which the target product belongs in the updated product detection model. After determining the branch detection model used for training the target product, the branch detection model is trained based on the test data of the target product to obtain a trained branch detection model.
[0051] In some embodiments, Figure 3 As shown, when the target product belongs to a new model, there is a certain possibility of reusing the initial branch detection model to which the target product belongs, depending on the degree of difference between the image data of the target product and the image data of the product corresponding to the target model. For example, if the target product corresponds to the first model and the detection result corresponding to the target product meets the preset standard, the original training data corresponding to the branch detection model to which the product belongs is obtained; based on the detection data and the original training data corresponding to the target product, the branch detection model to which the target product belongs is trained to obtain the trained branch detection model corresponding to the target product. For example, if the target product corresponds to the first model and the detection result corresponding to the target product does not meet the preset standard, a new branch detection model corresponding to the target product is created, and the new branch detection model is trained based on the detection data corresponding to the target product to obtain the trained branch detection model corresponding to the target product.
[0052] In some embodiments, when the target product belongs to an old model, since the product detection model has not been updated before, two detection situations may occur for products with new features of the old model: qualified products are detected as unqualified products, and unqualified products are detected as qualified products. For these two detection situations, the corresponding training data and training measures are also different. For example, if the target product corresponds to the second model and the detection result corresponding to the target product is the first detection situation, the target defect of the target product is determined based on the detection data corresponding to the target product, and the branch detection model to which the target product belongs is trained based on the detection data that shields the target defect, and the trained branch detection model corresponding to the target product is obtained. For another example, if the target product corresponds to the second model and the detection result corresponding to the target product is the second detection situation, the target defect of the target product is determined based on the detection data corresponding to the target product, and the branch detection model to which the target product belongs is trained based on the detection data carrying the target defect, and the trained branch detection model corresponding to the target product is obtained.
[0053] It can be seen that in this embodiment, based on the detection data corresponding to each model of the target product, the detection results of the branch detection model to which each model of the target product belongs are determined respectively, and then the branch detection model to which the target product belongs is determined based on the detection results to obtain the trained branch detection model. In this way, the branch detection model corresponding to the target product can be obtained based on the target detection data, so that the framework of the product detection model can be quickly determined, thereby shortening the development cycle of the detection model for multiple models of products.
[0054] As mentioned above, for a new model of product, the branch detection model in the product detection model may be reused, or the branch detection model in the product detection model may not be reused.
[0055] In some embodiments, based on the detection results corresponding to the target products of each model, the branch detection models to which the target products belong are trained respectively to obtain the trained branch detection models, including: if the target product corresponds to the first model and the detection results corresponding to the target product meet the preset standards, then the original training data corresponding to the branch detection model to which the target product belongs is obtained; based on the detection data and the original training data corresponding to the target product, the branch detection model to which the target product belongs is trained to obtain the trained branch detection model corresponding to the target product.
[0056] The updated target product model includes a first model and a second model, the first model does not exist in the model table, and the second model exists in the model table. The model table refers to the models of products that can be detected by the product detection model before the update. The first model can be, for example, a new model, that is, the model of a product that cannot be detected by the product detection model before the update. The second model can be, for example, a model in the model table.
[0057] When the test result corresponding to the target product meets the preset standard, it means that the degree of difference between the target product and other models that can be detected by the branch detection model to which the target product belongs is less than the preset value, so the target product can reuse the branch detection model. Before updating, the branch detection model to which the target product belongs is used to detect products of the target model. After analyzing the test data, the branch detection model to which the target product belongs can be used to detect the target product. In order to improve the adaptability of the branch detection model to the target product, that is, to improve the quality of detection of defects in the target product, it is necessary to train the branch detection model. Because the branch detection model was previously trained based on the original training data. The original training data is the training data related to the target model. Therefore, in this embodiment, the branch detection model to which the target product belongs is trained based on the test data and the original training data corresponding to the target product to obtain a trained branch training model corresponding to the target product.
[0058] In some embodiments, the detection data corresponding to the target product needs to be processed, for example, the real defect data is marked, and then the branch detection model is trained with the processed detection data corresponding to the target product and the original training data.
[0059] In some embodiments, in order to improve the convergence speed of the model, part of the training data can be randomly selected from the original training data, and then the branch detection model can be trained based on the test data corresponding to the processed target product and part of the training data to obtain a trained branch detection model corresponding to the target product of the first model and whose test results meet the preset standards.
[0060] It can be seen that in this embodiment, by reusing a branch detection model for products with smaller differences, it is possible to reduce the number of parameters of the product detection model and enhance the portability of the product detection model, and to train the branch detection model based on the detection data of the new model products to improve the branch detection model's ability to detect defects in the new model products, thereby improving the detection quality and efficiency of the product detection model.
[0061] In some embodiments, if the branch detection model to which the new model product belongs has a poor detection effect on the target product, that is, if the target product corresponds to the first model and the detection result corresponding to the target product does not meet the preset standard, then a new branch detection model corresponding to the target product is created, and the new branch detection model is trained based on the detection data corresponding to the target product to obtain a trained branch detection model corresponding to the target product. When the detection result corresponding to the first model of the target product does not meet the preset standard, it means that the original product detection model cannot reliably detect the new model product, so a new branch detection model corresponding to the target product can be created, and then the new branch detection model is trained based on the detection data corresponding to the target product to obtain a trained branch detection model corresponding to the target product.
[0062] When creating a branch detection model corresponding to a new product, knowledge distillation can be performed based on the large model to obtain the new branch detection model. Among them, each branch detection model in the product detection model can be obtained by knowledge distillation based on the large model. The large model can analyze the image of the product to obtain the product's defect data (such as defect type, defect location, etc.).
[0063] By creating a new branch detection model for products with poor detection results, the model processing flow can be simplified. By obtaining a new branch detection model based on the large model through knowledge distillation, the generalization ability of the model can be improved, thereby increasing the deployment and update speed of the model.
[0064] In some embodiments, when a newly created branch detection model is trained based on the detection data corresponding to the product, the original training data corresponding to the branch detection model to which the target product belongs can be obtained; the original training data is grouped according to the model to obtain multiple groups of training data; if the target defect data is missing in the target training data, the target training data is updated based on the target defect data in the original training data, and the target training data is used to train the target product; the newly created branch detection model is trained based on the target training data and the detection data corresponding to the target product.
[0065] For example, the training data of the branch detection model to which the target product belongs includes old models A and B. Model A has data on defect a. Previously, A and B shared the same model, so defect a of model B was not supplemented. Now, because it is necessary to divide the model into model A and models B and C, models B and C do not have data on defect a, so they need to be supplemented. Defect a data can also be supplemented based on the defect data of model A through the Stable Diffusion model. Among them, model C belongs to the first model.
[0066] By updating the target training data when the target defect data is missing, and using the updated target training data to train the target product, the detection quality and detection strength of the newly established branch detection model can be improved.
[0067] In some embodiments, how to obtain the detection results of the branch detection model to which each model of product belongs based on the detection data corresponding to each model of target product can also be achieved through the following content: obtain the target image data of the target model detected by the branch detection model to which the product belongs; if the difference between the target image data and the image data of the product is within a preset range, determine that the detection result meets the preset standard; otherwise, determine that the detection result does not meet the preset standard.
[0068] By comparing the image data of the target product with the image data of the target model product, the difference between the target product and the target model product is determined. If the difference is small, it means that the detection result meets the preset standard. If the difference is large, it means that the detection result does not meet the preset standard. In this way, based on the comparison result of the image data of the target product and the image data of the target model product, the corresponding detection result can be obtained, so as to quickly determine whether the target product can reuse the original branch detection model, thereby improving the update speed of the product detection model.
[0069] In some embodiments, in addition to comparing the image data of the target product with the image data of the target model product to obtain the test results to determine whether the target product can reuse the model, the test data of the target product can also be compared to see if they are consistent with the test data of the target model. If they are inconsistent, it means that a branch test model corresponding to the target product is newly created. If they are consistent, it means that the model can be reused.
[0070] The above content describes how to obtain the branch detection model corresponding to the new model product. In addition to the new model product, the updated target products also include old models but with new features. For such products, how to obtain the corresponding branch detection model can be found in the following content.
[0071] In some embodiments, based on the test results corresponding to the target products of each model, the branch detection models belonging to the target products are trained respectively to obtain the trained branch detection models, including: if the target product corresponds to the second model and the test result corresponding to the target product is the first test situation, then the target defect of the target product is determined based on the test data corresponding to the target product, and the branch detection model belonging to the target product is trained based on the test data of shielding the target defect, to obtain the trained branch detection model corresponding to the target product.
[0072] Among them, the first detection situation refers to the situation where a qualified product is detected as an unqualified product due to a new feature detection model. When the detection result of the product detection model for the second model product is the first detection situation, it means that the product detection model will determine the new feature as unqualified defect data. At this time, the target defect of the target product can be obtained based on the detection data corresponding to the target product. For example, the target defect of the target product is obtained based on the image data corresponding to the target product. When a new feature appears in the second model product, that is, when a new defect appears, if this defect is determined to be possible and not caused by industrial production, then the target defect can be shielded, and the branch detection model to which the target product belongs can be trained based on the detection data of the shielded target defect, thereby obtaining the trained branch detection model corresponding to the target product.
[0073] In some embodiments, the branch detection model may also be trained by shielding specific defects at fixed positions.
[0074] It can be seen that in this embodiment, by processing the branch detection model of the target product in the first detection situation, old model products with new features can be prevented from being detected as unqualified data, thereby reducing the probability of model misjudgment and increasing the types of products that the product detection model can handle.
[0075] In other embodiments, based on the test results corresponding to the target products of each model, the branch detection models to which the target products belong are trained respectively to obtain the trained branch detection models, including: if the target product corresponds to the second model and the test result corresponding to the target product is the second test situation, then the target defect of the target product is determined based on the test data corresponding to the target product, and the branch detection model to which the target product belongs is trained based on the test data carrying the target defect.
[0076] Among them, the second detection situation refers to the detection of unqualified products as qualified products by the new feature detection model. When the detection result of the product detection model for the second model of the target product is the second detection situation, it means that the product detection model will not identify the new feature as unqualified defect data. If the new feature is a new defect of the product, it needs to be detected. At this time, the target defect of the target product can be obtained based on the detection data corresponding to the product, and then the branch detection model to which the product belongs can be trained based on the detection data carrying the target defect. For example, the model is fine-tuned using about 10 new feature images, and can be updated to resume production on site within half an hour. While iterating quickly, normal model iteration tasks are started to ensure the model's subsequent detection capabilities.
[0077] It can be seen that in this embodiment, by processing the branch detection model of the target product in the second detection situation, the model can be further optimized so that the model can detect new features in a timely manner, thereby ensuring the detection quality of the product detection model.
[0078] In some embodiments, after updating the product detection model, the method also includes: when there is data of a first model in the target detection data, obtaining parameters of a branch training model corresponding to the target product of the first model, and adding the parameters to the configuration file; when there is data of a second model in the target detection data, obtaining parameters of a branch training model corresponding to the target product of the second model, deleting the configuration information corresponding to the second model in the configuration file, and adding the parameters of the branch training model corresponding to the second model to the configuration information corresponding to the second model.
[0079] Exemplarily, the parameters of each branch detection model in the product detection model are stored in the configuration file. In the configuration file, there is a corresponding position for the parameters of each branch detection model. If the product detection model creates a corresponding branch detection model for a new model product, it is necessary to add the parameters of the branch training model corresponding to the new model product in the configuration file. If the product detection model does not create a corresponding branch detection model for the new model product, the parameters of the branch detection model in the configuration file can be updated according to the parameters of the trained branch detection model to which the new model product belongs. Since the old model product still uses the original branch training model, but due to the addition of processing for new features, the parameters of the branch detection model corresponding to the old model product in the updated product detection model may change. Therefore, the configuration information corresponding to the second model in the configuration file can be deleted, and the parameters of the branch training model corresponding to the second model can be added to the configuration information corresponding to the second model.
[0080] It can be seen that in this embodiment, by storing the parameters of each branch detection model in the configuration file, each branch detection model can be managed in a unified manner, thereby reducing the difficulty of managing the product detection model.
[0081] In some embodiments, before obtaining the target detection data corresponding to the updated target product from the detection data of the product detection model, the method also includes: determining the branch detection model to which the target product belongs based on the received selection instruction; inputting the image data of the target product into the branch detection model to which the target product belongs, and obtaining the target detection data corresponding to the target product.
[0082] Then, the target detection data corresponding to the updated target product is obtained from the detection data of the product detection model, which is composed of multiple branch detection models. For example, image acquisition is performed for new model products or new feature defects.
[0083] Then, the target detection data is classified based on the product model to obtain the detection data corresponding to each model of the target product.
[0084] Obtain target image data of the target model detected by the branch detection model to which the target product belongs; if the difference between the target image data and the image data of the target product is within a preset range, determine that the detection result meets the preset standard; otherwise, determine that the detection result does not meet the preset standard.
[0085] If the target product corresponds to the first model and the detection result corresponding to the target product meets the preset standard, the original training data corresponding to the branch detection model to which the target product belongs is obtained, and the branch detection model to which the target product belongs is trained based on the detection data and the original training data corresponding to the target product to obtain the trained branch detection model corresponding to the target product.
[0086] If the target product corresponds to the first model and the detection result corresponding to the target product does not meet the preset standard, then a branch detection model corresponding to the target product is newly created, and the original training data corresponding to the branch detection model to which the target product belongs is obtained; the original training data is grouped according to the model to obtain multiple groups of training data; if the target training data lacks target defect data, the target training data is updated based on the target defect data in the original training data, and the target training data is used to train the target product; the newly created branch detection model is trained based on the target training data and the detection data corresponding to the target product to obtain a trained branch detection model corresponding to the target product.
[0087] For example, the new model data is compared with the existing model data at each inspection station, such as whether the number and position of small components are consistent, color changes, grayscale changes, and size changes. The detection test is carried out using the model used by existing similar products. If the effect is acceptable, the model is trained after supplementing the new model data and sharing the parameters. If the effect is not good, a new model is created and the existing data is regrouped. After grouping, if a group of data lacks a specific type of defect, it is supplemented with the StableDiffusion model using different data from other groups. Model distillation technology is used when training new models to ensure the basic detection effect of the model when there is less new model data.
[0088] If the target product corresponds to the second model and the test result corresponding to the target product is the first test situation, the target defect of the target product is obtained based on the test data corresponding to the target product, and the branch detection model to which the product belongs is trained based on the test data that shields the target defect, so as to obtain the trained branch detection model corresponding to the target product.
[0089] If the target product corresponds to the second model and the test result corresponding to the target product is the second test situation, the target defect of the target product is obtained based on the test data corresponding to the target product, and the branch detection model to which the target product belongs is trained based on the test data carrying the target defect.
[0090] For example, if a product has a new feature that has never appeared before, the detection model will generally over- or under-detect. For this, a fixed position can be temporarily used to shield specific defects while the model is iterated. If a new feature is missed during the production process, the equipment can only be shut down for maintenance. In this case, the model can be fine-tuned using about 10 new feature images, which can be updated to the site to resume production within half an hour. While iterating quickly, normal model iteration tasks can be started to ensure the model's subsequent detection capabilities.
[0091] In some embodiments, when data of a first model exists in the target detection data, parameters of a branch training model corresponding to a target product of the first model are obtained and added to a configuration file; when data of a second model exists in the target detection data, parameters of a branch training model corresponding to a target product of the second model are obtained, configuration information corresponding to the second model in the configuration file is deleted, and parameters of the branch training model corresponding to the second model are added to the configuration information corresponding to the second model.
[0092] For example, Figure 3 As shown, the updated model weights and information are updated to the algorithm SDK file. To reduce the difficulty of algorithm maintenance, multiple model SDK files are managed in the same folder. The folder consists of four parts: algorithm operation configuration, defect judgment configuration, code, and model weight. The defect judgment configuration is configured and maintained on site, and the code is only modified when new functions are added, so only the algorithm operation configuration and model weight parts are maintained on a daily basis. When adding a new model, it is necessary to add the corresponding model configuration to the algorithm operation configuration, specify the model weight and other information used, and add the weight to the weight part; after adding a new feature iteration model, it is necessary to delete the old model weight and update the weight information in the algorithm configuration using this model.
[0093] In some embodiments, due to the scale requirements of industrial production, there are a large number of quality inspection equipment, and professional software personnel cannot update or replace algorithms on multiple machines at the same time. Therefore, the server can update the algorithm operation configuration, code, and model weight of the model to the detection machine based on the update script according to the selected model. When the detection machine needs to be replaced, the on-site personnel can also run the corresponding update script to quickly complete the algorithm replacement. The detection machine runs the product detection model to detect the product. This can reduce the probability of errors in on-site deployment, and ensure accurate updating and replacement of the model through fool-proof design and automated scripts.
[0094] When the algorithm SDK file is updated, the algorithm maintenance personnel will send the complete SDK file containing the algorithm operation configuration, defect judgment configuration, code, and model weight to the on-site machine maintenance personnel. The update script does not update the defect judgment configuration by default. This part is a backup retained to prevent errors when adjusting defect detection parameters on-site. In specific error situations, this part is updated to restore machine production.
[0095] In some embodiments, the server can also regularly use all existing data to train a large model with more parameters, provide pre-trained weights and teacher models for the small model used for detection, and improve the training speed and basic detection effect of the small detection model.
[0096] It can be seen that in this embodiment, through the above-mentioned management of product detection models, the iteration speed of multi-model changes can be improved, and the detection model development cycle of new model products can be shortened. It can also increase the degree of model reuse, and at the same time, through the use of model distillation technology and data generation technology, reduce the dependence on a large amount of real product defect annotation data. In turn, it can provide a more efficient and stable defect detection solution for the industrial field, and promote the improvement of the quality and efficiency of industrial production.
[0097] 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.
[0098] Based on the same inventive concept, the embodiment of the present application also provides a management device for a product detection model. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in the embodiments of the management device for one or more product detection models provided below can refer to the limitations of the management method for product detection models above, and will not be repeated here.
[0099] like Figure 4 As shown, the embodiment of the present application provides a management device 400 for a product detection model, including:
[0100] The acquisition module 402 is used to acquire the target detection data corresponding to the updated target product from the detection data of the product detection model; the product detection model is composed of multiple branch detection models;
[0101] A classification module 404 is used to classify the target detection data based on the product model to obtain detection data corresponding to each model of the target product;
[0102] The training module 406 is used to train the branch detection models to which the target products belong based on the detection data corresponding to the target products of various models, so as to obtain the trained branch detection models;
[0103] The updating module 408 is used to determine an updated product detection model based on the trained branch detection models corresponding to each target product; the updated product detection model is used to detect defects of multiple models of products.
[0104] In some embodiments, in terms of training the branch detection models to which the target products belong based on the detection data corresponding to the target products of each model to obtain the trained branch detection models, the training module 406 is specifically used to: determine the detection results of the branch detection models to which the target products of each model belong based on the detection data corresponding to the target products of each model; train the branch detection models to which the target products belong based on the detection results corresponding to the target products of each model to obtain the trained branch detection models; wherein the models of the updated target products include a first model and a second model, the first model does not exist in the model table, and the second model exists in the model table.
[0105] In some embodiments, based on the detection results corresponding to the target products of each model, the branch detection models belonging to the target products are trained respectively to obtain the trained branch detection models. The training module 406 is specifically used for: if the target product corresponds to the first model and the detection results corresponding to the target product meet the preset standards, then the original training data corresponding to the branch detection model to which the target product belongs is obtained; based on the detection data and the original training data corresponding to the target product, the branch detection model to which the target product belongs is trained to obtain the trained branch detection model corresponding to the target product.
[0106] In some embodiments, the product detection model management device also includes a pre-detection module, which is used to: determine the branch detection model to which the target product belongs based on the received selection instruction; input the image data of the target product into the branch detection model to which the target product belongs, and obtain the target detection data corresponding to the target product.
[0107] In some embodiments, based on the detection results corresponding to the target products of each model, the branch detection models corresponding to the target products are trained respectively to obtain the trained branch detection models. The training module 406 is specifically used for: if the target product corresponds to the first model and the detection results corresponding to the target product do not meet the preset standards, then a new branch detection model corresponding to the target product is created; based on the detection data corresponding to the target product, the new branch detection model is trained to obtain the trained branch detection model corresponding to the target product.
[0108] In some embodiments, based on the detection results corresponding to the target products of each model, the branch detection models belonging to the target products are trained respectively to obtain the trained branch detection models. The training module 406 is specifically used for: if the target product corresponds to the second model and the detection result corresponding to the target product is the first detection situation, then determining the target defect of the target product based on the detection data corresponding to the target product; training the branch detection model belonging to the target product based on the detection data of shielding the target defect, to obtain the trained branch detection model corresponding to the target product.
[0109] In some embodiments, based on the test results corresponding to the target products of each model, the branch detection models belonging to the target products are trained respectively to obtain the trained branch detection models. The training module 406 is specifically used for: if the target product corresponds to the second model and the test result corresponding to the target product is the second test situation, then determining the target defect of the target product based on the test data corresponding to the target product; training the branch detection model belonging to the target product based on the test data carrying the target defect to obtain the trained branch detection model corresponding to the target product.
[0110] Each module in the management device of the above product detection model can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0111] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As 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 a management device for product detection models. 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 detection model management method are implemented.
[0112] 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 6 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 management method of the above-mentioned product detection model 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.
[0113] Those skilled in the art will understand that Figure 5 or Figure 6 The 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.
[0114] 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.
[0115] In some embodiments, Figure 7 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.
[0116] 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.
[0117] 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.
[0118] 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.
[0119] 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.
[0120] 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 method for managing a product inspection model, characterized in that: include: Obtaining target detection data corresponding to the updated target product from the detection data of the product detection model; The product detection model is composed of multiple branch detection models; Classifying the target detection data based on product models to obtain detection data corresponding to target products of each model; Based on the detection data corresponding to each of the target products of the model, the branch detection model to which the target product belongs is trained to obtain a trained branch detection model; Based on the trained branch detection models corresponding to each of the target products, an updated product detection model is determined; the updated product detection model is used to detect defects of multiple models of products.
2. The method according to claim 1, characterized in that The branch detection models to which the target products belong are trained based on the detection data corresponding to the target products of each model to obtain the trained branch detection models, including: Based on the detection data corresponding to the target products of each model, respectively determine the detection results of the branch detection models to which the target products of each model belong; Based on the detection results corresponding to the target products of each model, the branch detection models to which the target products belong are trained respectively to obtain trained branch detection models; The updated model of the target product includes a first model and a second model, the first model does not exist in the model table, and the second model exists in the model table.
3. The method according to claim 2, characterized in that The branch detection models to which the target products belong are trained based on the detection results corresponding to the target products of the respective models to obtain the trained branch detection models, including: If the target product corresponds to the first model and the detection result corresponding to the target product meets the preset standard, obtaining original training data corresponding to the branch detection model to which the target product belongs; Based on the detection data corresponding to the target product and the original training data, the branch detection model to which the target product belongs is trained to obtain a trained branch detection model corresponding to the target product.
4. The method according to claim 3, characterized in that Before acquiring the target detection data corresponding to the updated target product from the detection data of the product detection model, the method further includes: Determining, based on the received selection instruction, a branch detection model to which the target product belongs; The image data of the target product is input into the branch detection model to which the target product belongs, so as to obtain the target detection data corresponding to the target product.
5. The method according to claim 2, characterized in that: The branch detection models to which the target products belong are trained based on the detection results corresponding to the target products of the respective models to obtain the trained branch detection models, including: If the target product corresponds to the first model and the detection result corresponding to the target product does not meet the preset standard, a branch detection model corresponding to the target product is newly created; The newly created branch detection model is trained based on the detection data corresponding to the target product to obtain a trained branch detection model corresponding to the target product.
6. The method according to claim 2, characterized in that The branch detection models to which the target products belong are trained based on the detection results corresponding to the target products of the respective models to obtain the trained branch detection models, including: If the target product corresponds to the second model and the test result corresponding to the target product is the first test situation, determining a target defect of the target product based on the test data corresponding to the target product; The branch detection model to which the target product belongs is trained based on the detection data that masks the target defect, so as to obtain a trained branch detection model corresponding to the target product.
7. The method according to claim 2, characterized in that The branch detection models to which the target products belong are trained based on the detection results corresponding to the target products of the respective models to obtain the trained branch detection models, including: If the target product corresponds to the second model and the test result corresponding to the target product is the second test condition, determining a target defect of the target product based on the test data corresponding to the target product; The branch detection model to which the target product belongs is trained based on the detection data carrying the target defect to obtain a trained branch detection model corresponding to the target product.
8. A management device for a product inspection model, characterized in that: include: An acquisition module, used to acquire target detection data corresponding to the updated target product from the detection data of the product detection model; The product detection model is composed of multiple branch detection models; A classification module, used to classify the target detection data based on the product model, and obtain the detection data corresponding to each target product of the model; A training module, used to train the branch detection models to which the target products belong based on the detection data corresponding to the target products of each model, to obtain the trained branch detection models; An updating module is used to determine an updated product detection model based on the trained branch detection models corresponding to each of the target products; the updated product detection model is used to detect defects of multiple models of products.
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.