CN114882033B - Flaw online detection method and system for medical packaging box product - Google Patents

Flaw online detection method and system for medical packaging box product Download PDF

Info

Publication number
CN114882033B
CN114882033B CN202210807991.9A CN202210807991A CN114882033B CN 114882033 B CN114882033 B CN 114882033B CN 202210807991 A CN202210807991 A CN 202210807991A CN 114882033 B CN114882033 B CN 114882033B
Authority
CN
China
Prior art keywords
packaging box
medical packaging
image
box product
pixel points
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.)
Active
Application number
CN202210807991.9A
Other languages
Chinese (zh)
Other versions
CN114882033A (en
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.)
Xinjian Intelligent Control Shenzhen Technology Co ltd
Original Assignee
Xinjian Intelligent Control Shenzhen Technology 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 Xinjian Intelligent Control Shenzhen Technology Co ltd filed Critical Xinjian Intelligent Control Shenzhen Technology Co ltd
Priority to CN202210807991.9A priority Critical patent/CN114882033B/en
Publication of CN114882033A publication Critical patent/CN114882033A/en
Application granted granted Critical
Publication of CN114882033B publication Critical patent/CN114882033B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8854Grading and classifying of flaws
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • 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/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Chemical & Material Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Signal Processing (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Quality & Reliability (AREA)
  • Analysing Materials By The Use Of Radiation (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a flaw online detection method of a medical packaging box product, which comprises the following steps: acquiring an image of the medical packaging box product, and searching a template image corresponding to the image of the medical packaging box product from a template image library; carrying out image alignment processing on the image of the medical packaging box product and the template image of the medical packaging box product, and calculating a difference vector between the image of the medical packaging box product and the template image; establishing a classification model for detecting whether the image of the medical packaging box product has defects, training the classification model and inspecting the performance of the classification model; the image of the medical packaging box product and the template image of the medical packaging box product are input into the classification model, and the classification model outputs a result whether pixel points of the image of the medical packaging box product have flaws or not.

Description

Flaw online detection method and system for medical packaging box product
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a flaw online detection method and a flaw online detection system for medical packaging box products.
Background
According to the management standard of the medical packaging box products, the medical packaging box products must be subjected to three-stage detection before leaving factories, the three-stage detection of the medical packaging box products is generally carried out manually in the prior art, namely, the medical packaging box product or the image of the medical packaging box product needs to be manually checked to judge whether the medical packaging box product has defects in the third period or not, and the defective products are removed, the method has high requirement on the skill level of the manual work, and is easy to greatly influence the working efficiency of the three-stage detection of the medical packaging box product under the condition that the skill level of the manual work is not high enough, therefore, the method and the system for detecting the flaws of the medical packaging box products on line are researched, the medical packaging box products with the flaws in the third stage are automatically identified without depending on a large amount of manual operation, and the method and the system have very important practical significance.
Disclosure of Invention
The image of the medical packaging box product and the template image of the medical packaging box product are aligned, so that the difference vector of the image and the template image is conveniently extracted, a real label whether a pixel point of the image has a flaw or not is generated, a classification model for identifying whether the image has the flaw or not is trained and checked by using the difference vector and the real label, and the purpose of automatically detecting the flaw of the medical packaging box product is achieved.
In order to achieve the above object, the present invention provides an online defect detection method for medical packaging box products, which mainly comprises the following steps:
acquiring an image of a medical packaging box product, and searching a template image corresponding to the image of the medical packaging box product from a template image library, wherein different template images of the medical packaging box product are stored in the template image library;
performing image alignment processing on the image of the medical packaging box product and the template image of the medical packaging box product, and calculating a difference vector between the image of the medical packaging box product and the template image of the medical packaging box product based on the aligned image of the medical packaging box product and the template image of the medical packaging box product;
establishing a machine-learned classification model for detecting whether flaws exist in the image of the medical packaging box product, constructing a training data set and a verification data set of the classification model, simultaneously performing training processing on the classification model by using the training data set, and verifying the performance of the classification model by using the verification data set;
inputting the difference vector between the image of the medical packaging box product and the template image of the medical packaging box product into the classification model, outputting a result whether each pixel point of the image of the medical packaging box product has a flaw or not by the classification model, judging that the medical packaging box product has no flaw only when each pixel point of the image of the medical packaging box product has no flaw, and otherwise, judging that the medical packaging box product has a flaw.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention relates to a flaw online detection method of a medical packaging box product, which comprises the following steps of firstly, obtaining an image of the medical packaging box product, and searching a template image corresponding to the image of the medical packaging box product from a template image library; secondly, carrying out image alignment processing on the image of the medical packaging box product and the template image of the medical packaging box product, and calculating a difference vector between the image of the medical packaging box product and the template image; thirdly, establishing a classification model for detecting whether the image of the medical packaging box product has defects, training the classification model and inspecting the performance of the classification model; finally, inputting the difference vector between the image of the medical packaging box product and the template image of the medical packaging box product into a classification model, and outputting a result whether pixel points of the image of the medical packaging box product have flaws or not by the classification model;
2. the method solves the problems that in the prior art, when the flaw detection of the medical packaging box product is carried out manually, the requirement on the skill level of the manual work is high, and the manual work efficiency is low, can realize the automatic detection of the flaw of the medical packaging box product without spending a large amount of manual work, and has the advantages of good detection accuracy and high detection efficiency.
Drawings
FIG. 1 is a flow chart illustrating the steps of the method for detecting flaws on a medical packaging box product according to the present invention;
FIG. 2 is a structural diagram of the on-line defect detecting system for medical packaging box products according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another. For example, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script, without departing from the scope of the present application.
Referring to fig. 1, the invention provides an online defect detection method for a medical packaging box product, which is mainly realized by executing the following steps:
the method comprises the steps of firstly, obtaining an image of a medical packaging box product, and searching a template image corresponding to the image of the medical packaging box product from a template image library, wherein the template image library stores template images of different medical packaging box products.
Performing image alignment processing on the image of the medical packaging box product and the template image of the medical packaging box product, and calculating a difference vector between the image of the medical packaging box product and the template image of the medical packaging box product based on the aligned image of the medical packaging box product and the template image of the medical packaging box product;
further, the image alignment processing is performed on the image of the medical packaging box product and the template image of the medical packaging box product, and the method further comprises the following steps:
step one, traversing pixel points of the image of the medical packaging box product, respectively generating feature descriptors of the pixel points, and simultaneously respectively obtaining the feature descriptors of the pixel points of the template image of the medical packaging box product by using the same method;
secondly, determining pixel points of the template image of the medical packaging box product, which are matched with the pixel points of the image of the medical packaging box product, based on the feature descriptors of the pixel points of the image of the medical packaging box product and the feature descriptors of the pixel points of the template image of the medical packaging box product;
thirdly, calculating a transformation relation from the pixel points of the image of the medical packaging box product to the pixel points of the template image of the medical packaging box product according to the pixel points of the image of the medical packaging box product and the matched pixel points of the template image of the medical packaging box product;
fourthly, according to the transformation relation, respectively mapping pixel points of the image of the medical packaging box product to pixel points of the template image of the medical packaging box product;
specifically, the inventor considers that after the image of the medical packaging box product is obtained by the camera, the image angle is deviated between the image of the medical packaging box product and the template image of the medical packaging box product, so that the image alignment processing is required to be carried out on the image of the medical packaging box product and the template image, and the image alignment processing roughly comprises the following steps: the first step is to generate the feature descriptors of the pixel points of the image, the feature descriptors can be coded according to the image features of the pixel points to distinguish different pixel points, the feature descriptors of the corresponding pixel points in the two images are the same, the second step is to determine a plurality of matched pixel points in the two images by comparing the feature descriptors of the pixel points of the image of the medical packaging box product with the feature descriptors of the pixel points of the template image of the medical packaging box product, the third step is to calculate the conversion relationship from the image to the template image by using mathematical operation after the matched pixel points in the image of the medical packaging box product and the template image of the medical packaging box product are obtained, such as translation, zoom and rotation, and the fourth step is to map the pixel points of the image of the medical packaging box product to the pixel points of the template image of the medical packaging box product respectively, namely, the alignment of the image and the template image is realized;
further, the method for determining the pixel points of the template image of the medical packaging box product matched with the pixel points of the image of the medical packaging box product comprises the following steps:
firstly, forming unprocessed pixel points of the image of the medical packaging box product into a pixel point setpAnd from a set of pixel pointspIn selecting a pixel pointp i Simultaneously, the above-mentioned pixel points are combinedp i The similarity matching is carried out on the characteristic descriptors of the pixel points of the template image of the medical packaging box product, the pixel points of the template image of the medical packaging box product are sequenced from high to low according to the similarity, and the pixel points with higher similarity are determinedkPixel points of the template image of the individual medical packaging box product form a pixel point setm
Second, from the set of pixel pointsmIn selecting a pixel pointm i Simultaneously, the above-mentioned pixel points are combinedm i The similarity matching is carried out on the characteristic descriptors of the pixel points of the image of the medical packaging box product, the pixel points of the image of the medical packaging box product are sequenced from high to low according to the similarity, and the pixel points with higher similarity are determinedkPixel points of the image of the individual medical packaging box product form a pixel point sete
Thirdly, judging the pixel pointsp i Whether or not to be in the set of pixel pointseIf so, the pixel points are determinedp i And the above pixel pointsm i Matching, otherwise, continuing the next step;
fourthly, judging the pixel point setmIf there are unprocessed pixel points, continue to select the pixel point setmSkipping to the second step, otherwise, continuing the next step;
fifthly, judging the pixel point setpWhether or not to go backIf there are unprocessed pixel points, then continue to select the pixel point setpSkipping to the first step when the next pixel point is in the process, otherwise, ending the step;
specifically, determining pixel points of a template image of a medical packaging box product which are matched with the pixel points of the image of the medical packaging box product is an important step in the image alignment processing, and only if the pixel points which are matched with each other are accurately positioned, the pixel points in the image can be correctly corresponding to the pixel points in the template image, which is also the basis for subsequently constructing a training data set and a verification data set of the classification model, and one pixel point in the image is selected firstlyp i And determining the best matched front point in the template imagekEach pixel point forms a pixel point setmSecond from the set of pixel pointsmIn which a pixel point is selectedm i And determining the best matching front in the image with the pixel pointkEach pixel point forms a pixel point seteAnd finally if the pixel pointp i Set of pixel pointseIn this way, the pixel points are illustratedp i And pixel pointm i The matching accuracy between the pixel points of the image of the medical packaging box product and the pixel points of the template image of the medical packaging box product can be improved by matching the pixel points of the image of the medical packaging box product and the pixel points of the template image of the medical packaging box product;
further, calculating a difference vector between the image of the medical packaging box product and the template image of the medical packaging box productHThe method is realized by the following calculation formula:
H=[d 1 , d 2 , …, d n ], d i f (|α i β i / β i |), i∈[1,n];
wherein,nthe number of the pixel points of the image of the medical packaging box product,d i the first image of the medical packaging box productiThe medical packaging box system with matched pixel pointsTemplate image of articleiThe difference value between the pixel points is calculated,α i the first image of the medical packaging box productiThe pixel values of the individual pixel points,β i the first template image of the medical packaging box productiPixel value, function of individual pixel pointfIn a fluid passing throughα i β i / β i When | is less than the preset threshold, orderd i Is 0, otherwise, orderd i The molecular weight of the compound is 1, specifically,d i a value of 0 means that there is no difference between the pixel points of the image and the pixel points of the template image,d i a value of 1 means that the pixel point of the image is different from the pixel point of the template image.
Establishing a machine learning classification model for detecting whether flaws exist in the image of the medical packaging box product, constructing a training data set and a verification data set of the classification model, training the classification model by using the training data set, and verifying the performance of the classification model by using the verification data set;
further, before constructing the training data set and the verification data set of the classification model, the method further includes obtaining the difference vectors between a plurality of images of the medical packaging box product and the template images of the medical packaging box product in advance, and correspondingly obtaining whether the images of the medical packaging box product have defective real labels, if the pixels of the images of the medical packaging box product have defects, setting the real labels to be 1, otherwise, setting the real labels to be 0; specifically, when constructing the training data set and the verification data set of the classification model based on a plurality of difference vectors and a plurality of corresponding real labels, a construction method in the prior art may be used, which is not limited in this embodiment, for example, a random sampling and hierarchical sampling method may be used;
further, the method for testing the performance of the classification model by using the training data set to train the classification model and the verification data set further comprises the following steps:
firstly, setting a plurality of groups of model parameters aiming at the classification model, and selecting one group of model parameters from the plurality of groups of model parameters;
secondly, training the classification model by using a training data set based on a selected group of model parameters, and checking the performance of the classification model by using a verification data set after the training is finished, specifically calculating the performance score of the classification model by comparing whether each pixel of the image of the medical packaging box product output by the classification model has a defective result with whether each pixel of the image of the medical packaging box product has a defective real label;
thirdly, if the performance score of the currently calculated classification model is higher than the performance score of the previously calculated classification model, the classification model determines to use the selected group of model parameters, otherwise, judges whether other unprocessed group of model parameters exist, if so, continues to select the next group of model parameters, and jumps to the second step, otherwise, ends the step;
specifically, the classification model may be a support vector machine in a machine learning model, the present embodiment does not limit the type of the classification model, and after the training of the classification model, the classification model can learn an internal relationship between a difference vector between the image and the template image and whether each pixel point of the image has a defect, and in addition, the trained classification model further needs to verify its performance, and can be used to automatically detect a defect in the image only when its performance meets a requirement, where a performance score of the classification model can be calculated using a performance calculation formula as followsS
Figure DEST_PATH_IMAGE001
Wherein,ρthe number of the output of the classification model, namely the number of the pixel points of the image of the medical packaging box product,μthe output of the classification model is 0, and the corresponding number of the real label is also 0,νthe number of the output of the classification model is 0 and the corresponding real label is 1,λin order to set the adjustment parameters in advance,λmore than 0 and less than 1, which can be set according to specific calculation requirements, the embodiment is not limited thereto, and experimental data indicate that the higher the performance score of the classification model obtained by calculation is, the better the performance of the classification model is.
Step four, inputting the difference vector between the image of the medical packaging box product and the template image of the medical packaging box product into the classification model, wherein the classification model outputs a result whether each pixel point of the image of the medical packaging box product has a flaw or not, and only when each pixel point of the image of the medical packaging box product has no flaw, the medical packaging box product is judged to have no flaw, otherwise, the medical packaging box product is judged to have a flaw.
Further, referring to fig. 2, the present invention also provides an online defect detection system for a medical packaging product, which is used for implementing the online defect detection method for a medical packaging product described above, wherein the functions of the modules are as follows:
the image acquisition module is used for acquiring the image of the medical packaging box product and searching a template image corresponding to the image of the medical packaging box product from a template image library;
the image alignment module is used for carrying out image alignment processing on the image of the medical packaging box product and the template image of the medical packaging box product and calculating a difference vector between the image of the medical packaging box product and the template image of the medical packaging box product;
the model training module is used for establishing a machine learning classification model for detecting whether flaws exist in the image of the medical packaging box product, meanwhile, training the classification model by using a training data set, and checking the performance of the classification model by using a verification data set;
and the defect detection module is used for inputting the difference vector between the image of the medical packaging box product and the template image of the medical packaging box product into the classification model and obtaining a result of whether the medical packaging box product has defects or not.
In summary, according to the method for detecting the flaws of the medical packaging box product on line, firstly, the image of the medical packaging box product is obtained, and the template image corresponding to the image of the medical packaging box product is found out from the template image library; secondly, carrying out image alignment processing on the image of the medical packaging box product and the template image of the medical packaging box product, and calculating a difference vector between the image of the medical packaging box product and the template image; thirdly, establishing a classification model for detecting whether the image of the medical packaging box product has defects, training the classification model and inspecting the performance of the classification model; and finally, inputting the difference vector between the image of the medical packaging box product and the template image of the medical packaging box product into a classification model, and outputting a result whether pixel points of the image of the medical packaging box product have flaws or not by the classification model. The method solves the problems that in the prior art, when the flaw detection of the medical packaging box product is carried out manually, the requirement on the skill level of the manual work is high, and the manual work efficiency is low, can realize the automatic detection of the flaw of the medical packaging box product without spending a large amount of manual work, and has the advantages of good detection accuracy and high detection efficiency.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in various embodiments may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included therein.

Claims (5)

1. The method for detecting the flaws of the medical packaging box product on line is characterized by comprising the following steps of:
acquiring an image of a medical packaging box product, and searching a template image corresponding to the image of the medical packaging box product from a template image library, wherein the template image library stores template images of different medical packaging box products;
performing image alignment processing on the image of the medical packaging box product and the template image of the medical packaging box product, and calculating a difference vector between the image of the medical packaging box product and the template image of the medical packaging box product based on the aligned image of the medical packaging box product and the template image of the medical packaging box product;
establishing a machine-learned classification model for detecting whether flaws exist in the image of the medical packaging box product, constructing a training data set and a verification data set of the classification model, simultaneously performing training processing on the classification model by using the training data set, and verifying the performance of the classification model by using the verification data set;
inputting the difference vector between the image of the medical packaging box product and the template image of the medical packaging box product into the classification model, outputting a result whether each pixel point of the image of the medical packaging box product has a flaw or not by the classification model, and judging that the medical packaging box product has no flaw only when each pixel point of the image of the medical packaging box product has no flaw, otherwise, judging that the medical packaging box product has a flaw;
the image alignment processing is carried out on the image of the medical packaging box product and the template image of the medical packaging box product, and the method further comprises the following steps:
traversing pixel points of the image of the medical packaging box product, respectively generating feature descriptors of the pixel points, and simultaneously respectively obtaining the feature descriptors of the pixel points of the template image of the medical packaging box product by using the same method;
determining pixel points of the template image of the medical packaging box product, which are matched with the pixel points of the image of the medical packaging box product, based on the feature descriptors of the pixel points of the image of the medical packaging box product and the feature descriptors of the pixel points of the template image of the medical packaging box product;
calculating a transformation relation from the pixel points of the image of the medical packaging box product to the pixel points of the template image of the medical packaging box product according to the pixel points of the image of the medical packaging box product and the matched pixel points of the template image of the medical packaging box product;
according to the transformation relation, respectively mapping pixel points of the image of the medical packaging box product to pixel points of a template image of the medical packaging box product;
determining pixel points of the template image of the medical packaging box product, which are matched with the pixel points of the image of the medical packaging box product, and further comprising the following steps:
forming unprocessed pixel points of the image of the medical packaging box product into a pixel point setpAnd from a set of pixel pointspIn selecting a pixel pointp i Simultaneously applying the pixel pointsp i The similarity matching is carried out on the characteristic descriptors of the pixel points of the template image of the medical packaging box product, the pixel points of the template image of the medical packaging box product are sequenced from high to low according to the similarity, and the pixel points with higher similarity are determinedkPixel points of the template image of the individual medical packaging box product form a pixel point setm
From the stationThe pixel point setmIn selecting a pixel pointm i Simultaneously applying the pixel pointsm i The similarity matching is carried out on the characteristic descriptors of the pixel points of the image of the medical packaging box product, the pixel points of the image of the medical packaging box product are sequenced from high to low according to the similarity, and the pixel points with higher similarity are determinedkPixel points of the image of the individual medical packaging box product form a pixel point sete
Judging the pixel pointsp i Whether at the set of pixel pointseIf so, the pixel point is determinedp i And said pixel pointm i Matching, otherwise, continuing the next step;
judging the pixel point setmIf there are unprocessed pixel points, continuing to select the pixel point setmSkipping to the second step, otherwise, continuing the next step;
judging the pixel point setpIf there are unprocessed pixel points, continuing to select the pixel point setpAnd skipping to the first step, otherwise, ending the step.
2. The method of claim 1, wherein the difference vector between the image of the medical packaging box product and the template image of the medical packaging box product is calculatedHThe method is realized by the following calculation formula:
H=[d 1 , d 2 , …, d n ], d i f (|α i β i / β i |), i∈[1,n];
wherein,nthe number of the pixel points of the image of the medical packaging box product,d i is an image of the medical packaging box productiThe pixel points are matched with the medical packaging box systemTemplate image of articleiThe difference value between the pixel points is calculated,α i is an image of the medical packaging box productiThe pixel values of the individual pixel points,β i is the template image of the medical packaging box productiPixel value, function of individual pixel pointfIn a fluid passing throughα i β i / β i When | is less than the preset threshold, orderd i Is 0, otherwise, orderd i Is 1.
3. The method according to claim 1, wherein before the training data set and the verification data set of the classification model are constructed, the method further comprises obtaining the difference vectors between the images of the medical packaging box products and the template images of the medical packaging box products in advance, and correspondingly obtaining a real label of whether the images of the medical packaging box products have defects, if a pixel point of the images of the medical packaging box products has a defect, setting the real label to be 1, otherwise, setting the real label to be 0.
4. The method of claim 1, wherein the training process is performed on the classification model using a training data set, and the performance of the classification model is verified using a verification data set, further comprising the steps of:
setting a plurality of sets of model parameters for the classification model, and selecting one set of model parameters from the plurality of sets of model parameters;
training the classification model by using a training data set based on a selected group of model parameters, and checking the performance of the classification model by using a verification data set after the training is finished, and specifically calculating the performance score of the classification model by comparing the result of whether each pixel point of the image of the medical packaging box product output by the classification model has a defect and the real label of whether each pixel point of the image of the medical packaging box product has a defect;
if the performance score of the classification model calculated currently is higher than the performance score of the classification model calculated previously, the classification model determines to use the selected set of model parameters, otherwise, judges whether other unprocessed sets of model parameters exist, if so, continues to select the next set of model parameters, and jumps to the second step, otherwise, ends the step.
5. An on-line defect detection system for medical packaging products, for implementing the method according to any one of claims 1 to 4, characterized in that it comprises the following modules:
the image acquisition module is used for acquiring an image of the medical packaging box product and searching a template image corresponding to the image of the medical packaging box product from a template image library;
the image alignment module is used for carrying out image alignment processing on the image of the medical packaging box product and the template image of the medical packaging box product and calculating a difference vector between the image of the medical packaging box product and the template image of the medical packaging box product;
the model training module is used for establishing a machine learning classification model for detecting whether flaws exist in the image of the medical packaging box product, meanwhile, training the classification model by using a training data set, and checking the performance of the classification model by using a verification data set;
and the flaw detection module is used for inputting the difference vector between the image of the medical packaging box product and the template image of the medical packaging box product into the classification model and obtaining a result of whether the medical packaging box product has flaws or not.
CN202210807991.9A 2022-07-11 2022-07-11 Flaw online detection method and system for medical packaging box product Active CN114882033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210807991.9A CN114882033B (en) 2022-07-11 2022-07-11 Flaw online detection method and system for medical packaging box product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210807991.9A CN114882033B (en) 2022-07-11 2022-07-11 Flaw online detection method and system for medical packaging box product

Publications (2)

Publication Number Publication Date
CN114882033A CN114882033A (en) 2022-08-09
CN114882033B true CN114882033B (en) 2022-09-20

Family

ID=82682638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210807991.9A Active CN114882033B (en) 2022-07-11 2022-07-11 Flaw online detection method and system for medical packaging box product

Country Status (1)

Country Link
CN (1) CN114882033B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117437221B (en) * 2023-12-18 2024-04-26 浙江祥晋汽车零部件股份有限公司 Method and system for detecting bright decorative strip based on image detection

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112598627A (en) * 2020-12-10 2021-04-02 广东省大湾区集成电路与系统应用研究院 Method, system, electronic device and medium for detecting image defects
CN113516612A (en) * 2020-04-13 2021-10-19 阿里巴巴集团控股有限公司 Data processing method, device, equipment and storage medium
CN114092396A (en) * 2021-10-11 2022-02-25 安庆师范大学 Method and device for detecting corner collision flaw of packaging box
CN114140385A (en) * 2021-10-26 2022-03-04 杭州涿溪脑与智能研究所 Printed circuit board defect detection method and system based on deep learning

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10964015B2 (en) * 2019-01-15 2021-03-30 International Business Machines Corporation Product defect detection
CN110987968A (en) * 2019-09-30 2020-04-10 烟台南山学院 Method for detecting defects on surface of cloth by using three-dimensional matrix representation image
CN114596314A (en) * 2022-05-09 2022-06-07 合肥联亚制衣有限公司 Training method, device, equipment and medium for cloth flaw detection model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113516612A (en) * 2020-04-13 2021-10-19 阿里巴巴集团控股有限公司 Data processing method, device, equipment and storage medium
CN112598627A (en) * 2020-12-10 2021-04-02 广东省大湾区集成电路与系统应用研究院 Method, system, electronic device and medium for detecting image defects
CN114092396A (en) * 2021-10-11 2022-02-25 安庆师范大学 Method and device for detecting corner collision flaw of packaging box
CN114140385A (en) * 2021-10-26 2022-03-04 杭州涿溪脑与智能研究所 Printed circuit board defect detection method and system based on deep learning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于机器视觉的产品瑕疵识别系统设计;张济民 等;《工业控制计算机》;20140331;第27卷(第3期);第58-59页 *

Also Published As

Publication number Publication date
CN114882033A (en) 2022-08-09

Similar Documents

Publication Publication Date Title
CN111179251B (en) Defect detection system and method based on twin neural network and by utilizing template comparison
CN109271401B (en) Topic searching and correcting method and device, electronic equipment and storage medium
CN113516661B (en) Defect detection method and device based on feature fusion
US20100299355A1 (en) Image search apparatus and method thereof
CN113570003B (en) Feature fusion defect detection method and device based on attention mechanism
CN111401472B (en) Infrared target classification method and device based on deep convolutional neural network
CN114882033B (en) Flaw online detection method and system for medical packaging box product
CN113239800B (en) Target detection method and target detection device
CN113221987A (en) Small sample target detection method based on cross attention mechanism
CN114119460B (en) Semiconductor image defect recognition method, device, computer equipment and storage medium
CA3166088A1 (en) Training method and pedestrian re-identification method of multi-task classification network
CN110766075A (en) Tire area image comparison method and device, computer equipment and storage medium
CN111124896B (en) Metamorphic test system for primary and secondary peak ratio calculation algorithm
CN111124895B (en) Metamorphic testing method for primary and secondary peak ratio calculation algorithm
CN117235565A (en) Transformer fault diagnosis model construction method and device
CN113947597A (en) Industrial defect detection method, device and medium based on shielding reconstruction
CN114782756B (en) Defect detection method, device and equipment based on feature fusion and storage medium
Zou et al. YOLOv7‐EAS: A Small Target Detection of Camera Module Surface Based on Improved YOLOv7
CN112464660A (en) Text classification model construction method and text data processing method
CN116311391A (en) High-low precision mixed multidimensional feature fusion fingerprint retrieval method
CN115564734A (en) Product detection method, electronic equipment and storage medium
CN114155471A (en) Design drawing and object verification method, device, computer equipment and system
García et al. A configuration approach for convolutional neural networks used for defect detection on surfaces
Villena Toro et al. Automated and customized cad drawings by utilizing machine learning algorithms: A case study
CN114692887A (en) Semi-supervised learning system and semi-supervised learning method

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
GR01 Patent grant
GR01 Patent grant