CN110189351A - A kind of scratch image data amplification method based on production confrontation network - Google Patents

A kind of scratch image data amplification method based on production confrontation network Download PDF

Info

Publication number
CN110189351A
CN110189351A CN201910303496.2A CN201910303496A CN110189351A CN 110189351 A CN110189351 A CN 110189351A CN 201910303496 A CN201910303496 A CN 201910303496A CN 110189351 A CN110189351 A CN 110189351A
Authority
CN
China
Prior art keywords
scratch
image
network
scratch image
image data
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
CN201910303496.2A
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.)
Zhejiang University City College ZUCC
Original Assignee
Zhejiang University City College ZUCC
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 Zhejiang University City College ZUCC filed Critical Zhejiang University City College ZUCC
Priority to CN201910303496.2A priority Critical patent/CN110189351A/en
Publication of CN110189351A publication Critical patent/CN110189351A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components

Abstract

The invention discloses a kind of scratch image data amplification methods based on production confrontation network, comprising the following steps: step S1 constructs scratch image data set;Step S2, scratch image preprocessing;Step S3, building production fight network;Step S4, dual training;Step S5 exports scratch image amplification data collection.Beneficial effects of the present invention are mainly manifested in: producing a large amount of scratch image datas using network is generated, it can learn the validity feature of true scratch image using differentiation network, by to generation network and differentiation network implementation dual training, the probability distribution statistical rule difference for generating image and true picture can effectively be reduced, to not only meet the defect detecting system based on deep learning to the quantity demand of training sample, but also meet its quality requirement to training sample.

Description

A kind of scratch image data amplification method based on production confrontation network
Technical field
The present invention relates to a kind of image data amplification methods, and in particular to a kind of scratch figure based on production confrontation network As data amplification method, belong to computer vision field.
Background technique
In recent years, have benefited from the training sample of magnanimity and the calculation power of growth, deep learning is in theoretical research and multiple applications Breakthrough, especially computer vision field are achieved in field.Deep learning simulate human brain nerve connection and The low-level feature of high dimensional data is combined by signal processing mode, is gradually taken out by way of stratification more complicated Character representation, but the parameter of flood tide is also brought simultaneously.In order to avoid there is over-fitting in model, need great amount of samples to model into Row training, however, the cost collected and mark sample is very high and time-consuming.Existing image data amplification technique mainly includes Flip horizontal, cutting and adjustment contrast etc., however, these conventional methods are very limited to the amplification quantity of image data, it is difficult To meet the training demand of the application system (for example, defect detecting system) based on deep learning.In addition, surface defect image phase Quantity is less for natural image, and acquisition and mark are more difficult.
Summary of the invention
The present invention is directed to the limitation of the prior art, proposes that a kind of scratch image data based on production confrontation network expands Increasing method.
The present invention uses following technical scheme, the scratch image data amplification method packet based on production confrontation network Include following steps:
Step S1 constructs scratch image data set;
Step S2, scratch image preprocessing;
Step S3, building production fight network;
Step S4, dual training;
Step S5 exports scratch image amplification data collection.
According to the above technical scheme, in step sl, construct scratch image data set the following steps are included:
Step S1.1 acquires product surface image by CCD camera, chooses the wherein image with scratch and is used as training Image, the image of remaining no marking are used as the background image of subsequent composograph;
Step S1.2 carries out handmarking to scoring position, and tag image is carried out binary conversion treatment.
According to the above technical scheme, in step s 2, scratch image preprocessing the following steps are included:
Scratch image is converted to grayscale image by step S2.1;
Step S2.2, scratch positioning;
Step S2.3 cuts scored area image;
Step S2.4 zooms in and out the scratch image after cutting;
Step S2.5 carries out Random Level overturning to the scratch image after scaling.
According to the above technical scheme, in step S2.2, scratch positioning the following steps are included:
S2.2.1: contours extract is carried out to binaryzation tag image, gained profile is approximate region where scratch;
S2.2.2: Threshold segmentation is carried out in contoured interior, edge detection is carried out to scratch.
According to the above technical scheme, in step S2.3, scored area image is cut the following steps are included:
S2.3.1: traversal scratching edge all pixels point finds minimum abscissa, ordinate and the maximum of these pixels Abscissa, ordinate, thus obtain one it is horizontal, scratch can be completely included including minimum rectangle;
S2.3.2: using rectangular centre as image cropping center, the image containing scratch having a size of 120 × 120 is cut out;
S2.3.3: the image after centering idea is cut carries out multiple random cropping, and random cropping is having a size of 100 × 100.
According to the above technical scheme, in step s3, production confrontation network includes a generation network G and a differentiation Network D.
According to the above technical scheme, in step s 4, dual training refers to alternately excellent using stochastic gradient descent method Change objective function (1) and objective function (2):
Wherein, LDIt is the loss function for differentiating network D,It isFrom the expectation of the probability of authentic specimen Value,X~Pr, x is true scratch image,It is the scratch image generated by generation network G, PrAnd PgIt respectively indicates true Real scratch image data set and the probability distribution for generating scratch image data set,It isFrom the probability of authentic specimen, D (x) is the probability that x derives from authentic specimen, Ex[D (x)] is desired value of the x from the probability of authentic specimen, and λ isIn LDIn weight coefficient,It is the interpolation of true scratch image and generation image,ε is to obey equally distributed random number, and ε~U [0,1], U are to be uniformly distributed,It is the desired value of gradient penalty term,It isGradient,It isFrom authentic specimen Probability, LGIt is the loss function for generating network G.
According to the above technical scheme, in step s 5, scratch image amplification data collection is by the trained generation net of step S4 Network G is generated.
Scratch image data amplification method disclosed by the invention based on production confrontation network, the beneficial effect is that: A large amount of scratch image datas are produced using network is generated, the validity feature of true scratch image can be learnt using differentiation network, By can effectively reduce the probability distribution for generating image and true picture to generating network and differentiating network implementation dual training Statistical law difference, to not only meet the defect detecting system based on deep learning to the quantity demand of training sample, but also full Its quality requirement to training sample of foot.Since method disclosed by the invention only needs a small amount of true scratch image that can generate greatly The artificial synthesized scratch image of amount and true scratch image equal quality, therefore greatly reduce the application system based on deep learning The demand united to true scratch image data effectively saves collection and marks the cost of sample.
Detailed description of the invention
Fig. 1 is the method for the present invention flow chart;
Fig. 2 a- Fig. 2 c is for trained true scratch image;
Fig. 3 a- Fig. 3 c is the tag image of binaryzation;
Fig. 4 a- Fig. 4 c is scratch positioning schematic diagram;
Fig. 5 is the scratch image after multiple image successively overturns, cuts and scales;
Fig. 6 (a) is the scratch image generated by the method for the present invention;
Fig. 6 (b) is true scratch image.
Specific embodiment
In order to more clearly illustrate technical solution of the present invention, below in conjunction with the attached drawing in the present invention to skill of the invention Art scheme is described further.Obviously, content described in this specification embodiment is only the way of realization to inventive concept Enumerate, protection scope of the present invention should not be construed as being limited to the specific forms stated in the embodiments, protection of the invention Range also and in those skilled in the art conceive according to the present invention it is conceivable that equivalent technologies mean.
Embodiment 1
As shown in Figure 1, a kind of scratch image data amplification method based on production confrontation network is present embodiments provided, The following steps are included:
Step S1 constructs scratch image data set;
Step S2, scratch image preprocessing;
Step S3, building production fight network;
Step S4, dual training;
Step S5 exports scratch image amplification data collection.
Specifically, in step sl, construct scratch image data set the following steps are included:
Step S1.1 acquires product surface image by CCD camera, chooses the wherein image with scratch and is used as training Image, as shown in Fig. 2 a- Fig. 2 c, the image of remaining no marking is used as the background image of subsequent composograph;
Step S1.2 carries out handmarking to scoring position, and tag image is carried out binary conversion treatment, as Fig. 3 a- schemes Shown in 3c.
Further, in step s 2, scratch image preprocessing the following steps are included:
Scratch image is converted to grayscale image by step S2.1;
Step S2.2, scratch positioning, as shown in Fig. 4 a- Fig. 4 c;
Step S2.3 cuts scored area image;
Step S2.4 zooms in and out the scratch image after cutting, and the scratch image that size is 64 × 64 is obtained after scaling, As shown in Fig. 5;
Step S2.5 carries out Random Level overturning to the scratch image after scaling.
Further, in step S2.2, scratch positioning the following steps are included:
S2.2.1: contours extract is carried out to binaryzation tag image, gained profile is approximate region where scratch;
S2.2.2: Threshold segmentation is carried out in contoured interior, edge detection is carried out to scratch.
Further, in step S2.3, scored area image is cut the following steps are included:
S2.3.1: traversal scratching edge all pixels point finds minimum abscissa, ordinate and the maximum of these pixels Abscissa, ordinate, to obtain horizontal and including scratch capable of being completely included a minimum rectangle;
S2.3.2: using rectangular centre as image cropping center, the image containing scratch having a size of 120 × 120 is cut out;
S2.3.3: the image after centering idea is cut carries out 8 random croppings, and random cropping is having a size of 100 × 100.
Further, in step s3, production confrontation network includes a generation network G and a differentiation network D, net Network framework details difference is as shown in Table 1 and Table 2, wherein Conv indicates that convolutional layer, Res indicate that residual block, BN indicate batch regularization Layer, ReLU indicate that the linear unit activating function of amendment, Tanh indicate that tangent activation primitive, fc indicate full articulamentum, and convolution kernel is such as [3 × 3] indicate that convolution kernel size is 3 × 3, output 512 × 4 × 4 indicates that output channel number is 512, and output characteristic pattern size is 4 ×4。
The framework details of the generation network G of table 1.
The framework details of the differentiation of table 2. network D
Further, in step s 4, dual training refers to utilizing stochastic gradient descent method alternately optimization aim letter Number (1) and objective function (2):
Wherein, LDIt is the loss function for differentiating network D,It isFrom the expectation of the probability of authentic specimen Value,X~Pr, x is true scratch image,It is the scratch image generated by generation network G, PrAnd PgIt respectively indicates true Real scratch image data set and the probability distribution for generating scratch image data set,It isFrom the probability of authentic specimen, D (x) is the probability that x derives from authentic specimen, Ex[D (x)] is desired value of the x from the probability of authentic specimen, and λ isIn LDIn weight coefficient,It is the interpolation of true scratch image and generation image,ε is to obey equally distributed random number, and ε~U [0,1], U are to be uniformly distributed,It is the desired value of gradient penalty term,It isGradient,It isFrom authentic specimen Probability, LGIt is the loss function for generating network G.
Further, in step s 5, scratch image amplification data collection is generated by the trained generation network G of step S4, As shown in Fig. 6 (a), only needed on a small quantity really by can be seen that the present invention with the true scratch image comparison as shown in Fig. 6 (b) Scratch image can generate a large amount of and true scratch image equal quality artificial synthesized scratch image, so as to substantially reduce Demand based on the application system of deep learning to true scratch image data, effectively save collection and mark sample at This.

Claims (8)

1. a kind of scratch image data amplification method based on production confrontation network, which comprises the following steps:
Step S1 constructs scratch image data set;
Step S2, scratch image preprocessing;
Step S3, building production fight network;
Step S4, dual training;
Step S5 exports scratch image amplification data collection.
2. the method as described in claim 1, which is characterized in that in the step S1, building scratch image data set include with Lower step:
Step S1.1 acquires product surface image by CCD camera, chooses the wherein image with scratch and is used as training figure Picture, the image of remaining no marking are used as the background image of subsequent composograph;
Step S1.2 carries out handmarking to scratch approximate location, and tag image is carried out binary conversion treatment.
3. the method as described in claim 1, which is characterized in that in the step S2, scratch image preprocessing includes following step It is rapid:
Scratch image is converted to grayscale image by step S2.1;
Step S2.2, scratch positioning;
Step S2.3, scratch image cropping;
Step S2.4 zooms in and out the scratch image after cutting;
Step S2.5 carries out Random Level overturning to the scratch image after scaling.
4. method as claimed in claim 3, which is characterized in that in the step S2.2, scratch positioning the following steps are included:
S2.2.1: contours extract is carried out to binaryzation tag image, gained profile is approximate region where scratch;
S2.2.2: Threshold segmentation is carried out in contoured interior, edge detection is carried out to scratch.
5. method as claimed in claim 3, which is characterized in that in the step S2.3, scratch image cropping includes following step It is rapid:
S2.3.1: traversal scratching edge all pixels point finds the minimum abscissa, ordinate and maximum horizontal seat of these pixels Mark, ordinate, thus obtain one it is horizontal, scratch can be completely included including minimum rectangle;
S2.3.2: using rectangular centre as image cropping center, the image containing scratch is cut out;
S2.3.3: the image after centering idea is cut carries out multiple random cropping.
6. the method as described in claim 1, which is characterized in that in the step S3, it includes a life that production, which fights network, At network G and a differentiation network D.
7. the method as described in claim 1, which is characterized in that in the step S4, dual training refers to utilizing boarding steps Spend descent method alternately optimization object function (1) and objective function (2):
Wherein, LDIt is the loss function for differentiating network D,It isFrom the desired value of the probability of authentic specimen,X~Pr, x is true scratch image,It is the scratch image generated by generation network G, PrAnd PgIt respectively indicates true Scratch image data set and the probability distribution for generating scratch image data set,It isFrom the probability of authentic specimen, D It (x) is probability of the x from authentic specimen, Ex[D (x)] is desired value of the x from the probability of authentic specimen, and λ isIn LDIn weight coefficient,It is the interpolation of true scratch image and generation image,ε is to obey equally distributed random number, and ε~U [0,1], U are to be uniformly distributed,It is the desired value of gradient penalty term,It isGradient,It isFrom authentic specimen Probability, LGIt is the loss function for generating network G.
8. the method as described in claim 1, which is characterized in that in the step S5, scratch image amplification data collection is by step The trained generation network G of S4 generates.
CN201910303496.2A 2019-04-16 2019-04-16 A kind of scratch image data amplification method based on production confrontation network Pending CN110189351A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910303496.2A CN110189351A (en) 2019-04-16 2019-04-16 A kind of scratch image data amplification method based on production confrontation network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910303496.2A CN110189351A (en) 2019-04-16 2019-04-16 A kind of scratch image data amplification method based on production confrontation network

Publications (1)

Publication Number Publication Date
CN110189351A true CN110189351A (en) 2019-08-30

Family

ID=67714637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910303496.2A Pending CN110189351A (en) 2019-04-16 2019-04-16 A kind of scratch image data amplification method based on production confrontation network

Country Status (1)

Country Link
CN (1) CN110189351A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188824A (en) * 2019-05-31 2019-08-30 重庆大学 A kind of small sample plant disease recognition methods and system
CN111008692A (en) * 2019-11-08 2020-04-14 国网天津市电力公司 Method and device for generating multi-energy metering characteristic data based on improved generation countermeasure network
CN112116601A (en) * 2020-08-18 2020-12-22 河南大学 Compressive sensing sampling reconstruction method and system based on linear sampling network and generation countermeasure residual error network
CN112462001A (en) * 2020-11-17 2021-03-09 吉林大学 Gas sensor array model calibration method for data amplification based on condition generation countermeasure network
CN113159047A (en) * 2021-04-16 2021-07-23 南通大学 Power transformation equipment infrared image temperature value identification method based on CGAN image amplification
CN114266768A (en) * 2022-03-01 2022-04-01 聚时科技(江苏)有限公司 Method for generating surface scratch defect image
CN115270614A (en) * 2022-07-18 2022-11-01 郑州轻工业大学 Visual generation method for multi-physical-field digital twin organisms of muddy water circulation system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016406A (en) * 2017-02-24 2017-08-04 中国科学院合肥物质科学研究院 The pest and disease damage image generating method of network is resisted based on production
CN108711138A (en) * 2018-06-06 2018-10-26 北京印刷学院 A kind of gray scale picture colorization method based on generation confrontation network
CN108960409A (en) * 2018-06-13 2018-12-07 南昌黑鲨科技有限公司 Labeled data generation method, equipment and computer readable storage medium
CN109101976A (en) * 2018-07-10 2018-12-28 温州大学 A kind of detection method of arc extinguishing grid pieces surface defect
US20190057520A1 (en) * 2017-08-18 2019-02-21 Synapse Technology Corporation Generating Synthetic Image Data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016406A (en) * 2017-02-24 2017-08-04 中国科学院合肥物质科学研究院 The pest and disease damage image generating method of network is resisted based on production
US20190057520A1 (en) * 2017-08-18 2019-02-21 Synapse Technology Corporation Generating Synthetic Image Data
CN108711138A (en) * 2018-06-06 2018-10-26 北京印刷学院 A kind of gray scale picture colorization method based on generation confrontation network
CN108960409A (en) * 2018-06-13 2018-12-07 南昌黑鲨科技有限公司 Labeled data generation method, equipment and computer readable storage medium
CN109101976A (en) * 2018-07-10 2018-12-28 温州大学 A kind of detection method of arc extinguishing grid pieces surface defect

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188824A (en) * 2019-05-31 2019-08-30 重庆大学 A kind of small sample plant disease recognition methods and system
CN110188824B (en) * 2019-05-31 2021-05-14 重庆大学 Small sample plant disease identification method and system
CN111008692A (en) * 2019-11-08 2020-04-14 国网天津市电力公司 Method and device for generating multi-energy metering characteristic data based on improved generation countermeasure network
CN112116601A (en) * 2020-08-18 2020-12-22 河南大学 Compressive sensing sampling reconstruction method and system based on linear sampling network and generation countermeasure residual error network
CN112462001A (en) * 2020-11-17 2021-03-09 吉林大学 Gas sensor array model calibration method for data amplification based on condition generation countermeasure network
CN112462001B (en) * 2020-11-17 2021-07-23 吉林大学 Gas sensor array model calibration method for data amplification based on condition generation countermeasure network
CN113159047A (en) * 2021-04-16 2021-07-23 南通大学 Power transformation equipment infrared image temperature value identification method based on CGAN image amplification
CN113159047B (en) * 2021-04-16 2024-02-06 南通大学 Substation equipment infrared image temperature value identification method based on CGAN image amplification
CN114266768A (en) * 2022-03-01 2022-04-01 聚时科技(江苏)有限公司 Method for generating surface scratch defect image
CN115270614A (en) * 2022-07-18 2022-11-01 郑州轻工业大学 Visual generation method for multi-physical-field digital twin organisms of muddy water circulation system

Similar Documents

Publication Publication Date Title
CN110189351A (en) A kind of scratch image data amplification method based on production confrontation network
CN109360206B (en) Method for dividing rice ears in field based on deep learning
CN105894045B (en) A kind of model recognizing method of the depth network model based on spatial pyramid pond
CN110059758A (en) A kind of remote sensing image culture pond detection method based on semantic segmentation
CN108346159A (en) A kind of visual target tracking method based on tracking-study-detection
CN107273502A (en) A kind of image geographical marking method learnt based on spatial cognition
CN111982910B (en) Weak supervision machine vision detection method and system based on artificial defect simulation
CN111753828A (en) Natural scene horizontal character detection method based on deep convolutional neural network
CN102831604A (en) Two-dimensional Renyi entropic threshold segmentation method for grayscale images
CN112784736A (en) Multi-mode feature fusion character interaction behavior recognition method
CN111127417B (en) Printing defect detection method based on SIFT feature matching and SSD algorithm improvement
CN110322403A (en) A kind of more supervision Image Super-resolution Reconstruction methods based on generation confrontation network
CN110414509A (en) Stop Ship Detection in harbour based on the segmentation of extra large land and feature pyramid network
CN109685030A (en) A kind of mug rim of a cup defects detection classification method based on convolutional neural networks
CN116542932A (en) Injection molding surface defect detection method based on improved YOLOv5s
CN111754538A (en) Threshold segmentation method for USB surface defect detection
CN113657528A (en) Image feature point extraction method and device, computer terminal and storage medium
CN111310754A (en) Method for segmenting license plate characters
Zhong et al. Identification and depth localization of clustered pod pepper based on improved Faster R-CNN
CN108133182B (en) New energy power generation prediction method and device based on cloud imaging
CN110175548A (en) Remote sensing images building extracting method based on attention mechanism and channel information
CN111161227B (en) Target positioning method and system based on deep neural network
CN117079125A (en) Kiwi fruit pollination flower identification method based on improved YOLOv5
CN114863258B (en) Method for detecting small target based on visual angle conversion in sea-sky-line scene
CN112767387B (en) Automatic wood image recognition method based on block gradient weighting

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190830

RJ01 Rejection of invention patent application after publication