Cigarette perforation quality detection device, method, equipment and medium
By using a deep learning-based cigarette perforation quality inspection device, which combines industrial cameras and image preprocessing technology with Faster RCNN and ResNet50, the automatic detection of cigarette perforation location and diameter is achieved. This solves the problems of low efficiency and large error in existing technologies, and improves the detection speed and accuracy.
Patent Information
- Application Number
- CN202310201664.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-03-06
AI Technical Summary
Existing technologies for detecting the quality of perforated cigarettes are inefficient and rely on manual visual inspection, resulting in a heavy workload for inspectors and significant errors.
A deep learning-based cigarette punching quality inspection device is adopted. It acquires images through an industrial camera, combines image preprocessing and deep learning neural networks to automatically identify the punching location and diameter of cigarettes, and uses Faster RCNN and ResNet50 for target detection and feature extraction to improve detection accuracy and speed.
It enables precise positioning and hole diameter measurement of cigarette punching quality, improves detection speed and accuracy, and reduces errors caused by manual operation.
Smart Images

Figure CN116188438B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of industrial detection and computer vision, and particularly relates to a cigarette perforation quality detection device, method and equipment based on deep learning and a storage medium. BACKGROUND
[0002] In the cigarette production process, cigarette perforation is to solve the problem of cigarette draw resistance and ventilation degree, and the most commonly used quality detection of cigarette perforation at present is usually manual visual detection by a microscope. Although the number of cigarette perforations can be directly counted, once the detection quantity is too large, it will bring a great workload to the detection personnel, and the manual visual detection efficiency is low. Computer vision is increasingly used in industrial detection, and currently many enterprises use machine vision to detect cigarette perforation quality. Mainly by detecting the threshold difference between the cigarette perforation area and the non-perforation area, the cigarette perforation area on the cigarette is detected, and the quality of the cigarette perforation is evaluated. In recent years, the application of target detection based on deep learning has made machine vision more widely used in the industrial field. Especially in target detection and target positioning, it shows higher superiority. SUMMARY
[0003] Therefore, the purpose of the present application is to provide a cigarette perforation quality detection device, method, equipment and storage medium based on deep learning, which can accurately position and measure the diameter of the cigarette perforation, improve the detection speed and accuracy of the cigarette perforation quality, and greatly improve the convenience of manual detection. The specific scheme is as follows:
[0004] In a first aspect, the present application discloses a cigarette perforation quality detection device based on deep learning, comprising:
[0005] An image acquisition module is configured to acquire an image of a to-be-detected cigarette under the irradiation of a preset illumination device by an industrial camera, so as to obtain a perforation image of the to-be-detected cigarette.
[0006] An image processing module is configured to acquire the perforation image output by the image acquisition module, and pre-process the perforation image of the to-be-detected cigarette according to a preset image pre-processing method, so as to obtain a pre-processed perforation image.
[0007] A detection module is configured to acquire a target training model based on a deep learning neural network and the pre-processed perforation image, and process the perforation image of the to-be-detected cigarette by using the target training model and a preset image recognition algorithm, so as to determine the number of holes of the to-be-detected cigarette and the diameter of the holes of the to-be-detected cigarette.
[0008] Optionally, the image acquisition module comprises:
[0009] An image acquisition unit is configured to install the lighting device and the industrial camera at fixed positions and maintain a preset angle range with a detection area respectively, so as to acquire a perforation image of the cigarette to be detected located on the detection area.
[0010] Optionally, the image processing module comprises:
[0011] An image classification submodule is configured to classify the perforation image of the cigarette to be detected according to a preset classification rule, so as to obtain training samples, verification samples and test samples.
[0012] An image processing submodule is configured to perform denoising processing, contrast enhancement processing and foreground-background classification processing on the training samples, so as to obtain the preprocessed perforation image.
[0013] Optionally, the image processing submodule comprises:
[0014] A classification processing unit is configured to perform the foreground-background classification processing on the training samples after the denoising processing and the contrast enhancement processing by using a region growing algorithm, and filter a classification result obtained after the foreground-background classification processing based on a preset rule, so as to obtain the preprocessed perforation image.
[0015] Optionally, the detection module comprises:
[0016] A training unit is configured to train a target detection network by using a preset data set, so as to obtain an initialized training model.
[0017] A first model acquisition unit is configured to input the preprocessed perforation image into the initialized training model for training, so as to obtain a first training model.
[0018] A target model acquisition unit is configured to train the first training model by using the test samples and the verification samples, so as to obtain the target training model.
[0019] Optionally, the detection module comprises:
[0020] A detection unit is configured to detect the perforation image of the cigarette to be detected by using the target training model, so as to obtain a detection result, and determine a hole number of the cigarette to be detected and a perforation position of the cigarette to be detected based on the detection result.
[0021] Optionally, the detection module comprises:
[0022] A binarization processing unit is configured to perform binarization processing on the perforation image of the cigarette to be detected, so as to obtain a binarization-processed image.
[0023] An edge image acquisition unit is configured to identify the binary-processed image by using the preset image recognition algorithm to acquire a perforation edge image of the cigarette to be detected.
[0024] A hole diameter determination unit is configured to determine the hole diameter of the cigarette to be detected based on the perforation edge image of the cigarette to be detected and the perforation position of the cigarette to be detected.
[0025] In a second aspect, the present application discloses a cigarette perforation quality detection method based on deep learning, comprising:
[0026] An industrial camera is used to capture an image of the cigarette to be detected under the irradiation of a preset lighting device to obtain a perforation image of the cigarette to be detected.
[0027] A preset image preprocessing method is used to preprocess the perforation image of the cigarette to be detected to obtain a preprocessed perforation image.
[0028] A target training model is acquired based on a deep learning neural network and the preprocessed perforation image, and the target training model and a preset image recognition algorithm are used to process the perforation image of the cigarette to be detected to determine the number of holes of the cigarette to be detected and the hole diameter of the cigarette to be detected.
[0029] In a third aspect, the present application discloses an electronic device, comprising:
[0030] A memory is configured to save a computer program.
[0031] A processor is configured to execute the computer program to implement the steps of the cigarette perforation quality detection method based on deep learning.
[0032] In a fourth aspect, the present application discloses a computer readable storage medium configured to save a computer program, and the computer program is executed by a processor to implement the steps of the cigarette perforation quality detection method based on deep learning.
[0033] From the above, the application discloses a kind of based on deep learning's cigarette punch quality detection device, image acquisition module, for by industrial camera to the image acquisition of the cigarette to be detected under the illumination of preset illumination equipment, to obtain the punch image of the cigarette to be detected;Image processing module is used to obtain the punch image output by the image acquisition module, and according to the preset image preprocessing method, the punch image of the cigarette to be detected is preprocessed, and the preprocessed punch image is obtained;Detection module is used to obtain target training model based on deep learning neural network and the preprocessed punch image, and the punch image of the cigarette to be detected is processed using the target training model and preset image recognition algorithm, to determine the hole number of the cigarette to be detected and the hole diameter of the cigarette to be detected.It can be seen that the application is an automatic identification cigarette punch quality device, which uses an illumination device to illuminate the filter area on the cigarette, enhances the contrast between the cigarette punch and the filter area, and obtains a clear cigarette punch image;Industrial camera is used to shoot the punch image on the cigarette to be detected, and the punch image is sent to the image preprocessing system to obtain the edge image of the cigarette punch;Finally, the preprocessed image is input into the detection system using deep learning neural network, model training is carried out, and finally the trained model is used to detect the cigarette punch position, count the number of punches and measure the hole diameter of the real-time collected cigarette image.The speed and quality of cigarette punch detection are improved, and the error caused by manual operation is eliminated. BRIEF DESCRIPTION OF DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor.
[0035] Figure 1 It is a schematic diagram of a cigarette punch quality detection device based on deep learning disclosed by the present application.
[0036] Figure 2 It is a schematic diagram of the structure of a cigarette punch quality detection device based on deep learning disclosed by the present application.
[0037] Figure 3 It is a flowchart of a cigarette punch quality detection method based on deep learning disclosed by the present application.
[0038] Figure 4 It is a flowchart of a cigarette punch quality detection method based on deep learning disclosed by the present application.
[0039] Figure 5A structure diagram of an electronic device disclosed in the present application. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0041] In the prior art, the most commonly used quality detection for cigarette perforation is usually manual visual detection by using a microscope. Although the number of cigarette perforations can be directly counted, once the detection quantity is too large, it will bring a great workload to the detection personnel, and the manual visual detection efficiency is low. To solve the above problems, the present application discloses a cigarette perforation quality detection device based on deep learning, which can improve the detection speed and accuracy of cigarette perforation quality and eliminate errors caused by manual operation.
[0042] Referring to Figure 1 The embodiment of the present application discloses a cigarette perforation quality detection device based on deep learning, which comprises:
[0043] The image acquisition module 11 is used for image acquisition of the to-be-detected cigarette under the irradiation of the preset lighting device by the industrial camera, so as to obtain the perforation image of the to-be-detected cigarette.
[0044] In the embodiment, the quality detection of cigarette perforation first acquires the image of the cigarette. The image acquisition module can specifically comprise: an image acquisition unit, which is used for installing the lighting device and the industrial camera at a fixed position and maintaining a preset angle range with the detection area respectively, so as to acquire the perforation image of the to-be-detected cigarette located on the detection area. As shown in Figure 2 As shown in the figure, two lighting devices are installed above and below the vertical direction of the detection area, and the angles between the two industrial cameras and the detection area are 15°-25°. Among them, the lighting device illuminates the cigarette filter in the fixed detection area, reduces the interference of the external environment on the image acquisition of the cigarette perforation area, and the industrial camera is used for acquiring the image of the cigarette perforation. At the same time, the industrial camera is connected with the image processing module through a cable, and the perforation image of the to-be-detected cigarette is sent to the image processing module.
[0045] The image processing module 12 is used for acquiring the perforation image output by the image acquisition module, and pre-processing the perforation image of the to-be-detected cigarette according to a preset image preprocessing method, to obtain a pre-processed perforation image.
[0046] In the embodiment, the image processing module comprises: an image classification submodule, configured to classify the perforation image of the to-be-detected cigarette according to a preset classification rule to obtain training samples, verification samples and test samples; and an image processing submodule, configured to perform denoising processing, contrast enhancement processing and foreground-background classification processing on the training samples to obtain the preprocessed perforation image. Before classification, the LabelImage tool is used to label the perforation on the collected image, the region of the cigarette perforation is calibrated, the position of the hole in the image is obtained, and the xml form is saved. Further, the image processing submodule comprises: a classification processing unit, configured to perform the foreground-background classification processing on the training samples after the denoising processing and the contrast enhancement processing by using a region growing algorithm, and to filter the classification result obtained after the foreground-background classification processing based on a preset rule to obtain the preprocessed perforation image. It should be noted that in a specific embodiment, Faster RCNN is selected as the target detection network, ResNet50 is selected as the backbone network for training, and the self-data set ImageNet is used as the pre-training model. Since the anchor mechanism of the RPN (Region Proposal Network) network in Faster RCNN calculates the foreground-background probability and the regression offset of the candidate frame for each anchor point when generating the candidate region frame, the RPN network performs redundant calculation on the anchor point that does not contain the target. Therefore, the present application emphasizes that the foreground-background pre-classification is performed on the detection image, the classification result is used as prior information for filtering the anchor point, the anchor point that does not contain the target is deleted, the effective information of the anchor point in the RPN network is fully utilized, and thus the accuracy and speed of target detection are improved. Specifically, the region growing algorithm is used to perform foreground-background classification on the image. A first seed point is selected at the position of (10, 10) to (20, 20) on the image, the remaining seed points are selected in the range of 70 to 130 pixels in the length and width of the image and are put into a stack A, and the region growing rules are set. A matrix with the same size as the input image is set, and the values in the matrix are set to 1. The seed points in A are selected, and the seed point position (x0, y0) is set. The matrix (x0, y0) is set to 0 with (x0, y0) as the current point, and the 8-neighbor pixels (x i , y i ) of the current point (x0, y0) are compared. The pixel points (x i , y i ) with a difference value less than a threshold value and a value of 1 in the matrix are merged with the current point, the matrix (x i , y i ) is updated, and the process is repeated until the stack A is empty. The matrix (x i , y i ) is converted into a binary image, and the foreground-background classification of the image is completed.) is pushed into stack A. Repeat the above steps until the stack A is empty, the growth is over. The screened image is used as training data for Faster RCNN.
[0047] The detection module 13 is configured to obtain a target training model based on a deep learning neural network and the preprocessed punched image, and process the punched image of the to-be-detected cigarette by using the target training model and a preset image recognition algorithm, so as to determine the hole number of the to-be-detected cigarette and the hole diameter of the to-be-detected cigarette.
[0048] In the embodiment, the detection module includes a training unit configured to train a target detection network by using a preset data set to obtain an initialized training model; a first model obtaining unit configured to input the preprocessed punched image into the initialized training model for training to obtain a first training model; and a target model obtaining unit configured to train the first training model by using the test sample and the verification sample to obtain the target training model. The detection module further includes a detection unit configured to detect the punched image of the to-be-detected cigarette by using the target training model to obtain a detection result, and determine the hole number of the to-be-detected cigarette and the punching position of the to-be-detected cigarette based on the detection result. That is, the target detection network is first trained by using the preset data set to obtain the initialized training model, then the preprocessed punched image is input into the initialized training model for training to obtain the first training model, and then the first training model is trained by using the test sample and the verification sample to obtain the target training model. It should be noted that the first training model is trained again by using the test sample and the training sample, so that the training model is more in line with the requirements, the detection result is more accurate, the weight is adjusted, and a training model that is more in line with the requirements, i.e., the target training model, is obtained. Finally, the punched image of the to-be-detected cigarette is detected by using the target training model to obtain a detection result, and the hole number of the to-be-detected cigarette and the punching position of the to-be-detected cigarette are determined based on the detection result. The trained model needs to be exported to a Python environment, and the interface display of the hole number and the hole diameter is realized by calling a dynamic link library through C++ to count the number of cigarette holes.
[0049] In a specific embodiment, the model selects Faster RCNN as the target detection network. Faster RCNN improves the speed of target detection and classification by integrating feature extraction, candidate region extraction, target region position regression, and target classification into one network. Moreover, the region proposal network (RPN) proposed by the network model can accurately speed up the detection speed of the entire model. ResNet50 is selected as the backbone network for training. The backbone network is a neural network used for feature extraction, which is used to extract feature information of the collected image, generate a feature map, and provide the RPN network. First, the network initialization model is pre-trained using ImageNet. The trained Fast R-CNN model is used to train the new RPN network. Since the Faster R-CNN model shares convolutional layers, the shared convolutional layer parameters are fixed during training, and only the RPN network parameters are adjusted.
[0050] After determining the hole number of the to-be-detected cigarette and the punching position of the to-be-detected cigarette, the image needs to be processed to further determine the hole diameter of the to-be-detected cigarette. The detection module comprises: a binary processing unit configured to perform binary processing on the punching image of the to-be-detected cigarette to obtain a binary processed image; an edge image acquisition unit configured to identify the binary processed image using the preset image recognition algorithm to obtain a punching edge image of the to-be-detected cigarette; and a hole diameter determination unit configured to determine the hole diameter of the to-be-detected cigarette based on the punching edge image of the to-be-detected cigarette and the punching position of the to-be-detected cigarette. That is, the collected image is again binary processed, and the Canny operator is used to obtain the punching edge image of the cigarette. According to the position of the cigarette hole detected by the neural network and the edge of the cigarette hole, the diameter of the hole is calculated. Finally, the hole number and the diameter of the hole of the to-be-detected cigarette are determined, so that the quality of the cigarette hole is detected.
[0051] As can be seen, the cigarette punching quality detection device based on deep learning disclosed in the application comprises an image acquisition module, which is configured to acquire an image of a to-be-detected cigarette under the irradiation of a preset lighting device by an industrial camera, so as to obtain a punching image of the to-be-detected cigarette; an image processing module, which is configured to acquire the punching image output by the image acquisition module, and pre-process the punching image of the to-be-detected cigarette according to a preset image pre-processing method, so as to obtain a pre-processed punching image; and a detection module, which is configured to acquire a target training model based on a deep learning neural network and the pre-processed punching image, and process the punching image of the to-be-detected cigarette by using the target training model and a preset image recognition algorithm, so as to determine the number of holes of the to-be-detected cigarette and the hole diameter of the to-be-detected cigarette. As can be seen, the device for automatically identifying the punching quality of a cigarette is used to illuminate the filter area on the cigarette by using a lighting device, to enhance the contrast between the punching and other areas of the filter, to obtain a clear punching image of the cigarette, to capture the punching image on the to-be-detected cigarette by using an industrial camera, to send the punching image to an image pre-processing system to obtain an edge image of the punching of the cigarette, and finally to input the pre-processed image into a detection system by using a deep learning neural network, to perform model training, and to finally use the trained model to detect the punching position of the cigarette, to count the number of holes, and to measure the hole diameter of the real-time collected cigarette image. Thus, the speed and quality of the punching detection of the cigarette are improved, and the errors caused by manual operation are eliminated.
[0052] Referring to Figure 3 As shown in the drawings, the embodiment of the application discloses a cigarette punching quality detection method based on deep learning, which comprises the following steps:
[0053] In step S11, an image of a to-be-detected cigarette under the irradiation of a preset lighting device is acquired by an industrial camera, so as to obtain a punching image of the to-be-detected cigarette.
[0054] In step S12, the punching image of the to-be-detected cigarette is pre-processed according to a preset image pre-processing method, so as to obtain a pre-processed punching image.
[0055] In step S13, the pre-processed punching image is processed based on a deep learning neural network and a preset image recognition algorithm, so as to determine the number of holes of the to-be-detected cigarette and the hole diameter of the to-be-detected cigarette.
[0056] In the embodiment, as Figure 4As shown, first, an industrial camera and a preset lighting device are used to collect images of the to-be-detected cigarette, and the collected images are preprocessed, wherein the preprocessing includes denoising processing, threshold processing, and foreground and background classification processing, to obtain the processed images. Then, model training is performed, and the trained model and image data are used to detect the number of holes punched by the real-time collected cigarette. Further, a Canny operator is used to obtain a cigarette hole edge image, so as to determine the hole diameter of the cigarette, thereby completing the detection of the cigarette hole quality. It should be noted that the hole punching image of the to-be-detected cigarette used for deep learning is an image collected before deep learning, and the hole punching image of the to-be-detected cigarette finally detected is an image collected in real time after deep learning is completed.
[0057] As can be seen from the above, when detecting the cigarette hole quality, the present application first collects images of the to-be-detected cigarette under the irradiation of the preset lighting device by using the industrial camera, to obtain a hole punching image of the to-be-detected cigarette; the hole punching image of the to-be-detected cigarette is preprocessed according to a preset image preprocessing method, to obtain a preprocessed hole punching image; a target training model is obtained based on a deep learning neural network and the preprocessed hole punching image, and the target training model and a preset image recognition algorithm are used to process the hole punching image of the to-be-detected cigarette, to determine the number of holes of the to-be-detected cigarette and the hole diameter of the to-be-detected cigarette. As can be seen, the present application uses a method for automatically identifying the cigarette hole quality, uses the lighting device to illuminate the filter area on the cigarette, strengthens the contrast between the cigarette hole and other areas of the filter, and obtains a clear cigarette hole image; the industrial camera is used to shoot the hole punching image on the to-be-detected cigarette, and the hole punching image is sent to an image preprocessing system to obtain an edge image of the cigarette hole; finally, the deep learning neural network is used to input the preprocessed image into a detection system, to perform model training, and finally use the trained model to detect the cigarette hole position, count the number of holes, and measure the hole diameter of the real-time collected cigarette image. Therefore, the speed and quality of the cigarette hole detection are improved, and the errors caused by manual operation are eliminated.
[0058] Further, the present application embodiment also discloses an electronic device, Figure 5 The electronic device 20 structure diagram shown in the figure cannot be considered as any limitation on the use range of the present application.
[0059] Figure 5A structural schematic diagram of an electronic device 20 is provided in the embodiments of the present application. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is configured to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the related steps in the deep learning-based cigarette perforation quality detection method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the embodiments of the present application can be specifically an electronic computer.
[0060] In the embodiments of the present application, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited specifically herein; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited specifically herein.
[0061] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.
[0062] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the deep learning-based cigarette perforation quality detection method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program capable of completing other specific work.
[0063] Further, the present application further discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by the processor to implement the foregoing deep learning-based cigarette perforation quality detection method. The specific steps of the method can refer to the corresponding contents disclosed in the foregoing embodiments, which will not be repeated here.
[0064] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can refer to the method part.
[0065] Those skilled in the art will further appreciate that the units and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various examples have been described herein in terms of their functionality, which has been described generally and symbolically in flow charts. Having thus described the functionality of the examples, a person of ordinary skill in the art will be able to implement such functions in hardware, software, or a combination thereof without undue experimentation, and without undue experimentation, one skilled in the art will be able to implement such functions in hardware, software, or a combination thereof without undue experimentation. Various examples have been described as processes, which are generally designed to be implemented on a computer using one or more computer programs. However, one skilled in the art will recognize that the processes can be implemented in whole or in part by hardware, such as a machine having a processor and a memory, or a machine that is specially configured to perform the steps of the processes.
[0066] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in random access memory (RAM), flash memory, read-only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0067] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and are not otherwise intended to refer to the sequence, quantity, or importance of the elements. Also, the terms "comprises", "comprising", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements in the list, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0068] The above detailed description of the technical solutions provided by the present application has been described in detail, and the principles and implementation modes of the present application have been described in the text. The above description of the examples is only to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; in view of the above, the content of the description should not be understood as a limitation of the present application.
Claims
1. A deep learning-based device for detecting the quality of perforation in cigarettes, characterized in that, include: An image acquisition module is used to acquire images of the cigarette to be tested under the illumination of a preset lighting device using an industrial camera, so as to obtain a perforated image of the cigarette to be tested; wherein, the lighting device includes two lighting devices respectively installed above and below the vertical direction of the detection area; the industrial camera includes two cameras, and the angle between the two industrial cameras and the detection area is 15 degrees to 25 degrees respectively; An image processing module is used to acquire the punched image output by the image acquisition module, and to preprocess the punched image of the cigarette to be detected according to a preset image preprocessing method to obtain a preprocessed punched image; the preprocessing includes classifying the foreground and background of the image using a region growing algorithm, and using the classification result as prior information for filtering anchor points in the target detection network to delete anchor points that do not contain the target; The detection module is used to obtain a target training model based on a deep learning neural network and the preprocessed punched image, and to process the punched image of the cigarette to be detected using the target training model and a preset image recognition algorithm to determine the number of holes and the hole diameter of the cigarette to be detected; wherein, the deep learning neural network is Faster RCNN, its backbone network is ResNet50, and a Region Proposal Candidate Network (RPN) is used, and the anchor points of the RPN network are filtered using the foreground and background classification results.
2. The deep learning-based cigarette punching quality detection device according to claim 1, characterized in that, The image acquisition module includes: An image acquisition unit is used to install the lighting device and the industrial camera in a fixed position and maintain an angle within a preset range with the detection area to acquire a perforated image of the cigarette to be detected located in the detection area.
3. The deep learning-based cigarette punching quality detection device according to claim 1 or 2, characterized in that, The image processing module includes: The image classification submodule is used to classify the punched image of the cigarette to be detected according to a preset classification rule to obtain training samples, verification samples and test samples. The image processing submodule is used to perform denoising, contrast enhancement, and foreground / background classification on the training samples to obtain the preprocessed punched image.
4. The deep learning-based cigarette punching quality detection device according to claim 3, characterized in that, The image processing submodule includes: The classification processing unit is used to perform foreground and background classification processing on the training samples after the denoising and contrast enhancement processing using a region growing algorithm, and to filter the classification results obtained after the foreground and background classification processing based on preset rules to obtain the preprocessed punched image.
5. The deep learning-based cigarette punching quality detection device according to claim 4, characterized in that, The detection module includes: The training unit is used to train the object detection network using a pre-set dataset to obtain an initial training model; The first model acquisition unit is used to input the preprocessed punched image into the initial training model for training, so as to obtain the first training model. The target model acquisition unit is used to train the first training model using the test samples and the verification samples to obtain the target training model.
6. The deep learning-based cigarette punching quality detection device according to claim 5, characterized in that, The detection module includes: The detection unit is used to detect the perforated image of the cigarette to be detected using the target training model to obtain the detection result, and to determine the number of holes and the perforation position of the cigarette to be detected based on the detection result.
7. The deep learning-based cigarette punching quality detection device according to claim 6, characterized in that, The detection module includes: The binarization processing unit is used to perform binarization processing on the punched image of the cigarette to be detected, so as to obtain the binarized image. The edge image acquisition unit is used to identify the binarized image using the preset image recognition algorithm to obtain the perforation edge image of the cigarette to be detected. Aperture determination unit is used to determine the aperture of the cigarette to be tested based on the perforation edge image of the cigarette to be tested and the perforation position of the cigarette to be tested.
8. A deep learning-based method for detecting the quality of perforated cigarettes, characterized in that, include: An industrial camera is used to capture images of the cigarette to be tested under the illumination of a preset lighting device to obtain a perforated image of the cigarette to be tested; wherein, the lighting device includes two lighting devices respectively installed above and below the vertical direction of the detection area; the industrial camera includes two cameras, and the angle between the two industrial cameras and the detection area is 15 degrees to 25 degrees respectively. The perforated image of the cigarette to be detected is preprocessed according to a preset image preprocessing method to obtain a preprocessed perforated image; the preprocessing includes classifying the foreground and background of the image using a region growing algorithm, and using the classification result as prior information for filtering anchor points in the target detection network to delete anchor points that do not contain the target. A target training model is obtained based on a deep learning neural network and the preprocessed punched image. The target training model and a preset image recognition algorithm are used to process the punched image of the cigarette to be detected to determine the number of holes and the hole diameter of the cigarette to be detected. The deep learning neural network is Faster RCNN, its backbone network is ResNet50, and a Region Proposal Network (RPN) is used. The anchor points of the RPN network are selected using the foreground and background classification results.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the deep learning-based cigarette punching quality detection method as described in claim 8.
10. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the deep learning-based cigarette punching quality detection method as described in claim 8.
Citation Information
Patent Citations
Laser drilling detection device for cigarette filter tip
CN215894359U