A transparent packaging bag defect detection system and method
Through beam projection image and simple image comparison technology, the problem of low detection efficiency in the existing technology is solved, and the defect location is quickly detected and the defect location is positioned, which reduces the difficulty of model training, improves detection efficiency, and continues to learn Improve detection accuracy.
Patent Information
- Application Number
- CN202311548070.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2043-11-20
AI Technical Summary
The existing machine vision-based transparent packaging bag defect detection method needs to consider a variety of defect types, which makes model training difficult and low detection efficiency, especially for defect-free packaging bags, which is meaningless to locate defects, reducing detection efficiency.
Use beam projection images to replace scanning or shooting, and quickly determine whether there are defects in the packaging bag through simple image comparison, and locate defects for defective packaging bags, and use a preset defect detection model for detection, reducing the difficulty of the model training. Improve detection efficiency.
It realizes rapid and effective detection of the transparent packaging bags for defects and positioning the location of the defects without considering the defect category, which improves the detection efficiency. At the same time, the results are controlled through human-machine verification, and the defect detection model is constantly updated. Improve detection accuracy.
Smart Images

Figure CN117589771B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of packaging bag detection, and in particular to a transparent packaging bag defect detection system and method. Background Art
[0002] After the production of transparent packaging bags is completed, their quality will be inspected, including detection of surface defects such as dirt, bubbles, damage, wrinkles, foreign objects in the bag, etc. Due to the problems of low detection efficiency and high cost of manual quality inspection, machine vision-based inspection methods have begun to gradually replace manual quality inspection.
[0003] The existing machine vision-based detection method mainly collects images of transparent packaging bags, and then performs defect detection based on the collected images through the existing detection model. In addition to detecting whether there are defects, the image position of the defects can also be directly located. However, in this method, the generation of the model needs to use various defect types as target categories, which makes the requirements for sample data relatively high. In addition, under normal circumstances, there are only a small number of transparent packaging bags with defects, and it is meaningless to locate defects on packaging bags without defects, which will reduce the detection efficiency. Summary of the invention
[0004] The purpose of the present application is to provide a transparent packaging bag defect detection system and method, which can quickly determine whether a transparent packaging bag has defects without considering the type of defects, and then locate the defects for the defective packaging bag to increase the detection efficiency.
[0005] In a first aspect, the present application provides a transparent packaging bag defect detection system, the system comprising an image acquisition module, an image detection module and a defect positioning module;
[0006] The image acquisition module is used to obtain the projection image of the lighting light through the transparent packaging bag and obtain the current projection parameters;
[0007] The image detection module is used to perform image comparison based on the projection image using a preset standard image template, and record the projection image with inconsistent comparison results as an abnormal image;
[0008] The defect location module is used to perform detection based on the abnormal image through a preset defect detection model to obtain a detection result, and obtain the location information of the defect on the transparent packaging bag based on the detection result and the current projection parameters.
[0009] Through the above technical solution, the light beam projection image is used to replace the scanned or photographed image for defect detection. Through simple image comparison, it is possible to quickly determine whether the transparent packaging bag has defects, and then only the transparent packaging bag with defects is located without considering the type of defects. This reduces the difficulty of model training and also improves the detection efficiency of transparent packaging bags.
[0010] Optionally, the image detection module includes an image enhancement unit, an image comparison unit and an abnormality prompt unit;
[0011] The image enhancement unit is used to enhance the acquired projection image by a preset image preprocessing method;
[0012] The image comparison unit is used to compare the enhanced projection image with a preset standard image template and obtain an image comparison result;
[0013] The abnormality prompt unit is used to determine whether an abnormality occurs according to the image comparison result and a preset standard. If an abnormality occurs, the current projected image is recorded as an abnormal image and corresponding prompt information is output.
[0014] Optionally, the defect positioning module includes a target detection unit, a target screening unit and a positioning calculation unit;
[0015] The target detection unit is used to perform detection according to the abnormal image through a preset defect detection model and obtain a detection result, wherein the detection result includes target position information and confidence level;
[0016] The target screening unit is used to select the detection results whose confidence reaches a preset threshold and obtain the corresponding target position information;
[0017] The positioning calculation unit is used to obtain the position information of the defect in the projection image according to the target position information, and calculate the position information of the defect in the transparent packaging bag according to the position information of the defect in the projection image through the current projection parameters.
[0018] Optionally, the system further includes a defect checking module and a model updating module;
[0019] The defect inspection module is used to obtain an original inspection image according to the location information of the defect on the transparent packaging bag, send the original inspection image to a manual inspection, and obtain the inspection feedback result;
[0020] The model updating module is used to obtain a newly added projection image by performing illumination projection and image annotation on the original verification image that has passed the verification according to the verification feedback result, and to update the preset defect detection model according to the newly added projection image.
[0021] Optionally, the defect detection module includes a detection image acquisition unit and a detection feedback unit;
[0022] The verification image acquisition unit is used to collect images of the transparent packaging bag, record the collected images as original images, and intercept a partial original image from the original image according to the location information of the defect, and record it as the original verification image;
[0023] The verification feedback unit is used to send the original verification image to a human for verification and obtain a verification feedback result.
[0024] Optionally, the verification feedback result includes defect confirmation information and defect location information, and the model updating module includes an image projection unit, an image annotation unit and a model updating unit;
[0025] The image projection unit is used to obtain a corresponding projection image and projection parameters by illuminating and projecting the original verification image according to the defect confirmation information;
[0026] The image annotation unit is used to calculate the image annotation information according to the defect position information through the projection parameters, and annotate the acquired projection image according to the image annotation information to generate a newly added projection image;
[0027] The model updating unit is used to expand the preset training set according to the newly added projection image, and iteratively update the preset defect detection model according to the expanded training set.
[0028] In a second aspect, the present application provides a method for detecting defects in a transparent packaging bag, comprising the following steps:
[0029] Obtain the projection image and projection parameters of the current transparent packaging bag;
[0030] Compare the current projected image with the preset standard image template to determine whether the images are consistent. If the images are inconsistent, the current projected image is recorded as an abnormal image;
[0031] The abnormal image is detected by a preset defect detection model to obtain the detection result, and the location information of the defect on the transparent packaging bag is obtained based on the detection result and the projection parameters.
[0032] Optionally, after obtaining the location information of the defect on the transparent packaging bag, the method further includes:
[0033] Obtaining a captured image of the transparent packaging bag, and obtaining an original verification image based on the position information of the defect on the transparent packaging bag;
[0034] Send the original verification image to manual verification and obtain verification feedback results;
[0035] According to the verification feedback results, the preset defect detection model is updated.
[0036] Optionally, the verification feedback result includes defect confirmation information and defect location information, and the updating of a preset defect detection model according to the verification feedback result includes:
[0037] According to the defect confirmation information, the original verification image is illuminated and projected to obtain the corresponding projection image and projection parameters;
[0038] According to the defect location information, the image annotation information is calculated by using the projection parameters, and the acquired projection image is annotated according to the image annotation information to generate a newly added projection image;
[0039] The preset training set is expanded according to the newly added projection images, and the preset defect detection model is iteratively updated according to the expanded training set.
[0040] In a third aspect, the present application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute the above-mentioned method for detecting defects in transparent packaging bags.
[0041] To summarize, firstly, by replacing the scanned or photographed images with light beam projection images for defect detection, it is possible to quickly determine whether the transparent packaging bag has defects through simple image comparison, and then only the transparent packaging bags with defects are located without considering the type of defects, which reduces the difficulty of model training and improves the detection efficiency of transparent packaging bags; in addition, the defect positioning results are sent to manual verification to ensure that the defect results are controllable in the form of human-machine combination; in addition, the defect detection model is updated with the help of the defect detection verification results, and the accuracy of the defect detection model is continuously improved through continuous learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a schematic diagram of a transparent packaging bag defect detection system provided in an embodiment of the present application;
[0043] Figure 2 is a schematic diagram of an image detection module provided in an embodiment of the present application;
[0044] Figure 3 is a schematic diagram of a defect location module provided in an embodiment of the present application;
[0045] Figure 4 is a schematic diagram of a defect detection module provided in an embodiment of the present application;
[0046] Figure 5 is a schematic diagram of a model updating module provided in an embodiment of the present application;
[0047] Figure 6 It is a flow chart of a transparent packaging bag defect detection method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The following is combined with Figure 1 -Attached Figure 6 , further details of this application are given.
[0049] This application provides a transparent packaging bag defect detection system, see Figure 1 The system includes an image acquisition module 10, an image detection module 20 and a defect positioning module 30.
[0050] The image acquisition module 10 is used to obtain a projection image of the illumination light passing through the transparent packaging bag and obtain current projection parameters.
[0051] The image detection module 20 is used to perform image comparison based on the projection image using a preset standard image template, and record the projection image with inconsistent comparison results as an abnormal image.
[0052] The defect location module 30 is used to perform detection based on the abnormal image through a preset defect detection model to obtain a detection result, and obtain the location information of the defect on the transparent packaging bag based on the detection result and the current projection parameters.
[0053] Among them, the projection image is the image obtained by projecting the lighting light onto a plane after passing through the transparent packaging bag, and the projection parameters are the distances between the projection area, the transparent packaging bag and the lighting lamp, and the angle between the lighting beam and the plane where the transparent packaging bag is located.
[0054] Since the transparent packaging bag defect detection system provided by the present application will be applied in corresponding devices or equipment, such equipment generally has a designated placement area for placing the transparent packaging bags to be inspected. The transparent packaging bags are suspended at both ends in a flat state, and then the transparent packaging bags in the designated placement area are transmitted and inspected through the corresponding transmission mechanism. A lighting lamp is arranged below the transparent packaging bag, and a projection area and an image acquisition device are arranged above the transparent packaging bag, which is similar to a camera and can capture the projection image of the projection area, and can also scan or photograph the transparent packaging bag to obtain the original transparent packaging bag image. After the lighting lamp is turned on, the light beam passes through the transparent packaging bag and forms an image in the projection area above, and the projection image can be obtained through the image acquisition device.
[0055] The preset standard image template represents the projection image of a transparent packaging bag without any defects after illumination projection. The preset defect detection model is based on the target detection model as a prototype and the projection image as a data set. All defect types are classified into one category and the target detection model is obtained through training.
[0056] When a transparent packaging bag has defects, such as damage or foreign matter, there will be a certain difference when the lighting beam passes through the transparent packaging bag compared to the flawless situation. By capturing this difference, it can be determined whether the transparent packaging bag has defects.
[0057] Therefore, in the embodiment of the present application, projection images are used as the main detection means to detect transparent packaging bags.
[0058] First, the image acquisition module 10 is used to obtain a projection image of the illumination light passing through the transparent packaging bag, and obtain current projection parameters.
[0059] In the embodiments of the present application, the inspection of transparent packaging bags can be regarded as an assembly line project, and the transparent packaging bags are inspected in batches or groups. After completing the inspection of each batch, it will enter the next batch. Each batch of transparent packaging bags can be single or multiple, which can be set according to actual conditions, and this application does not make specific limitations.
[0060] It is worth noting that the projection parameters can be adjusted, but they need to be consistent with the generation of the preset standard image template. If the projection parameters need to be adjusted, the corresponding standard image template needs to be obtained for the new projection parameters.
[0061] After the projection image is acquired, detection will begin based on the projection image, that is, the image detection module 20 performs image comparison based on the projection image using a preset standard image template, and records the projection image with inconsistent comparison results as an abnormal image.
[0062] Specifically, see Figure 2 The image detection module 20 includes an image enhancement unit 201, an image comparison unit 202 and an abnormality prompt unit 203.
[0063] The image enhancement unit 201 is used to enhance the acquired projection image by using a preset image preprocessing method.
[0064] The image contrast unit 202 is used to compare the enhanced projection image with a preset standard image template and obtain an image contrast result.
[0065] The abnormality prompt unit 203 is used to determine whether an abnormality occurs according to the image comparison result and a preset standard. If an abnormality occurs, the current projected image is recorded as an abnormal image and corresponding prompt information is output.
[0066] Among them, image preprocessing mainly refers to image enhancement methods such as image scaling and image equalization, and the corresponding preprocessing parameters will be set.
[0067] In the embodiment of the present application, after the projection image is acquired, it is first determined whether there are defects based on the projection image. However, considering the image input size of the image contrast algorithm and the problem of improving image contrast, the projection image is first preprocessed before the image comparison is performed. That is, the image enhancement unit 201 enhances the acquired projection image by a preset image preprocessing method. Of course, the standard image template will also be processed with the same image preprocessing parameters.
[0068] Then, the enhanced projection image will be compared with a preset standard image template by the image comparison unit 202, and the image comparison result will be obtained. The image comparison here is a conventional image similarity comparison. By extracting features from the image and converting them into feature vectors, the similarity of the two images can be calculated, and the image comparison result will be measured by similarity.
[0069] Through the preset similarity threshold, it can be determined whether the two images are consistent. If the comparison results of the two images are inconsistent, that is, the projection image obtained by the current transparent packaging bag is different from the standard projection image, it means that there is a high possibility that the current transparent packaging bag has defects. At this time, the current projection image will be recorded as an abnormal image through the abnormal prompt unit 203, and the corresponding prompt information will be output. After the prompt information is output, the transparent packaging bag currently in the detection state will be further confirmed. If it is confirmed that there is a defect, the staff will remove the defective transparent packaging bag.
[0070] Since the purpose of using machine vision to detect defects in transparent packaging bags is to free up more manpower and improve detection efficiency, it is inevitable that machine vision will still have a certain error rate. Therefore, in order to provide a certain accuracy guarantee for the detection of transparent packaging bags, manual verification is usually used, that is, the detection work is completed in a human-machine combination, which not only improves the detection efficiency but also increases the accuracy guarantee. However, in order to maximize the role of machine detection, the specific location of the defect will be detected after the defect is detected, and then the specific location will be marked, and then manually verified. In this way, the manual workload is reduced to a minimum, and the accuracy of machine detection is also checked.
[0071] Therefore, after detecting that a defect occurs in the transparent packaging bag, the specific location of the defect will also be detected, that is, the defect positioning module 30 performs detection based on the abnormal image through a preset defect detection model to obtain the detection result, and obtains the location information of the defect on the transparent packaging bag based on the detection result and the current projection parameters.
[0072] Specifically, see Figure 3The defect positioning module 30 includes a target detection unit 301 , a target screening unit 302 and a positioning calculation unit 303 .
[0073] The target detection unit 301 is used to perform detection based on the abnormal image through a preset defect detection model and obtain the detection result.
[0074] The target screening unit 302 is used to select the detection results whose confidence reaches a preset threshold and obtain the corresponding target position information.
[0075] The positioning calculation unit 303 is used to obtain the position information of the defect in the projection image according to the target position information, and calculate the position information of the defect in the transparent packaging bag according to the position information of the defect in the projection image through the current projection parameters.
[0076] Among them, the detection results include target position information and confidence. The so-called target position information is equivalent to the predicted area of the target, reflecting the position and size of the projected image where the defect is located; the so-called confidence is equivalent to a probability, that is, the probability that the predicted target is a defect. The higher the confidence, the greater the possibility that the predicted target is a defect.
[0077] As mentioned above, the preset defect detection model is based on the target detection model as a prototype, with the projection image as a data set, and all defect types are classified into one category. The target detection model is obtained through training. In this way, compared with the conventional method of defect detection for transparent packaging bags, there is no need to consider the category of the defect. It is only necessary to determine whether it is a defect and the image location of the defect. This is equivalent to turning a multi-classification problem into a binary classification problem, which will also improve the detection efficiency of transparent packaging bags to a certain extent.
[0078] In the embodiment of the present application, after the abnormal image is obtained, the target detection unit 301 will first use the abnormal image as input, perform detection through a preset defect detection model, and obtain the detection result. Since the detection result may contain multiple targets, corresponding screening is required, that is, the target screening unit 302 will select the detection result whose confidence reaches the preset threshold, and obtain the corresponding target position information. In other words, it is considered that only when the confidence reaches a certain level will the target be recognized as a defective target.
[0079] It is worth noting that the situation where no target is detected in the test results is not ruled out. The reason for this situation may be a problem with the defect detection model, or there may be no defect, that is, the previous image comparison result is wrong. No matter which situation it is, it is a detection abnormality. In this case, the associated detection data of the current transparent packaging bag, including the projected image and the detection results obtained by the defect detection model, will be stored in the preset database for subsequent adjustment and optimization of the entire detection method.
[0080] Since the acquired target position information indicates the specific position and size of the defect in the projected image, and the target of manual verification should be the image of the transparent packaging bag obtained by shooting or scanning, it is necessary to further confirm the position of the defect on the transparent packaging bag.
[0081] Therefore, after determining the defect target and obtaining its position information, the positioning calculation unit 303 will also obtain the position information of the defect in the projection image based on the target position information, and calculate the position information of the defect in the transparent packaging bag based on the position information of the defect in the projection image through the current projection parameters. It should be noted here that there are two projection images, one is the original projection image directly obtained by lighting the transparent packaging bag, and the other is the detection projection image after preprocessing the original projection image. Therefore, the target position information here refers to the position of the defect in the detection projection image, so it is necessary to first obtain the position information of the defect in the original projection image through the preprocessing parameters, and then calculate the position information of the defect in the transparent packaging bag based on the projection parameters.
[0082] It is mentioned above that the purpose of locating defects is to facilitate manual verification. In addition, with the help of the results of manual verification, the validity of the defect target in the projection image can be confirmed to expand the data, thereby improving the problems of small data samples and detection model fitting.
[0083] Therefore, see Figure 1 The transparent packaging bag defect detection system provided in the present application also includes a defect verification module 40 and a model updating module 50.
[0084] The defect inspection module 40 is used to obtain an original inspection image according to the location information of the defect on the transparent packaging bag, send the original inspection image to manual inspection, and obtain the inspection feedback result.
[0085] The model updating module 50 is used to obtain a newly added projection image by performing illumination projection and image annotation on the original verification image that has passed the verification according to the verification feedback result, and to update the preset defect detection model according to the newly added projection image.
[0086] In the embodiment of the present application, after confirming the position information of the defect in the transparent packaging bag, the defect verification module 40 can obtain the original verification image according to the position information of the defect on the transparent packaging bag, and send the original verification image to manual verification, and obtain the verification feedback result.
[0087] Specifically, see Figure 4 The defect checking module 40 includes a checking image acquiring unit 401 and a checking feedback unit 402 .
[0088] The verification image acquisition unit 401 is used to collect images of the transparent packaging bag, record the collected images as original images, and cut out a partial original image from the original image according to the location information of the defect, and record it as the original verification image.
[0089] The verification feedback unit 402 is used to send the original verification image to a human for verification and obtain the verification feedback result.
[0090] Among them, the verification feedback result includes defect confirmation information and defect location information.
[0091] In the embodiment of the present application, manual verification is performed in the form of an image, and the verified image is sent to the corresponding employee verification terminal, and the image is the image that needs to be verified. Since it is a verification, it is necessary to start from the source, that is, start from the transparent packaging bag in the detection state, and present the transparent packaging bag in the form of an image, that is, the transparent packaging bag is imaged by the verification image acquisition unit 401, and the collected image is recorded as the original image. The collection here can be understood as photographing or scanning the transparent packaging bag through the corresponding image acquisition device, and then combined with the position information of the transparent packaging bag where the defect is located, it can be marked in the collected original image, that is, the defect is marked in the form of a rectangular frame in the original image, and then a partial original image is captured from the original image according to the marked rectangular frame. Of course, it is convenient to use the image background information as a reference when capturing, and the rectangular frame will be correspondingly expanded, and then the image will be captured with the expanded rectangular frame, and finally the captured partial original image is recorded as the original verification image.
[0092] After obtaining the original verification image, the verification feedback unit 402 will send the original verification image to manual verification, and obtain the verification feedback result. Verifying the defect detection result is originally a manual inspection job, but there is no need for manual inspection and search on the transparent packaging bags one by one at the cost of visual fatigue. Instead, the target is directly placed in front of the staff, and they only need to judge whether the inspection is correct.
[0093] The so-called verification feedback result is confirmed by relevant staff whether the defects marked in the original verification image are correct, and whether the marked area is correct. The staff can directly confirm it at the corresponding employee verification end. The incorrectly marked area can also be re-marked and fed back to the detection end. The concept of the detection end is not mentioned above. In fact, it is equivalent to the server corresponding to the entire detection system.
[0094] As mentioned above, by verifying the defect detection results, the validity of the defect targets in the projection image can also be confirmed, that is, the defect detection results are reliable, which is equivalent to manually annotated images, and there are also manually re-identified defects, so data expansion can be used to improve the problems of small data samples and detection model fitting.
[0095] Therefore, in the embodiment of the present application, after verification by the defect verification module 40, the model updating module 50 will also perform illumination projection and image annotation on the original verification image that has passed the verification according to the verification feedback result to obtain a newly added projection image, and update the preset defect detection model according to the newly added projection image.
[0096] Specifically, see Figure 5 The model updating module 50 includes an image projection unit 501 , an image annotation unit 502 and a model updating unit 503 .
[0097] The image projection unit 501 is used to obtain a corresponding projection image and projection parameters by illuminating and projecting the original verification image according to the defect confirmation information.
[0098] The image annotation unit 502 is used to calculate image annotation information according to the defect position information and projection parameters, and to annotate the acquired projection image according to the image annotation information to generate a newly added projection image.
[0099] The model updating unit 503 is used to expand the preset training set according to the newly added projection images, and iteratively update the preset defect detection model according to the expanded training set.
[0100] Since the defect detection model uses projection images as data sets, the expanded image data is naturally also projection images. The image prototype that has been verified and confirmed is a photographed or scanned image of the transparent packaging bag, so the original verification image also needs to be converted into the corresponding projection image.
[0101] Therefore, in the embodiment of the present application, after obtaining the verification feedback result, the image projection unit 501 will firstly perform illumination projection on the original verification image according to the defect confirmation information to obtain the corresponding projection image and projection parameters, that is, according to the defect confirmation information in the verification feedback result, the original verification image after manual confirmation is obtained, and then the projection image can be obtained by means of illumination projection on the original verification image.
[0102] Then, the acquired projection image is annotated, that is, the position of the defect in the projection image is annotated, and the position of the defect in the projection image can be calculated according to the position of the defect in the original verification image, that is, the defect position information in the feedback result, through the projection parameters. That is, the image annotation unit 502 calculates the image annotation information through the projection parameters according to the defect position information, and annotates the acquired projection image according to the image annotation information, so as to generate a new projection image.
[0103] After acquiring the newly added projection images, the preset training set can be expanded according to the newly added projection images through the model updating unit 503, and the preset defect detection model can be iteratively updated according to the expanded training set. Of course, considering the cost loss of each update, the newly added projection images can be stored, and when the storage amount reaches a certain level, they can be updated.
[0104] It is worth noting that the model update work can be carried out outside the transparent packaging bag inspection work and will not affect the operation of the inspection work. The entire inspection process only needs to detect whether there are defects, and then further inspect the defective image to obtain the location of the defect on the transparent packaging bag, and then convert it into a verification image for manual verification. If it is confirmed that there are defects after verification, the verification image will be recorded as the model update material, and the transparent packaging bag under inspection will be removed, and then the inspection will continue.
[0105] The present application also provides a method for detecting defects in transparent packaging bags. Figure 6 , including the following steps:
[0106] S100: Obtaining a projection image and projection parameters of a current transparent packaging bag.
[0107] S200: Compare the current projected image with a preset standard image template to determine whether the images are consistent. If the images are inconsistent, the current projected image is recorded as an abnormal image.
[0108] S300, detecting the abnormal image using a preset defect detection model to obtain a detection result, and obtaining location information of the defect on the transparent packaging bag based on the detection result and projection parameters.
[0109] First, a projection image is generated for the transparent packaging bag currently in the inspection state through illumination projection, and the parameters of the currently generated projection image are recorded. Then, the similarity is compared with the preset standard image template. If the similarity is lower than the preset threshold, it is considered that the current projection image is inconsistent with the preset standard image template, so the current projection image will be recorded as an abnormal image.
[0110] The abnormal image is then detected using a preset defect detection model to determine the location of the defect in the projected image. If a defect is detected, the location information of the defect on the transparent packaging bag is calculated and obtained based on the location of the defect in the projected image and the projection parameters.
[0111] After obtaining the location information of the defect on the transparent packaging bag, verification will be performed, that is, the location information of the defect on the transparent packaging bag will be presented in the form of an image and sent to the manual verification end for verification by related staff.
[0112] Therefore, in the embodiment of the present application, after obtaining the position information of the defect on the transparent packaging bag, the following steps are also included:
[0113] S410: Acquire a captured image of the transparent packaging bag, and acquire an original verification image based on the position information of defects on the transparent packaging bag.
[0114] S420: Send the original verification image to a human for verification, and obtain verification feedback results.
[0115] S430: Update the preset defect detection model according to the verification feedback result.
[0116] First, the transparent packaging bag may be photographed or scanned to generate an original image, and then, according to the location of the defect on the transparent packaging bag, the location information of the defect may be marked in the original image to serve as the original verification image.
[0117] The original verification image is then sent to the personnel verification end for verification, and the associated staff will confirm whether the defects marked in the original verification image are correct and whether the marked location area is correct. The staff can directly confirm at the corresponding verification end, and the corresponding marked area can be re-marked if it is incorrect. After the associated staff submits the confirmation, they will receive feedback information, that is, the verification feedback result, which includes defect confirmation information and defect location information.
[0118] By verifying the feedback results, we can know whether the defect detection results are reliable. Reliable defect detection results are equivalent to manually labeled data samples, so they can be used to expand the model training data set, thereby improving the problem of small data samples and detection model fitting.
[0119] Therefore, after obtaining the verification feedback results, the preset defect detection model will also be updated.
[0120] Specifically, according to the verification feedback result, the preset defect detection model is updated, including the following steps:
[0121] S431. According to the defect confirmation information, the original verification image is illuminated and projected to obtain a corresponding projection image and projection parameters.
[0122] S432 . Calculate image annotation information using projection parameters according to the defect position information, and annotate the acquired projection image according to the image annotation information to generate a newly added projection image.
[0123] S433, expanding the preset training set according to the newly added projection image, and iteratively updating the preset defect detection model according to the expanded training set.
[0124] Since the defect detection model uses projection images as data sets, the expanded image data is naturally also projection images. The prototype of the verified and confirmed image is a photographed or scanned image of the transparent packaging bag, so the original verification image also needs to be converted into the corresponding projection image.
[0125] Therefore, after obtaining the verification feedback result, the original verification image after manual confirmation is first obtained according to the defect confirmation information in the verification feedback result, and then the projection image can be obtained by means of lighting projection on the original verification image.
[0126] Then, the acquired projection image is annotated, that is, the position of the defect in the projection image is annotated. According to the defect position information, the image annotation information can be calculated through the projection parameters, and then the acquired projection image is annotated according to the image annotation information. In this way, the annotated projection image can be obtained and recorded as a newly added projection image.
[0127] After acquiring the newly added projection images, the preset training set can be expanded according to the newly added projection images. When the newly added projection images accumulate to a certain level, the newly added projection images can be added to the preset sample training set. The current preset defect detection model is used as the pre-training model, and iterative updates are performed on this basis to generate a new updated detection model. Through this continuous learning method, the accuracy of the detection model can be continuously improved.
[0128] The embodiment of the present application also provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute any of the above-mentioned transparent packaging bag defect detection methods.
[0129] The embodiments of this specific implementation method are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Therefore, all equivalent changes made based on the principles of the present application should be included in the protection scope of the present application.
Claims
1. A transparent packaging bag defect detection system, characterized in that: The system includes an image acquisition module, an image detection module and a defect positioning module; The image acquisition module is used to obtain the projection image of the lighting light through the transparent packaging bag and obtain the current projection parameters; The image detection module is used to perform image comparison based on the projection image using a preset standard image template, and record the projection image with inconsistent comparison results as an abnormal image, wherein the preset standard image template represents a projection image obtained by lighting and projecting a transparent packaging bag without any defects; The defect location module is used to perform detection based on the abnormal image through a preset defect detection model to obtain a detection result, and obtain the location information of the defect on the transparent packaging bag based on the detection result and the current projection parameters; The defect positioning module includes a target detection unit, a target screening unit and a positioning calculation unit; The target detection unit is used to perform detection according to the abnormal image through a preset defect detection model and obtain a detection result, wherein the detection result includes target position information and confidence, wherein the preset defect detection model is a target detection model obtained through training, which takes the target detection model as a prototype and the projection image as a data set, classifies all defect types into one category; The target screening unit is used to select the detection results whose confidence reaches a preset threshold and obtain the corresponding target position information; The positioning calculation unit is used to obtain the position information of the defect in the projection image according to the target position information, and calculate the position information of the defect in the transparent packaging bag according to the position information of the defect in the projection image through the current projection parameters.
2. A transparent packaging bag defect detection system according to claim 1, characterized in that: The image detection module includes an image enhancement unit, an image comparison unit and an abnormality prompt unit; The image enhancement unit is used to enhance the acquired projection image by a preset image preprocessing method; The image comparison unit is used to compare the enhanced projection image with a preset standard image template and obtain an image comparison result; The abnormality prompt unit is used to determine whether an abnormality occurs according to the image comparison result and a preset standard. If an abnormality occurs, the current projected image is recorded as an abnormal image and corresponding prompt information is output.
3. A transparent packaging bag defect detection system according to claim 1, characterized in that: The system also includes a defect checking module and a model updating module; The defect inspection module is used to obtain an original inspection image according to the location information of the defect on the transparent packaging bag, send the original inspection image to a manual inspection, and obtain the inspection feedback result; The model updating module is used to obtain a newly added projection image by performing illumination projection and image annotation on the original verification image that has passed the verification according to the verification feedback result, and to update the preset defect detection model according to the newly added projection image.
4. A transparent packaging bag defect detection system according to claim 3, characterized in that: The defect detection module includes a detection image acquisition unit and a detection feedback unit; The verification image acquisition unit is used to collect images of the transparent packaging bag, record the collected images as original images, and intercept a partial original image from the original image according to the location information of the defect, and record it as the original verification image; The verification feedback unit is used to send the original verification image to a human for verification and obtain a verification feedback result.
5. The transparent packaging bag defect detection system according to claim 3, characterized in that: The verification feedback result includes defect confirmation information and defect location information, and the model updating module includes an image projection unit, an image annotation unit and a model updating unit; The image projection unit is used to obtain a corresponding projection image and projection parameters by illuminating and projecting the original verification image according to the defect confirmation information; The image annotation unit is used to calculate the image annotation information according to the defect position information through the projection parameters, and annotate the acquired projection image according to the image annotation information to generate a newly added projection image; The model updating unit is used to expand the preset training set according to the newly added projection image, and iteratively update the preset defect detection model according to the expanded training set.
6. A method for detecting defects in transparent packaging bags, applied to a system for detecting defects in transparent packaging bags as claimed in any one of claims 1 to 5, characterized in that: include: Obtain the projection image and projection parameters of the current transparent packaging bag; Compare the current projected image with the preset standard image template to determine whether the images are consistent. If the images are inconsistent, the current projected image is recorded as an abnormal image; The abnormal image is detected by a preset defect detection model to obtain the detection result, and the location information of the defect on the transparent packaging bag is obtained based on the detection result and the projection parameters.
7. A method for detecting defects in transparent packaging bags according to claim 6, characterized in that: After obtaining the location information of the defect on the transparent packaging bag, the method includes: Obtaining a captured image of the transparent packaging bag, and obtaining an original verification image based on the position information of the defect on the transparent packaging bag; Send the original verification image to manual verification and obtain verification feedback results; According to the verification feedback results, the preset defect detection model is updated.
8. A method for detecting defects in transparent packaging bags according to claim 7, characterized in that: The verification feedback result includes defect confirmation information and defect location information. The updating of the preset defect detection model according to the verification feedback result includes: According to the defect confirmation information, the original verification image is illuminated and projected to obtain the corresponding projection image and projection parameters; According to the defect location information, the image annotation information is calculated by using the projection parameters, and the acquired projection image is annotated according to the image annotation information to generate a newly added projection image; The preset training set is expanded according to the newly added projection images, and the preset defect detection model is iteratively updated according to the expanded training set.
9. A computer-readable storage medium storing a computer program that can be loaded by a processor and execute the method for detecting defects of a transparent packaging bag according to any one of claims 6 to 8.
