CN114708247A - Cigarette case packaging defect identification method and device based on deep learning - Google Patents

Cigarette case packaging defect identification method and device based on deep learning Download PDF

Info

Publication number
CN114708247A
CN114708247A CN202210428101.3A CN202210428101A CN114708247A CN 114708247 A CN114708247 A CN 114708247A CN 202210428101 A CN202210428101 A CN 202210428101A CN 114708247 A CN114708247 A CN 114708247A
Authority
CN
China
Prior art keywords
training model
image information
image
deep learning
cigarette case
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
CN202210428101.3A
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.)
Leading Optical Technology Jiangsu Co ltd
Original Assignee
Leading Optical Technology Changshu 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 Leading Optical Technology Changshu Co ltd filed Critical Leading Optical Technology Changshu Co ltd
Priority to CN202210428101.3A priority Critical patent/CN114708247A/en
Publication of CN114708247A publication Critical patent/CN114708247A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • G06F18/2155Generating training patterns; Bootstrap methods, e.g. bagging or boosting characterised by the incorporation of unlabelled data, e.g. multiple instance learning [MIL], semi-supervised techniques using expectation-maximisation [EM] or naïve labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/088Non-supervised learning, e.g. competitive learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • 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

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Biology (AREA)
  • Quality & Reliability (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a cigarette case packaging defect identification method and device based on deep learning, belonging to the field of cigarette detection, wherein the method comprises the following steps: acquiring first image information of cigarette case packages; outputting the first image information to a first training model, and judging whether the first image is novel and meets the requirements, wherein the first training model is obtained by adopting unsupervised deep learning and training; and outputting the first image information to a second training model, and judging whether the first image is novel and meets the requirement, wherein the second training model is obtained by supervised deep learning and training. The invention classifies the defects of the cigarette case package, designs the combination of supervised learning and unsupervised learning according to the defect types, realizes the detection of various defects on the cigarette case package, and improves the breadth and the precision of the defect detection.

Description

Cigarette case packaging defect identification method and device based on deep learning
Technical Field
The invention belongs to the field of cigarette detection, and particularly relates to a cigarette case packaging defect identification method and device based on deep learning.
Background
In the production of cigarettes, various quality defects are often associated. How to effectively identify quality defects on cigarette packet packages becomes an important means for improving the quality of cigarettes. Some cigarette case package detection methods exist in the existing factories, for example, a robot vision detection technology, which eliminates unqualified cigarette cases by acquiring color images of cigarette cases on a production line in real time, extracting geometric features, identifying information such as appearance and peripheral sealing on the cigarette cases, and the like.
However, in actual detection, various packaging defects exist, related algorithms need to be designed one by one, and a user adds detection items gradually in the using process. The machine vision algorithm is difficult to model and transfer defect features completely, reusability is not large, and working conditions are required to be distinguished, so that a large amount of labor cost is wasted.
Disclosure of Invention
The invention aims to provide a cigarette case packaging defect identification method, a cigarette case packaging defect identification device, a cigarette case packaging defect identification server and a readable storage medium based on deep learning, and aims to solve the problems involved in the background art.
Based on the technical problem, the invention provides a cigarette case packaging defect identification method based on deep learning, a cigarette case packaging defect identification device based on deep learning, a server and a readable storage medium, and the cigarette case packaging defect identification method based on deep learning comprises the following four aspects.
In a first aspect, the present invention provides a cigarette packet packaging defect identification method based on deep learning, wherein the method comprises:
acquiring first image information of cigarette case packages;
presetting a first training model, wherein the first training model is obtained by adopting unsupervised deep learning and training; the first training model takes a first distinguishing characteristic as supervision data; the first distinguishing characteristic comprises that adhesive tapes or other foreign matters needing to be distinguished are mixed in the cigarette box package, and the surface is damaged or other defects which can be seen by naked eyes are generated;
outputting the first image information to a first training model, and judging whether the first image type meets the requirements or not; if the output meets the requirements, executing the next step, otherwise, outputting unqualified output;
presetting a second training model, wherein the second training model is obtained by supervised deep learning and training; the first training model takes a second distinguishing characteristic as supervision data; the second distinguishing characteristic comprises common flanging and white-exposed defects on cigarette case packages;
outputting the first image information to a second training model, and judging whether the first image is novel and meets the requirements; if the output is qualified, otherwise, the output is unqualified.
Preferably or optionally, the method further comprises:
before the first image information is output to a first training model, first preprocessing is carried out on the first image information; the first preprocessing method is to compress the first image information.
Preferably or optionally, the first pre-treatment method comprises:
reading an original image and determining an optimal compression range;
performing screenshot processing according to the size of the original image, and then judging whether the screenshot image meets the optimal compression range;
if yes, the compression is stopped, otherwise, the image processed by screenshot is further compressed, so that the compression rate is within the optimal compression range.
Preferably or optionally, the compression method for further compressing the screenshot-processed image comprises:
carrying out binarization on the image subjected to screenshot processing to obtain a pixel value matrix;
then judging whether any two adjacent pixel points in the pixel value matrix meet the following conditions,
|R0-R1|+|G0-G1|+|B0-B1|<L;
wherein R is0、G0、B0Respectively, the RGB value, R, of a certain pixel1、G1、B1Respectively the RGB values of adjacent pixel points, L is a preset maximum distance between colors to be combined, and the size of L has a relation with the optimal compression range;
and the two pixel points are classified into a corresponding color.
Preferably or alternatively, the method for determining the optimal compression range comprises:
pre-constructing a change curve or a comparison table between the image compression ratio and the image pixels; and acquiring the original image pixels according to the original image, and searching the optimal compression range.
Preferably or optionally, the method further comprises:
before the first image information is output to a second training model, second preprocessing is carried out on the first image information; and the second preprocessing method comprises the steps of extracting the positioning frame of the first image information and cutting to obtain the image information of the defect area.
Preferably or optionally, the second pre-treatment method comprises:
carrying out binarization on the first image information to obtain a pixel value matrix;
acquiring the position of the landmark feature in the cigarette case according to the pixel value matrix,
according to the distance between the characteristic feature and the periphery of the cigarette case, the boundary of the cigarette case can be gradually obtained through searching in a snowball rolling mode, and the positioning frame of the cigarette case in the first image information is obtained.
In a second aspect, the present invention also provides a deep learning based cigarette pack packaging defect identification device, the device comprising:
the first acquisition unit is suitable for acquiring first image information of cigarette case packages;
the first processing unit is suitable for presetting a first training model, and the first training model is obtained by adopting unsupervised deep learning and training; the first training model takes a first distinguishing characteristic as supervision data; the first distinguishing characteristic comprises that adhesive tapes or other foreign matters needing to be distinguished are mixed in the cigarette box package, and the surface is damaged or other defects which can be seen by naked eyes are generated;
the first judging unit is suitable for outputting the first image information to a first training model and judging whether the first image type meets the requirement or not;
the first execution unit executes the next step if the first execution unit meets the requirement, otherwise, the output is unqualified;
the second processing unit is suitable for presetting a second training model, and the second training model is obtained by supervised deep learning and training; the first training model takes a second distinguishing characteristic as supervision data; the second distinguishing characteristic comprises common flanging and white-appearing defects on cigarette case packages;
the second judging unit is suitable for outputting the first image information to a second training model and judging whether the first image is novel and meets the requirement;
and the second execution unit outputs qualified data if the output meets the requirement, and otherwise outputs unqualified data.
In a third aspect, the present invention further provides a deep learning-based cigarette packet packaging defect identification server, including a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor implements the steps of the deep learning-based cigarette packet packaging defect identification method when executing the program.
In a fourth aspect, a computer readable storage medium, which program, when executed by a processor, performs the steps of the deep learning based cigarette pack packaging defect identification method.
Has the advantages that: the invention relates to a cigarette case package defect identification method and a cigarette case package defect identification device based on deep learning. In addition, a proper pretreatment mode is designed according to the types of the defects, so that the detection precision is ensured, the detection efficiency is improved, and the detection requirement of at least 95% of quality defects of a customer can be met.
Drawings
Fig. 1 is a schematic flow chart of a cigarette packet packaging defect identification method based on deep learning in embodiment 1 of the present invention.
Fig. 2 is a cigarette packet packaging defect recognition device based on deep learning in embodiment 2 of the present invention.
Fig. 3 is a schematic structural diagram of an exemplary electronic device in embodiment 3 of the present invention.
Fig. 4 shows various examples of the first image information in embodiment 1 of the present invention.
Description of reference numerals: a first obtaining unit 11, a first processing unit 12, a first judging unit 13, a first executing unit 14, a second processing unit 15, a second judging unit 16, a second executing unit 17, a bus 300, a receiver 301, a processor 302, a transmitter 303, a memory 304, and a bus interface 305.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the present invention. It will be apparent, however, to one skilled in the art, that the present invention may be practiced without one or more of these specific details. In other instances, well-known features have not been described in order to avoid obscuring the invention.
Example 1
As shown in fig. 1, fig. 1 is a schematic flow chart of a cigarette packet packaging defect identification method based on deep learning in embodiment 1 of the present invention, and the cigarette packet packaging defect identification method based on deep learning includes the following steps:
s100, acquiring first image information of cigarette case packages;
specifically, the first image information is an image obtained by shooting the cigarette case through a camera by a user; in actual production, a CCD camera is arranged at one side of the production line of the cigarette packet packages, and the packaging face of the cigarette packet packages in the production line, generally the side face of the cigarette packet, is captured at a predetermined gap according to the transmission speed of the production line. And sorting the cigarette cases according to the bar code information contained in the image information so as to facilitate later statistics and verification.
S200, presetting a first training model;
specifically, the first training model is obtained through unsupervised deep learning and training of multiple groups of training data. The plurality of sets of training data comprise a first distinguishing characteristic, and specifically comprise that adhesive tapes or other foreign matters needing to be distinguished are mixed on the cigarette box package, and the surface is damaged or other defects which can be seen by naked eyes are formed. Such as stains, broken boxes, stuck foreign bodies, no code spraying, crumpling, breakage and the like.
Since the first distinguishing feature includes a complex situation, there are many situations, and the uncertainty factor is too much. And with the later actual use process, the detection index is inevitably required to be updated, so the first training model is obtained by adopting unsupervised deep learning and training through multiple groups of training data. In the embodiment, only one set of data is given in the unsupervised deep learning and training, the data includes both standard image information and defective image information, the purpose is to find a special structure in the set of data, confirm a threshold value of difference comparison through a sliding window, thereby detect a defect, divide the set of data into two different groups, and implement clustering on the set of data. Through actual measurement, a small defect sample can be detected.
S300, performing first preprocessing on the first image information; the first preprocessing method is to compress the first image information;
specifically, the first image information is compressed to save the storage space, and meanwhile, the efficiency can be greatly detected. Since an important indicator of the first distinguishing characteristic is visible to the naked eye, proper compression of the first image information does not affect the accuracy of the detection. The compression method comprises the following steps: reading an original image and determining an optimal compression range; performing screenshot processing according to the size of the original image, and then judging whether the screenshot image meets the optimal compression range; if yes, the compression is stopped, otherwise, the image processed by screenshot is further compressed, so that the compression rate is within the optimal compression range. Firstly, the method and the device can pre-compress the first image and convert pictures with different formats into images with a unified format by screenshot processing on the original image, for example, the pictures with a jpg format, a gif format, an jxr format, an avif format, a wdbp format and the like can be uniformly converted into the images with a png format, whether the first training module recognizes the first image information is not needed to be considered, the image processing by the first training module is conveniently carried out in the later period, the adaptation degree of the first training model and the acquisition unit of the first image information is improved, and therefore, for technicians in the field, specific types and models of the acquisition unit are not needed to be considered.
As for the further compression approach, this embodiment presents an exemplary method, which includes: carrying out binarization on the image subjected to screenshot processing to obtain a pixel value matrix, and then, resolving colors which accord with a certain hue range in the two-dimensional pixel value matrix into a corresponding color; for example, it is determined whether any two adjacent pixels in the pixel value matrix satisfy the following condition, that is, the two pixels can be summarized as a corresponding color; | R0-R1|+|G0-G1|+|B0-B1L < L; wherein R is0、G0、B0Respectively, the RGB value, R, of a certain pixel1、G1、B1The RGB values of adjacent pixels are respectively, L is a preset maximum distance between colors to be combined, and the size of L has a certain relation with the optimal compression range. The size of L is calculated in advance according to the compression range, the compression process can be completed through one-time operation, the compression efficiency can be effectively improved, and the detection speed of the whole system is further improved.
Therefore, in the compression process, the compression rate and the image quality of the image are a set of contradictory variables to be comprehensively considered, and if the compression rate is too high, the distortion rate of the image is too high, and many details become blurred, and if the compression rate is too low, the image still has a relatively large memory after being compressed, so that the running speed of the first training module is reduced. In order to ensure a relatively high recognition accuracy for millimeter-scale defects, the compression rate should not be too high. Through a plurality of tests, a change curve or a comparison table between the image compression ratio and the image pixel is constructed, the original image pixel is obtained according to the original image, and the optimal compression range is searched.
Based on the compression method, the detection speed of the current single image can reach 8ms, which is faster than the detection speed of 30ms for directly adopting the original image for identification; the original image PNG is 1.2M, the image can be compressed to within 20K which is 1.7% of the original image by compressing through an actual new algorithm, and the storage space can be greatly saved.
S400, outputting the first image information to a first training model, and judging whether the first image information meets the requirement; if the output meets the requirements, executing the next step, otherwise, outputting unqualified output;
in particular, Artificial Intelligence (Artificial Intelligence) is the most extensive concept, the purpose of Artificial Intelligence is to let a computer, a Machine, think like a human, and Machine Learning (Machine Learning) is a branch of Artificial Intelligence, which is specialized in studying how a computer simulates or realizes human Learning behavior to acquire new knowledge or skills, so as to continuously improve the performance of the computer. Deep Learning (Deep Learning) is a machine Learning method that attempts to use algorithms that involve high-level abstractions of data using multiple processing layers (neural networks) that contain complex structures or are composed of multiple nonlinear transformations. Briefly, it is a mathematical model. The neural network model is represented by network topology node characteristics and learning rules. In the embodiment of the application, first image information is used as input data and is input into a first training model, each set of input training data comprises a training sample with a first distinguishing characteristic and a normal training sample, a preset clustering algorithm is adopted, so that the first image information is subjected to clustering training, the converged tie value is used as central data of a data set, then output data is obtained according to the central data, and the image information of a to-be-supervised object which accords with the first distinguishing characteristic is automatically selected from a plurality of first image information.
S500, presetting a second training model;
specifically, the first training model takes a second distinguishing characteristic as supervision data; the second distinguishing characteristic comprises common flanging and white-appearing defects on cigarette case packages; the second distinguishing characteristic belongs to two common quality problems in cigarette case package detection, and the occurrence frequency is relatively high, so that the second training model is obtained by supervised deep learning and training, and thus, a training model with relatively high detection precision can be obtained in a short time. Specifically, in this embodiment, an optimal model and a second training model are obtained by training a training sample with common flanging and white exposure defects, all inputs are mapped to corresponding outputs by using the second training model, and the outputs are simply judged to achieve the purpose of classification, so that the unknown data can be classified.
S600, performing second preprocessing on the first image information;
specifically, since the second distinguishing feature has a high requirement on the detection accuracy, the second preprocessing cannot reduce the resolution of the first image information as the first preprocessing, thereby improving the detection efficiency. Therefore, the second preprocessing method is to extract the first image information by using the positioning frame, and to crop the first image information to obtain the image information of the defective area.
As for the extraction method of the positioning frame, there are various forms, such as extracting the outline of the cigarette case by using the color and texture of the cigarette case itself; predicting by using the position of the mathematical morphology cigarette case; and the position of the cigarette case can be accurately positioned in a way that the neural network can only identify the cigarette case, but the methods have certain problems. This embodiment presents an exemplary method, and the extraction method includes: carrying out binarization on the first image information to obtain a pixel value matrix; the position of the landmark feature in the cigarette case is obtained according to the pixel value matrix, the boundary of the cigarette case can be gradually obtained through searching in a snowball rolling mode according to the distance between the landmark feature and the periphery of the cigarette case, and the positioning frame of the cigarette case in the first image information is obtained. The characteristic feature can be a two-dimensional code or a bar code positioned on the side surface of the cigarette case or a logo positioned on the front surface of the cigarette case. Therefore, the method does not need to be easily influenced by the external environment like color features, does not need to perform complex mathematical processing like an extraction mode of mathematical morphology and neural network prediction, and can quickly and accurately acquire the position of the positioning frame.
S700, outputting the first image information to a second training model, and judging whether the first image information meets the requirement; if the output is qualified, otherwise, the output is unqualified.
Specifically, the image intercepted after the first image information is processed should be input into the second training model. In the embodiment of the application, the first image information is used as input data and is input into a second training model, each set of input training data is a training sample comprising a second distinguishing characteristic, and the second distinguishing characteristic comprises common flanging and whitening defects on cigarette case packages. The second distinguishing characteristic is used as supervision data, so that the first image information is trained, output data is obtained, and the image information of the object to be supervised, which accords with the second distinguishing characteristic, is automatically screened out from the second image information.
Compared with the prior art, the embodiment has the following advantages: the invention classifies the defects of the cigarette case package, designs the combination of supervised learning and unsupervised learning according to the defect types, realizes the detection of various defects on the cigarette case package, and improves the breadth and the precision of the defect detection. In addition, a proper pretreatment mode is designed according to the types of the defects, so that the detection precision is ensured, the detection efficiency is improved, and the detection requirement of at least 95% of quality defects of a customer can be met.
Example 2
Based on the same inventive concept as the cigarette case package defect identification method based on deep learning in the foregoing embodiment 1, the present invention further provides a cigarette case package defect identification device based on deep learning, as shown in fig. 2, the device includes:
a first acquisition unit 11 adapted to acquire first image information of the packet of cigarettes;
the first processing unit 12 is adapted to preset a first training model, and the first training model is obtained by unsupervised deep learning and training; the first training model takes a first distinguishing characteristic as supervision data; the first distinguishing characteristic comprises that adhesive tapes or other foreign matters needing to be distinguished are mixed in the cigarette box package, and the surface is damaged or other defects which can be seen by naked eyes are generated;
the first judging unit 13 is adapted to output the first image information to a first training model and judge whether the first image is novel and meets the requirement;
the first execution unit 14 executes the next step if the first execution unit meets the requirement, otherwise, the output is unqualified;
the second processing unit 15 is suitable for presetting a second training model, and the second training model is obtained by supervised deep learning and training; the first training model takes a second distinguishing characteristic as supervision data; the second distinguishing characteristic comprises common flanging and white-exposed defects on cigarette case packages;
the second judging unit 16 is adapted to output the first image information to a second training model and judge whether the first image information meets the requirement;
and the second execution unit 17 outputs qualified data if the requirements are met, and otherwise outputs unqualified data.
Further, the apparatus further comprises:
the third processing unit is suitable for performing first preprocessing on the first image information before outputting the first image information to the first training model; the first preprocessing method is to compress the first image information.
Further, the apparatus further comprises:
the fourth processing unit is suitable for reading the original image and determining the optimal compression range;
the third judging unit is suitable for carrying out screenshot processing according to the size of the original image and then judging whether the screenshot image meets the optimal compression range or not;
and the third execution unit stops compression if the compression rate is within the optimal compression range, otherwise, further compresses the image subjected to screenshot processing, and finally compresses the image subjected to screenshot processing.
Further, the apparatus further comprises:
the fifth processing unit is suitable for carrying out binarization on the image subjected to screenshot processing to obtain a pixel value matrix;
a fourth judging unit adapted to judge whether any two adjacent pixel points in the pixel value matrix satisfy the following condition,
|R0-R1|+|G0-G1|+|B0-B1|<L;
wherein R is0、G0、B0Respectively, the RGB value, R, of a certain pixel1、G1、B1Respectively the RGB values of adjacent pixel points, L is a preset maximum distance between colors to be combined, and the size of L has a relation with the optimal compression range;
and the fourth execution unit is suitable for integrating the two pixel points into a corresponding color.
Further, the apparatus further comprises:
the sixth processing unit is suitable for constructing a change curve or a comparison table between the image compression rate and the image pixels in advance;
and the seventh processing unit is suitable for acquiring the pixels of the original image according to the original image and searching the optimal compression range.
Further, the apparatus further comprises:
the eighth processing unit is suitable for performing second preprocessing on the first image information before outputting the first image information to the second training model; and the second preprocessing method comprises the steps of extracting the positioning frame of the first image information and cutting to obtain the image information of the defect area.
A ninth processing unit adapted to binarize the first image information to obtain a pixel value matrix;
a tenth processing unit adapted to obtain the location of the signature feature in the pack from the matrix of pixel values,
and the eleventh processing unit is suitable for searching in a snowball rolling mode according to the distance between the landmark features and the periphery of the cigarette case, so that the boundaries of the cigarette case can be gradually obtained, and the positioning frame of the cigarette case in the first image information is obtained.
Various changes and specific examples of the cigarette packet packaging defect identification method based on deep learning in the foregoing embodiment 1 are also applicable to the cigarette packet packaging defect identification device based on deep learning in this embodiment, and through the foregoing detailed description of the cigarette packet packaging defect identification method based on deep learning, those skilled in the art can clearly know the implementation method of the cigarette packet packaging defect identification device based on deep learning in this embodiment, so for the sake of brevity of the description, detailed descriptions are omitted here.
Example 3
Based on the same inventive concept as one of the deep learning-based cigarette packet packaging defect recognition methods in the foregoing embodiments, the present invention further provides a deep learning-based cigarette packet packaging defect recognition server, as shown in fig. 3, fig. 3 is an exemplary electronic device in embodiment 3, and includes a memory 304, a processor 302, and a computer program stored on the memory 304 and capable of running on the processor 302, and when the processor 302 executes the program, the processor 302 implements the steps of any one of the deep learning-based cigarette packet packaging defect recognition methods.
Where in fig. 3 a bus architecture (represented by bus 300), bus 300 may include any number of interconnected buses and bridges, bus 300 linking together various circuits including one or more processors, represented by processor 302, and memory, represented by memory 304. The bus 300 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 305 provides an interface between the bus 300 and the receiver 301 and transmitter 303. The receiver 301 and the transmitter 303 may be the same element, i.e., a transceiver, providing a means for communicating with various other apparatus over a transmission medium.
The processor 302 is responsible for managing the bus 300 and general processing, and the memory 304 may be used for storing data used by the processor 302 in performing operations.
Example 4
Based on the same inventive concept as the cigarette packet packaging defect identification method based on deep learning in the previous embodiment, the present invention further provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the following steps: acquiring first image information of cigarette case packages; presetting a first training model, wherein the first training model is obtained by adopting unsupervised deep learning and training; the first training model takes a first distinguishing characteristic as supervision data; the first distinguishing characteristic comprises that adhesive tapes or other foreign matters needing to be distinguished are mixed in the cigarette box package, and the surface is damaged or other defects which can be seen by naked eyes are generated; outputting the first image information to a first training model, and judging whether the first image is novel and meets the requirements; if the output meets the requirements, executing the next step, otherwise, outputting unqualified output; presetting a second training model, wherein the second training model is obtained by supervised deep learning and training; the first training model takes a second distinguishing characteristic as supervision data; the second distinguishing characteristic comprises common flanging and white-exposed defects on cigarette case packages; outputting the first image information to a second training model, and judging whether the first image is novel and meets the requirements; if the output is qualified, otherwise, the output is unqualified.
One or more technical solutions in the embodiments of the present invention at least have one or more of the following technical effects: the invention classifies the defects of the cigarette case package, designs the combination of supervised learning and unsupervised learning according to the defect types, realizes the detection of various defects on the cigarette case package, and improves the breadth and the precision of the defect detection. In addition, a proper pretreatment mode is designed according to the types of the defects, so that the detection precision is ensured, the detection efficiency is improved, and the detection requirement of at least 95% of quality defects of a customer can be met.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. The invention is not described in detail in order to avoid unnecessary repetition.

Claims (10)

1. A cigarette case packaging defect identification method based on deep learning, which is characterized by comprising the following steps:
acquiring first image information of cigarette case packages;
presetting a first training model, wherein the first training model is obtained by adopting unsupervised deep learning and training; the first training model takes a first distinguishing characteristic as supervision data; the first distinguishing characteristic comprises that adhesive tapes or other foreign matters needing to be distinguished are mixed on the cigarette box package, and the surface is damaged or other defects which can be seen by naked eyes are not obtained;
outputting the first image information to a first training model, and judging whether the first image type meets the requirements or not; if the output meets the requirements, executing the next step, otherwise, outputting unqualified output;
presetting a second training model, wherein the second training model is obtained by supervised deep learning and training; the first training model takes a second distinguishing characteristic as supervision data; the second distinguishing characteristic comprises common flanging and white-exposed defects on cigarette case packages;
outputting the first image information to a second training model, and judging whether the first image is novel and meets the requirements; if the output is qualified, otherwise, the output is unqualified.
2. The deep learning based cigarette pack packaging defect identification method of claim 1, further comprising:
before the first image information is output to a first training model, first preprocessing is carried out on the first image information; the first preprocessing method is to compress the first image information.
3. The deep learning based cigarette pack packaging defect identification method according to claim 2, wherein the first preprocessing method comprises:
reading an original image and determining an optimal compression range;
performing screenshot processing according to the size of the original image, and then judging whether the screenshot image meets the optimal compression range;
if yes, the compression is stopped, otherwise, the image subjected to screenshot processing is further compressed, and the compression rate is enabled to be within the optimal compression range.
4. The deep learning based cigarette pack packaging defect identification method according to claim 3, wherein the compression method for further compressing the screenshot processed image comprises the following steps:
carrying out binarization on the image subjected to screenshot processing to obtain a pixel value matrix;
judging whether any two adjacent pixel points in the pixel value matrix meet the following conditions,
|R0-R1|+|G0-G1|+|B0-B1|<L;
wherein R is0、G0、B0Respectively, the RGB value, R, of a certain pixel1、G1、B1Respectively the RGB values of adjacent pixel points, L is a preset maximum distance between colors to be combined, and the size of L has a relation with the optimal compression range;
and the two pixel points are classified into a corresponding color.
5. The deep learning based cigarette pack packaging defect identification method according to claim 3 or 4, wherein the determination method of the optimal compression range comprises:
pre-constructing a change curve or a comparison table between the image compression ratio and the image pixels; and acquiring the pixels of the original image according to the original image, and searching the optimal compression range.
6. The deep learning based cigarette pack packaging defect identification method of claim 1, further comprising:
before the first image information is output to a second training model, second preprocessing is carried out on the first image information; and the second preprocessing method comprises the steps of extracting the positioning frame of the first image information and cutting to obtain the image information of the defect area.
7. The deep learning based cigarette pack packaging defect identification method according to claim 6, wherein the second preprocessing method comprises:
carrying out binarization on the first image information to obtain a pixel value matrix;
acquiring the position of the landmark feature in the cigarette case according to the pixel value matrix,
according to the distance between the characteristic feature and the periphery of the cigarette case, the boundary of the cigarette case can be gradually obtained through searching in a snowball rolling mode, and the positioning frame of the cigarette case in the first image information is obtained.
8. A cigarette case package defect recognition device based on deep learning, the device comprising:
the first acquisition unit is suitable for acquiring first image information of cigarette case packages;
the first processing unit is suitable for presetting a first training model, and the first training model is obtained by adopting unsupervised deep learning and training; the first training model takes a first distinguishing characteristic as supervision data; the first distinguishing characteristic comprises that adhesive tapes or other foreign matters needing to be distinguished are mixed in the cigarette box package, and the surface is damaged or other defects which can be seen by naked eyes are generated;
the first judging unit is suitable for outputting the first image information to a first training model and judging whether the first image is novel and meets the requirement;
the first execution unit executes the next step if the first execution unit meets the requirement, otherwise, the output is unqualified;
the second processing unit is suitable for presetting a second training model, and the second training model is obtained by supervised deep learning and training; the first training model takes a second distinguishing characteristic as supervision data; the second distinguishing characteristic comprises common flanging and white-exposed defects on cigarette case packages;
the second judging unit is suitable for outputting the first image information to a second training model and judging whether the first image is novel and meets the requirement;
and the second execution unit outputs qualified output if the output meets the requirement, and otherwise outputs unqualified output.
9. A deep learning based server for identifying defects in cigarette pack packaging, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the program.
10. A computer-readable storage medium, characterized in that the program is adapted to carry out the steps of the method of any one of claims 1-7 when executed by a processor.
CN202210428101.3A 2022-04-22 2022-04-22 Cigarette case packaging defect identification method and device based on deep learning Pending CN114708247A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210428101.3A CN114708247A (en) 2022-04-22 2022-04-22 Cigarette case packaging defect identification method and device based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210428101.3A CN114708247A (en) 2022-04-22 2022-04-22 Cigarette case packaging defect identification method and device based on deep learning

Publications (1)

Publication Number Publication Date
CN114708247A true CN114708247A (en) 2022-07-05

Family

ID=82174949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210428101.3A Pending CN114708247A (en) 2022-04-22 2022-04-22 Cigarette case packaging defect identification method and device based on deep learning

Country Status (1)

Country Link
CN (1) CN114708247A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116664871A (en) * 2023-06-27 2023-08-29 本溪钢铁(集团)信息自动化有限责任公司 Intelligent control method and system based on deep learning
CN117333483A (en) * 2023-11-30 2024-01-02 中科慧远视觉技术(洛阳)有限公司 Defect detection method and device for bottom of metal concave structure
CN117333483B (en) * 2023-11-30 2024-06-25 中科慧远视觉技术(洛阳)有限公司 Defect detection method and device for bottom of metal concave structure

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116664871A (en) * 2023-06-27 2023-08-29 本溪钢铁(集团)信息自动化有限责任公司 Intelligent control method and system based on deep learning
CN116664871B (en) * 2023-06-27 2024-05-31 本溪钢铁(集团)信息自动化有限责任公司 Intelligent control method and system based on deep learning
CN117333483A (en) * 2023-11-30 2024-01-02 中科慧远视觉技术(洛阳)有限公司 Defect detection method and device for bottom of metal concave structure
CN117333483B (en) * 2023-11-30 2024-06-25 中科慧远视觉技术(洛阳)有限公司 Defect detection method and device for bottom of metal concave structure

Similar Documents

Publication Publication Date Title
CN112381775B (en) Image tampering detection method, terminal device and storage medium
CN110458077B (en) Vehicle color identification method and system
CN113763355A (en) Defect detection method and device, electronic equipment and storage medium
CN112241699A (en) Object defect category identification method and device, computer equipment and storage medium
CN114240939B (en) Method, system, equipment and medium for detecting appearance defects of mainboard components
CN112132196B (en) Cigarette case defect identification method combining deep learning and image processing
CN111583180B (en) Image tampering identification method and device, computer equipment and storage medium
CN114169381A (en) Image annotation method and device, terminal equipment and storage medium
CN111415339B (en) Image defect detection method for complex texture industrial product
CN110378254B (en) Method and system for identifying vehicle damage image modification trace, electronic device and storage medium
CN117173172B (en) Machine vision-based silica gel molding effect detection method and system
CN111597933A (en) Face recognition method and device
CN115063584A (en) Pipeline steam leakage detection method and detection system based on deep learning
CN115861210A (en) Transformer substation equipment abnormity detection method and system based on twin network
CN112308148A (en) Defect category identification and twin neural network training method, device and storage medium
CN114708247A (en) Cigarette case packaging defect identification method and device based on deep learning
CN110111311B (en) Image quality evaluation method and device
CN114820626A (en) Intelligent detection method for automobile front part configuration
CN114359172A (en) Cigarette carton multi-face detection and identification method and system under stock or display scene
CN112750113B (en) Glass bottle defect detection method and device based on deep learning and linear detection
CN115620083B (en) Model training method, face image quality evaluation method, equipment and medium
CN117079286A (en) Identification method and identification system for pointer instrument
CN116977249A (en) Defect detection method, model training method and device
CN116342499A (en) Multi-dimensional quality inspection method and system for bags
CN115761606A (en) Box electric energy meter identification method and device based on image processing

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230823

Address after: 213000 2nd, 3rd and 4th floors, Room 105, Building 12, Changzhou Tian'an Digital City, No. 588, Changwu South Road, Wujin National Hi tech Industrial Development Zone, Changzhou, Jiangsu

Applicant after: Leading optical technology (Jiangsu) Co.,Ltd.

Address before: 215500 No.9, research institute road, Changshu Economic and Technological Development Zone, Suzhou City, Jiangsu Province

Applicant before: Leading optical technology (Changshu) Co.,Ltd.