A mask defect detection device and method
By designing a kind of compromise mechanism, conveying agency, image collection mechanism, image processing software, and eliminating mask defect detection devices, the 4K line array camera and deep learning methods are used to solve the low -quality detection efficiency and cost in the existing technologies. The problem of high and unsuitable quality realizes automation detection, improves efficiency and accuracy, and reduces costs.
Patent Information
- Application Number
- CN202210188343.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2042-02-28
AI Technical Summary
In the prior art, mask testing relies on manual testing, which is low efficiency, high cost and insecure, making it difficult to ensure the normal quality of the product.
A mask defect detection device is designed, including a loading mechanism, a conveying mechanism, an image acquisition mechanism, an image processing software and a rejection mechanism. The mask image is collected through a 4K line array camera, and combined with the traditional BLOB detection method and deep learning method, the mask can be detected Automatic detection of defects.
The automated detection of mask defects is achieved, the detection efficiency and accuracy are improved, the cost is reduced, and the quality of product quality is ensured.
Smart Images

Figure CN114527075B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mask production, and in particular to a mask defect detection device and method. Background Art
[0002] With the acceleration of industrialization and urbanization, air pollution is becoming more and more serious. Masks, as an important protective product for epidemic prevention and control, have become an indispensable life dependency. In the mass production process of masks, due to various reasons such as raw materials, production machines and personnel operation, many kinds of defective mask products will be produced. Manual inspection, that is, relying on a large number of online quality inspectors to conduct offline inspection of masks, can achieve certain quality control, but it is easy to cause personnel fatigue, time-consuming and low efficiency. The manual visual inspection method is easily affected by subjective factors such as the inspector's technical quality, experience, and eye resolution and fatigue. It lacks accuracy and standardization and cannot guarantee normal product quality. These problems will directly lead to the low efficiency of missing detection and reduce the profits of manufacturers, thereby reducing the competitiveness of mask manufacturers' products and may eventually be eliminated by the market. Therefore, the research and development of automatic defect detection devices is imminent and urgent. Summary of the invention
[0003] In view of the shortcomings of the prior art, the present invention provides a mask defect detection device and method to solve the technical problems of low efficiency, high cost and unguaranteed quality in the current mask inspection through manual inspection.
[0004] The present invention is implemented through the following technical scheme: a mask defect detection device, including a device cabinet, on which are respectively installed: a feeding mechanism, providing masks to be detected; a three-stage belt line conveying mechanism, conveying masks to be detected; an image acquisition mechanism, collecting images of the masks to be detected; image processing software, judging the collected mask images according to preset mask standards and detection algorithms and giving good or defective results; a rejection mechanism, rejecting defective products given by the image processing software; a control system, used to electrically connect the feeding mechanism, the conveying mechanism, the image acquisition mechanism, the image processing software and the rejection mechanism.
[0005] Preferably, the image acquisition mechanism includes: a bracket for fixing the camera; a 4K line array camera installed on the bracket and electrically connected to the image processing software; a fixed-focus FA lens that matches the interface of the 4K line array camera and can fine-tune the aperture and focal length; and a photoelectric detection switch and encoder module that are electrically connected to the 4K line array camera; wherein two groups of the 4K line array cameras are respectively located directly below and directly above the gap between each two adjacent sections of the belt.
[0006] Preferably, the image acquisition mechanism also includes: four groups of high-brightness linear light sources; two groups of the high-brightness linear light sources are respectively located directly above and directly below the gap between each two adjacent belt sections, and the other two groups of the high-brightness linear light sources are respectively located 45° to the side of the gap between each two adjacent belt sections, that is, the high-brightness linear light sources respectively adopt a backlighting method with the irradiation direction facing the FA lens and a front lighting method with an angle of 45° to the central axis of the 4K linear array camera; to complete the lighting of the mask to be inspected.
[0007] Preferably, the feeding mechanism is used to connect with the upstream mask production conveyor line to receive the masks to be tested conveyed by the upstream mask production conveyor line.
[0008] Preferably, the conveying mechanism includes: a first conveying belt, a second conveying belt and a third conveying belt; and a servo motor for driving the first conveying belt, the second conveying belt and the third conveying belt to operate; the mask to be tested is conveyed between the first conveying belt, the second conveying belt and the third conveying belt.
[0009] Preferably, the rejection mechanism comprises: an air blowing cylinder located at the discharge end of the conveying mechanism and a defective product collection box located directly below the air blowing nozzle of the air blowing cylinder.
[0010] The present invention also provides the following technical solution: a mask defect detection method, which is performed using the mask defect detection device described above, and the detection defect items of the detection method include but are not limited to the following five categories: empty mask bags / twin masks / half masks, mask wrinkles, mask membrane joints, mask ear strap integrity detection and mask ear strap pressure defect detection.
[0011] Preferably, the detection method comprises the following steps:
[0012] S1. Use a 4K linear array camera to collect the background image of the mask to be detected and the image of the mask to be detected, and subtract the two images to obtain a difference image, which is recorded as Image_Sub;
[0013] S2, cropping the difference image Image_Sub from the original acquired image to obtain the target mask region image Image_MaskRegion;
[0014] Among them, the steps of the detection method for the two detection items of empty mask bag / twin masks / half mask and mask wrinkles include:
[0015] (a) performing preprocessing operations such as image graying and image binarization on the target mask region image Image_MaskRegion, and using the region area and geometric shape features to screen out the image region of the defect type to be judged, recorded as ToJudgeRegion, and cropping the image region of the defect type to be judged from the original acquired image;
[0016] (b) For the image region ToJudgeRegion of the defect type to be determined, if the area and geometric shape characteristics of the region do not conform to the pre-set feature range of the mask, it is directly determined to be a defective product; if the area and geometric shape characteristics of the region conform to the pre-set feature range of the mask, the image of the defect type to be determined is cached and reserved for using a deep learning method to determine whether it is a highly overlapping twin mask, thereby avoiding the risk of misjudging the highly overlapping twin masks;
[0017] S3. For the cached image of the defect type to be determined after the above steps, when detecting the integrity of the mask ear straps and the mask ear strap pressure defect, since the position of the mask ear straps relative to the mask body is relatively random, the traditional detection method may result in misjudgment or failure to detect. Therefore, it is considered to use deep learning to detect the integrity of the mask ear straps and the mask ear strap pressure defect.
[0018] Preferably, the steps of the detection method of the mask membrane joint detection item specifically include:
[0019] (a) Taking into account the color characteristics of the mask membrane joint, on the basis of completing the above detection items, when performing membrane joint detection, the target mask region image Image_MaskRegion is converted from the RGB space to the HSV space using a color space conversion algorithm, and the channel-separated image is subjected to image binarization using the S channel image, and the membrane joint region is screened out using the regional area and geometric shape features, which is recorded as MoJieTouRegion;
[0020] (b) If the membrane joint area MoJieTouRegion screened out from the above target mask area is not empty, the detection result is judged as a defective product. If the membrane joint area MoJieTouRegion screened out from the above target mask area is empty, the image of the defect type to be determined is cached for use in subsequent detection steps.
[0021] Preferably, the steps of the method for detecting the mask ear strap integrity and the mask ear strap pressure defect detection items using a deep learning method specifically include:
[0022] (a) A large number of images of masks with qualified and unqualified ear straps under various light intensities and postures are collected and stored in two folders, OK and NG, as sample image sets for the deep learning classification model;
[0023] (b) Use a pre-trained binary classification deep learning model, set the main hyperparameters of model training, such as batch_size and learning_rate, use 70% of the total sample image set as the training image set of the training model, and train the pre-trained model;
[0024] (c) Use 20% of the total sample image set as test images for the training model and test the model trained with the set hyperparameters.
[0025] (d) Use 10% of the total sample image set as validation images for the training model to verify the classification effect of the model trained with the set hyperparameters.
[0026] The step (a) further comprises the following processing steps:
[0027] The cached images of the types of defects to be determined are collected and stored in the NG folder as a sample image set for the deep learning classification model; so that the entire detection method can be compatible with the situation where the twin masks have highly overlapped twin masks.
[0028] The beneficial effects of the present invention are:
[0029] The invention provides a mask defect detection device and method, which realizes automatic feeding through a feeding mechanism and a conveying mechanism, and conveys the mask to be detected to the bottom of an image acquisition mechanism. The image acquisition mechanism collects the image of the mask to be detected and transmits it to the image processing software, and processes it through a detection algorithm, and the processing information is fed back to the electrical control system, and then the electrical control system is used to control the rejection of defective products, thereby realizing automatic detection of the mask to be detected. The innovation of the invention lies in that the detection device provided by the invention is equipped with a linear array camera to complete the mask defect detection, and can be deployed quickly and flexibly in a modular manner, and the mask defect detection method provided by the invention uses a combination of a traditional BLOB detection method and a deep learning method to complete the detection of all items to be detected. The detection method has high stability, high detection efficiency, and high detection accuracy, so that the quality of the product after the device detection is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 A schematic diagram of the structure of a mask defect detection device provided by an embodiment of the present invention;
[0032] Figure 2 This is an overall flow chart of the mask detection method provided by an embodiment of the present invention.
[0033] In the figure: 1-feeding mechanism; 2-conveying mechanism; 21-first conveyor belt; 22-second conveyor belt; 23-third conveyor belt; 3-image acquisition mechanism; 31-camera 1; 32-lens 1; 33-light source 1; 34-light source 2; 35-light source 3; 36-light source 4; 37-photoelectric detection sensor; 38-encoder module; 39-camera 2; 310-lens 2; 4-rejection mechanism; 41-defective product blowing nozzle; 42-defective product collection box; 5-image processing software; 6-electrical control system; 7-mask to be tested. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Example
[0035] See also Figure 1-2 As shown: A mask defect detection device provided by the present invention includes: a device cabinet (not shown in the figure); a feeding mechanism 1, which provides masks to be detected; a three-stage belt line conveying mechanism 2, which conveys the masks to be detected; an image acquisition mechanism 3, which collects the images of the masks to be detected; image processing software 5, which judges the collected mask images according to the preset mask standards and detection algorithms and gives good or bad results; a rejection mechanism 4, which rejects the bad products given by the image processing software; and an electrical control system 6 connecting the feeding mechanism 1, the conveying mechanism 2, the image acquisition mechanism 3, the image processing software 5, and the rejection mechanism 4.
[0036] The device cabinet is used as the main body of the device. The feeding mechanism 1 is connected to the upstream mask production conveying mechanism to receive the masks to be tested conveyed by the upstream mask production conveying mechanism. The conveying mechanism 2 adopts a three-segment belt line conveying method installed on the cabinet. The control of the first conveying belt 21, the second conveying belt 22, and the third conveying belt 23 of the three-segment belt line adopts a synchronous belt method. The three-phase terminals of the servo motor controlling the three-segment belt line are controlled by a controller, and the horizontality of the belt line installation is strictly controlled to achieve the best transmission effect, so that the masks to be tested can be smoothly transmitted; the image acquisition mechanism 3 is used to collect the image of the mask to be tested 7 and pass the collected image to the image processing software 5. The image processing software 5 is installed in the computer equipped with the device. The detection algorithm in the image processing software detects the collected image and outputs the result of whether the mask to be tested is a good product or a defective product. And the detection result is passed to the electrical control mechanism 6, and the electrical control mechanism 6 controls the blowing nozzle 41 in the rejection mechanism 4 to reject the defective products, and the rejected defective masks are stored in the defective product collection box 42.
[0037] Specifically, in the present embodiment, the image acquisition mechanism 3 includes: 4K linear array cameras 31 and 39 mounted on the device cabinet by a fixed bracket, and FA lenses 32 and 310 connected to 31 and 39, and high-brightness line light sources 34 and 35 of the backlight mode facing the FA lens in the direction of light source illumination, and high-brightness line light sources 33 and 36 of the front lighting mode at 45° to the central axis of the camera. In addition, the image acquisition mechanism is equipped with a photoelectric detection switch 37 and an encoder module 38, which are used to control the timing of image acquisition and realize the acquisition of a complete mask image. The detection device provided by the present invention has two sets of image acquisition mechanisms, which are respectively installed in the gaps between the three belt lines, and are used to flexibly complete the detection of multi-faceted defects of various types of masks.
[0038] In addition, the present invention also provides a mask defect detection method, the detection defect items of the detection method include but are not limited to the following five categories: mask empty bag / twin masks / half mask, mask wrinkles, mask membrane joints, mask ear strap integrity detection and mask ear strap pressure defect detection, the specific process of the detection algorithm is as follows Figure 2 As shown, the specific steps of the detection algorithm are as follows:
[0039] S1, collecting the background image of the mask to be detected and the image of the mask to be detected through a camera connected to the image processing software, and subtracting the two images to obtain a difference image, which is recorded as Image_Sub;
[0040] S2, cutting out the difference image Image_Sub from the original collected image to obtain the target mask region image Image_MaskRegion;
[0041] The steps of the detection method for the two detection items of empty mask bag / twin masks / half mask and mask wrinkles include:
[0042] S3, performing preprocessing operations such as image graying and image binarization on the target mask region image Image_MaskRegion, and using the regional area and geometric shape features to screen out the image region of the defect type to be judged, recorded as ToJudgeRegion, and cutting out the image region of the defect type to be judged from the original collected image;
[0043] S4. For the image region ToJudgeRegion of the defect type to be determined, if the area and geometric shape characteristics of the region do not meet the pre-set feature range of the mask, it is directly determined to be a defective product. If the area and geometric shape characteristics of the region meet the pre-set feature range of the mask, the image of the defect type to be determined is cached and reserved for using a deep learning method to determine whether it is a highly overlapping twin masks, thereby avoiding the risk of misjudging the highly overlapping twin masks;
[0044] The steps of the test method for the mask membrane joint test item include:
[0045] S5. Considering the color characteristics of the mask membrane joint, on the basis of completing the above detection items, when performing membrane joint detection, the target mask region image Image_MaskRegion is converted from the RGB space to the HSV space using a color space conversion algorithm, and the channel-separated image is subjected to image binarization using an S channel image, and the membrane joint region is screened out using the regional area and geometric shape features, which is recorded as MoJieTouRegion;
[0046] S6. If the membrane joint area MoJieTouRegion selected from the above target mask area is not empty, the detection result is judged as a defective product. If the membrane joint area MoJieTouRegion selected from the above target mask area is empty, the image of the defect type to be determined is cached for use in subsequent detection steps;
[0047] S7. For the cached defect type image to be determined after the above steps, when detecting the integrity of the mask ear straps and the mask ear strap pressure defects, since the position of the mask ear straps relative to the mask body is relatively random, the traditional detection method may result in misjudgment or failure to detect, so it is considered to use a deep learning method to perform mask ear strap integrity and mask ear strap pressure defect detection;
[0048] The main steps of using deep learning to detect mask ear strap integrity and mask ear strap defects include:
[0049] S8. Collect a large number of images of masks with qualified and unqualified ear straps under various light intensities and postures, and store them in two folders, OK and NG, as sample image sets for the deep learning classification model;
[0050] S9. Use the pre-trained binary classification deep learning model, set the main hyperparameters of model training, such as batch_size and learning_rate, use 70% of the total sample image set as the training image set of the training model, and train the pre-trained model;
[0051] S10. Use 20% of the total sample image set as test images for the training model to test the model trained with the set hyperparameters.
[0052] S11. Use 10% of the total sample image set as validation images for the training model to verify the classification effect of the model trained with the set hyperparameters.
[0053] The step S8 also includes the following processing steps:
[0054] S81. Collect the cached images of the types of defects to be determined and store them in the NG folder as a sample image set for the deep learning classification model; so that the entire detection method can be compatible with the situation where the twin masks have highly overlapped twin masks.
[0055] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A mask defect detection method is performed using a mask defect detection device, the mask defect detection device comprising a device cabinet, characterized in that: The device cabinets are respectively equipped with: The feeding mechanism provides masks to be tested; Three-stage belt conveyor mechanism to convey masks to be tested; An image acquisition mechanism, for acquiring the image of the mask to be detected; Image processing software, which judges the collected mask images according to the preset mask standards and detection algorithms and gives good or bad results; Rejection mechanism, to reject defective products given by image processing software; A control system, used for electrically connecting the feeding mechanism, the conveying mechanism, the image acquisition mechanism, the image processing software and the rejection mechanism; The image acquisition mechanism includes: a bracket for fixing the camera; a 4K line array camera installed on the bracket and electrically connected to the image processing software; a fixed-focus FA lens matching the interface of the 4K line array camera and capable of fine-tuning the aperture and focal length; and a photoelectric detection switch and encoder module electrically connected to the 4K line array camera; Two groups of the 4K linear array cameras are respectively located directly below and directly above the gap between each two adjacent belt sections; The image acquisition mechanism also includes: four groups of high-brightness linear light sources; two groups of the high-brightness linear light sources are respectively located directly above and directly below the gap between each two adjacent sections of the belt, and the other two groups of the high-brightness linear light sources are respectively located 45° to the side of the gap between each two adjacent sections of the belt, that is, the high-brightness linear light sources respectively use a backlighting method with the irradiation direction facing the FA lens and a front lighting method with an angle of 45° to the central axis of the 4K linear array camera; complete the lighting of the mask to be tested; The detection defect items of the detection method include the following five categories: empty mask bag / twin masks / half mask, mask wrinkles, mask membrane joints, mask ear strap integrity detection and mask ear strap pressure defect detection; The detection method comprises the following steps: S1. Use a 4K linear array camera to collect the background image of the mask to be detected and the image of the mask to be detected, and subtract the two images to obtain a difference image Image_Sub; S2, cropping the difference image Image_Sub from the original acquired image to obtain the target mask region image Image_MaskRegion; Among them, the steps of the detection method for the two detection items of empty mask bag / twin masks / half mask and mask wrinkles include: S3, performing image graying and image binarization preprocessing operations on the target mask region image Image_MaskRegion, and using the regional area and geometric shape features to screen out the image region ToJudgeRegion of the defect type to be judged, and cutting out the image region ToJudgeRegion of the defect type to be judged from the original collected image; S4. For the image region ToJudgeRegion of the defect type to be determined, if the area and geometric shape characteristics of the region do not meet the pre-set feature range of the mask, it is directly determined to be a defective product. If the area and geometric shape characteristics of the region meet the pre-set feature range of the mask, the image of the defect type to be determined is cached and reserved for using a deep learning method to determine whether it is a highly overlapping twin masks, thereby avoiding the risk of misjudging the highly overlapping twin masks; The steps of the detection method of the mask membrane joint detection item specifically include: S5. Taking into account the color characteristics of the mask membrane joint, on the basis of completing the above-mentioned detection items, when performing membrane joint detection, the target mask area image Image_MaskRegion is converted from RGB space to HSV space using a color space conversion algorithm, and the channel-separated image is subjected to image binarization using an S channel image, and the membrane joint area MoJieTouRegion is screened out using regional area and geometric shape features; S6. If the membrane joint region MoJieTouRegion screened out from the above target mask region image Image_MaskRegion is not empty, the detection result is judged as a defective product. If the membrane joint region MoJieTouRegion screened out from the above target mask region image Image_MaskRegion is empty, the image of the defect type to be determined is cached for use in subsequent detection steps; S7. For the cached defect type image to be determined after the above steps, when detecting the integrity of the mask ear straps and the mask ear strap pressure defects, a deep learning method is used to detect the integrity of the mask ear straps and the mask ear strap pressure defects; The steps of the method for detecting the integrity of the mask ear straps and the defects of the mask ear straps using deep learning methods specifically include: S8. Collect a large number of images of masks with qualified and unqualified ear straps under various light intensities and postures, and store them in two folders, OK and NG, as sample image sets for the deep learning classification model; S9. Use the pre-trained binary classification deep learning model, set the main hyperparameters of model training, including batch_size and learning_rate, use 70% of the total sample image set as the training image set of the training model, and train the pre-trained model; S10, using 20% of the total sample image set as test images for the training model, and testing the model trained with the set hyperparameters; S11. Use 10% of the total sample image set as validation images for the training model to verify the classification effect of the model trained with the set hyperparameters. Step S8 also includes the following processing steps: The cached images of the types of defects to be determined are collected and stored in the NG folder as a sample image set for the deep learning classification model; so that the entire detection method is compatible with the situation where twin masks have highly overlapping twin masks.
2. A mask defect detection method according to claim 1, characterized in that: The feeding mechanism is used to connect with the upstream mask production conveyor line to receive the masks to be tested conveyed by the upstream mask production conveyor line.
3. A mask defect detection method according to claim 1, characterized in that: The conveying mechanism includes: a first conveying belt, a second conveying belt and a third conveying belt; and a servo motor for driving the first conveying belt, the second conveying belt and the third conveying belt to operate; the mask to be tested is conveyed between the first conveying belt, the second conveying belt and the third conveying belt.
4. A mask defect detection method according to claim 1, characterized in that: The rejecting mechanism comprises: an air blowing cylinder located at the discharge end of the conveying mechanism and a defective product collection box located directly below the air blowing nozzle of the air blowing cylinder.
Citation Information
Patent Citations
Mask defect detecting device and method
CN109374635A