CN115578585A - Industrial image anomaly detection method, system, computer device and storage medium - Google Patents

Industrial image anomaly detection method, system, computer device and storage medium Download PDF

Info

Publication number
CN115578585A
CN115578585A CN202211219352.7A CN202211219352A CN115578585A CN 115578585 A CN115578585 A CN 115578585A CN 202211219352 A CN202211219352 A CN 202211219352A CN 115578585 A CN115578585 A CN 115578585A
Authority
CN
China
Prior art keywords
matrix
feature
score
dimensional
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211219352.7A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Shuzhilian Technology Co Ltd
Original Assignee
Chengdu Shuzhilian 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 Chengdu Shuzhilian Technology Co Ltd filed Critical Chengdu Shuzhilian Technology Co Ltd
Priority to CN202211219352.7A priority Critical patent/CN115578585A/en
Publication of CN115578585A publication Critical patent/CN115578585A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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
    • 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/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • 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/7715Feature extraction, e.g. by transforming the feature space, e.g. multi-dimensional scaling [MDS]; Mappings, e.g. subspace methods
    • 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/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention provides an industrial image anomaly detection method, which relates to the field of industrial image detection and specifically comprises the steps of taking a convolution layer of a multi-classification pre-training model as a feature extractor, extracting a plurality of first two-dimensional feature matrixes from a training set containing non-defective pictures, and extracting a second two-dimensional feature matrix from a detection picture; splicing the first two-dimensional feature matrixes to obtain a two-dimensional matrix feature pool of a training set; calculating the similarity of the eigenvectors in the first two-dimensional characteristic matrix and the second two-dimensional characteristic matrix to obtain a distance matrix; selecting topK distance components with the nearest distance from the feature vector and fusing the distance components to obtain abnormal scores of the feature vector of the detected picture, wherein the abnormal scores form a score matrix; scaling the score matrix to make the size of the score matrix identical to that of the detected picture, and setting a threshold T for the score matrix to judge whether the detected picture is abnormal or not; the method is used for solving the problem that the abnormity detection method proposed by the background technology must provide a defect sample.

Description

Industrial image anomaly detection method, system, computer device and storage medium
Technical Field
The invention relates to the field of industrial image detection, in particular to an industrial image anomaly detection method.
Background
The production period of industrial products is long, the process is complex, a lot of defects are often generated in the production process, for example, a panel factory is taken as an example, the panel production process comprises dozens of core process steps, defective products need to be found in time and sent to maintenance after the defects are generated in the production process, otherwise, the quality of final finished products is unqualified.
The traditional defect detection is that AOI equipment is adopted to photograph products in the production process, pictures are transmitted to a computer terminal, and the pictures are observed by naked eyes to find whether defects exist. On one hand, the mode consumes a large amount of labor cost, on the other hand, tens of thousands of pictures can be observed manually, the detection quality is low due to fatigue problems, and detection omission easily occurs. In recent years, an object detection algorithm based on deep learning is applied to industrial defect detection, but the algorithm belongs to a supervised learning algorithm, a model needs to be trained by collecting enough training samples aiming at specific defects, and finally the defect can be effectively detected by the model. If a defect fails to collect enough training samples in advance, the model still generates false positives.
Disclosure of Invention
The embodiment of the invention provides an industrial image anomaly detection method, which is used for solving the problem that a defect sample must be provided in the anomaly detection method provided by the background technology.
Firstly, the invention provides an industrial image anomaly detection method, which comprises the following steps:
taking the convolution layer of the multi-classification pre-training model as a feature extractor, extracting a plurality of first two-dimensional feature matrixes from a training set containing a defect-free picture, and extracting a second two-dimensional feature matrix from a detection picture;
splicing a plurality of first two-dimensional feature matrixes to obtain a two-dimensional matrix feature pool of the training set;
calculating the similarity of the eigenvectors in the first two-dimensional characteristic matrix and the second two-dimensional characteristic matrix to obtain a distance matrix;
selecting topK distance components with the nearest distance from the feature vector and fusing the topK distance components to obtain abnormal scores of the feature vector of the detected picture, wherein a plurality of abnormal scores form a score matrix;
and scaling the score matrix to enable the size of the score matrix to be the same as that of the detected picture, and setting a threshold T for the score matrix to judge whether the detected picture is abnormal or not.
The provided complete set of abnormality detection method can effectively detect the image defects only by extracting the characteristics of the non-defective samples without providing defective samples, and then effectively reduces the labor cost and the model missing detection risk, and can effectively avoid the missing detection caused by the defects especially under the condition that enough training samples cannot be collected in advance.
Preferably, when the first two-dimensional feature matrix is extracted from the training set, a first two-dimensional feature matrix is extracted from a defect-free picture, and a two-dimensional feature matrix f of mn is extracted from a picture, where m is the number of one-dimensional feature vectors extracted from the picture, i.e., each row represents the feature extracted from one pixel position in the picture, and n is the length of each feature vector, i.e., the number of channels of the convolutional layer.
Preferably, each feature vector of each detection picture corresponds to an abnormal score, a score vector with the length of m is obtained from one detection picture, the score vector is converted into a two-dimensional matrix structure, and one score vector can be obtained
Figure BDA0003875530120000022
I.e. the scoring matrix.
Preferably, the scaling process performed on the score matrix is as follows: bilinear interpolation between the scoring matrix elements enlarges the matrix to the size of the detected picture.
Preferably, the bilinear interpolation process is as follows: and interpolating between every four adjacent score positions to obtain a new score, and linearly interpolating between two new scores in the transverse direction or the longitudinal direction to obtain a final generated score, wherein the transverse direction and the longitudinal direction refer to one direction only, so that the uniformity of the implementation of the distinguishing scheme is facilitated, and the restriction of the longitudinal direction or the transverse direction is not necessarily made.
Preferably, the selecting and fusing the topK distance components closest to the feature vector comprises: selecting topK distance components with the nearest distance for each feature vector, and fusing the topK distance components to obtain the final abnormal score s of each feature vector of the detection picture. Wherein s is the distance between the feature vector of the detected picture and the feature vector with the minimum distance in the two-dimensional matrix feature pool of the training set, and the final abnormal score s is obtained by adjusting the weight of s by using the distance between the nearest topK feature vectors, and the formula is as follows:
Figure BDA0003875530120000021
preferably, the score vector is converted into a two-dimensional matrix structure through a reshape function, the conversion effect is better, and the final abnormity judgment is more accurate.
Also disclosed is an industrial image anomaly detection system, comprising:
the matrix extraction module is used for taking the convolution layer of the multi-classification pre-training model as a feature extractor, extracting a plurality of first two-dimensional feature matrixes from a training set containing a defect-free picture and extracting a second two-dimensional feature matrix from a detection picture;
the splicing module is used for splicing the first two-dimensional feature matrixes to obtain a two-dimensional matrix feature pool of the training set;
the similarity processing module is used for calculating the similarity of the characteristic vectors in the first two-dimensional characteristic matrix and the second two-dimensional characteristic matrix to obtain a distance matrix;
the fusion module is used for selecting topK distance components with the nearest distance from the feature vector and fusing the topK distance components to obtain abnormal scores of the feature vector of the detected picture, and a plurality of abnormal scores form a score matrix;
and the scaling judging module is used for scaling the score matrix to enable the size of the score matrix to be the same as that of the detected picture, and setting a threshold T for the score matrix to judge whether the detected picture is abnormal or not.
The above-described system is only illustrative, for example, the division of the modules is only one logical functional division, and there may be another division in actual implementation, and the modules illustrated as separate components may or may not be physically separated, may be located in one place, or may be distributed on multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment, that is, each functional module may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The specific implementation effect, such as the effect of the above industrial image anomaly detection method, is not described herein again.
And a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor: the processor realizes the industrial image anomaly detection method when executing the computer program.
The specific implementation effect, such as the effect of the above industrial image anomaly detection method, is not described herein again.
And a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for detecting the industrial image anomaly is implemented, and a specific implementation effect of the method for detecting the industrial image anomaly is the effect of the method for detecting the industrial image anomaly, which is not described herein again.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic diagram of scale-scaling of the scoring matrix in example 1.
Fig. 2 is a schematic diagram of a picture with a defect in embodiment 1.
Fig. 3 is a thermodynamic diagram of the score matrix of the picture with defects in example 1 plotted against the magnitude of abnormal scores.
Detailed Description
In order to better understand the technical solutions of the present invention, the following detailed descriptions of the technical solutions of the present invention are provided with the accompanying drawings and the specific embodiments, and it should be understood that the specific features in the embodiments and the examples of the present invention are the detailed descriptions of the technical solutions of the present invention, and are not limitations of the technical solutions of the present invention, and the technical features in the embodiments and the examples of the present invention may be combined with each other without conflict.
It should also be appreciated that in the foregoing description of embodiments of the invention, various features are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure aiding in the understanding of at least one embodiment of the invention. This method of disclosure, however, is not intended to suggest that more features are required than are set forth in the claims. Indeed, the embodiments may be characterized as having less than all of the features of a single embodiment disclosed above.
Example 1
The embodiment provides an industrial image anomaly detection method, which comprises the following steps:
s1, taking the convolution layer of a multi-classification pre-training model as a feature extractor, extracting a plurality of first two-dimensional feature matrixes from a training set containing a defect-free picture, and extracting a second two-dimensional feature matrix from a detection picture;
splicing a plurality of first two-dimensional feature matrixes to obtain a two-dimensional matrix feature pool of the training set, specifically: and taking a multi-classification pre-training model resnet50 of the torchvision as a feature extractor, taking the convolution layer of the characteristic extractor as the feature extractor, and extracting feature information on the detected picture. For a non-defective picture in the training set, a two-dimensional feature matrix f with m × n may be extracted, where m is the number of one-dimensional feature vectors extracted from the picture, i.e., each row represents the feature extracted from a pixel position in the picture, and n is the length of each feature vector, i.e., the number of channels in the convolutional layer. If the training set has q non-defective pictures, the training set can extract q m × n feature matrices, and the feature matrices are spliced to obtain a two-dimensional matrix feature pool F of the training set:
Figure BDA0003875530120000041
s2, calculating the similarity of the feature vectors in the first two-dimensional feature matrix and the second two-dimensional feature matrix to obtain a distance matrix, specifically: for the detected picture, the feature extractor is also used to extract a feature matrix F 'with the size of m × n, then similarity between each feature vector in F' and all feature vectors in the training set feature pool F is calculated, the similarity measurement calculation adopts euclidean distance, and finally a distance matrix D is obtained, the size of which is m × (q × m), wherein m is the number of feature vectors of the picture to be detected, and q × m is the number of feature vectors in the training set feature pool:
Figure BDA0003875530120000051
s3, selecting topK distance components with the nearest distance from the feature vector and fusing the topK distance components to obtain abnormal scores of the feature vector of the detected picture, wherein the abnormal scores form a score matrix: for the distance matrix, each row represents the similarity distance between one feature vector of the detection picture and all feature vectors of the training set, and the larger the distance is, the lower the similarity is, which indicates that the detection picture has the features which do not exist in the training set and indicates that the detection picture has the abnormality. In order to make the calculation of the abnormal score more stable, topK distance components closest to each feature vector are selected for each feature vector, and the topK distance components are fused to obtain the final abnormal score s of each feature vector of the detection picture. Wherein s is the distance between the feature vector of the detected picture and the feature vector with the minimum distance in the training set feature pool, and the final abnormal score s is obtained by adjusting the weight of s by using the distance between the nearest topK feature vectors:
Figure BDA0003875530120000052
through the score calculation, each feature vector of the detection pictures obtains an abnormal score, one detection picture obtains a score vector with the length of m, and the reshape of the score vector is of a two-dimensional matrix structure, so that one detection picture can obtain one score vector
Figure BDA0003875530120000053
The scoring matrix S of (a) is as follows:
Figure BDA0003875530120000054
s4, scaling the score matrix to enable the size of the score matrix to be the same as that of the detected picture, and setting a threshold T for the score matrix to judge whether the detected picture is abnormal: since the above-mentioned score matrix S is smaller in size than the original picture and it is desired to visually represent the abnormal position in the original picture size, the score matrix is scaled by performing bilinear interpolation between matrix elements to enlarge the matrix to the original picture size. As shown in FIG. 1, the bilinear interpolation algorithm interpolates every four adjacent score positions to obtain a new score, and firstly, Q is 11 And Q 21 By linear interpolation to obtain R 1 And is in Q 12 And Q 22 By linear interpolation to obtain R 2 Then, in R 1 And R 2 And obtaining a final generation score P through linear interpolation.
The detection score matrix of the picture after interpolation and scaling is consistent with the size of the picture, the picture score matrix with the defect is drawn into a thermodynamic diagram according to the abnormal score, and the thermodynamic diagram is shown in fig. 3, and fig. 2 shows the original state of the defect picture.
In the detection stage, a threshold value T is set for the abnormal score matrix, if the score of any one characteristic position exceeds T, the position is indicated to have the characteristic which the training set normal sample does not have, and the picture is judged to have abnormality.
The provided complete set of abnormality detection method can effectively detect the image defects only by extracting the characteristics of the non-defective samples without providing defective samples, and then effectively reduces the labor cost and the model missing detection risk, and can effectively avoid the missing detection caused by the defects especially under the condition that enough training samples cannot be collected in advance.
Also disclosed is an industrial image anomaly detection system, comprising:
the matrix extraction module is used for taking the convolution layer of the multi-classification pre-training model as a feature extractor, extracting a plurality of first two-dimensional feature matrixes from a training set containing a defect-free picture and extracting a second two-dimensional feature matrix from a detection picture;
the splicing module is used for splicing the first two-dimensional feature matrixes to obtain a two-dimensional matrix feature pool of the training set;
the similarity processing module is used for calculating the similarity of the characteristic vectors in the first two-dimensional characteristic matrix and the second two-dimensional characteristic matrix to obtain a distance matrix;
the fusion module is used for selecting topK distance components with the nearest distance from the feature vector and fusing the topK distance components to obtain abnormal scores of the feature vector of the detected picture, and a plurality of abnormal scores form a score matrix;
and the scaling judging module is used for scaling the score matrix to enable the size of the score matrix to be the same as that of the detected picture, and setting a threshold T for the score matrix to judge whether the detected picture is abnormal or not.
The system described above is only illustrative, for example, the division of the modules is only one logical functional division, and there may be other divisions in actual implementation, and the modules illustrated as separate components may or may not be physically separated, may be located in one place, or may be distributed on a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment, that is, each functional module may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The specific implementation effect, such as the effect of the above industrial image anomaly detection method, is not described herein again.
Example 2
The invention provides a computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor: the processor realizes the industrial image anomaly detection method when executing the computer program.
The specific implementation effect, such as the effect of the above industrial image anomaly detection method, is not described herein again.
Example 3
The invention 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 specific implementation effect of the industrial image anomaly detection method is realized, such as the effect of the industrial image anomaly detection method described above, which is not repeated herein.
The processor may be a Central Processing Unit (CPU), or other general processors, digital signal processors (digital signal processors), application specific integrated circuits (Application specific integrated circuits), ready-made programmable gate arrays (field programmable gate arrays) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory can be used for storing the computer program and/or the module, and the processor can realize various functions of the printed circuit board defect detection device in the invention by operating or executing the data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, at least one magnetic disk storage device, a flash memory device, or other volatile solid state storage device.
The industrial image abnormality detection system, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, all or part of the flow in the method of implementing the embodiments of the present invention may also be stored in a computer readable storage medium through a computer program, and when the computer program is executed by a processor, the computer program may implement the steps of the above-described method embodiments. Wherein the computer program comprises computer program code, an object code form, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying said computer program code, a recording medium, a usb-disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, a point carrier signal, a telecommunications signal, a software distribution medium, etc. It should be noted that the computer readable medium may contain content that is appropriately increased or decreased as required by legislation and patent practice in the jurisdiction.
Having described the basic concept of the invention, it should be apparent to those skilled in the art that the foregoing detailed disclosure is to be considered merely as illustrative and not restrictive of the broad invention. Various modifications, improvements and adaptations to the present description may occur to those skilled in the art, although not explicitly described herein. Such modifications, improvements and adaptations are proposed in the present specification and thus fall within the spirit and scope of the exemplary embodiments of the present specification.
Also, the description uses specific words to describe embodiments of the description. Reference throughout this specification to "one embodiment," "an embodiment," and/or "some embodiments" means that a particular feature, structure, or characteristic described in connection with at least one embodiment of the specification is included. Therefore, it is emphasized and should be appreciated that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, some features, structures, or characteristics of one or more embodiments of the specification may be combined as appropriate.
Moreover, those skilled in the art will appreciate that aspects of the present description may be illustrated and described in terms of several patentable species or situations, including any new and useful combination of processes, machines, manufacture, or materials, or any new and useful improvement thereof. Accordingly, aspects of this description may be performed entirely by hardware, entirely by software (including firmware, resident software, micro-code, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data block," module, "" engine, "" unit, "" component, "or" system. Furthermore, aspects of the present description may be represented as a computer product, including computer readable program code, embodied in one or more computer readable media.
The computer storage medium may comprise a propagated data signal with the computer program code embodied therewith, for example, on baseband or as part of a carrier wave. The propagated signal may take any of a variety of forms, including electromagnetic, optical, etc., or any suitable combination. A computer storage medium may be any computer-readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code located on a computer storage medium may be propagated over any suitable medium, including radio, cable, fiber optic cable, RF, or the like, or any combination of the preceding.

Claims (10)

1. An industrial image anomaly detection method is characterized by comprising the following steps:
taking the convolution layer of the multi-classification pre-training model as a feature extractor, extracting a plurality of first two-dimensional feature matrixes from a training set containing a defect-free picture, and extracting a second two-dimensional feature matrix from a detection picture;
splicing a plurality of first two-dimensional feature matrixes to obtain a two-dimensional matrix feature pool of the training set;
calculating the similarity of the eigenvectors in the first two-dimensional characteristic matrix and the second two-dimensional characteristic matrix to obtain a distance matrix;
selecting topK distance components with the nearest distance from the feature vector and fusing the topK distance components to obtain abnormal scores of the feature vector of the detected picture, wherein a plurality of abnormal scores form a score matrix;
and scaling the score matrix to enable the size of the score matrix to be the same as that of the detected picture, and setting a threshold T for the score matrix to judge whether the detected picture is abnormal or not.
2. The method of claim 1, wherein a first two-dimensional feature matrix is extracted from a defect-free picture when the first two-dimensional feature matrix is extracted from the training set.
3. The industrial image anomaly detection method according to claim 2, wherein each feature vector of each detection picture corresponds to an anomaly score, a score vector with the length of m is obtained from one detection picture, and the score vector is converted into a two-dimensional matrix structure, namely the score matrix.
4. The industrial image anomaly detection method according to claim 1, wherein the scaling process of the scoring matrix is: bilinear interpolation between the scoring matrix elements enlarges the matrix to the size of the detected picture.
5. The industrial image anomaly detection method according to claim 4, wherein said bilinear interpolation process is as follows: and interpolating between every four adjacent score positions to obtain a new score, and linearly interpolating between two new scores in the transverse direction or the longitudinal direction to obtain a final generated score.
6. The method for detecting the industrial image anomaly according to claim 1, wherein the step of selecting the topK distance components with the nearest distance from the feature vector and performing fusion comprises the following steps: selecting topK distance components with the nearest distance for each feature vector, and fusing the topK distance components to obtain the final abnormal score s of each feature vector of the detection picture. Wherein s is the distance between the feature vector of the detected picture and the feature vector with the minimum distance in the two-dimensional matrix feature pool of the training set, and the final abnormal score s is obtained by adjusting the weight of s by using the distance between the nearest topK feature vectors, and the formula is as follows:
Figure FDA0003875530110000021
7. the industrial image anomaly detection method according to claim 3, wherein the score vector is converted into a two-dimensional matrix structure by a reshape function.
8. An industrial image anomaly detection system, comprising:
the matrix extraction module is used for taking the convolution layer of the multi-classification pre-training model as a feature extractor, extracting a plurality of first two-dimensional feature matrices from a training set containing a defect-free picture and extracting a second two-dimensional feature matrix from a detection picture;
the splicing module is used for splicing the first two-dimensional feature matrixes to obtain a two-dimensional matrix feature pool of the training set;
the similarity processing module is used for calculating the similarity of the feature vectors in the first two-dimensional feature matrix and the second two-dimensional feature matrix to obtain a distance matrix;
the fusion module is used for selecting topK distance components with the nearest distance from the feature vector and fusing the topK distance components to obtain abnormal scores of the feature vector of the detected picture, and a plurality of abnormal scores form a score matrix;
and the scaling judging module is used for scaling the score matrix to enable the size of the score matrix to be the same as that of the detected picture, and setting a threshold T for the score matrix to judge whether the detected picture is abnormal or not.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: the processor, when executing the computer program, implements an industrial image anomaly detection method as claimed in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, implements an industrial image anomaly detection method according to any one of claims 1 to 7.
CN202211219352.7A 2022-09-30 2022-09-30 Industrial image anomaly detection method, system, computer device and storage medium Pending CN115578585A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211219352.7A CN115578585A (en) 2022-09-30 2022-09-30 Industrial image anomaly detection method, system, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211219352.7A CN115578585A (en) 2022-09-30 2022-09-30 Industrial image anomaly detection method, system, computer device and storage medium

Publications (1)

Publication Number Publication Date
CN115578585A true CN115578585A (en) 2023-01-06

Family

ID=84582480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211219352.7A Pending CN115578585A (en) 2022-09-30 2022-09-30 Industrial image anomaly detection method, system, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN115578585A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116758400A (en) * 2023-08-15 2023-09-15 安徽容知日新科技股份有限公司 Method and device for detecting abnormality of conveyor belt and computer readable storage medium
CN117765363A (en) * 2024-02-22 2024-03-26 山东省计算中心(国家超级计算济南中心) Image anomaly detection method and system based on lightweight memory bank

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116758400A (en) * 2023-08-15 2023-09-15 安徽容知日新科技股份有限公司 Method and device for detecting abnormality of conveyor belt and computer readable storage medium
CN116758400B (en) * 2023-08-15 2023-10-17 安徽容知日新科技股份有限公司 Method and device for detecting abnormality of conveyor belt and computer readable storage medium
CN117765363A (en) * 2024-02-22 2024-03-26 山东省计算中心(国家超级计算济南中心) Image anomaly detection method and system based on lightweight memory bank

Similar Documents

Publication Publication Date Title
CN112884064B (en) Target detection and identification method based on neural network
CN115578585A (en) Industrial image anomaly detection method, system, computer device and storage medium
CN114240939B (en) Method, system, equipment and medium for detecting appearance defects of mainboard components
CN111524137A (en) Cell identification counting method and device based on image identification and computer equipment
CN112115879B (en) Self-supervision pedestrian re-identification method and system with shielding sensitivity
CN111738994B (en) Lightweight PCB defect detection method
CN112651989A (en) SEM image molecular sieve particle size statistical method and system based on Mask RCNN example segmentation
CN114663392A (en) Knowledge distillation-based industrial image defect detection method
CN117670820B (en) Plastic film production defect detection method and system
CN113537119B (en) Transmission line connecting part detection method based on improved Yolov4-tiny
CN113256608B (en) Workpiece defect detection method and device
US11900589B2 (en) Detection device of display panel and detection method thereof, electronic device and readable medium
CN112884866A (en) Coloring method, device, equipment and storage medium for black and white video
CN113591647B (en) Human motion recognition method, device, computer equipment and storage medium
CN116188855A (en) Multi-scale plant disease identification method, device, storage medium and apparatus
CN115564727A (en) Method and system for detecting abnormal defects of exposure development
CN112396083B (en) Image recognition, model training and construction and detection methods, systems and equipment
CN112288748A (en) Semantic segmentation network training and image semantic segmentation method and device
CN115760746A (en) Industrial image anomaly detection method and system
CN113486781B (en) Electric power inspection method and device based on deep learning model
CN113111921B (en) Object identification method, device, electronic equipment and storage medium
CN114998706B (en) Image target detection method based on reinforcement learning decision region subdivision
CN111950493B (en) Image recognition method, device, terminal equipment and readable storage medium
CN118365918A (en) Deep learning-based 2D visual cable state classification method, device and medium
US20220284563A1 (en) Method for discovering defects in products by detecting abnormalities in images, electronic device, and storage medium

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