CN117830245A - Cigarette appearance detection method, device and medium - Google Patents

Cigarette appearance detection method, device and medium Download PDF

Info

Publication number
CN117830245A
CN117830245A CN202311821888.0A CN202311821888A CN117830245A CN 117830245 A CN117830245 A CN 117830245A CN 202311821888 A CN202311821888 A CN 202311821888A CN 117830245 A CN117830245 A CN 117830245A
Authority
CN
China
Prior art keywords
cigarette
image
appearance
machine vision
detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311821888.0A
Other languages
Chinese (zh)
Inventor
田秋生
王立
刘强
李谧
张坤峰
张广军
程书根
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Tobacco Henan Industrial Co Ltd
Original Assignee
China Tobacco Henan Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Tobacco Henan Industrial Co Ltd filed Critical China Tobacco Henan Industrial Co Ltd
Priority to CN202311821888.0A priority Critical patent/CN117830245A/en
Publication of CN117830245A publication Critical patent/CN117830245A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Image Analysis (AREA)

Abstract

The disclosure relates to a method, a device and a medium for detecting appearance of cigarettes, and relates to the technical field of detection of appearance defects of cigarettes. Wherein the method comprises the following steps: obtaining a cigarette appearance image; detecting the cigarette appearance image by using a trained machine vision model, wherein the machine vision model is solved based on a machine vision algorithm, the machine vision algorithm is based on a YOLO detection algorithm, a network of the YOLO detection algorithm comprises a FReLU activation function, a convolution block attention module for introducing multi-frequency spectrum channel attention is added into the network, and a loss function uses Eiou loss; and generating a detection result. By the method, the types and the number of the cigarette defects can be determined, the detection efficiency and the accuracy of the cigarette defects are improved, and the short plates for manual detection are avoided.

Description

Cigarette appearance detection method, device and medium
Technical Field
The disclosure relates to the technical field of cigarette appearance defect detection, and in particular relates to a cigarette appearance detection method, device and medium.
Background
The quality detection of the appearance quality of the cigarettes in the tobacco industry mainly depends on subjective feelings of detection personnel to carry out defect recognition, has larger uncertainty on the judgment and accuracy of the detection of the appearance defects of the cigarettes, uses the traditional machine vision technology to carry out quality inspection in a small amount, has lower recognition accuracy of irregular defects of objects, is highly influenced by external environment, reduces production efficiency, and increases labor cost and management cost.
Disclosure of Invention
The present disclosure proposes a method, an apparatus, and a medium for detecting the appearance of a cigarette, which solve the technical problems: the defect identification is mainly carried out by relying on subjective feelings of detection personnel, larger uncertainty exists in the judgment and accuracy of the appearance defect detection of the cigarettes, quality inspection is carried out by using a small amount of traditional machine vision technology, the identification accuracy of irregular defects of objects is low, and the influence of external environment is high.
To solve the above technical problems, according to a first aspect of the present disclosure, a method for detecting an appearance of a cigarette is provided, including: obtaining a cigarette appearance image; detecting the cigarette appearance image by using a trained machine vision model, wherein the machine vision model is solved based on a machine vision algorithm, the machine vision algorithm is based on a YOLO detection algorithm, a network of the YOLO detection algorithm comprises a FReLU activation function, a convolution block attention module for introducing multi-frequency spectrum channel attention is added into the network, and a loss function uses Eiou loss; and generating a detection result.
In some embodiments, the detecting the cigarette appearance image using a machine vision model that has been trained, wherein training the machine vision model comprises: collecting cigarette defect images; preprocessing the cigarette defect image to obtain a first image; labeling the first image to obtain a second image; inputting the second image into a machine vision model, and outputting a third image; comparing the third image with the real label, and adjusting parameters of the machine vision model based on the comparison result; the machine vision model subjected to parameter adjustment is evaluated, and the machine vision model subjected to parameter adjustment is optimized based on an evaluation result.
In some embodiments, before the obtaining the cigarette appearance image, the method further includes: judging whether the generated cigarette appearance image has a position number or not; if the generated cigarette appearance image has a position number, continuously judging whether a cigarette is fixed at a clamping groove position in the generated cigarette appearance image; and if the cigarettes are fixed in the clamping groove positions in the generated cigarette appearance images, sending the cigarette appearance images.
In some embodiments, before the determining whether the generated cigarette appearance image has the position number, the method further includes: obtaining a cigarette appearance detection signal; opening a negative pressure switch of a negative pressure device based on the cigarette appearance detection signal; starting a servo motor; shooting the cigarette in the dynamic state by using an image generating device to obtain a fourth image; and generating a cigarette appearance image based on the fourth image.
In some embodiments, the generating a cigarette appearance image based on the fourth image comprises: cutting the fourth image to obtain a fifth image; and merging the fifth images to generate a cigarette appearance image.
In some embodiments, the fourth image is cropped using a rectangular cropping algorithm.
In some embodiments, if the generated cigarette appearance image has no position number or no cigarette is fixed in a clamping groove in the generated cigarette appearance image, closing a negative pressure switch of a negative pressure device; closing the servo motor; and turning off the image generating device.
According to a second aspect of the present disclosure, there is provided a cigarette appearance detection device, comprising: the acquisition module is used for acquiring the appearance image of the cigarette; the detection module is used for detecting the cigarette appearance image by using a trained machine vision model, wherein the machine vision model is solved based on a machine vision algorithm, the machine vision algorithm is based on a YOLO detection algorithm, a network of the YOLO detection algorithm comprises a FReLU activation function, a convolution block attention module for introducing multi-frequency spectrum channel attention is added into the network, and a loss function uses Eiou loss; and the generating module is used for generating a detection result.
According to a third aspect of the present disclosure, a method for detecting the appearance of a cigarette is provided, including: a memory; and a processor coupled to the memory, the processor configured to perform a method of detecting a cigarette appearance as described above based on instructions stored in the memory.
According to a fourth aspect of the present disclosure, a computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method of detecting a appearance of a cigarette as described above is provided.
By adopting the technical scheme, the embodiment of the disclosure has the beneficial technical effects that: the method and the device have the advantages that the identification of irregular defects of the object is remarkably superior to the traditional machine vision technology through the rapid screening of the AI model, the accuracy is higher, the influence of external environment is low, the detection effect is better than that of manual work, the model can be continuously and iteratively trained based on quality inspection data, the accuracy of the model is continuously improved, the production efficiency is improved, the product quality is ensured, and the labor cost and the management cost are reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure will be more clearly understood from the following detailed description with reference to the accompanying drawings.
Fig. 1 is a flow chart illustrating a method of detecting a cigarette appearance according to some embodiments of the present disclosure.
Fig. 2 is a schematic diagram illustrating a structure of an image capturing apparatus according to some embodiments of the present disclosure.
Fig. 3 is a block diagram illustrating a cigarette defect intelligent detection system according to some embodiments of the present disclosure.
Fig. 4 is a control logic diagram illustrating a PLC control program according to some embodiments of the present disclosure.
Fig. 5 is a schematic diagram illustrating determining whether an image can be transmitted according to some embodiments of the present disclosure.
Fig. 6 is a schematic diagram illustrating the cooperation of an image acquisition module, a PLC control module, and a cigarette appearance detection module according to some embodiments of the present disclosure.
Fig. 7 is a flow chart illustrating training of a model according to some embodiments of the present disclosure.
Fig. 8 is an integrated flow chart illustrating identifying the appearance of a cigarette according to some embodiments of the present disclosure.
Fig. 9 is a schematic diagram illustrating the structure of a FreLU activation function according to some embodiments of the present disclosure.
Fig. 10 is a schematic diagram illustrating a convolution block attention module incorporating attention directing multi-spectral channels in a network according to some embodiments of the present disclosure.
Fig. 11 is a network block diagram illustrating improvements according to some embodiments of the present disclosure.
Fig. 12 is a block diagram illustrating a cigarette appearance detection device according to some embodiments of the present disclosure.
Fig. 13 is a block diagram illustrating a cigarette appearance detection device according to further embodiments of the present disclosure.
FIG. 14 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
As shown in fig. 1, the steps of the method for detecting the appearance of a cigarette include steps 110 to 130.
At step 110, a cigarette appearance image is acquired.
In some embodiments, as shown in fig. 5, 6 and 8, before the obtaining the cigarette appearance image, the method further includes: judging whether the generated cigarette appearance image has a position number or not; if the generated cigarette appearance image has a position number, continuously judging whether a cigarette is fixed at a clamping groove position in the generated cigarette appearance image; and if the cigarettes are fixed in the clamping groove positions in the generated cigarette appearance images, sending the cigarette appearance images.
In some embodiments, as shown in fig. 4, before determining whether the generated cigarette appearance image has the position number, the method further includes: obtaining a cigarette appearance detection signal; opening a negative pressure switch of a negative pressure device based on the cigarette appearance detection signal; starting a servo motor; shooting the cigarette in the dynamic state by using an image generating device to obtain a fourth image; and generating a cigarette appearance image based on the fourth image.
In some embodiments, the generating a cigarette appearance image based on the fourth image comprises: cutting the fourth image to obtain a fifth image; and merging the fifth images to generate a cigarette appearance image. And clipping the fourth image by using a rectangular clipping algorithm.
In some embodiments, as shown in fig. 2, the test cigarette is first placed in the upper magazine 5; when the cigarettes move to the first position 1 and enter the cigarette clamping groove 4 of the first driving wheel 2, the negative pressure box is started, the ventilation groove on the cigarette clamping groove 4 adsorbs the cigarettes, the cigarettes cannot fall, when the first driving wheel 2 rotates anticlockwise to the second position 9, the first camera 8 and the second camera 10 near the second position 9 shoot the surfaces of the cigarettes, the cigarettes continue to rotate downwards to the position of the third camera 6, and the third camera 6 shoots the cigarette ends or the cigarette tails of the cigarettes. The cigarettes continue to rotate anticlockwise at the joint of the first driving wheel 2 and the second driving wheel 3, the first driving wheel 2 stops adsorbing, and the second driving wheel 3 adsorbs the cigarettes to the cigarette clamping groove 4. The cigarettes rotate clockwise on the second driving wheel 3 to reach the position of the fourth camera 7, the fourth camera 7 shoots the tail or the head of the cigarettes, and when the cigarettes continue to rotate clockwise to the third position 13, the fifth camera 13 and the sixth camera 11 shoot the surface of the overturned cigarettes. When the cigarettes rotate to the upper part of the storage box on the second driving wheel 3, the cigarette clamping groove 4 stops adsorbing, and finally the cigarettes are collected into the storage box.
In some embodiments, as shown in fig. 3, the cigarette appearance detection device comprises a cigarette mechanical transmission device, a PLC control module, an image acquisition module, an artificial intelligent module, a system management module and an image acquisition module, wherein the six industrial cameras are respectively arranged at different positions of the cigarette mechanical transmission device, the light source module is arranged around six camera heads to provide light for shooting high-quality images of cigarettes, the cameras are connected with the image acquisition preprocessing system, the PLC control module controls the cigarette mechanical transmission device to enable the stay positions of the cigarettes to correspond to the shooting positions of the cameras, the image acquisition module is connected with the artificial intelligent module through the ethernet, the artificial intelligent module establishes and trains an AI identification model of the appearance defects of the cigarettes through a deep learning algorithm, and the type and the number of the appearance defects of the cigarettes are intelligently judged by identifying images of the whole cigarettes processed by the image acquisition preprocessing system.
The PLC control module is mainly responsible for controlling mechanical equipment, and comprises camera assembly control, mechanical control and gas circuit control. The camera assembly controls the on-off state for managing the cameras and the light sources, and 6 cameras and four light sources are arranged in the system, as shown in fig. 2, so that the cameras are kept in an on state in the image acquisition process, the light sources are kept in a continuous on state, and the cameras and the light sources are turned off after the image acquisition is completed. The mechanical control module is mainly responsible for internal mechanical motion control, ensures that the transmission wheel performs circular motion at a uniform speed during image acquisition, and further ensures stable transmission of cigarettes. The gas path control module is responsible for the on-off control of gas path elements, the driving wheels in the system are provided with the gas path elements, and the controller is responsible for managing the on-off of the gas path, so that the two driving wheels can stably finish tasks when executing the cigarette alternating actions. The circuit control module mainly manages all circuits in the system, and the camera, the light source, the motor and the like are in a connection state only when image acquisition is carried out through relay control.
In some embodiments, as shown in fig. 4, the image acquisition module is developed using the c# language and is mainly responsible for processing the acquired images, including image acquisition, image cropping and image merging. The image acquisition is communicated with the PLC control module in a serial port mode, when a task is started, a command is transmitted through the serial port to start the camera and the light source, and when smoke is discharged out of the field of view of the camera, the camera automatically shoots and transmits the acquired image to the image acquisition module; the image clipping is mainly responsible for clipping the acquired image, noise possibly exists in the image due to the fixed focal length of the camera, and in order to solve the problem, a rectangular clipping algorithm is adopted, and the algorithm clips out a specific part of the image by formulating the coordinates and the size of a rectangular area so as to obtain the required image; the image combination is mainly responsible for combining the acquired images, six cameras are arranged in the equipment and used for shooting the images, therefore, six images with different angles can be shot in the transmission process of a single cigarette, a digital mark is arranged outside a clamping groove of a transmission wheel, and the system combines six images with the same mark into one piece by identifying the number of the clamping groove position on the image, so that the six images are shot by the same cigarette.
In some embodiments, the system management module is configured in a micro-service manner, and is developed by using Java language, and is mainly responsible for basic data management and overall collaboration management of the system, and specifically includes: task management, data set management, data labeling, data statistics and log management. The task management is communicated with the image acquisition module in a TCP/IP mode, when the task is started, the image acquisition module transmits the combined image to the task management module for temporary storage, and once the image acquisition is completed, the task management module communicates with the artificial intelligent module in a TCP/IP mode to inform the artificial intelligent module of data detection and analysis. The data set management module is responsible for effectively managing the data required by the model, and has the main responsibility of storing images of abnormal cigarettes for subsequent model training. The data labeling module is mainly used for labeling the data in the data set on line and is responsible for storing the labeled data so as to provide data support for model training. Data statistics mainly performs multidimensional statistics on data inside a system, such as: statistics of data sets, statistics of model training, statistics of detection results, log statistics and the like. The log management module is responsible for collecting operation logs in the system and storing log data so as to carry out operations such as audit, fault removal or performance analysis when required.
At step 120: and detecting the cigarette appearance image by using a trained machine vision model, wherein the machine vision model is solved based on a machine vision algorithm, the machine vision algorithm is based on a YOLO detection algorithm, a FReLU activation function is included in a network of the YOLO detection algorithm, a convolution block attention module for introducing multi-frequency spectrum channel attention is added in the network, and an Eiou loss is used by a loss function.
In some embodiments, as shown in fig. 6 and 7, the artificial intelligence module is developed in Python language, and its main tasks cover the artificial intelligence part of the system, specifically including the functions of machine vision algorithm, model training, and model detection. The machine vision algorithm improves the YOLO detection algorithm, simultaneously gives consideration to the model speed and the precision, has the effect exceeding the current YOLO series method, and has the advantages of higher reasoning speed and higher detection precision. Model training is mainly responsible for training tasks of machine vision models in a platform, the models adopt a Convolutional Neural Network (CNN) architecture, training is performed by using a pre-labeled data set, and the trained models are stored for later use. The model detection module is mainly responsible for analyzing and monitoring the cigarette data by using a trained model, and when the image acquisition is finished, the system management module sends the image to the model detection module in a TCP/IP communication mode, and the model detection module detects the data by using a machine vision algorithm and stores the detected data.
In some embodiments, as shown in fig. 8, a user places a cigarette to be detected into a loading bin of a mechanical device; the user creates a detection task in the system management module and starts task detection; the system management module informs the image acquisition module of starting an image acquisition task by using a TCP/IP communication mode; the image acquisition module sends a starting instruction to the PLC control module through serial port communication, the PLC control module sequentially starts the circuit, the camera, the light source, the gas circuit and the driving wheel immediately, and after the starting is finished, the PLC control module informs the image acquisition module that the starting is finished in a serial port communication mode, so that the image acquisition can be started; along with the uniform rotation of the two driving wheels, when cigarettes pass through the camera, the image acquisition module performs image acquisition operation on the cigarettes and performs cutting operation on acquired pictures. Six cameras are arranged in the device, wherein four cameras are used for shooting the side face of the cigarette, each camera covers a 180-degree angle, and two cameras are used for shooting the head part and the tail part of the cigarette, so that 720-degree acquisition is carried out on the whole cigarette. The system carries out image merging operation on six images with the same mark by identifying the numbers of the positions of the clamping grooves on the images so as to mark that the six images belong to the same cigarette; the image acquisition module judges whether cigarettes to be detected exist or not, and when cigarettes are not found in ten continuous clamping grooves, the image acquisition module is regarded as the completion of an image acquisition task, sends an instruction to the PLC control module in a serial port communication mode, and notifies that the image acquisition is completed; after receiving the notice of the completion of acquisition, the PLC control module sequentially stops the rotation of the driving wheel, turns off the camera, turns off the light source, turns off the gas circuit and turns off the circuit, and after all the equipment is turned off, the image acquisition module is notified of being completely turned off, and the image acquisition module notifies the artificial intelligent module to start image detection in a TCP/IP communication mode; the artificial intelligent module receives the image detection task and detects the acquired tobacco data by using a pre-trained model; after the artificial intelligent module finishes detection, the system management module is informed of the detection task completion through a TCP/IP communication mode, and the system management module displays the detection result.
In some embodiments, as shown in fig. 9, the Silu activation function in the shallow network is replaced with a FreLU activation function, improving the ability of the shallow network to extract spatial context features and implementing pixel-level modeling.
In some embodiments, as shown in fig. 10, a convolution block attention module (Convolutional Block Attention Module, CBAM) for introducing attention (Multi-Spectral Channel Attention, MSCA) of a Multi-spectrum channel is added to the network, so that the network can effectively use other frequency components in the characteristic map channel to better construct attention weights, reduce interference of background and foreground in an image to the network, and make the network focus on a target object, namely:
in some embodiments, the loss function uses EioU (Efficient Intersection over Union) loss instead of GioU (Generalized Intersection over Union) loss to speed up convergence of the network model and improve positioning accuracy, namely:
in some embodiments, as shown in fig. 11, the machine vision algorithm improves the YOLO detection algorithm, and meanwhile, the model speed and the model precision are both considered, so that the effect is superior to that of the existing YOLO series method, the reasoning speed is faster, and the detection precision is higher.
In the cigarette production process, it is very important to accurately and efficiently detect the appearance quality of cigarettes. The traditional manual detection and vision technology has certain limitation in the aspect of identifying irregular defects, and cannot meet the requirements of modern production, so that the intelligent, accurate and efficient detection of the appearance quality of the cigarette can be realized by combining 720-degree image acquisition and efficient iterative closed loop of a data model by means of the fusion of AI deep learning and vision detection technology. Firstly, through 720-degree image acquisition technology, an omnibearing image of a cigarette can be obtained, wherein the image comprises the end face and the surface of the cigarette, and comprehensive cigarette appearance information can be provided; then, the images are processed and analyzed by using an AI model algorithm, and an AI deep learning model can be trained by a large amount of training data, so that the characteristics and rules of the appearance quality of the cigarettes are learned. By establishing a cigarette defect model library, the defects of cigarettes can be detected and classified. The AI deep learning model may perform feature extraction and classification on images through a multi-layer neural network. Various defects of the cigarettes, such as breakage of the cigarettes, foreign matters, cigarette paper wrinkles and the like, can be identified by utilizing a visual detection technology. Through carrying out intelligent detection to cigarette appearance quality, can improve the rate of accuracy and the efficiency that detects greatly, reduce cost and the error rate of manual detection simultaneously. The efficient and rapid iterative closed loop of the data model is a key for realizing intelligent detection of the appearance quality of the cigarettes. Through continuously collecting and updating the appearance quality data of the cigarettes, the AI model can be trained and optimized, and the accuracy and the robustness of the model are continuously improved. Meanwhile, the detection, judgment and classification statistics of the appearance quality of the cigarettes can be realized by comparing the appearance quality defect library with the accumulated appearance quality defect library of the cigarettes. As above, the overall control of the appearance quality of the cigarette can be realized. Through intelligent cigarette appearance quality detection, the problem that the traditional manual detection and vision technology is insufficient in recognition capability of irregular defects can be solved. Based on the fusion of AI deep learning and visual detection technology, the intelligent, accurate and efficient detection of the appearance quality of the cigarettes can be realized.
In some embodiments, the data needs to be loaded and pre-processed for use in subsequent steps; the architecture of the model needs to be defined, including selecting the appropriate algorithm and network structure; training and adjusting the model to achieve optimal performance; the performance of the model needs to be evaluated and optimized.
In some embodiments, training an AI identification model includes: and (3) data collection: firstly, collecting cigarette defect image data such as empty heads, punctures, cracks, stains, raised edges, folds, extrusion deformation and the like which need to be identified, wherein the quality and the diversity of the data are critical to the performance of the model; data preprocessing: before training the model, the cigarette image needs to be preprocessed, including operations such as data cleaning and standardization, and the preprocessing aims to improve the quality and consistency of data so that the model can learn and generalize better; and (3) data marking: when an AI identification model is established, useful characteristic defects are required to be extracted from original cigarette image data for marking, and the purpose of marking defect classification information of a cigarette image is to convert the data into a form which can be understood and processed by a machine learning algorithm; model selection and training: selecting a proper model architecture according to the characteristics and requirements of the identification task, selecting a model depending on the characteristics and target tasks of the data, training the model by using the preprocessed data and a specific model, and in the training process, the data is input into the model, and parameters of the model are adjusted by comparing the output of the model with the real label, so that the original characteristics are combined, converted and selected to improve the performance of the model; model evaluation: in the training process, the model needs to be evaluated to know how the model performs, various indexes such as accuracy, recall, F1 score and the like can be used for evaluation, and the evaluation result can help to determine the optimization direction and parameter adjustment of the model; model optimization: optimizing the model according to the evaluation result, which may involve adjusting the hyper-parameters of the model, adding training data, changing the model architecture, etc., with the objective of improving the performance and generalization ability of the model; and (3) model detection: once model training and optimization are completed, the model can be applied to a cigarette appearance defect detection task, automatic detection, judgment and classification statistics of cigarette appearance quality of cigarettes are completed by comparing the model with an accumulated cigarette appearance quality defect library, defect identification and classification of products are realized under the conditions of complex image classification and background interference, intelligent quality detection of the appearance surface of the cigarettes is realized, alarm information is sent in real time, and model performance can be improved by data iterative training; continuous improvement: the creation and training of AI identification models is a continuously improved process, over time more data can be collected, model architecture improved, optimization algorithms, etc., to improve the performance and adaptability of the model.
In step 130, a detection result is generated.
According to the method, six industrial cameras are adopted to collect all-round images of the cigarettes, after pretreatment and integration are carried out on the images of the cigarettes, the appearance defects of the cigarettes are identified and detected through an artificial intelligent algorithm, the types and the number of the cigarette defects are determined, the detection efficiency and the accuracy of the cigarette defects are improved, manual detection work is replaced, and the appearance sampling quality of the cigarettes is improved.
As shown in fig. 12, the cigarette appearance detection device 1200 includes an acquisition module 1210, a detection module 1220, and a generation module 1230.
An acquisition module 1210 configured to acquire a cigarette appearance image;
a detection module 1220 configured to detect the cigarette appearance image with a trained machine vision model, wherein the machine vision model is solved based on a machine vision algorithm, the machine vision algorithm is based on a YOLO detection algorithm, a network of the YOLO detection algorithm includes a FReLU activation function, a convolution block attention module introducing multi-spectral channel attention is added to the network, and a loss function uses EioU loss;
the generating module 1230 is configured to generate a detection result.
In the device of the embodiment of the disclosure, through the rapid screening of the AI model, the identification of irregular defects of the object has remarkable advantages compared with the traditional machine vision technology, the accuracy is higher, the influence of external environment is low, the detection effect is better than that of manual work, the model can also perform continuous iterative training based on quality inspection data, the accuracy of the model is continuously improved, the production efficiency is improved, the product quality is ensured, and the labor cost and the management cost are reduced.
As shown in fig. 13, the cigarette appearance detection device 1300 includes a memory 1310; and a processor 1320 coupled to the memory 1310. The memory 1310 is used for storing instructions for executing a corresponding embodiment of the method for detecting the appearance of a cigarette. Processor 1320 is configured to perform the method of detecting the appearance of a cigarette in any of some embodiments of the present disclosure based on instructions stored in memory 1310.
As shown in FIG. 14, computer system 1400 may be embodied in the form of a general purpose computing device. Computer system 1400 includes a memory 1410, a processor 1420, and a bus 1430 that connects the different system components.
Memory 1410 may include, for example, system memory, non-volatile storage media, and the like. The system memory stores, for example, an operating system, application programs, boot Loader (Boot Loader), and other programs. The system memory may include volatile storage media, such as Random Access Memory (RAM) and/or cache memory. The non-volatile storage medium stores, for example, instructions for performing a corresponding embodiment of at least one of the methods of generating a cigarette appearance image. Non-volatile storage media include, but are not limited to, disk storage, optical storage, flash memory, and the like.
Processor 1420 may be implemented as discrete hardware components such as a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gates, or transistors. Accordingly, each module, such as the acquisition module, the detection module, and the generation module, may be implemented by a Central Processing Unit (CPU) executing instructions in a memory to perform the corresponding steps, or may be implemented by a dedicated circuit to perform the corresponding steps.
Bus 1430 may employ any of a variety of bus structures. For example, bus structures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.
The computer system 1400 may also include input/output interfaces 1440, network interfaces 1450, storage interfaces 1460, and the like. These interfaces 1440, 1450, 1460, and memory 1410 and processor 1420 may be connected by a bus 1430. The input/output interface 1440 may provide a connection interface for input/output devices such as a display, mouse, keyboard, etc. Network interface 1450 provides a connection interface for a variety of networked devices. Storage interface 1460 provides a connection interface for external storage devices such as floppy disks, U disks, SD cards, and the like.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor, create means for implementing the functions specified in the flowchart and/or block diagram block or blocks.
These computer readable program instructions may also be stored in a computer readable memory that can direct a computer to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and/or block diagram block or blocks.
The present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
Thus far, the cigarette appearance detection method, device and medium according to the present disclosure have been described in detail. In order to avoid obscuring the concepts of the present disclosure, some details known in the art are not described. How to implement the solutions disclosed herein will be fully apparent to those skilled in the art from the above description.
Although specific embodiments of the disclosure have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the disclosure. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the disclosure. The scope of the present disclosure is defined by the appended claims.

Claims (10)

1. A method for detecting the appearance of a cigarette, the method comprising:
obtaining a cigarette appearance image;
detecting the cigarette appearance image by using a trained machine vision model, wherein the machine vision model is solved based on a machine vision algorithm, the machine vision algorithm is based on a YOLO detection algorithm, a network of the YOLO detection algorithm comprises a FReLU activation function, a convolution block attention module for introducing multi-frequency spectrum channel attention is added into the network, and a loss function uses Eiou loss;
and generating a detection result.
2. The method of claim 1, wherein the detecting the appearance image of the cigarette using a trained machine vision model, wherein training the machine vision model comprises:
collecting cigarette defect images;
preprocessing the cigarette defect image to obtain a first image;
labeling the first image to obtain a second image;
inputting the second image into a machine vision model, and outputting a third image;
comparing the third image with the real label, and adjusting parameters of the machine vision model based on the comparison result;
the machine vision model subjected to parameter adjustment is evaluated, and the machine vision model subjected to parameter adjustment is optimized based on an evaluation result.
3. The method for detecting the appearance of a cigarette according to claim 1, further comprising, before the step of acquiring the appearance image of the cigarette:
judging whether the generated cigarette appearance image has a position number or not;
if the generated cigarette appearance image has a position number, continuously judging whether a cigarette is fixed at a clamping groove position in the generated cigarette appearance image;
and if the cigarettes are fixed in the clamping groove positions in the generated cigarette appearance images, sending the cigarette appearance images.
4. The method for detecting the appearance of a cigarette according to claim 3, wherein before determining whether the generated appearance image of the cigarette has the position number, the method further comprises:
obtaining a cigarette appearance detection signal;
opening a negative pressure switch of a negative pressure device based on the cigarette appearance detection signal;
starting a servo motor;
shooting the cigarette in the dynamic state by using an image generating device to obtain a fourth image;
and generating a cigarette appearance image based on the fourth image.
5. The method of claim 4, wherein generating a cigarette appearance image based on the fourth image comprises:
cutting the fourth image to obtain a fifth image;
and merging the fifth images to generate a cigarette appearance image.
6. The method of claim 5, wherein the fourth image is cropped using a rectangular cropping algorithm.
7. The method according to claim 3, wherein if the generated cigarette appearance image has no position number or no cigarette is fixed in a clamping groove in the generated cigarette appearance image, a negative pressure switch of a negative pressure device is turned off;
closing the servo motor; and
the image generating device is turned off.
8. A cigarette appearance detection device, characterized by comprising:
the acquisition module is used for acquiring the appearance image of the cigarette;
the detection module is used for detecting the cigarette appearance image by using a trained machine vision model, wherein the machine vision model is solved based on a machine vision algorithm, the machine vision algorithm is based on a YOLO detection algorithm, a network of the YOLO detection algorithm comprises a FReLU activation function, a convolution block attention module for introducing multi-frequency spectrum channel attention is added into the network, and a loss function uses Eiou loss;
and the generating module is used for generating a detection result.
9. A method for detecting the appearance of a cigarette, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the method of detecting a cigarette appearance of any one of claims 1 to 7 based on instructions stored in the memory.
10. A computer-readable storage medium, having stored thereon computer program instructions which, when executed by a processor, implement a method of detecting the appearance of a cigarette as claimed in any one of claims 1 to 7.
CN202311821888.0A 2023-12-27 2023-12-27 Cigarette appearance detection method, device and medium Pending CN117830245A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311821888.0A CN117830245A (en) 2023-12-27 2023-12-27 Cigarette appearance detection method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311821888.0A CN117830245A (en) 2023-12-27 2023-12-27 Cigarette appearance detection method, device and medium

Publications (1)

Publication Number Publication Date
CN117830245A true CN117830245A (en) 2024-04-05

Family

ID=90516703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311821888.0A Pending CN117830245A (en) 2023-12-27 2023-12-27 Cigarette appearance detection method, device and medium

Country Status (1)

Country Link
CN (1) CN117830245A (en)

Similar Documents

Publication Publication Date Title
CN109886298B (en) Weld quality detection method based on convolutional neural network
CN110136101B (en) Tire X-ray defect detection method based on twinning distance comparison
CN105891233A (en) Intelligent detection system for surface defects of lens based on machine vision and implementation method of intelligent detection system
CN105044122A (en) Copper part surface defect visual inspection system and inspection method based on semi-supervised learning model
CN104063873A (en) Shaft sleeve part surface defect on-line detection method based on compressed sensing
CN113723325B (en) Frock defect detecting system of prefabricated component of assembled
CN115184359A (en) Surface defect detection system and method capable of automatically adjusting parameters
US20230053085A1 (en) Part inspection system having generative training model
CN113012228B (en) Workpiece positioning system and workpiece positioning method based on deep learning
CN117664990A (en) Intelligent PCBA appearance defect detection method
CN111105413B (en) Intelligent spark plug appearance defect detection system
CN117409005A (en) Defective product detection system and method for plate receiving machine based on image
CN112800909A (en) Self-learning type tobacco shred sundry visual image detection method
CN117830245A (en) Cigarette appearance detection method, device and medium
CN116542962A (en) Improved Yolov5m model-based photovoltaic cell defect detection method
CN115690001A (en) Method for detecting defects in steel pipe welding digital radiographic image
CN114120318B (en) Dark field image target point accurate extraction method based on integrated decision tree
CN113723841B (en) On-line detection method for tool missing in assembled prefabricated part
CN114235810A (en) Automatic cloth flaw detection method based on area array industrial camera
CN113192068A (en) AI visual inspection system for printed wiring board
CN112330606A (en) Defect detection method based on machine learning
CN116681644B (en) Cigarette appearance defect detection method based on variable decibel leaf reasoning
CN117409332B (en) Long wood shaving appearance data detection system and method based on big data processing
US20220375067A1 (en) Automated part inspection system
KR102541166B1 (en) AI vision inspection system using robot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination