CN109584225A - A kind of unsupervised defect inspection method based on self-encoding encoder - Google Patents

A kind of unsupervised defect inspection method based on self-encoding encoder Download PDF

Info

Publication number
CN109584225A
CN109584225A CN201811408531.9A CN201811408531A CN109584225A CN 109584225 A CN109584225 A CN 109584225A CN 201811408531 A CN201811408531 A CN 201811408531A CN 109584225 A CN109584225 A CN 109584225A
Authority
CN
China
Prior art keywords
image
self
reconstructed
encoding encoder
error
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.)
Granted
Application number
CN201811408531.9A
Other languages
Chinese (zh)
Other versions
CN109584225B (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.)
Jushi Technology (shanghai) Co Ltd
Original Assignee
Jushi Technology (shanghai) 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 Jushi Technology (shanghai) Co Ltd filed Critical Jushi Technology (shanghai) Co Ltd
Priority to CN201811408531.9A priority Critical patent/CN109584225B/en
Publication of CN109584225A publication Critical patent/CN109584225A/en
Application granted granted Critical
Publication of CN109584225B publication Critical patent/CN109584225B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The present invention relates to a kind of unsupervised defect inspection method based on self-encoding encoder, image to be detected is inputted a trained self-encoding encoder model by this method, obtain reconstructed image corresponding with described image to be detected, judge whether described image to be detected is defective based on the defect dipoles criterion for filtering small noise reconstructed error, when the defect dipoles criterion is set up, it is determined to have defect.Compared with prior art, the present invention have many advantages, such as available better quality reconstruction, can be to small reconstructed noise robust.

Description

A kind of unsupervised defect inspection method based on self-encoding encoder
Technical field
The present invention relates to a kind of open defect detection methods, more particularly, to a kind of unsupervised defect based on self-encoding encoder Detection method.
Background technique
Open defect detection is an important link during actual industrial production, be may be implemented pair by defects detection The quality of product controls.In actual industrial process, most appearance detection is realized by manual inspection, this method ratio Subjective judgement that is more bothersome and being limited to people.Therefore carrying out automatic defects detection to actual product object sampled images has very Important practical application value.
In the actual production process, since product qualification rate is higher, many times it is difficult to obtain a large amount of defect sample, because This can not be using the method for having supervision for needing a large amount of normal samples and defect sample.Unsupervised lack is being carried out based on normal sample It falls into the method for detection, self-encoding encoder is a kind of common method.Such as document " Residual Error Based Anomaly Detection Using Auto-Encoder in SMD Machine Sound"(Oh,D.Y.;Yun,I.D..Sensors 2018,18,1308) in, self-encoding encoder is used to the exception in detection machine sound.Such method is based on a self-encoding encoder mould Type, which is realized, is reconstructed into input sample close to consistent output the coding and decoding of input sample.
Self-encoding encoder model is as shown in Figure 1, the purpose of the model is to obtain to the greatest extent may be used with input picture to given input picture It can consistent output image.Input picture X, which is compressed into low-dimensional by encoder (encoder), indicates h, and h is using decoder (decoder) it is reconstructed into and an equal amount of image X ' of X.The parameter of encoder and decoder is all based on training image in model Acquistion is arrived.In the training stage, main purpose is to learn the weight of encoder and decoder to make reconstructed image and input picture As close as, therefore define the reconstructed error based on input sample and reconstruct output sample and measure, and by the measurement Target as loss function as training optimization.The objective function that the training process of usual self-encoding encoder minimizes is formula (1) or (2), wherein formula (1) is used to the L1 norm of error between calculating input image and reconstructed image, can be used to measure The sparsity of error image between the two, what formula (2) calculated is the L2 norm of error image, and measurement is the flat of error image Slip.
|X-X'|1 (1)
|X-X'|2 (2)
At the end of training, the judgment threshold τ for testing test phase is estimated.In test phase, pass through test image The size of reconstructed error metric realizes defects detection.It is trained since the self-encoding encoder is based only on zero defect sample, it can To realize that preferably reconstruct is on zero defect sample to obtain lesser reconstructed error measurement, but reconstructs and miss on defect sample Difference metric is larger, to can carry out the judgement of defects detection based on reconstructed error measurement.In test phase, to unseen survey Attempt as being reconstructed, and calculate reconstructed error same as training process, is then based on reconstructed error progress defects detection and sentences It is disconnected, if meeting formula (3), then it is assumed that be defect.
|X-X'|1> τ (3)
But such method is also disadvantageous: quality reconstruction is not good enough under the slightly complicated scene of texture, causes based on weight The statistical measures of structure error image do the inadequate robust of defects detection.
Summary of the invention
It is an object of the present invention to overcome the above-mentioned drawbacks of the prior art and provide one kind to be based on self-encoding encoder Unsupervised defect inspection method.
The purpose of the present invention can be achieved through the following technical solutions:
A kind of unsupervised defect inspection method based on self-encoding encoder, this method are trained by image to be detected input one Self-encoding encoder model obtains reconstructed image corresponding with described image to be detected, based on the defect for filtering small noise reconstructed error Judgment criterion judges whether described image to be detected is defective, when the defect dipoles criterion is set up, is determined to have defect.
Further, the expression formula of the defect dipoles criterion are as follows:
In formula, Δ X is that the reconstructed error image obtained is calculated by reconstructed image and image to be detected, and δ X is to filter small noise The bianry image of reconstructed error, i, j indicate that location of pixels, τ are reconstruct error metrics threshold value.
Further, the reconstructed error metric threshold is set based on the expectation to model defect detectability.
Further, the reconstructed error metric threshold is based on the Balancing selection to defects detection recall rate and accuracy rate, When expecting high-accuracy, take the maximum value of all training image reconstructed errors as reconstructed error metric threshold, when expectation is high When recall rate, a kind of statistical value that training image reconstructed error is measured is as reconstructed error metric threshold.
Further, the bianry image is defined as:
In formula, ε is small noise reconstructed error filtering threshold.
Further, during the self-encoding encoder model training, the optimization object function expression formula of use are as follows:
|X-X'|1+λ|X-X'|2
In formula, X is input picture, and X' is reconstructed image, and λ is weight.
Further, the value range of the weight λ is 0.1-10.
Compared with prior art, the present invention have with following the utility model has the advantages that
1, the objective function of optimization is defined as compatible reconstruct flatness and sparsity in self-encoding encoder training by the present invention Loss, available better quality reconstruction, that is, smaller reconstructed error;
2, this programme has used the defect estimation measurement criterion to different size of defect area robust, can be to small weight Structure noise robustness, and the different size of defect area of detection can be stablized.
Detailed description of the invention
Fig. 1 is self-encoding encoder network diagram;
Fig. 2 is the training flow diagram of self-encoding encoder network of the present invention;
Fig. 3 is the testing process schematic diagram of self-encoding encoder network of the present invention.
Specific embodiment
The present invention is described in detail with specific embodiment below in conjunction with the accompanying drawings.The present embodiment is with technical solution of the present invention Premised on implemented, the detailed implementation method and specific operation process are given, but protection scope of the present invention is not limited to Following embodiments.
The present invention provides a kind of unsupervised defect inspection method based on self-encoding encoder, and this method inputs image to be detected One trained self-encoding encoder model obtains reconstructed image corresponding with described image to be detected, based on filtering reconstructed error picture The defect dipoles criterion that element is less than given threshold judges whether described image to be detected is defective.
In the present invention, the training process of self-encoding encoder model is as shown in Figure 2, comprising:
Step S101 obtains training set image;
Step S102, training pattern, the optimization object function used in training process are as follows:
|X-X'|1+λ|X-X'|2 (4)
Above-mentioned function can not only make reconstructed error image sparsity as far as possible, but also can guarantee to reconstruct flatness, and λ is Weight realizes the reconstructed error image smoothing of self-encoding encoder and the balance of sparsity by taking different values, is worth bigger instruction The reconstructed error image got is more smooth, otherwise reconstructed error image is more sparse, and general range is taken as 0.1-10;
Step S103 estimates reconstructed error metric threshold τ and small noise reconstructed error filtering threshold ε.
The selection mode of reconstructed error metric threshold τ is generally basede on pair dependent on expectation to model defect detectability The balance of defects detection recall rate and accuracy rate is selected.If expecting high accuracy rate, recommended method is to take all training The maximum value of image reconstruction error;And if it is desire to recall rate is higher, recommend the one kind measured based on training image reconstructed error Statistical value is as threshold value, for example assumes training image reconstructed error Gaussian distributed, can be by 90% quartile of Gaussian Profile Value is used as threshold value.
In test phase, the present invention defines a kind of new more accurate defects detection of defect dipoles criterion realization.It is fixed first One bianry image δ X of justice is used to refer to the biggish location of pixels of reconstructed error such as formula (5), and parameter ε is used to filter out small Reconstructed error pixel is chosen based on the reconstructed error on training set.
The average value that the present invention defines larger reconstructed error pixel carries out defects detection as judgment criterion, and criterion is public Formula is as follows:
As shown in figure 3, test process includes:
Step S201, takes out image from test set, as mode input;
Step S202 obtains reconstructed image to operation before network;
Step S203 calculates reconstructed error image;
Step S204 obtains reconstructed error bianry image according to filtering threshold using formula (5);
Step S205 calculates judgment criterion measurement according to reconstructed error image and bianry image;
Step S206, judges whether measurement is greater than threshold value, that is, judges whether measurement meets formula (6), if so, judgement figure As defective, if it is not, then judging image zero defect.
When carrying out unknown images detection, defects detection is carried out to unknown images using above-mentioned test process.
The preferred embodiment of the present invention has been described in detail above.It should be appreciated that those skilled in the art without It needs creative work according to the present invention can conceive and makes many modifications and variations.Therefore, all technologies in the art Personnel are available by logical analysis, reasoning, or a limited experiment on the basis of existing technology under this invention's idea Technical solution, all should be within the scope of protection determined by the claims.

Claims (7)

1. a kind of unsupervised defect inspection method based on self-encoding encoder, which is characterized in that this method inputs image to be detected One trained self-encoding encoder model obtains reconstructed image corresponding with described image to be detected, is reconstructed based on small noise is filtered The defect dipoles criterion of error judges whether described image to be detected is defective, when the defect dipoles criterion is set up, is determined as Existing defects.
2. the unsupervised defect inspection method according to claim 1 based on self-encoding encoder, which is characterized in that the defect The expression formula of judgment criterion are as follows:
In formula, Δ X is that the reconstructed error image obtained is calculated by reconstructed image and image to be detected, and δ X is to filter small noise reconstruct The bianry image of error, i, j indicate that location of pixels, τ are reconstruct error metrics threshold value.
3. the unsupervised defect inspection method according to claim 2 based on self-encoding encoder, which is characterized in that the reconstruct Error metrics threshold value is set based on the expectation to model defect detectability.
4. the unsupervised defect inspection method according to claim 3 based on self-encoding encoder, which is characterized in that the reconstruct Error metrics threshold value takes all instructions when expecting high-accuracy based on the Balancing selection to defects detection recall rate and accuracy rate Practice the maximum value of image reconstruction error as reconstructed error metric threshold, when it is expected high recall rate, training image is reconstructed and is missed A kind of statistical value of difference metric is as reconstructed error metric threshold.
5. the unsupervised defect inspection method according to claim 2 based on self-encoding encoder, which is characterized in that the two-value Image definition are as follows:
In formula, ε is small noise reconstructed error filtering threshold.
6. the unsupervised defect inspection method according to claim 1 based on self-encoding encoder, which is characterized in that described self-editing During code device model training, the optimization object function expression formula of use are as follows:
|X-X'|1+λ|X-X'|2
In formula, X is input picture, and X' is reconstructed image, and λ is weight.
7. the unsupervised defect inspection method according to claim 1 based on self-encoding encoder, which is characterized in that the weight The value range of λ is 0.1-10.
CN201811408531.9A 2018-11-23 2018-11-23 Unsupervised defect detection method based on self-encoder Active CN109584225B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811408531.9A CN109584225B (en) 2018-11-23 2018-11-23 Unsupervised defect detection method based on self-encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811408531.9A CN109584225B (en) 2018-11-23 2018-11-23 Unsupervised defect detection method based on self-encoder

Publications (2)

Publication Number Publication Date
CN109584225A true CN109584225A (en) 2019-04-05
CN109584225B CN109584225B (en) 2023-02-03

Family

ID=65923837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811408531.9A Active CN109584225B (en) 2018-11-23 2018-11-23 Unsupervised defect detection method based on self-encoder

Country Status (1)

Country Link
CN (1) CN109584225B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263807A (en) * 2019-05-13 2019-09-20 杭州安恒信息技术股份有限公司 Anomaly detection method based on auto-encoder
CN111310819A (en) * 2020-02-11 2020-06-19 深圳前海微众银行股份有限公司 Data screening method, device, equipment and readable storage medium
CN114119463A (en) * 2021-10-08 2022-03-01 广东美卡智能信息技术有限公司 Defect detection method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020054293A1 (en) * 2000-04-18 2002-05-09 Pang Kwok-Hung Grantham Method of and device for inspecting images to detect defects
CN108537132A (en) * 2018-03-16 2018-09-14 中国人民解放军陆军工程大学 A kind of lane segmentation method of the depth autocoder based on supervised learning
CN108734690A (en) * 2018-03-02 2018-11-02 苏州汉特士视觉科技有限公司 A kind of defects of vision detection device and its detection method
WO2018209932A1 (en) * 2017-05-17 2018-11-22 清华大学 Multi-quantization depth binary feature learning method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020054293A1 (en) * 2000-04-18 2002-05-09 Pang Kwok-Hung Grantham Method of and device for inspecting images to detect defects
WO2018209932A1 (en) * 2017-05-17 2018-11-22 清华大学 Multi-quantization depth binary feature learning method and device
CN108734690A (en) * 2018-03-02 2018-11-02 苏州汉特士视觉科技有限公司 A kind of defects of vision detection device and its detection method
CN108537132A (en) * 2018-03-16 2018-09-14 中国人民解放军陆军工程大学 A kind of lane segmentation method of the depth autocoder based on supervised learning

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263807A (en) * 2019-05-13 2019-09-20 杭州安恒信息技术股份有限公司 Anomaly detection method based on auto-encoder
CN111310819A (en) * 2020-02-11 2020-06-19 深圳前海微众银行股份有限公司 Data screening method, device, equipment and readable storage medium
CN114119463A (en) * 2021-10-08 2022-03-01 广东美卡智能信息技术有限公司 Defect detection method and device

Also Published As

Publication number Publication date
CN109584225B (en) 2023-02-03

Similar Documents

Publication Publication Date Title
CN106950276B (en) Pipeline defect depth inversion method based on convolutional neural network
CN109584225A (en) A kind of unsupervised defect inspection method based on self-encoding encoder
CN109086876B (en) Method and device for detecting running state of equipment, computer equipment and storage medium
CN112381790A (en) Abnormal image detection method based on depth self-coding
CN111275307A (en) Quality control method for high-frequency continuous observation data of automatic online water quality station
CN106779217B (en) Air quality detection method and air quality detection system
CN110349153B (en) Image method tobacco peduncle content detection method based on multi-feature fusion
CN112669305B (en) Metal surface rust resistance test bench and rust resistance evaluation method
CN112037166A (en) Surface defect detection method and detection device
CN109543743B (en) Multi-sensor fault diagnosis method for refrigerating unit based on reconstructed prediction residual error
CN117371337B (en) Water conservancy model construction method and system based on digital twin
CN114358435A (en) Pollution source-water quality prediction model weight influence calculation method of two-stage space-time attention mechanism
CN114970688A (en) Landslide monitoring data preprocessing method based on LSTMAD algorithm and Hermite interpolation method
CN111879709B (en) Lake water body spectral reflectivity inspection method and device
CN115018790A (en) Workpiece surface defect detection method based on anomaly detection
CN109557434B (en) Partial discharge signal identification method under strong background noise based on composite dictionary sparse representation classification
CN111784645A (en) Crack detection method for filling pipeline
CN117100191A (en) Cleaning agent delivery control system and method for automatic dish washing machine
CN117630800A (en) Fault diagnosis method and system for automatic calibrating device of electric energy meter
CN110308254B (en) Accurate monitoring method for low dissolved oxygen
CN116778269A (en) Method for constructing product surface defect detection model based on self-encoder reconstruction
CN110570022A (en) mGBDT-based building energy consumption prediction method and system
CN115830514A (en) Method and system for calculating surface flow velocity of whole river section of riverway with curve
CN115713511A (en) Detection method and device for conveyor belt and electronic equipment
CN111898314B (en) Lake water parameter inspection method and device, electronic equipment 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
GR01 Patent grant
GR01 Patent grant