CN110706308B - GAN-based steel coil end face edge loss artificial sample generation method - Google Patents

GAN-based steel coil end face edge loss artificial sample generation method Download PDF

Info

Publication number
CN110706308B
CN110706308B CN201910844888.XA CN201910844888A CN110706308B CN 110706308 B CN110706308 B CN 110706308B CN 201910844888 A CN201910844888 A CN 201910844888A CN 110706308 B CN110706308 B CN 110706308B
Authority
CN
China
Prior art keywords
sample
network
generated
image
steel coil
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910844888.XA
Other languages
Chinese (zh)
Other versions
CN110706308A (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.)
Innovation Qizhi Chengdu Technology Co ltd
Original Assignee
Innovation Qizhi Chengdu 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 Innovation Qizhi Chengdu Technology Co ltd filed Critical Innovation Qizhi Chengdu Technology Co ltd
Priority to CN201910844888.XA priority Critical patent/CN110706308B/en
Publication of CN110706308A publication Critical patent/CN110706308A/en
Application granted granted Critical
Publication of CN110706308B publication Critical patent/CN110706308B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • 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
    • 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
    • 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
    • G06T2207/30136Metal

Landscapes

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

Abstract

The invention discloses a method for generating a steel coil end face edge loss artificial sample based on GAN, which comprises the following specific steps of improving a GAN network structure, inputting a steel coil end face edge image sample, generating a network code and a network decoder by an encoder, sending the generated sample and a real image sample corresponding to the sample into a generated network loss function for calculation, respectively inputting the generated image sample and the corresponding real image sample into a discriminator, finally outputting a classification result by the discriminator, judging whether the sample is the real sample or the generated sample, simultaneously calculating a binary cross entropy loss function back propagation derivation according to the judgment result, and adopting an ADAM optimizer to carry out iterative optimization; according to the method, the GAN network is improved, so that a more vivid defective steel coil end face image sample can be generated, the generated defect part and the background part are in transition nature, the method is more consistent with the real situation, and a steel coil end face edge loss defect sample which is partially defective but is still normal in the background part can be generated.

Description

GAN-based steel coil end face edge loss artificial sample generation method
Technical Field
The invention relates to the technical field of industrial vision, in particular to a GAN-based steel coil end face edge loss artificial sample generation method.
Background
In the prior art of generating artificial samples aiming at the edge loss of the end face of a steel coil, the defect parts in a plurality of limited real defect image samples are usually deducted, then the samples are pasted on the real non-defect steel coil end face images in a pasting mode, and then the edges of the pasting are smoothly processed through a plurality of image processing technologies, so that the pasting looks more similar to the background. The disadvantages of this technique are, on the one hand, that the defect texture and background texture trends of the map often differ greatly and are not realistic enough in comparison with the real defect sample, and, on the other hand, that the defect portion is not diverse enough.
In the conventional GAN-based general image generation technology, an image which looks like a real image can be generated from noise by learning a large number of target images. The disadvantage is that images with some details cannot be generated in a targeted manner, and only images that look similar overall can be generated.
Disclosure of Invention
The invention aims to overcome the problems in the prior art and provide a method for generating a steel coil end face edge loss artificial sample based on GAN, which can generate a more vivid defective steel coil end face image sample by improving a GAN network, wherein the generated defective part and the background part are in transition nature and are more in line with the real situation, and the defect can be generated locally, but the background part is still a normal steel coil end face edge loss defective sample, and only the real sample without defects is required to be used as a training sample, so that the problem that the steel coil end face edge loss sample is difficult to obtain is avoided.
In order to achieve the technical purpose and achieve the technical effect, the invention is realized by the following technical scheme:
a method for generating artificial samples of end face edge loss of steel coils based on GAN comprises the following steps:
s1, improving the GAN network structure, and respectively improving the generation network and the judgment network;
s101, the generated network is improved to adopt a coding-decoding structure, a coding part is formed by sequentially connecting three modules, each module consists of 3 convolution layers of 3 multiplied by 3, a RELU layer and a maximum pooling layer of 2 multiplied by 2, the decoding part and the coding part are in mirror symmetry, and the maximum pooling layer is replaced by an up-sampling layer; adding a jump connection between symmetrical modules of the coding and decoding parts to fully fuse the characteristics of the coding part and the decoding part;
s102, the judgment network is improved to be that the main part is the same as the generated network coding part, and a full connection layer is added to enable a vector with the final output length of 2 to be used for secondary classification;
s2, inputting the edge image sample of the end face of the steel coil, and generating network coding and network decoding by the coder, wherein at the moment, the original image sample generates an image sample filled with image content;
s3, the generated sample and the real image sample corresponding to the sample are sent to the calculation of the generated network loss function, the generated network loss function adopts L1 loss, and the calculation formula of the loss function is as follows:
L=|F(x)-Y|;
s4, the generated image sample and the corresponding real image sample are respectively input into a discriminator, the discriminator finally outputs a two-classification result, whether the image sample is the real sample or the generated sample is judged, and a two-value cross entropy loss function is calculated according to the judgment result, wherein the two-value cross entropy loss function calculation formula is as follows:
Figure BDA0002194908400000021
and S5, weighting and summing the loss functions obtained in S3 and S4 to obtain a total loss function of the final network, then carrying out back propagation derivation, and adopting an ADAM optimizer to carry out iterative optimization.
Further, the generating network loss function is calculating an absolute value of an error between the generated image and the target image.
Further, the binary cross entropy loss function is used to measure the dissimilarity between two probability distributions.
Further, the method comprises the following steps of locally modifying the input edge image:
randomly selecting one or two of regularly arranged arc curves on the normal flawless steel coil end face edge image, wiping off a small section of the arc curve, then randomly generating an irregular curve to connect the wiped sections together to obtain a locally modified edge image, inputting the modified edge image into the proposed GAN network, and finally generating a steel coil end face edge loss sample with a local random shape distortion defect.
The benefit effects of the invention are:
1. the GAN network-based sample generation method provided by the invention can generate more vivid defective steel coil end face image samples, and the generated defective part and the background part are in transition nature and are more in line with the real situation.
2. The improved GAN network provided by the invention overcomes the defect that the original GAN network can only generate the whole image content and can not change the locally generated content in a targeted manner, so that a sample with local defects can be generated, but the background part is still the normal edge loss defect of the end face of the steel coil.
3. According to the GAN network-based sample generation method provided by the invention, only a real sample without defects is needed as a training sample, so that the problem that the edge loss sample on the end surface of the steel coil is difficult to obtain is avoided, and the generated sample can be used for subsequent edge loss detection and identification, so that the problem that the sample is difficult to obtain can be solved to a certain extent.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow diagram of the present invention;
FIG. 2 is a schematic diagram of an improved GAN network training method of the present invention;
FIG. 3 is a schematic diagram of an image of a normal steel coil end face;
FIG. 4 is a schematic diagram of extracting an edge image of an end face of a steel coil;
FIG. 5 is a schematic diagram of a simulated image generated from an edge image;
FIG. 6 is a schematic diagram of an image of a normal steel coil end face;
FIG. 7 is a schematic diagram of extracting an edge image of an end face of a steel coil;
FIG. 8 is a schematic view of a manually modified partial edge shape;
FIG. 9 is a schematic diagram of image generation from an edge image.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
As shown in fig. 1-5, the invention relates to a GAN-based method for generating an artificial sample of end face edge loss of a steel coil, which comprises the following steps:
s1, improving the GAN network structure, and respectively improving the generation network and the judgment network;
s101, the generated network is improved to adopt a coding-decoding structure, a coding part is formed by sequentially connecting three modules, each module consists of 3 convolution layers of 3 multiplied by 3, a RELU layer and a maximum pooling layer of 2 multiplied by 2, the decoding part and the coding part are in mirror symmetry, and the maximum pooling layer is replaced by an up-sampling layer; adding a jump connection between symmetrical modules of the coding and decoding parts to fully fuse the characteristics of the coding part and the decoding part;
s102, the judgment network is improved to be that the main part is the same as the generated network coding part, and a full connection layer is added to enable a vector with the final output length of 2 to be used for secondary classification;
s2, inputting the edge image sample of the end face of the steel coil, as shown in fig. 3, the encoder generates a network code and a network decode, and at this time, the original image sample generates an image sample filled with image content, as shown in fig. 4;
s3, the generated sample and the real image sample corresponding to the sample are sent to a generated network loss function calculation, the generated network loss function adopts L1 loss, the purpose is to make the image generated by the generated network and the real image as close as possible, and the loss function calculation formula is as follows:
L=|F(x)-Y|;
s4, the generated image sample and the corresponding real image sample are respectively input into a discriminator, the discriminator finally outputs a binary result, whether the image sample is the real sample or the generated sample is judged, the generated sample and the real sample can be distinguished as much as possible, the targets of the generated network and the judged network are countermeasures, a generated network with better effect can be obtained through the countermeasures, and a binary cross entropy loss function is calculated according to the judgment result, wherein the calculation formula of the binary cross entropy loss function is as follows:
Figure BDA0002194908400000051
and S5, weighting and summing the loss functions obtained in S3 and S4 to obtain a total loss function of the final network, then carrying out back propagation derivation, and carrying out iterative optimization by adopting an ADAM optimizer to obtain an image shown in FIG. 5.
Generating a network loss function, wherein the generating the network loss function is calculating an absolute value of an error between a generated image and a target image; a binary cross entropy loss function is used to measure the dissimilarity between the two probability distributions.
Example 2
As shown in fig. 1-2 and 6-9, selecting a normal edge image, as shown in fig. 6, extracting an edge image of an end face of a steel coil, as shown in fig. 7, locally modifying an input edge image, randomly selecting one or two of regularly arranged circular arc curves on the edge image of the end face of the steel coil without defects, erasing a small section of the circular arc curve, then randomly generating an irregular curve to connect the erased sections, so as to obtain a locally modified edge image, as shown in fig. 8, inputting the modified edge image into the proposed GAN network, and finally generating a steel coil end face edge loss sample with locally random shape distortion defects, as shown in fig. 9.
In conclusion, the invention can generate more vivid defective steel coil end face image samples by improving the GAN network, the generated defect part and the background part are in transition nature and accord with the real situation better, the defect part can generate the steel coil end face edge damage defect samples which are partially defective but the background part is still normal, and only the real samples without defects are needed to be used as training samples, thereby avoiding the problem that the steel coil end face edge damage samples are difficult to obtain.
In the description herein, references to the description of "one embodiment," "an example," "a specific example" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims (3)

1. A method for generating artificial samples of edge loss of end faces of steel coils based on GAN is characterized by comprising the following steps: the method comprises the following steps:
s1, improving the GAN network structure, and respectively improving the generation network and the judgment network;
s101, the generated network is improved to adopt a coding-decoding structure, a coding part is formed by sequentially connecting three modules, each module consists of 3 convolution layers of 3 multiplied by 3, a RELU layer and a maximum pooling layer of 2 multiplied by 2, the decoding part and the coding part are in mirror symmetry, and the maximum pooling layer is replaced by an up-sampling layer; adding a jump connection between symmetrical modules of the coding and decoding parts to fully fuse the characteristics of the coding part and the decoding part;
s102, the judgment network is improved to be that the main part is the same as the generated network coding part, and a full connection layer is added to enable a vector with the final output length of 2 to be used for secondary classification;
s2, locally modifying the input edge image, the steps are as follows: randomly selecting one or two of regularly arranged arc curves on the edge image of the end face of the steel coil without defects, wiping off a small section of the arc curve, and then randomly generating an irregular curve to connect the wiped sections to obtain a locally modified edge image;
inputting a steel coil end face edge image sample, generating network coding and network decoding by an encoder, and generating an image sample filled with image content by an original image sample at the moment;
s3, the generated sample and the real image sample corresponding to the sample are sent to the calculation of the generated network loss function, the generated network loss function adopts L1 loss, and the calculation formula of the loss function is as follows:
L=|F(x)-Y|;
s4, the generated image sample and the corresponding real image sample are respectively input into a discriminator, the discriminator finally outputs a two-classification result, whether the image sample is the real sample or the generated sample is judged, and a two-value cross entropy loss function is calculated according to the judgment result, wherein the two-value cross entropy loss function calculation formula is as follows:
Figure FDA0002595702730000011
and S5, weighting and summing the loss functions obtained in S3 and S4 to obtain a total loss function of the final network, then carrying out back propagation derivation, and adopting an ADAM optimizer to carry out iterative optimization.
2. The GAN-based artificial sample generation method for the end face edge loss of the steel coil according to claim 1, wherein: the generating network loss function is calculating an absolute value of an error between a generated image and a target image.
3. The GAN-based artificial sample generation method for the end face edge loss of the steel coil according to claim 1, wherein: the binary cross entropy loss function is used to measure the dissimilarity between two probability distributions.
CN201910844888.XA 2019-09-07 2019-09-07 GAN-based steel coil end face edge loss artificial sample generation method Active CN110706308B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910844888.XA CN110706308B (en) 2019-09-07 2019-09-07 GAN-based steel coil end face edge loss artificial sample generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910844888.XA CN110706308B (en) 2019-09-07 2019-09-07 GAN-based steel coil end face edge loss artificial sample generation method

Publications (2)

Publication Number Publication Date
CN110706308A CN110706308A (en) 2020-01-17
CN110706308B true CN110706308B (en) 2020-09-25

Family

ID=69194957

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910844888.XA Active CN110706308B (en) 2019-09-07 2019-09-07 GAN-based steel coil end face edge loss artificial sample generation method

Country Status (1)

Country Link
CN (1) CN110706308B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111681162B (en) * 2020-06-09 2023-09-01 创新奇智(成都)科技有限公司 Defect sample generation method and device, electronic equipment and storage medium
CN112085734B (en) * 2020-09-25 2022-02-01 西安交通大学 GAN-based image restoration defect detection method
CN112562720B (en) * 2020-11-30 2024-07-12 清华珠三角研究院 Lip-sync video generation method, device, equipment and storage medium
CN112988854A (en) * 2021-05-20 2021-06-18 创新奇智(成都)科技有限公司 Complaint data mining method and device, electronic equipment and storage medium
CN113361443A (en) * 2021-06-21 2021-09-07 广东电网有限责任公司 Method and system for power transmission line image sample counterstudy augmentation
CN113487512B (en) * 2021-07-20 2024-07-02 陕西师范大学 Digital image restoration method and device based on edge information guidance

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109584221A (en) * 2018-11-16 2019-04-05 聚时科技(上海)有限公司 A kind of abnormal image detection method generating confrontation network based on supervised
CN109840561A (en) * 2019-01-25 2019-06-04 湘潭大学 A kind of rubbish image automatic generation method can be used for garbage classification

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10910099B2 (en) * 2018-02-20 2021-02-02 Siemens Healthcare Gmbh Segmentation, landmark detection and view classification using multi-task learning
CN109829895B (en) * 2019-01-09 2021-08-17 武汉精立电子技术有限公司 AOI defect detection method based on GAN
CN109829900A (en) * 2019-01-18 2019-05-31 创新奇智(北京)科技有限公司 A kind of steel coil end-face defect inspection method based on deep learning
CN110097543B (en) * 2019-04-25 2023-01-13 东北大学 Hot-rolled strip steel surface defect detection method based on generation type countermeasure network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109584221A (en) * 2018-11-16 2019-04-05 聚时科技(上海)有限公司 A kind of abnormal image detection method generating confrontation network based on supervised
CN109840561A (en) * 2019-01-25 2019-06-04 湘潭大学 A kind of rubbish image automatic generation method can be used for garbage classification

Also Published As

Publication number Publication date
CN110706308A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
CN110706308B (en) GAN-based steel coil end face edge loss artificial sample generation method
CN109934761B (en) JPEG image steganalysis method based on convolutional neural network
CN111047522B (en) Image restoration method based on edge generation
CN107301668B (en) A kind of picture compression method based on sparse matrix, convolutional neural networks
CN110473144B (en) Image super-resolution reconstruction method based on Laplacian pyramid network
CN111292265A (en) Image restoration method based on generating type antagonistic neural network
CN113129272A (en) Defect detection method and device based on denoising convolution self-encoder
CN113392711A (en) Smoke semantic segmentation method and system based on high-level semantics and noise suppression
CN112150450A (en) Image tampering detection method and device based on dual-channel U-Net model
CN113450261A (en) Single image defogging method based on condition generation countermeasure network
CN111861935B (en) Rain removing method based on image restoration technology
CN114742985A (en) Hyperspectral feature extraction method and device and storage medium
CN113763364A (en) Image defect detection method based on convolutional neural network
CN112785578A (en) Road crack detection method and system based on U-shaped codec neural network
CN113888431A (en) Training method and device of image restoration model, computer equipment and storage medium
CN113780423A (en) Single-stage target detection neural network based on multi-scale fusion and industrial product surface defect detection model
CN118096487B (en) Intermediate process supervised deep learning image watermark extraction method and system
CN118036476B (en) Precast concrete crack detection model, method, system and readable medium
CN112102306B (en) Dual-GAN-based defect detection method for edge repair feature fusion
CN116778346B (en) Pipeline identification method and system based on improved self-attention mechanism
CN115641437A (en) Industrial defect instance segmentation method
CN114359009B (en) Watermark embedding method, watermark embedding network construction method, system and storage medium for robust image based on visual perception
CN113205503B (en) Satellite coastal zone image quality evaluation method
CN115511820A (en) Defect detection model training method and defect detection method for flexible circuit board
CN114980723A (en) Fault prediction method and system for cross-working-condition chip mounter suction nozzle

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