CN114782755A - Training method of penicillin bottle detection model, and penicillin bottle detection method and device - Google Patents
Training method of penicillin bottle detection model, and penicillin bottle detection method and device Download PDFInfo
- Publication number
- CN114782755A CN114782755A CN202210659628.7A CN202210659628A CN114782755A CN 114782755 A CN114782755 A CN 114782755A CN 202210659628 A CN202210659628 A CN 202210659628A CN 114782755 A CN114782755 A CN 114782755A
- Authority
- CN
- China
- Prior art keywords
- penicillin bottle
- pictures
- bottles
- detection model
- penicillin
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a training method of a penicillin bottle detection model, a penicillin bottle detection method and a device, wherein the method comprises the following steps: acquiring penicillin bottle picture samples with a preset number as a training set; wherein the number of qualified bottles is greater than the number of defective bottles; cutting the penicillin bottle picture into a plurality of same basic units; carrying out normalization processing on a plurality of basic units; extracting the characteristics of the penicillin bottle pictures according to the basic unit; clustering penicillin bottle pictures subjected to feature extraction according to the extracted features to obtain a preset number of categories; inputting the clustered penicillin bottle pictures into a neural network classification algorithm, and outputting a final classification result; the final classification result comprises pass and defect; and adjusting the parameters of the penicillin bottle detection model according to the final classification result to obtain the trained penicillin bottle detection model. According to the method and the device, by reasonably distributing the sample categories, the problem of unbalanced samples is relieved, and the classification accuracy is improved.
Description
Technical Field
The invention relates to the field of data defect detection, in particular to a training method of a penicillin bottle detection model, a penicillin bottle detection method and a penicillin bottle detection device.
Background
Data defect detection can be applied to many fields, such as defect data intrusion detection of computers, medical defect data detection, sensor detection defect data and the like; at present, the mainstream detection mode is detection through a sensor, but various problems can be encountered in the actual operation process, for example, due to large time drift and temperature drift, real and effective data may not be obtained in long-time detection, so that an image detection algorithm based on artificial intelligence is required to be used, defect data under a complex condition can be detected, and the detection is more accurate.
In the prior art, for defect detection of penicillin bottles, a large amount of sample data is required, the defect detection is not suitable for small-scale data sets, the class distribution of samples is unbalanced, one class occupies a main part, and the other class is few in the collected samples, so that the problem of inaccuracy exists in the conventional detection result.
Disclosure of Invention
The invention provides a training method of a penicillin bottle detection model, a penicillin bottle detection method and a penicillin bottle detection device, which are used for solving the problem that a small-scale data set cannot be used and the sample class is unevenly distributed in the existing detection technology.
In order to solve the above problems, the present invention is realized by:
in a first aspect, an embodiment of the present invention provides a training method for a penicillin bottle detection model, including:
acquiring penicillin bottle picture samples with a preset number as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
image cutting is carried out on penicillin bottle pictures in the training set, and the penicillin bottle pictures are cut into a plurality of same basic units;
carrying out normalization processing on a plurality of basic units;
extracting the characteristics of the penicillin bottle pictures according to the basic unit;
clustering the penicillin bottle pictures after feature extraction according to the extracted features to obtain classes of preset number; wherein the penicillin bottle pictures in each category have the same main characteristics;
inputting the clustered penicillin bottle pictures into a neural network classification algorithm, and outputting a final classification result; the final classification result comprises pass and defect;
and adjusting the parameters of the penicillin bottle detection model according to the final classification result to obtain the trained penicillin bottle detection model.
Optionally, the dividing the penicillin bottle picture sample into a qualified bottle and a defective bottle includes:
and distributing the qualified bottles and the defective bottles in the penicillin bottle picture sample according to a ratio of 9: 1.
Optionally, the image cutting is performed on the penicillin bottle pictures in the training set, and the penicillin bottle pictures are cut into a plurality of same basic units, including:
performing image cutting on the penicillin bottle pictures in the training set, and cutting the penicillin bottle pictures into a plurality of identical detection windows;
cutting the detection windows into a plurality of identical detection blocks;
and cutting a plurality of the detection blocks into a plurality of same basic units.
Optionally, the normalizing the plurality of basic units includes at least one of: illumination processing, shadow processing, and edge compression processing.
Optionally, the performing feature extraction on the penicillin bottle picture according to the basic unit includes:
calculating the gradient in the abscissa direction and the gradient in the ordinate direction of the plurality of base units after the normalization processing, calculating the gradient direction of the plurality of base units according to the gradient in the abscissa direction and the gradient in the ordinate direction, and obtaining the characteristics of the penicillin bottle picture according to the gradient direction of the plurality of base units.
In a second aspect, an embodiment of the present invention provides a method for detecting a vial, where the vial detection model according to any one of the first aspect is applied, and the method includes:
acquiring a penicillin bottle picture;
inputting the penicillin bottle picture into the penicillin bottle detection model; the penicillin bottle detection model acquires a preset number of penicillin bottle image samples as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
outputting a final classification result of the penicillin bottle pictures; the final classification result includes pass and defect.
In a third aspect, an embodiment of the present invention provides a training apparatus for a penicillin bottle detection model, including:
the first acquisition module is used for acquiring penicillin bottle picture samples with a preset number as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
the cutting module is used for cutting images of the penicillin bottle pictures in the training set into a plurality of same basic units;
the normalization processing module is used for performing normalization processing on the plurality of basic units;
the characteristic extraction module is used for extracting the characteristics of the penicillin bottle pictures according to the basic unit;
the clustering module is used for clustering the penicillin bottle pictures after feature extraction according to the extracted features to obtain the categories of the preset number; wherein the penicillin bottle pictures in each category have the same main characteristics;
the classification module is used for inputting the clustered penicillin bottle pictures into a neural network classification algorithm and outputting a final classification result; the final classification result comprises pass and defect;
and the parameter adjusting module is used for adjusting the parameters of the penicillin bottle detection model according to the final classification result to obtain the trained penicillin bottle detection model.
Optionally, the first obtaining module includes:
and the classification submodule is used for distributing the qualified bottles and the defective bottles in the penicillin bottle picture samples according to the proportion of 9: 1.
Optionally, the cutting module includes:
the cutting sub-module is used for carrying out image cutting on the penicillin bottle pictures in the training set and cutting the penicillin bottle pictures into a plurality of same detection windows; cutting the detection windows into a plurality of identical detection blocks; and cutting a plurality of the detection blocks into a plurality of same basic units.
Optionally, the normalizing the plurality of basic units includes at least one of: illumination processing, shadow processing, and edge compression processing.
Optionally, the feature extraction module includes:
and the calculation sub-module is used for calculating the gradients in the abscissa direction and the gradients in the ordinate direction of the plurality of the basic units after the normalization processing, calculating the gradient directions of the plurality of the basic units according to the gradients in the abscissa direction and the gradients in the ordinate direction, and obtaining the characteristics of the penicillin bottle pictures according to the gradient directions of the plurality of the basic units.
In a fourth aspect, an embodiment of the present invention provides a penicillin bottle detection apparatus, where the penicillin bottle detection model according to any one of the first aspects is applied, and the apparatus includes:
the second acquisition module is used for acquiring penicillin bottle pictures;
the detection module is used for inputting the penicillin bottle picture into the penicillin bottle detection model; the penicillin bottle detection model acquires a preset number of penicillin bottle image samples as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
the output module is used for outputting the final classification result of the penicillin bottle pictures; the final classification result includes pass and defect.
In a fifth aspect, an embodiment of the present invention provides a server, including: a processor, a memory and a program stored on the memory and running on the processor, wherein the program when executed by the processor implements the steps of the training method for the penicillin bottle detection model according to any one of the first aspect, or the penicillin bottle detection method according to the second aspect.
In a sixth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the training method for penicillin bottle detection model according to any one of the first aspect, or the penicillin bottle detection method according to the second aspect.
In the invention, by reasonably distributing the sample types, the problem that a small-scale data set and the sample types cannot be distributed unevenly in the conventional detection technology is solved, and the classification accuracy is improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of a training method of a penicillin bottle detection model according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for detecting penicillin bottles according to an embodiment of the present invention;
fig. 3 is a general flowchart of a penicillin bottle detection method according to an embodiment of the present invention;
fig. 4 is a structural diagram of a training device of a penicillin bottle detection model according to an embodiment of the present invention;
fig. 5 is a structural diagram of a detection device for penicillin bottles according to an embodiment of the present invention;
fig. 6 is a diagram of a server architecture according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the drawings of the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the invention, are within the scope of the invention.
Unless otherwise defined, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs. The use of "first," "second," and the like, herein does not denote any order, quantity, or importance, but rather the terms "first," "second," and the like are used to distinguish one element from another. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used only to indicate relative positional relationships, and when the absolute position of the object to be described is changed, the relative positional relationships are changed accordingly.
Referring to fig. 1, an embodiment of the present invention provides a training method for a penicillin bottle detection model, including:
step 11: acquiring penicillin bottle picture samples with a preset number as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
step 12: image cutting is carried out on penicillin bottle pictures in the training set, and the penicillin bottle pictures are cut into a plurality of same basic units;
step 13: normalizing a plurality of the basic units;
step 14: extracting the characteristics of the penicillin bottle pictures according to the basic unit;
step 15: clustering the penicillin bottle pictures after feature extraction according to the extracted features to obtain classes of preset number; wherein the penicillin bottle pictures in each category have the same main characteristics;
step 16: inputting the clustered penicillin bottle pictures into a neural network classification algorithm, and outputting a final classification result; the final classification result comprises pass and defect;
and step 17: and adjusting the parameters of the penicillin bottle detection model according to the final classification result to obtain the trained penicillin bottle detection model.
In the embodiment of the invention, the problem that a small-scale data set and sample categories cannot be distributed unevenly in the existing detection technology is solved by reasonably distributing the sample categories, and the classification accuracy is improved.
In the embodiment of the invention, in step 11, a preset number of penicillin bottle picture samples are obtained as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles; for example: the method comprises the steps of obtaining 3000 high-definition pictures of penicillin bottles, using the pictures as a training and testing data set of the embodiment, and selecting 300 pictures from the pictures, wherein the qualified bottles and the defective bottles in the penicillin bottle picture samples are distributed according to a ratio of 9:1 to serve as a training set, and the rest pictures serve as a testing set to be used in subsequent tests.
In the embodiment of the invention, the characteristics of the penicillin bottle picture are extracted through a HOG (Histogram of Oriented Gradient) algorithm; the main extraction process is divided into four parts: detecting a window, normalizing an image, calculating a gradient and counting a histogram to obtain a feature vector.
In step 12, the HOG algorithm divides the image by detecting windows and blocks, and processes the pixel value of a certain area of the image by taking cells as units; the detection window is used for dividing an image into a plurality of identical windows according to a certain size, the block is used for dividing each window into a plurality of identical blocks according to a certain size, the cell is used for dividing each block into a plurality of identical cells according to a certain size, and the cell is a basic unit for feature extraction; namely, cutting the penicillin bottle picture into a plurality of same detection windows; cutting the detection windows into a plurality of identical detection blocks; cutting a plurality of the detection blocks into a plurality of same basic units; for example: dividing each penicillin bottle picture into 64 × 128 small detection windows; dividing each window into 16-by-16 detection blocks; cutting a plurality of the detection blocks into a plurality of identical 8-by-8 basic units; when calculating the block, each sliding is 8 × 8 basic units, i.e. 8 pixels up and down or left and right.
In step 13, the normalization process is to perform contrast normalization on the image, and by calculating the density of each unit and then performing normalization on each basic unit according to the density, better effects on illumination changes and shadows can be obtained after the normalization process; wherein normalizing the plurality of basic units comprises at least one of: illumination processing, shading processing, and edge compression processing.
In step 14, feature extraction is performed by calculating a gradient and a statistical histogram, and feature extraction is performed on the penicillin bottle picture according to the basic unit, including:
calculating the gradient in the abscissa direction and the gradient in the ordinate direction of the plurality of base units after the normalization processing, calculating the gradient direction of the plurality of base units according to the gradient in the abscissa direction and the gradient in the ordinate direction, and obtaining the characteristics of the penicillin bottle picture according to the gradient direction of the plurality of base units.
In the step 15-17, clustering the penicillin bottle pictures after feature extraction according to the extracted features to obtain a preset number of categories; wherein the penicillin bottle pictures in each category have the same main characteristics; according to the embodiment of the invention, a K-means clustering algorithm is adopted for clustering, and specific clustering categories can be set according to actual conditions, such as four categories; inputting the clustered penicillin bottle pictures into a neural network classification algorithm, and if four types of penicillin bottle pictures are input into the neural network classification algorithm, outputting a final classification result through calculation of a hidden layer; the final classification result comprises pass and defect; and adjusting the parameters of the penicillin bottle detection model according to the final classification result to obtain the trained penicillin bottle detection model.
In the embodiment of the invention, the small samples and the samples distributed in an unbalanced manner can have higher detection performance through reasonable distribution of the sample types, and the embodiment is used for defect detection of penicillin bottles in real time industry and defect picture detection in public data sets.
Referring to fig. 2, an embodiment of the present invention provides a method for detecting a penicillin bottle, including:
step 21: acquiring a penicillin bottle picture;
step 22: inputting the penicillin bottle picture into the penicillin bottle detection model; the penicillin bottle detection model acquires a preset number of penicillin bottle image samples as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
step 23: outputting a final classification result of the penicillin bottle pictures; the final classification result includes pass and defect.
In the embodiment of the invention, the small samples and the samples distributed in an unbalanced manner can have higher detection performance through reasonable distribution of the sample types, and the embodiment is used for defect detection of penicillin bottles in real time industry and defect picture detection in public data sets.
Referring to fig. 3, in the embodiment of the present invention, firstly, a penicillin bottle sample picture is obtained, then, the penicillin bottle sample picture is input into the penicillin bottle detection model, and the input penicillin bottle detection model is classified through an HOG feature extractor, a K-means clustering algorithm, and a BP neural network, so as to finally obtain a classification result.
Referring to fig. 4, an embodiment of the present invention provides a training apparatus for a penicillin bottle detection model, including:
the first obtaining module 41 is configured to obtain a preset number of penicillin bottle picture samples as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
the cutting module 42 is configured to perform image cutting on the vial pictures in the training set, and cut the vial pictures into a plurality of same basic units;
a normalization processing module 43, configured to perform normalization processing on a plurality of the basic units;
the feature extraction module 44 is configured to perform feature extraction on the penicillin bottle picture according to the basic unit;
the clustering module 45 is used for clustering the penicillin bottle pictures after feature extraction according to the extracted features to obtain the categories of the preset number; wherein the penicillin bottle pictures in each category have the same main characteristics;
the classification module 46 is configured to input the clustered penicillin bottle pictures into a neural network classification algorithm, and output a final classification result; the final classification result comprises pass and defect;
and the parameter adjusting module 47 is used for adjusting the parameters of the penicillin bottle detection model according to the final classification result to obtain the trained penicillin bottle detection model.
In this embodiment of the present invention, optionally, the first obtaining module includes:
and the classification submodule is used for distributing the qualified bottles and the defective bottles in the penicillin bottle picture samples according to the proportion of 9: 1.
In an embodiment of the present invention, optionally, the cutting module includes:
the cutting sub-module is used for carrying out image cutting on the penicillin bottle pictures in the training set and cutting the penicillin bottle pictures into a plurality of same detection windows; cutting the detection windows into a plurality of identical detection blocks; and cutting a plurality of the detection blocks into a plurality of same basic units.
In this embodiment of the present invention, optionally, the normalizing the plurality of basic units includes at least one of: illumination processing, shading processing, and edge compression processing.
In this embodiment of the present invention, optionally, the feature extraction module includes:
and the calculation submodule is used for calculating the gradients in the abscissa direction and the gradients in the ordinate direction of the plurality of the basic units after the normalization processing, calculating the gradient directions of the plurality of the basic units according to the gradients in the abscissa direction and the gradients in the ordinate direction, and obtaining the characteristics of the penicillin bottle picture according to the gradient directions of the plurality of the basic units.
The training device for the penicillin bottle detection model provided by the embodiment of the invention can realize each process realized by the training method for the penicillin bottle detection model in the method embodiment of fig. 1, and is not repeated here for avoiding repetition.
Referring to fig. 5, an embodiment of the present invention provides a penicillin bottle detection apparatus, which employs the penicillin bottle detection model according to any one of the first aspect, including:
the second obtaining module 51 is used for obtaining a penicillin bottle picture;
the detection module 52 is configured to input the vial image into the vial detection model; the penicillin bottle detection model acquires a preset number of penicillin bottle image samples as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
the output module 53 is configured to output a final classification result of the penicillin bottle pictures; the final classification result includes pass and defect.
The detection device for the penicillin bottle provided by the embodiment of the invention can realize each process realized by the detection method for the penicillin bottle in the method embodiment of fig. 2, and in order to avoid repetition, the details are not repeated.
Referring to fig. 6, an embodiment of the present invention further provides a server 60, which includes a processor 61, a memory 62, and a computer program stored in the memory 62 and running on the processor 61, where the computer program is executed by the processor 61 to implement the processes of the above training method for penicillin bottle detection model, and can achieve the same technical effects, and in order to avoid repetition, the details are not repeated here.
The embodiment of the invention further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program realizes each process of the training method embodiment of the penicillin bottle detection model, and can achieve the same technical effect, and is not repeated here to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a terminal) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
1. A training method for a penicillin bottle detection model is characterized by comprising the following steps:
acquiring penicillin bottle picture samples with a preset number as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
performing image cutting on the penicillin bottle pictures in the training set, and cutting the penicillin bottle pictures into a plurality of same basic units;
normalizing a plurality of the basic units;
extracting the characteristics of the penicillin bottle pictures according to the basic unit;
clustering the penicillin bottle pictures after feature extraction according to the extracted features to obtain the categories of a preset number; wherein the penicillin bottle pictures in each category have the same main characteristics;
inputting the clustered penicillin bottle pictures into a neural network classification algorithm, and outputting a final classification result; the final classification result comprises pass and defect;
and adjusting the parameters of the penicillin bottle detection model according to the final classification result to obtain the trained penicillin bottle detection model.
2. The training method for penicillin bottle detection models according to claim 1, wherein the dividing of the penicillin bottle picture samples into qualified bottles and defective bottles comprises:
and distributing the qualified bottles and the defective bottles in the penicillin bottle picture sample according to a ratio of 9: 1.
3. The method for training penicillin bottle detection models according to claim 1, wherein the image segmentation of the penicillin bottle pictures in the training set into a plurality of identical basic units comprises:
performing image cutting on the penicillin bottle pictures in the training set, and cutting the penicillin bottle pictures into a plurality of identical detection windows;
cutting a plurality of detection windows into a plurality of same detection blocks;
and cutting a plurality of the detection blocks into a plurality of same basic units.
4. The training method of penicillin bottle detection model according to claim 1,
normalizing the plurality of basic units comprises at least one of the following: illumination processing, shading processing, and edge compression processing.
5. The method for training the penicillin bottle detection model according to claim 1, wherein the step of extracting the features of the penicillin bottle pictures according to the basic unit comprises the following steps:
calculating the gradient in the abscissa direction and the gradient in the ordinate direction of the plurality of base units after the normalization processing, calculating the gradient direction of the plurality of base units according to the gradient in the abscissa direction and the gradient in the ordinate direction, and obtaining the characteristics of the penicillin bottle picture according to the gradient direction of the plurality of base units.
6. A penicillin bottle detection method, which is characterized in that the penicillin bottle detection model of any one of claims 1 to 5 is applied, and comprises the following steps:
acquiring a penicillin bottle picture;
inputting the penicillin bottle picture into the penicillin bottle detection model; the penicillin bottle detection model acquires a preset number of penicillin bottle picture samples as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
outputting a final classification result of the penicillin bottle pictures; the final classification result includes pass and defect.
7. The utility model provides a xiLin bottle detection model's trainer which characterized in that includes:
the first acquisition module is used for acquiring penicillin bottle picture samples with a preset number as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
the cutting module is used for cutting images of the penicillin bottle pictures in the training set into a plurality of same basic units;
the normalization processing module is used for performing normalization processing on the plurality of basic units;
the characteristic extraction module is used for extracting the characteristics of the penicillin bottle pictures according to the basic unit;
the clustering module is used for clustering the penicillin bottle pictures after feature extraction according to the extracted features to obtain the categories of the preset number; wherein the penicillin bottle pictures in each category have the same main characteristics;
the classification module is used for inputting the clustered penicillin bottle pictures into a neural network classification algorithm and outputting a final classification result; the final classification result comprises pass and defect;
and the parameter adjusting module is used for adjusting the parameters of the penicillin bottle detection model according to the final classification result to obtain the trained penicillin bottle detection model.
8. The penicillin bottle detection device is characterized in that the penicillin bottle detection model of any one of claims 1 to 4 is applied, and the penicillin bottle detection model comprises the following components:
the second acquisition module is used for acquiring penicillin bottle pictures;
the detection module is used for inputting the penicillin bottle picture into the penicillin bottle detection model; the penicillin bottle detection model acquires a preset number of penicillin bottle image samples as a training set; dividing the penicillin bottle picture sample into qualified bottles and defective bottles, wherein the number of the qualified bottles is more than that of the defective bottles;
the output module is used for outputting the final classification result of the penicillin bottle pictures; the final classification result includes pass and defect.
9. A server, comprising: a processor, a memory and a program stored on the memory and run on the processor, the program when executed by the processor implementing the steps of the training method of the penicillin bottle detection model according to any one of claims 1 to 5 or the penicillin bottle detection method according to claim 6.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program, which when executed by a processor implements the steps of the training method of the penicillin bottle detection model according to any one of claims 1 to 5 or the detection method of penicillin bottles according to claim 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210659628.7A CN114782755A (en) | 2022-06-13 | 2022-06-13 | Training method of penicillin bottle detection model, and penicillin bottle detection method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210659628.7A CN114782755A (en) | 2022-06-13 | 2022-06-13 | Training method of penicillin bottle detection model, and penicillin bottle detection method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114782755A true CN114782755A (en) | 2022-07-22 |
Family
ID=82421241
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210659628.7A Withdrawn CN114782755A (en) | 2022-06-13 | 2022-06-13 | Training method of penicillin bottle detection model, and penicillin bottle detection method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114782755A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106952258A (en) * | 2017-03-23 | 2017-07-14 | 南京汇川图像视觉技术有限公司 | A kind of bottle mouth defect detection method based on gradient orientation histogram |
CN112330591A (en) * | 2020-09-30 | 2021-02-05 | 中国铁道科学研究院集团有限公司 | Steel rail surface defect detection method and device capable of achieving sample-less learning |
CN114065874A (en) * | 2021-11-30 | 2022-02-18 | 河北省科学院应用数学研究所 | Medicine glass bottle appearance defect detection model training method and device and terminal equipment |
-
2022
- 2022-06-13 CN CN202210659628.7A patent/CN114782755A/en not_active Withdrawn
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106952258A (en) * | 2017-03-23 | 2017-07-14 | 南京汇川图像视觉技术有限公司 | A kind of bottle mouth defect detection method based on gradient orientation histogram |
CN112330591A (en) * | 2020-09-30 | 2021-02-05 | 中国铁道科学研究院集团有限公司 | Steel rail surface defect detection method and device capable of achieving sample-less learning |
CN114065874A (en) * | 2021-11-30 | 2022-02-18 | 河北省科学院应用数学研究所 | Medicine glass bottle appearance defect detection model training method and device and terminal equipment |
Non-Patent Citations (1)
Title |
---|
刘玉环: "《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》", 15 November 2018 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108846835B (en) | Image change detection method based on depth separable convolutional network | |
WO2021139258A1 (en) | Image recognition based cell recognition and counting method and apparatus, and computer device | |
CN112801146B (en) | Target detection method and system | |
US11455831B2 (en) | Method and apparatus for face classification | |
CN104537359B (en) | A kind of vehicle target detection method and device | |
KR20080021181A (en) | Video data processing method and system thereof | |
CN112257801B (en) | Incremental clustering method and device for images, electronic equipment and storage medium | |
CN111382766A (en) | Equipment fault detection method based on fast R-CNN | |
CN111931751A (en) | Deep learning training method, target object identification method, system and storage medium | |
CN109948429A (en) | Image analysis method, device, electronic equipment and computer-readable medium | |
CN113239869A (en) | Two-stage behavior identification method and system based on key frame sequence and behavior information | |
CN114463637A (en) | Winter wheat remote sensing identification analysis method and system based on deep learning | |
CN113297420A (en) | Video image processing method and device, storage medium and electronic equipment | |
CN114005019B (en) | Method for identifying flip image and related equipment thereof | |
CN106714007A (en) | Video abstract method and apparatus | |
CN116977260A (en) | Target defect detection method and device, electronic equipment and storage medium | |
CN110929788A (en) | Food material identification method and device, storage medium and electronic equipment | |
CN114449362B (en) | Video cover selection method, device, equipment and storage medium | |
CN114782755A (en) | Training method of penicillin bottle detection model, and penicillin bottle detection method and device | |
CN115546554A (en) | Sensitive image identification method, device, equipment and computer readable storage medium | |
CN115409810A (en) | Sample selection method, device and system for remote sensing image | |
CN114693554A (en) | Big data image processing method and system | |
CN114399497A (en) | Text image quality detection method and device, computer equipment and storage medium | |
CN112749702B (en) | Image recognition method, device, terminal and storage medium | |
CN112861836B (en) | Text image processing method, text and card image quality evaluation method and device |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20220722 |
|
WW01 | Invention patent application withdrawn after publication |