A self-learning quality inspection method and device
Through self-learning quality inspection methods, using abnormal detection algorithms and iterative replacement of overkill image update model, the problem of misjudgment of AI models during process changes is solved, the accuracy and efficiency of industrial product appearance inspection is improved, and customer costs are reduced.
Patent Information
- Application Number
- CN202310488950.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2043-05-04
AI Technical Summary
In the existing industrial product appearance inspection technology, the AI model based on forward learning is prone to misjudgment of good products as bad products when process changes and incoming materials changes, resulting in model failure, which in turn causes the outflow of bad products and high customer costs.
Using self-learning quality inspection method, train preset good product image library through an abnormal detection algorithm to identify bad indicators, and update the model by iteratively replacing the overkill image, adjust the learning rate to improve the model's good product recognition ability and compatibility, and avoid the expansion of good product library The training difficulty is increased.
Real-time detection of model failure and timely adjustment of the model is achieved, improving the recognition ability of good products and compatibility of diversity characteristics, avoiding increasing model training difficulty and increasing customer costs.
Smart Images

Figure CN116664492B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of product appearance inspection, and in particular to a self-learning quality inspection method and device. Background Art
[0002] In recent years, the application of industrial product appearance inspection technology based on AI image recognition technology has become more and more widespread, and the desire of manufacturing companies to replace manual labor to achieve automated and digital quality inspection has been increasing.
[0003] At present, in the field of industrial product appearance inspection, AI based on forward learning technology for good products is emerging, and its main representative algorithms include: Patchcore algorithm, CFlow algorithm, DFM algorithm, DRAEM algorithm, FastFlow algorithm, GANomaly algorithm, PADIM algorithm. The basic principle of this type of technology is to use AI models to build a high-dimensional good product feature vector library by learning the features of a large number of good samples. When defective products appear, the feature vector of the defective product is far away from the feature vector of the good product, so that the AI model can recognize the defective position and defective area at the pixel level, and output the distance as a score of the image difference.
[0004] However, after such solutions are introduced into the production line, due to process changes, incoming material changes, etc., the characteristics of good products, such as shape, color, position, and size, are also changing. The above-mentioned forward learning algorithm model will misjudge good products as defective products, that is, overkill occurs.
[0005] When this problem occurs, overkill samples are often added to the good product database for relearning, thereby improving the AI model's compatibility with the changed features.
[0006] However, if this method is used in the long run, the training set of the good product library will continue to expand. When the data set reaches a larger scale, the training difficulty of the model increases and the training cycle becomes longer, which has a negative impact on practical applications.
[0007] Model failure on the production line will cause at least the following negative impacts: since model failure is often detected only after a long time, it may lead to accidents such as the outflow of defective products; after model failure, algorithm engineers are required to perform secondary model optimization, which is a time-consuming and labor-intensive process and increases the customer's usage cost. Summary of the invention
[0008] In order to solve the above technical problems, the present invention provides a self-learning quality inspection method and device.
[0009] Specifically, the technical solution of the present invention is as follows:
[0010] In a first aspect, the present invention provides a self-learning quality inspection method, comprising:
[0011] The abnormality detection algorithm is used to train the good product images in the preset original good product library to build a detection model;
[0012] Collecting a number of product appearance images, identifying a plurality of bad appearance images from the product appearance images through the detection model, and generating a current bad index; wherein the current bad index is the ratio of the number of the bad appearance images to the number of the product appearance images;
[0013] When the current defective index exceeds a preset value, at least one overkill image is screened out from the defective appearance images according to an externally input marking signal;
[0014] Based on the detection model, in the original good product image library, a preset number of good product images are selected to be replaced with the preset number of overkill images, so as to obtain the original good product image library after the first iteration;
[0015] Using the original good product image library after each iteration to build an iterative detection model, identifying multiple bad appearance images after the iteration, and generating the current bad index after the iteration;
[0016] When the current defective index after iteration still exceeds the preset value, the detection model is continuously iterated by repeatedly replacing the preset number of good product images selected after each iteration with the preset number of overkill images until the current defective index obtained after iteration does not exceed the preset value.
[0017] This implementation method can promptly discover the failure of the detection model by real-time detection of the current defective indicators. When it is detected that the defective indicators of the product do not meet the standards, part of the good product images in the detection model are selected based on the detection model to be replaced with over-killed images determined by the external input marking signal after each iteration. By updating the original good product library in the iterative detection model in this way, the model's maximum good product recognition ability and compatibility with the diverse characteristics of good products are improved without causing the expansion of the good product library, which will lead to an increase in the difficulty of model training.
[0018] In the implementation of some self-learning quality inspection methods,
[0019] The preset number is calculated by a preset learning rate and a preset number of good product images in the original good product image library;
[0020] The calculation formula is n=a*N; wherein n is the preset number, a is the preset learning rate, and N is the preset number of good product images in the original good product gallery.
[0021] This implementation method obtains the number of good images that need to be replaced in each iteration through a pre-set learning rate and the number of good images in the original good image library. The learning speed of the detection model can be easily adjusted by modifying the learning rate.
[0022] In some implementation methods of the self-learning quality inspection method, based on the detection model, selecting a preset number of the good product images in the original good product image library to replace them with the preset number of the overkill images includes:
[0023] Based on the detection model, a first score is calculated for each of the overkilled images, and a second score is calculated for each of the good product images; wherein the first score is a difference value between the image feature value extracted from the overkilled image and the image in the original good product gallery, and the second score is a difference value between the image feature value extracted from the good product image and the image in the original good product gallery;
[0024] According to the first score of each of the overkill images, a sorting order of the overkill images is obtained; according to the second score of each of the good product images, a sorting order of the good product images is obtained;
[0025] According to the sorting order of the overkill images and the sorting order of the good product images, in the original good product image library, selecting the preset number of the bad images as replacement images, and selecting the preset number of the good product images as replaced images;
[0026] The replaced image in the original good product gallery is replaced with the replacement image.
[0027] This implementation method provides a specific method for selecting a replacement image and a replaced image by an anomaly detection algorithm, which is a first score and a second score obtained by analyzing a detection model. The first score and the second score describe the image difference between the image and the original good image library.
[0028] In some implementation methods of the self-learning quality inspection method, before repeatedly replacing the preset number of good product images selected after each iteration with the preset number of overkill images, the method further includes:
[0029] Calculating a difference between the bad indicator and the preset value;
[0030] The preset learning rate is modified according to the difference value.
[0031] This implementation method sets the learning rate corresponding to the bad indicator before each loop iteration according to the bad indicator obtained in this round of loop iteration. By flexibly adjusting the learning rate, the learning efficiency of the detection model can be accelerated and time can be saved.
[0032] In the implementation of some self-learning quality inspection methods,
[0033] After identifying a plurality of poor appearance images from the product appearance images and generating a current poor index, the method further includes:
[0034] When the current defective index does not exceed a preset value, a defective product corresponding to the defective appearance image is intercepted.
[0035] This implementation method determines that the learning of the detection model is completed when the defective index meets the conditions, and intercepts the defective product according to the defective appearance image obtained by the last iteration.
[0036] In a second aspect, the present invention provides a self-learning quality inspection device, comprising:
[0037] An industrial camera connected to the industrial computer, used to collect a plurality of product appearance images of the product transmitted on the conveying device according to a collection control signal received from the industrial computer, and send the plurality of product appearance images to the industrial computer;
[0038] The industrial computer is used to send the acquisition control signal to the industrial camera, and train the good product images in the preset original good product library through an abnormality detection algorithm to build a detection model;
[0039] The industrial computer is further used to identify multiple bad appearance images from the product appearance images through the detection model and generate a current bad index; the industrial computer sends the bad appearance images and the bad index to the display; wherein the current bad index is the proportion of the number of the bad appearance images to the number of the product appearance images;
[0040] The display is connected to the industrial computer and is used for displaying the bad appearance image when the current bad index exceeds a preset value;
[0041] A button, including a first button and a second button, connected to the industrial computer, when the first button is pressed, a first marking signal is sent to the industrial computer; when the second button is pressed, a second marking signal is sent to the industrial computer, and the first marking signal and the second marking signal are sent to the industrial computer; the first marking signal is that the currently recognized bad appearance image is a re-judged real bad appearance image, and the second marking signal is that the currently recognized bad appearance image is an overkill image;
[0042] The industrial computer is used to filter out at least one overkill image from the poor appearance images according to the second marking signal;
[0043] The industrial computer is also used to select a preset number of good product images from the original good product library based on the detection model and replace them with the preset number of overkill images to obtain the original good product library after the first iteration; use the original good product library after each iteration to build an iterative detection model, identify multiple bad appearance images after iteration, and generate the current bad index after iteration; when the current bad index after iteration still exceeds the preset value, repeatedly replace the preset number of good product images selected after each iteration with the preset number of overkill images, and continue to iterate the detection model until the current bad index obtained after iteration does not exceed the preset value.
[0044] This implementation method can promptly discover the failure of the detection model by detecting the current defective indicators in real time through the industrial computer. When it is detected that the defective indicators of the product do not meet the standards, the industrial computer selects part of the good product images in the detection model based on the detection model and replaces them with over-killed images determined by the external input marking signal after each iteration. By updating the original good product library in the iterative detection model in this way, the model's maximum good product recognition ability and compatibility with the diverse characteristics of good products are improved without increasing the difficulty of model training due to the expansion of the good product library.
[0045] The implementation methods of some self-learning quality inspection devices include:
[0046] The preset number is calculated by a preset learning rate and a preset number of good product images in the original good product image library;
[0047] The calculation formula is n=a*N; wherein n is the preset number, a is the preset learning rate, and N is the preset number of good product images in the original good product gallery.
[0048] This implementation method obtains the number of good images that need to be replaced in each iteration through a pre-set learning rate and the number of good images in the original good image library. By adjusting the learning rate, the learning speed of the detection model can be easily updated.
[0049] In the implementation methods of some self-learning quality inspection devices,
[0050] The industrial computer is further used to calculate a first score for each of the overkill images and a second score for each of the good images based on the detection model; obtain a sorting order of the overkill images according to the first score of each of the overkill images; obtain a sorting order of the good images according to the second score of each of the good images; select a preset number of the bad images as replacement images and a preset number of the good images as replaced images from the original good image library according to the sorting order of the overkill images and the sorting order of the good images; and replace the replaced images in the original good image library with the replacement images;
[0051] The first score is the difference between the image feature values extracted from the overkill image and the images in the original good product gallery, and the second score is the difference between the image feature values extracted from the good product image and the images in the original good product gallery.
[0052] This implementation method provides an industrial computer to select a replacement image and a replaced image based on a detection model, which is obtained by analyzing a first score and a second score of the detection model, and the first score and the second score describe the difference between the image of the input model and the image of the original good product library.
[0053] In the implementation methods of some self-learning quality inspection devices,
[0054] The anomaly detection algorithms include: Patchcore algorithm, CFlow algorithm, DFM algorithm, DRAEM algorithm, FastFlow algorithm, GANomaly algorithm, and PADIM algorithm.
[0055] This implementation method provides an anomaly detection algorithm that can detect image differences.
[0056] In the implementation methods of some self-learning quality inspection devices,
[0057] The industrial computer is further used to intercept defective products corresponding to the defective appearance image when the current defective index does not exceed a preset value.
[0058] When the implementation method determines that the defective index meets the conditions, it is confirmed that the detection model learning is completed, and the defective product is intercepted according to the defective appearance image obtained by the last iteration.
[0059] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0060] 1. The present invention can timely discover the failure of the detection model by real-time detection of the current defective indicators. When it is detected that the defective indicators of the product do not meet the standards, part of the good product images in the detection model are selected based on the detection model to replace them with part of the over-killed images judged by the external input marking signal after each iteration. By updating and iterating the original good product library in the detection model, the model's maximum good product recognition ability and compatibility with the diversity characteristics of good products are improved, without causing the expansion of the good product library, which will lead to an increase in the difficulty of model training.
[0061] 2. The present invention sets the learning rate corresponding to the bad indicator through the bad indicator obtained in each cycle iteration process. By flexibly adjusting the learning rate, the learning efficiency of the detection model can be accelerated and time can be saved. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The preferred implementation modes will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of the present invention.
[0063] Figure 1 It is a flow chart of an embodiment of a self-learning quality inspection method provided by the present invention;
[0064] Figure 2 It is a system block diagram of an embodiment of a self-learning quality inspection device provided by the present invention.
[0065] Explanation of the accompanying figures: 10--industrial camera, 20--industrial computer, 30--display, 40--button. DETAILED DESCRIPTION
[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.
[0067] In order to simplify the drawings, only the parts related to the invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".
[0068] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0069] In this document, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0070] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0071] In one embodiment, the reference specification Figure 1 The present invention provides a self-learning quality inspection method, comprising:
[0072] S110, training good product images in a preset original good product library through an anomaly detection algorithm to build a detection model.
[0073] In step S110, a detection model is constructed using anomaly detection algorithms and the original good product image library. The anomaly detection algorithms include: Patchcore algorithm, CFlow algorithm, DFM algorithm, DRAEM algorithm, FastFlow algorithm, GANomaly algorithm, and PADIM algorithm. The detection model has the ability to generate equal-sized heat maps. The heat map can be regarded as the score of the input image by pixel-by-pixel scores. The score size describes the difference between the input image and the good product image. The heat map can intuitively reflect the abnormal position in the input image in the form of color.
[0074] S120, collecting a number of product appearance images, identifying a plurality of defective appearance images from the product appearance images through a detection model, and generating a current defective index; wherein the detection model is constructed based on good product images in a preset original good product gallery, and the current defective index is the ratio of the number of defective appearance images to the number of product appearance images.
[0075] In step S120, the camera is used to collect product appearance images of the products on the production line. The detection model uses an anomaly detection algorithm based on the good product images in the original good product library to identify the bad appearance images and generate a bad index representing the proportion of the number of bad products. Since the detection model has a certain over-kill rate, the bad appearance images judged by the detection model include real bad appearance images and over-kill images; the over-kill images are judged by the system as bad appearance images, but are actually good product images.
[0076] S130, when the current defective index exceeds a preset value, at least one overkill image is screened out from the defective appearance images according to an externally input marking signal.
[0077] In step S130, when the proportion of defective products is too large, the detection system determines that there are a certain number of over-killed images in the identified defective appearance images, and obtains the over-killed images based on the marking signals input by the quality inspector. The marking signals include: the currently identified image is a real defective appearance image, and the currently identified image is an over-killed image.
[0078] S140, based on the detection model, in the original good product gallery, a preset number of good product images are selected and replaced with a preset number of overkill images, to obtain the original good product gallery after the first iteration.
[0079] In step S140, the overkilled images are replaced into the original good product library, and the original good product library is iteratively updated to reduce the probability of the images being overkilled. At the same time, the size of the good product library is also controlled. The good product library will not be infinitely expanded due to the continuous addition of overkilled images to the good product library, which will make it difficult to train to the final convergence in practical applications.
[0080] S150, using the original good product image library after each iteration to build an iterative detection model, identify multiple bad appearance images after the iteration, and generate a current bad index after the iteration.
[0081] In step S150, step S120 is repeatedly executed by using the iterated detection model to generate a poor appearance image and a poor index corresponding to each iterative model.
[0082] S160, when the current defective index after iteration still exceeds the preset value, the detection model is continuously iterated by repeatedly replacing the preset number of good images selected after each iteration with the preset number of overkill images, until the current defective index obtained after iteration does not exceed the preset value.
[0083] In step S160, when the defective index after iteration still does not meet expectations, the original good product image library in the detection model is iterated and cycled continuously until the defective index meets expectations.
[0084] This embodiment can promptly discover the failure of the detection model by real-time detection of the current defective indicators. When it is detected that the defective indicators of the product do not meet the standards, part of the good product images in the detection model are selected based on the detection model to be replaced with overkill images determined by the external input marking signal after each iteration. By updating the original good product gallery in the iterative detection model in this way, overkill images that are greatly different from the good product gallery are continuously replaced into the good product gallery; the compatibility of the model with the diverse features of good products is improved without expanding the good product gallery, thereby increasing the difficulty of model training.
[0085] This embodiment provides a self-learning quality inspection method based on the above embodiment, including:
[0086] The preset number is calculated by a preset learning rate and the number of good product images in a preset original good product image library;
[0087] The calculation formula is n=a*N, wherein n is a preset number, a is a preset learning rate, and N is the number of good product images in a preset original good product library.
[0088] In this embodiment, the number of good product images that need to be replaced in each iteration is obtained through a preset learning rate and the number of good product images in the original good product library. The learning speed of the detection model can be conveniently adjusted by modifying the preset learning rate.
[0089] This embodiment provides a self-learning quality inspection method based on the above embodiment. The method selects a preset number of good product images from the original good product image library and replaces them with a preset number of overkill images based on the detection model, including:
[0090] Based on the detection model, a first score is calculated for each overkill image, and a second score is calculated for each good product image; wherein the first score is the difference between the image feature values extracted from the overkill image and the images in the original good product gallery, and the second score is the difference between the image feature values extracted from the good product image and the images in the original good product gallery, and the image feature values are extracted from the overkill image and the images in the original good product gallery using the detection model;
[0091] According to the first score of each overkill image, the sorting order of the overkill images is obtained; according to the second score of each good product image, the sorting order of the good product images is obtained;
[0092] According to the sorting order of the overkill images and the sorting order of the good product images, a preset number of bad images are selected as replacement images and a preset number of good product images are selected as replaced images from the original good product library;
[0093] Replace the replaced images in the original good gallery with the replacement images.
[0094] The present embodiment provides a method for a detection model to specifically select a replacement image and a replaced image. The original good product image library in the present embodiment includes: a preset original good product image library and an iterated original good product image library. The detection model established according to the preset original good product image library or the iterated detection model established according to the iterated original good product image library can obtain a first score reflecting the difference between each overkilled image and the original good product image library and a second score reflecting the difference between each good product image and the original good product image library by inputting an overkilled image and a good product image. The first score and the second score are used to select a suitable overkilled image to replace the good product image. Preferably, when the first score and the second score obtained by the detection model satisfy that the larger the first score, the greater the difference between each overkilled image and the original good product image library, and the larger the second score, the greater the difference between each good product image and the original good product image library, the images with large differences can be ranked first and the images with small differences can be ranked last according to the first score and the second score, and the N overkilled images at the top of the sorting are selected to replace the N good product images at the bottom of the sorting, where N is a preset number.
[0095] This embodiment provides a self-learning quality inspection method based on the above embodiment, and before repeatedly replacing the preset number of good product images selected after each iteration with the preset number of overkill images, it also includes:
[0096] Calculate the difference between the bad indicator and the preset value;
[0097] Modify the preset learning rate based on the difference value.
[0098] In this embodiment, before each loop iteration, a learning rate corresponding to the bad indicator is set according to the bad indicator obtained in this round of loop iteration. By flexibly adjusting the learning rate, the learning efficiency of the detection model can be accelerated and time can be saved. Specifically, when the bad indicator is much larger than the preset value, the learning rate is set to 1 / 10, that is, if there are 1000 images in the original graphics library, then the detection model needs to replace 100 images in this loop iteration; when the bad indicator is slightly higher than the preset value, the learning rate is set to 1 / 50, that is, if there are 1000 images in the original graphics library, then the detection model needs to replace 20 good images in this loop iteration.
[0099] This embodiment provides a self-learning quality inspection method based on the above embodiments.
[0100] After identifying a plurality of poor appearance images from the product appearance images and generating a current poor index, the method further includes:
[0101] When the current defective index does not exceed the preset value, the defective product corresponding to the defective appearance image is intercepted.
[0102] In this embodiment, when the defective index meets the conditions, it is determined that the learning of the detection model is completed, and defective products are intercepted according to the defective appearance image obtained by the last iteration.
[0103] In one embodiment, the reference specification Figure 2 The present invention provides a self-learning quality inspection device, comprising:
[0104] The industrial camera 10 is connected to the industrial computer 20 , and is used to collect a plurality of product appearance images of the product transmitted on the conveying device according to the collection control signal received from the industrial computer 20 , and send the plurality of product appearance images to the industrial computer 20 .
[0105] The industrial computer 20 is used to send an acquisition control signal to the industrial camera 10, and train the good product images in the preset original good product library through the anomaly detection algorithm to build a detection model; the anomaly detection algorithm includes: Patchcore algorithm, CFlow algorithm, DFM algorithm, DRAEM algorithm, FastFlow algorithm, GANomaly algorithm, and PADIM algorithm.
[0106] The industrial computer 20 is also used to identify multiple poor appearance images from the product appearance images through the detection model and generate a current poor index; the industrial computer 20 sends the poor appearance images and the poor index to the display 30; wherein the current poor index is the proportion of the number of poor appearance images to the number of product appearance images.
[0107] The display 30 is connected to the industrial computer 20 and is used to display a bad appearance image when the current bad index exceeds a preset value.
[0108] The button 40 includes a first button and a second button, and is connected to the industrial computer. When the first button is pressed, a first marking signal is sent to the industrial computer; when the second button is pressed, a second marking signal is sent to the industrial computer, and the first marking signal and the second marking signal are sent to the industrial computer; the first marking signal indicates that the currently identified bad appearance image is a re-judged real bad appearance image, and the second marking signal indicates that the currently identified bad appearance image is an overkill image;
[0109] The industrial computer is used to screen out at least one overkill image from the bad appearance images according to the second marking signal;
[0110] The corresponding button is selected externally according to the bad appearance image displayed on the display 30 to input the marking signal. The button 40 can also be replaced by other signal input devices, which is not limited here.
[0111] The industrial computer 20 is also used to select a preset number of good product images from the original good product gallery based on the detection model and replace them with a preset number of overkill images to obtain the original good product gallery after the first iteration. The original good product gallery after each iteration is used to build the detection model after the iteration, identify multiple bad appearance images after the iteration, and generate the current bad index after the iteration; when the current bad index after the iteration still exceeds the preset value, the detection model is continuously iterated by repeatedly replacing the preset number of good product images selected after each iteration with the preset number of overkill images until the current bad index obtained after the iteration does not exceed the preset value.
[0112] In this embodiment, the industrial computer 20 detects the current defective indicators in real time and can promptly discover the failure of the detection model. When it is detected that the defective indicators of the product do not meet the standards, the industrial computer 20 selects part of the good product images in the detection model based on the detection model and replaces them with part of the over-killed images judged by the marking signal input by the key 40 after each iteration. By updating the original good product library in the iterative detection model in this way, the over-killed images that are greatly different from the good product library are continuously replaced into the good product library; the compatibility of the model with the diverse characteristics of good products is improved without expanding the good product library, thereby increasing the difficulty of model training.
[0113] This embodiment provides a self-learning quality inspection device based on the above embodiments.
[0114] The preset number is calculated by a preset learning rate and the number of good product images in a preset original good product library.
[0115] The calculation formula is n=a*N, wherein n is a preset number, a is a preset learning rate, and N is the number of good product images in a preset original good product library.
[0116] This embodiment obtains the number of good images that need to be replaced in each iteration through a preset learning rate and the number of good images in the original good image library. By adjusting the learning rate, the learning speed of the detection model can be conveniently updated.
[0117] This embodiment provides a self-learning quality inspection device based on the above embodiments.
[0118] The industrial computer 20 is further used to calculate the first score of each overkill image and the second score of each good image based on the detection model; obtain the sorting order of the overkill images according to the first score of each good image; obtain the sorting order of the good images according to the second score of each good image; select a preset number of bad images as replacement images and a preset number of good images as replaced images from the original good image library according to the sorting order of the overkill images and the sorting order of the good images; and replace the replaced images in the original good image library with the replacement images;
[0119] Among them, the first score is the difference between the image feature values extracted from the overkill image and the images in the original good product gallery, and the second score is the difference between the image feature values extracted from the good product image and the images in the original good product gallery. The image feature values are extracted from the overkill image and the images in the original good product gallery using the detection model.
[0120] The present embodiment provides that the industrial computer 20 selects a replacement image and a replaced image based on a detection model, which is obtained by analyzing a detection model obtained based on a preset original good product library or a detection model obtained based on an iterated original good product library, and finally obtains a first score and a second score, which describe the image difference between the picture and the original good product library.
[0121] This embodiment provides a self-learning quality inspection device based on the above embodiments.
[0122] The industrial computer 20 is also used to intercept defective products corresponding to the defective appearance image when the current defective index does not exceed a preset value.
[0123] When the defective index in this embodiment is judged to meet the condition, it is confirmed that the learning of the detection model is completed, and the defective product is intercepted according to the defective appearance image obtained by the last iteration.
[0124] It should be noted that the above embodiments can be freely combined as needed. The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. A self-learning quality inspection method, It is characterized in that include: The abnormality detection algorithm is used to train the good product images in the preset original good product library to build a detection model; Collecting a number of product appearance images, identifying a plurality of bad appearance images from the product appearance images through the detection model, and generating a current bad index; wherein the current bad index is the ratio of the number of the bad appearance images to the number of the product appearance images; When the current defective index exceeds a preset value, at least one overkill image is screened out from the defective appearance images according to an externally input marking signal; Based on the detection model, in the original good product image library, a preset number of good product images are selected to be replaced with the preset number of overkill images, so as to obtain the original good product image library after the first iteration; Using the original good product image library after each iteration to build an iterative detection model, identifying multiple bad appearance images after the iteration, and generating the current bad index after the iteration; When the current defective index after iteration still exceeds the preset value, the detection model is continuously iterated by repeatedly replacing the preset number of good product images selected after each iteration with the preset number of overkill images, until the current defective index obtained after iteration does not exceed the preset value; The overkill image is a good product image misjudged by the detection model.
2. A self-learning quality inspection method according to claim 1, It is characterized in that include: The preset number is calculated by a preset learning rate and a preset number of good product images in the original good product image library; The calculation formula is n=a*N; wherein n is the preset number, a is the preset learning rate, and N is the preset number of good product images in the original good product gallery.
3. A self-learning quality inspection method according to claim 2, It is characterized in that The selecting, based on the detection model, a preset number of the good product images in the original good product image library to replace the preset number of the overkill images comprises: Based on the detection model, a first score is calculated for each of the overkilled images, and a second score is calculated for each of the good product images; wherein the first score is a difference value between the image feature value extracted from the overkilled image and the image in the original good product gallery, and the second score is a difference value between the image feature value extracted from the good product image and the image in the original good product gallery; According to the first score of each of the overkill images, a sorting order of the overkill images is obtained; according to the second score of each of the good product images, a sorting order of the good product images is obtained; According to the sorting order of the overkill images and the sorting order of the qualified product images, in the original qualified product image library, selecting the preset number of the overkill images as replacement images, and selecting the preset number of the qualified product images as replaced images; The replaced image in the original good product gallery is replaced with the replacement image.
4. A self-learning quality inspection method according to claim 2 or 3, It is characterized in that Before repeatedly replacing the preset number of good product images selected after each iteration with the preset number of overkill images, the method further includes: Calculating a difference between the bad indicator and the preset value; The preset learning rate is modified according to the difference value.
5. A self-learning quality inspection method according to any one of claims 1 to 3, It is characterized in that After identifying a plurality of poor appearance images from the product appearance images and generating a current poor index, the method further includes: When the current defective index does not exceed the preset value, a defective product corresponding to the defective appearance image is intercepted.
6. A self-learning quality inspection device, It is characterized in that include: An industrial camera connected to the industrial computer, used to collect a plurality of product appearance images of the product transmitted on the conveying device according to a collection control signal received from the industrial computer, and send the plurality of product appearance images to the industrial computer; The industrial computer is used to send the acquisition control signal to the industrial camera, and train the good product images in the preset original good product library through an abnormality detection algorithm to build a detection model; The industrial computer is further used to identify multiple bad appearance images from the product appearance images through the detection model and generate a current bad index; the industrial computer sends the bad appearance images and the bad index to the display; wherein the current bad index is the proportion of the number of the bad appearance images to the number of the product appearance images; The display is connected to the industrial computer and is used for displaying the bad appearance image when the current bad index exceeds a preset value; A button, including a first button and a second button, connected to the industrial computer, when the first button is pressed, a first marking signal is sent to the industrial computer; when the second button is pressed, a second marking signal is sent to the industrial computer, and the first marking signal and the second marking signal are sent to the industrial computer; the first marking signal indicates that the currently identified bad appearance image is a re-judged real bad appearance image, and the second marking signal indicates that the currently identified bad appearance image is an overkill image; The industrial computer is used to filter out at least one of the overkill images from the poor appearance images according to the second marking signal; The industrial computer is further used to select a preset number of good product images from the original good product library based on the detection model and replace them with the preset number of overkill images to obtain the original good product library after the first iteration; use the original good product library after each iteration to build the detection model after the iteration, identify the multiple bad appearance images after the iteration, and generate the current bad index after the iteration; when the current bad index after the iteration still exceeds the preset value, repeatedly replace the preset number of good product images selected after each iteration with the preset number of overkill images, and continue to iterate the detection model until the current bad index obtained after the iteration does not exceed the preset value; The overkill image is a good product image misjudged by the detection model.
7. A self-learning quality inspection device according to claim 6, It is characterized in that include: The preset number is calculated by a preset learning rate and a preset number of good product images in the original good product image library; The calculation formula is n=a*N; wherein n is the preset number, a is the preset learning rate, and N is the preset number of good product images in the original good product gallery.
8. A self-learning quality inspection device according to claim 7, It is characterized in that The industrial computer is further used to calculate a first score for each of the overkilled images and a second score for each of the good product images based on the detection model; obtain a sorting order of the overkilled images according to the first score of each of the overkilled images; obtain a sorting order of the good product images according to the second score of each of the good product images; select a preset number of the overkilled images as replacement images and a preset number of the good product images as replaced images in the original good product gallery according to the sorting order of the overkilled images and the sorting order of the good product images; and replace the replaced images in the original good product gallery with the replacement images; The first score is the difference between the image feature values extracted from the overkill image and the images in the original good product gallery, and the second score is the difference between the image feature values extracted from the good product image and the images in the original good product gallery.
9. A self-learning quality inspection device according to any one of claims 6 to 8, It is characterized in that The anomaly detection algorithms include: Patchcore algorithm, CFlow algorithm, DFM algorithm, DRAEM algorithm, FastFlow algorithm, GANomaly algorithm, and PADIM algorithm.
10. A self-learning quality inspection device according to any one of claims 6 to 8, It is characterized in that The industrial computer is further used to intercept defective products corresponding to the defective appearance image when the current defective index does not exceed the preset value.
Citation Information
Patent Citations
Saliency detection method based on active learning
CN110443257A
Image description generation method and system based on course learning
CN115035304A
Target detection model training method and device, equipment and storage medium
CN115546693A
Model establishment method, object detection method and related equipment
CN115937632A
Image-recognition apparatus, image-recognition method, and non-transitory computer-readable storage medium thereof
US20210027105A1
