WO2021088101A1 - Insulator segmentation method based on improved conditional generative adversarial network - Google Patents

Insulator segmentation method based on improved conditional generative adversarial network Download PDF

Info

Publication number
WO2021088101A1
WO2021088101A1 PCT/CN2019/117494 CN2019117494W WO2021088101A1 WO 2021088101 A1 WO2021088101 A1 WO 2021088101A1 CN 2019117494 W CN2019117494 W CN 2019117494W WO 2021088101 A1 WO2021088101 A1 WO 2021088101A1
Authority
WO
WIPO (PCT)
Prior art keywords
insulator
image
segmentation
insulator segmentation
model
Prior art date
Application number
PCT/CN2019/117494
Other languages
French (fr)
Chinese (zh)
Inventor
梁自泽
高子舒
杨国栋
李恩
景奉水
田雨农
王昊
孙苑淞
陆偲蓰
汪晗
龙晓宇
徐光耀
Original Assignee
中国科学院自动化研究所
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 中国科学院自动化研究所 filed Critical 中国科学院自动化研究所
Publication of WO2021088101A1 publication Critical patent/WO2021088101A1/en

Links

Images

Classifications

    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • 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/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • 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

Definitions

  • the invention belongs to the field of image segmentation and high-voltage transmission line inspection, and in particular relates to an insulator segmentation method, system and device based on an improved condition generation counter network.
  • Insulators are widely used in power systems. Once damaged, they will cause the power network to collapse and cause serious power economic losses. Therefore, detecting insulators has become an indispensable task in the power inspection process. With the rapid development of robots and unmanned aerial vehicles and the improvement of image detection technology, dangerous and complicated manual power inspections are gradually replaced by machines. In recent years, with the continuous development of artificial intelligence neural networks, power inspection based on deep learning has become the focus of researchers in recent years. How to use deep learning to accurately segment and identify insulators has become an important research direction in current line inspection.
  • Image segmentation is an important research topic in computer vision. It mainly studies the task of assigning a label to each pixel in the image, and recognizes the target at the pixel level. Image segmentation methods can be divided into three main categories. The first is based on traditional methods, such as "Normalized cut” and "Grab cut”. This type of method mainly uses pixel-level bottom-level information for segmentation. The overall algorithm has low complexity, does not require training, and the segmentation efficiency is relatively high. However, in the face of an image with a slightly complicated background, auxiliary information needs to be added to help its segmentation, otherwise the effect is not ideal.
  • Deep learning image segmentation methods mainly include full convolutional networks, autoencoder networks, and generative adversarial networks (GAN).
  • the full convolutional network FCN uses the deconvolution layer to upsample the feature map output by the last convolution layer to obtain an image with the same size as the input, and complete pixel-level segmentation on this image.
  • FCN uses a fully convolutional network and has become a classic algorithm in image segmentation algorithms.
  • the self-encoder method mainly uses an encoder to extract image features, obtain a feature map, and use a decoder to divide the feature map at the pixel level. This method is more complicated and time-consuming than a full convolutional network.
  • the image segmentation completed by the generative confrontation network is generally used by the generator to map the extracted low-dimensional features into the segmentation model of the object.
  • the discriminator network is generally symmetrical with the generator network to distinguish whether the predicted segmentation model is true. Through continuous training, a high-quality generator model is obtained, and the trained generator model is used to complete image segmentation. This method has higher segmentation accuracy and can be better improved in efficiency. However, the accuracy and efficiency of segmentation are still poor for insulator images with complex image backgrounds and various postures.
  • this patent proposes an insulator segmentation method based on an improved conditional generation adversarial network, which has greater advantages over existing methods in terms of image segmentation accuracy and efficiency.
  • the first aspect of the present invention proposes an improved conditional generation confrontation network
  • the method for dividing the insulator includes:
  • Step S100 Obtain an image containing an insulator as an input image
  • Step S200 based on the input image, obtain an insulator segmentation image through an insulator segmentation model
  • the insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
  • the asymmetric convolution layer of the encoder is composed of a convolution function, a batch normalization function, and a linear rectification function;
  • the asymmetric convolution layer of the decoder is composed of a deconvolution function, Batch normalization function and linear rectification function are formed.
  • the training method of the insulator segmentation model is:
  • Step A100 Obtain an image containing insulators, and construct a sample set by a preset image enhancement method, the sample set including input image samples and real segmentation images of the insulators contained therein; split the sample set into training samples Set and test sample set;
  • Step A200 Obtain an insulator segmentation image through an insulator segmentation model based on the input image samples in the training sample set; use it as an insulator to generate a segmentation image;
  • Step A300 Generate a segmented image according to the insulator and the real segmented image of the insulator corresponding to the training sample, obtain the segmentation results of each region in the insulator segmented image through the conditional generation against the network cGAN discriminator, and obtain the loss value of the insulator segmentation model ;
  • Step A400 Obtain the current number of iterations. If the loss value is less than the preset training loss threshold or the number of iterations is greater than the preset number of training iterations, output the trained insulator segmentation model and use it as the first model. Go to step A500; otherwise, based on the loss value, use the backpropagation algorithm to update the parameters of the insulator segmentation model, increase the number of iterations by 1, and skip to step A200;
  • Step A500 Obtain insulator segmentation images of all input image samples in the test sample set through the first model, and compare the insulator segmentation images with the real segmentation images of the insulators contained in the test sample set to obtain mIoU The assessed value;
  • Step A600 if the mIoU evaluation value is greater than the preset evaluation value, use the first model as the finally trained insulator segmentation model; otherwise, skip to step A200.
  • the method of "constructing a sample set through a preset image enhancement method" in step A100 is as follows:
  • the brightness processed image sample and the rotation processed image sample are scaled to a preset size; and a sample set is constructed based on the scaled image.
  • the discriminator of the conditional generation against network cGAN is composed of five layers of convolutional layers; the first layer of convolutional layer is composed of convolution function and Leaky ReLU function, and the last layer is composed of convolution function , The remaining three convolutional layers are composed of convolution function, Leaky ReLU function, and batch normalization function.
  • the output of the discriminator of the conditional generation against network cGAN is a 16 ⁇ 16 matrix.
  • an insulator segmentation system based on an improved conditional generation confrontation network is proposed.
  • the system includes an acquisition module and an output module;
  • the acquisition module is configured to acquire an image containing an insulator as an input image
  • the output module is configured to obtain an insulator segmentation image through an insulator segmentation model based on the input image
  • the insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
  • a storage device in which a plurality of programs are stored, and the program applications are loaded and executed by a processor to realize the above-mentioned insulator segmentation method based on the improved conditional generation confrontation network.
  • a processing device including a processor and a storage device; the processor is suitable for executing each program; the storage device is suitable for storing multiple programs; the program is suitable for being loaded by the processor And execute to realize the above-mentioned insulator segmentation method based on the improved condition to generate the confrontation network.
  • the invention generates a confrontation network through an improved condition, which improves the accuracy and efficiency of the insulator segmentation.
  • the present invention forms a self-encoder network by constructing encoders and decoders containing asymmetric convolutional layers, and uses them as an improved conditional generation counter-network cGAN generator, which reduces the calculation amount of insulator segmentation and improves segmentation efficiency.
  • the present invention changes the output of the discriminator of the conditional generation against network cGAN to a 16 ⁇ 16 matrix, which can discriminate the segmentation results of each region of the insulator segmented image output by the generator, and update the generator (insulator segmentation model) based on the result output by the discriminator ), compared with the 0 and 1 values output by the existing discriminator, the trained insulator model has higher accuracy, and achieves high-quality segmentation in insulator images with complex backgrounds and diverse types and poses.
  • FIG. 1 is a schematic flowchart of an insulator segmentation method based on an improved conditional generation confrontation network according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an insulator segmentation system based on an improved conditional generation confrontation network according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a training method of an insulator model according to an embodiment of the present invention
  • FIG. 4 is an example diagram of an improved conditional generation confrontation network according to an embodiment of the present invention.
  • FIG. 5 is an example diagram of comparison of detection results of different network models according to an embodiment of the present invention.
  • Fig. 6 is an exemplary diagram of the detection result of the present invention according to an embodiment of the present invention.
  • the insulator segmentation method based on the improved condition generation confrontation network of the present invention includes the following steps:
  • Step S100 Obtain an image containing an insulator as an input image
  • Step S200 based on the input image, obtain an insulator segmentation image through an insulator segmentation model
  • the insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
  • the training method of the insulator segmentation model will be described in detail first, and the insulator segmentation method based on the improved condition generation adversarial network will be described in detail.
  • the insulator segmentation model as shown in Figure 3, includes the following steps:
  • Step A100 Obtain an image containing insulators, and construct a sample set by a preset image enhancement method, the sample set including input image samples and real segmentation images of the insulators contained therein; split the sample set into training samples Set and test sample set;
  • Step A200 Obtain an insulator segmentation image through an insulator segmentation model based on the input image samples in the training sample set; use it as an insulator to generate a segmentation image;
  • Step A300 Generate a segmented image according to the insulator and the real segmented image of the insulator corresponding to the training sample, obtain the segmentation results of each region in the insulator segmented image through the conditional generation against the network cGAN discriminator, and obtain the loss value of the insulator segmentation model ;
  • Step A400 Obtain the current number of iterations. If the loss value is less than the preset training loss threshold or the number of iterations is greater than the preset number of training iterations, output the trained insulator segmentation model and use it as the first model. Go to step A500; otherwise, based on the loss value, use the backpropagation algorithm to update the parameters of the insulator segmentation model, increase the number of iterations by 1, and skip to step A200;
  • Step A500 Obtain insulator segmentation images of all input image samples in the test sample set through the first model, and compare the insulator segmentation images with the real segmentation images of the insulators contained in the test sample set to obtain mIoU The assessed value;
  • Step A600 if the mIoU evaluation value is greater than the preset evaluation value, use the first model as the finally trained insulator segmentation model; otherwise, skip to step A200.
  • Step A100 Obtain an image containing insulators, and construct a sample set by a preset image enhancement method, the sample set including input image samples and real segmentation images of the insulators contained therein; split the sample set into training samples Set and test sample set.
  • Step A101 Obtain an image containing the insulator as the original image.
  • Step A102 in order to enrich the samples, the present invention performs brightness processing and rotation processing on the original image.
  • the brightness processing method is: randomly select two values in the range of 0.5 to 1.5 times the brightness of the original image to process the brightness of the original image.
  • Rotation processing Rotate the original image once every 24°, and each image can get 15 enhanced images.
  • the present invention preferably rotates once every 24°. In other preferred embodiments, it can be set according to actual conditions.
  • the above image enhancement method is used to process 350 insulator images to obtain 6000 enhanced images.
  • step A103 the enhanced image is scaled to a size of 256 ⁇ 256, and named according to 1.jpg to 6000.jpg, and the sample set image is annotated to obtain the insulator segmentation map, and the production of the image sample set is completed.
  • the sample set includes input image samples and real segmented images of the insulators contained therein.
  • the sample set is divided into a training sample set and a test sample set, where 5000 sheets are used as the training sample set and 1000 sheets are used as the test sample set.
  • Step A200 Obtain an insulator segmented image through an insulator segmentation model based on the input image samples in the training sample set; use it as an insulator to generate a segmented image.
  • the conditional generation confrontation network cGAN is composed of a generator and a discriminator, as shown in FIG. 4.
  • the insulator segmentation model is constructed based on the generator of the conditional generation confrontation network cGAN.
  • the generator is a self-encoder, including an encoder and a decoder, that is, the encoding part and the decoding part. Save the sampling index of the coding part and pass it to the up-sampling layer, thereby reducing information loss.
  • the real segmented image of the insulator and its corresponding image sample, the segmented image of the insulator output by the generator and its corresponding input image sample are regarded as a true and false image pair.
  • a 16 ⁇ 16 matrix is output through the discriminator, and each element of the matrix represents whether the corresponding patch (region) is true or not false.
  • Each encoder in the generator includes an asymmetric convolutional layer and a maximum pooling layer.
  • the asymmetric convolution layer is composed of a convolution function, a batch normalization function, and a linear rectification function, that is, the structure of Conv+BN+ReLU, which can deepen the network complexity while reducing network parameters.
  • the decoder includes an asymmetric convolution layer and an up-sampling layer; the decoder and the encoder are symmetrical, using a deconvolution function, a batch normalization function, and a linear rectification function, that is, the structure of Conv+BN+ReLU. As shown in Table 1:
  • Set is the frame, including Input, Encoder1-Encoder5 (encoder), Decoder1-Decoder5 (decoder), Layer name represents the name of each layer in the generator, RGB image is the input image, Conv represents the volume Multiplying layer, MP means maximum pooling layer, Deconv means deconvolution layer, UP means upsampling layer, Type of layers means layer type, fs means convolution kernel, window means window size, Max-pooling means maximum pooling, UpSampling For upsampling, Output size represents the output size.
  • the input image samples in the training sample set are input to the generator, and the resolution of the input image samples is 256 ⁇ 256 ⁇ 3, and the insulator segmentation image is obtained; and the segmentation image is generated as the insulator.
  • Step A300 Generate a segmented image according to the insulator and the real segmented image of the insulator corresponding to the training sample, obtain the segmentation results of each region in the insulator segmented image through the conditional generation against the network cGAN discriminator, and obtain the loss value of the insulator segmentation model .
  • the discriminator of the conditional generation adversarial network cGAN is mainly composed of five-layer encoders, that is, five-layer convolutional layers.
  • the first convolutional layer is composed of convolutional functions and Leaky ReLU functions; and the last layer is composed of convolutional functions and Leaky ReLU functions.
  • the other three convolutional layers are composed of convolution function, Leaky ReLU function, and batch normalization function, namely Conv+Leaky ReLU+BN.
  • the convolution kernel adopts 4 ⁇ 4, and the step size is 2. As shown in table 2:
  • RGB image and generated image are the generated image of the generator and the real segmentation image of the insulator corresponding to the training sample.
  • the input of the discriminator is the generated image of the generator and the real segmentation image of the insulator corresponding to the training sample, and the output is a 16 ⁇ 16 matrix. Each element of the matrix represents whether the corresponding patch is true or false.
  • the segmented image and the real segmented image of the insulator corresponding to the training sample are generated, and the segmentation results of each region in the insulator segmented image are obtained through the conditional generation of the discriminator against the network cGAN.
  • Let the input samples conduct feedforward conduction in the network, and obtain the training error after comparing the generated segmentation map with the real segmentation map.
  • the generator and discriminator continue to operate on the read training samples until the network output Training loss value of generator and discriminator.
  • Step A400 Obtain the current number of iterations. If the loss value is less than the preset training loss threshold or the number of iterations is greater than the preset number of training iterations, output the trained insulator segmentation model and use it as the first model. Go to step A500; otherwise, based on the loss value, use the back propagation algorithm to update the parameters of the insulator segmentation model, increase the number of iterations by 1, and skip to step A200.
  • the training insulator segmentation model is obtained; otherwise, based on the loss value, the conditional generation is obtained through backpropagation. Fight against the change of the network cGAN, update the parameters, increase the number of iterations by 1, and jump to step A200.
  • Step A500 Obtain insulator segmentation images of all input image samples in the test sample set through the first model, and compare the insulator segmentation images with the real segmentation images of the insulators contained in the test sample set to obtain mIoU The assessed value.
  • the model is tested through a test sample set. That is to say, all the input image samples in the test sample set generate insulator segmentation images, which are compared with the real segmentation images of the insulators contained in the test sample set to obtain the mIoU evaluation value and calculate the average test time.
  • Step A600 if the mIoU evaluation value is greater than the preset evaluation value, use the first model as the finally trained insulator segmentation model; otherwise, skip to step A200.
  • Models in Table 3 represents the network model used in the experiment
  • Ours is the improved network extracted by the present invention, that is, the network in Figures 5 and 6,
  • Pix2pix, SegNet, Unet, and FCN are pixel-to-pixel models, semantic segmentation networks, Deep learning segmentation network, full convolutional neural network
  • Trainable Para(M) represents the amount of training parameters
  • Time represents the average test time. It can be seen from Table 3 that the mIoU evaluation value of the segmentation in the present invention is the highest, indicating the average segmentation effect the best.
  • the network requires the least parameters, which greatly reduces network complexity and improves segmentation efficiency.
  • Figure 5 shows the final segmentation result. It can be seen that because the discriminator is added to the network of the present invention, the segmentation accuracy of the insulator can be improved, and pixel-level segmentation can also be completed in minute details.
  • step S100 an image containing an insulator is obtained as an input image.
  • an image containing an insulator actually acquired is used as the input image.
  • the image containing the insulator can be taken manually, or obtained by aerial photography or other means.
  • Step S200 based on the input image, obtain an insulator segmentation image through an insulator segmentation model.
  • the insulator segmentation image is acquired through the trained insulator segmentation model.
  • an insulator segmentation system based on an improved condition generation confrontation network includes: an acquisition module 100 and an output module 200;
  • the acquiring module 100 is configured to acquire an image containing an insulator as an input image
  • the output module 200 is configured to obtain an insulator segmentation image through an insulator segmentation model based on the input image
  • the insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
  • the insulator segmentation system based on the improved condition to generate the confrontation network only uses the division of the above functional modules as an example.
  • the above function can be assigned to different functions according to needs.
  • Functional modules are implemented, that is, the modules or steps in the embodiments of the present invention are further decomposed or combined.
  • the modules of the above-mentioned embodiments can be combined into one module, or further divided into multiple sub-modules to complete all or the steps described above. Part of the function.
  • the names of the modules and steps involved in the embodiments of the present invention are only for distinguishing each module or step, and are not regarded as improper limitations on the present invention.
  • a plurality of programs are stored therein, and the programs are suitable for being loaded by a processor and implementing the above-mentioned insulator segmentation method based on the improved condition generation confrontation network.
  • a processing device includes a processor and a storage device; the processor is suitable for executing each program; the storage device is suitable for storing multiple programs; the program is suitable for being loaded and executed by the processor In order to realize the above-mentioned insulator segmentation method based on the improved condition to generate the confrontation network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

An insulator segmentation method and system based on an improved conditional generative adversarial network, and an apparatus, aiming at solving the problems of poor segmentation precision and low efficiency of the insulator segmentation method based on the conditional generative adversarial network. The system method comprises: obtaining an image comprising an insulator as an input image (S100); and obtaining an insulator segmentation image by means of an insulator segmentation model on the basis of the input image, the insulator segmentation model being constructed on the basis of a generator of the conditional generative adversarial network, the generator being constructed on the basis of an auto-encoder and comprising an encoder and a decoder, the encoder comprising an asymmetric convolution layer and a maximum pooling layer, the decoder comprising an asymmetric convolution layer and an up-sampling layer, a training sample of the insulator segmentation model comprising an input image sample and a real segmentation image of an insulator comprised in the training sample (S200). By means of the improved conditional generative adversarial network, the insulator segmentation precision and efficiency are improved.

Description

基于改进的条件生成对抗网络的绝缘子分割方法Insulator segmentation method based on improved conditional generation confrontation network 技术领域Technical field
本发明属于图像分割、高压输电线路巡检领域,具体涉及一种基于改进的条件生成对抗网络的绝缘子分割方法、系统、装置。The invention belongs to the field of image segmentation and high-voltage transmission line inspection, and in particular relates to an insulator segmentation method, system and device based on an improved condition generation counter network.
背景技术Background technique
绝缘子在电力系统中被广泛使用,一旦损坏将导致电力网崩溃,造成严重的电力经济损失,所以检测绝缘子成为电力巡检过程中不可或缺的一个任务。随着机器人、无人机的迅速发展和图像检测技术的提高,危险复杂的人工电力巡检逐渐被机器所取代。近年来人工智能神经网络的不断发展,基于深度学习的电力巡检近几年成为了研究者们关注的焦点,如何使用深度学习将绝缘子准确的分割识别出来成为当前巡线检测的重要研究方向。Insulators are widely used in power systems. Once damaged, they will cause the power network to collapse and cause serious power economic losses. Therefore, detecting insulators has become an indispensable task in the power inspection process. With the rapid development of robots and unmanned aerial vehicles and the improvement of image detection technology, dangerous and complicated manual power inspections are gradually replaced by machines. In recent years, with the continuous development of artificial intelligence neural networks, power inspection based on deep learning has become the focus of researchers in recent years. How to use deep learning to accurately segment and identify insulators has become an important research direction in current line inspection.
图像分割在计算机视觉中是一个重要的研究课题。它主要研究为图像中的每一个像素分配一个标签的任务,对目标进行像素级的识别。图像分割方法主要可以分为三大类。首先是基于传统方法,比如”Normalized cut”,”Grab cut”。这一类方法分割时主要使用像素级的底层信息,整个算法复杂度低,不需要训练,分割效率比较高。但是面对背景稍微复杂的图像,则需要添加辅助信息来帮助其分割,否则效果不够理想。Image segmentation is an important research topic in computer vision. It mainly studies the task of assigning a label to each pixel in the image, and recognizes the target at the pixel level. Image segmentation methods can be divided into three main categories. The first is based on traditional methods, such as "Normalized cut" and "Grab cut". This type of method mainly uses pixel-level bottom-level information for segmentation. The overall algorithm has low complexity, does not require training, and the segmentation efficiency is relatively high. However, in the face of an image with a slightly complicated background, auxiliary information needs to be added to help its segmentation, otherwise the effect is not ideal.
另外一种很重要的方式是深度学习方法。目前,深度学习的图像分割方法主要有全卷积网络、自编码器网络、生成式对抗网络(GAN)。全卷积网络FCN利用反卷积层对最后一个卷积层输出的特征图进行上采样,得到与输入尺寸相同的图像,并在此图像上完成像素级的分割。FCN 采用全卷积网络,成为图像分割算法中的经典算法。自编码器方法主要使用编码器来提取图像特征,得到特征图,利用解码器将特征图进行像素级的分割。这种方法相比全卷积网络复杂度更高,耗时更多。生成式对抗网络完成的图像分割一般由生成器将提取低维度的特征映射成物体的分割模型,判别器网络一般与生成器网络对称,用来区分预测的分割模型是否为真。通过不断训练,得到高质量的生成器模型,用训练得到的生成器模型完成图像分割。这种方法分割精度更高,在效率上可以得到更好的提高。但面对图像背景复杂,种类姿态多样的绝缘子图像,分割的精度和效率还是较差。Another very important method is the deep learning method. Currently, deep learning image segmentation methods mainly include full convolutional networks, autoencoder networks, and generative adversarial networks (GAN). The full convolutional network FCN uses the deconvolution layer to upsample the feature map output by the last convolution layer to obtain an image with the same size as the input, and complete pixel-level segmentation on this image. FCN uses a fully convolutional network and has become a classic algorithm in image segmentation algorithms. The self-encoder method mainly uses an encoder to extract image features, obtain a feature map, and use a decoder to divide the feature map at the pixel level. This method is more complicated and time-consuming than a full convolutional network. The image segmentation completed by the generative confrontation network is generally used by the generator to map the extracted low-dimensional features into the segmentation model of the object. The discriminator network is generally symmetrical with the generator network to distinguish whether the predicted segmentation model is true. Through continuous training, a high-quality generator model is obtained, and the trained generator model is used to complete image segmentation. This method has higher segmentation accuracy and can be better improved in efficiency. However, the accuracy and efficiency of segmentation are still poor for insulator images with complex image backgrounds and various postures.
因此,本专利提出一种基于改进的条件生成对抗网络的绝缘子分割方法,该方法在图像分割精度和效率上相比于现有方法有较大优势。Therefore, this patent proposes an insulator segmentation method based on an improved conditional generation adversarial network, which has greater advantages over existing methods in terms of image segmentation accuracy and efficiency.
发明内容Summary of the invention
为了解决现有技术中的上述问题,即为了解决现有基于条件生成对抗网络的绝缘子分割方法分割精度差、效率低的问题,本发明第一方面,提出了一种基于改进的条件生成对抗网络的绝缘子分割方法,该方法包括:In order to solve the above-mentioned problems in the prior art, that is, to solve the problems of poor segmentation accuracy and low efficiency of the existing insulator segmentation method based on the conditional generation confrontation network, the first aspect of the present invention proposes an improved conditional generation confrontation network The method for dividing the insulator includes:
步骤S100,获取包含绝缘子的图像,作为输入图像;Step S100: Obtain an image containing an insulator as an input image;
步骤S200,基于所述输入图像,通过绝缘子分割模型获取绝缘子分割图像;Step S200, based on the input image, obtain an insulator segmentation image through an insulator segmentation model;
所述绝缘子分割模型基于条件生成对抗网络cGAN的生成器构建;所述生成器基于自编码器构建,其包括编码器和解码器;所述编码器包括非对称卷积层、最大池化层;所述解码器包括非对称卷积层、上采样层;所述绝缘子分割模型的训练样本包括输入图像样本、及其中所包含的绝缘子的真实分割图像。The insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
在一些优选的实施方式中,所述编码器的非对称卷积层由卷积函数、批量归一化函数、线性整流函数构成;所述解码器的非对称卷积层由反卷积函数、批量归一化函数、线性整流函数构成。In some preferred embodiments, the asymmetric convolution layer of the encoder is composed of a convolution function, a batch normalization function, and a linear rectification function; the asymmetric convolution layer of the decoder is composed of a deconvolution function, Batch normalization function and linear rectification function are formed.
在一些优选的实施方式中,所述绝缘子分割模型,其训练方法为:In some preferred embodiments, the training method of the insulator segmentation model is:
步骤A100,获取包含绝缘子的图像,通过预设的图像增强方法构建样本集,所述样本集包括输入图像样本、及其中所包含的绝缘子的真实分割图像;将所述样本集拆分为训练样本集和测试样本集;Step A100: Obtain an image containing insulators, and construct a sample set by a preset image enhancement method, the sample set including input image samples and real segmentation images of the insulators contained therein; split the sample set into training samples Set and test sample set;
步骤A200,基于所述训练样本集中的输入图像样本通过绝缘子分割模型获取绝缘子分割图像;将其作为绝缘子生成分割图像;Step A200: Obtain an insulator segmentation image through an insulator segmentation model based on the input image samples in the training sample set; use it as an insulator to generate a segmentation image;
步骤A300,根据所述绝缘子生成分割图像及对应训练样本的绝缘子真实分割图像,通过条件生成对抗网络cGAN的判别器得到所述绝缘子分割图像中各区域的分割结果,并获取绝缘子分割模型的损失值;Step A300: Generate a segmented image according to the insulator and the real segmented image of the insulator corresponding to the training sample, obtain the segmentation results of each region in the insulator segmented image through the conditional generation against the network cGAN discriminator, and obtain the loss value of the insulator segmentation model ;
步骤A400,获取当前迭代次数,若所述损失值小于预设的训练损失值阈值或所述迭代次数大于预设的训练迭代次数,输出训练好的绝缘子分割模型,将其作为第一模型,跳转步骤A500;否则基于所述损失值,通过反向传播算法,更新所述绝缘子分割模型的参数,令迭代次数加1,跳转步骤A200;Step A400: Obtain the current number of iterations. If the loss value is less than the preset training loss threshold or the number of iterations is greater than the preset number of training iterations, output the trained insulator segmentation model and use it as the first model. Go to step A500; otherwise, based on the loss value, use the backpropagation algorithm to update the parameters of the insulator segmentation model, increase the number of iterations by 1, and skip to step A200;
步骤A500,通过所述第一模型获取所述测试样本集中所有输入图像样本的绝缘子分割图像,并将所述绝缘子分割图像和所述测试样本集中所包含的绝缘子的真实分割图像进行对比,获取mIoU评估值;Step A500: Obtain insulator segmentation images of all input image samples in the test sample set through the first model, and compare the insulator segmentation images with the real segmentation images of the insulators contained in the test sample set to obtain mIoU The assessed value;
步骤A600,若所述mIoU评估值大于预设的评估值,将所述第一模型作为最终训练好的绝缘子分割模型,否则,跳转步骤A200。Step A600, if the mIoU evaluation value is greater than the preset evaluation value, use the first model as the finally trained insulator segmentation model; otherwise, skip to step A200.
在一些优选的实施方式中,步骤A100中“通过预设的图像增强方法构建样本集”,其方法为:In some preferred embodiments, the method of "constructing a sample set through a preset image enhancement method" in step A100 is as follows:
获取包含绝缘子的图像,作为预处理图像样本;Obtain an image containing insulators as a pre-processed image sample;
基于预设的亮度倍数集合,随机选取亮度倍数对所述预处理图像样本进行亮度处理,得到亮度处理图像样本;Based on a preset set of brightness multiples, randomly select a brightness multiple to perform brightness processing on the preprocessed image sample to obtain a brightness processed image sample;
对所述预处理图像样本进行旋转,得到多张旋转处理图像样本;Rotate the preprocessed image samples to obtain multiple rotated processed image samples;
将所述亮度处理图像样本和所述旋转处理图像样本缩放至预设尺寸;基于缩放后的图像,构建样本集。The brightness processed image sample and the rotation processed image sample are scaled to a preset size; and a sample set is constructed based on the scaled image.
在一些优选的实施方式中,所述条件生成对抗网络cGAN的判别器由五层卷积层组成;第一层卷积层由卷积函数、Leaky ReLU函数构成,最后一层由卷积函数构成,其余三层卷积层由卷积函数、Leaky ReLU函数、批量归一化函数构成。In some preferred embodiments, the discriminator of the conditional generation against network cGAN is composed of five layers of convolutional layers; the first layer of convolutional layer is composed of convolution function and Leaky ReLU function, and the last layer is composed of convolution function , The remaining three convolutional layers are composed of convolution function, Leaky ReLU function, and batch normalization function.
在一些优选的实施方式中,所述条件生成对抗网络cGAN的判别器其输出为16×16大小的矩阵。In some preferred embodiments, the output of the discriminator of the conditional generation against network cGAN is a 16×16 matrix.
本发明的第二方面,提出了一种基于改进的条件生成对抗网络的绝缘子分割系统,该系统包括获取模块、输出模块;In the second aspect of the present invention, an insulator segmentation system based on an improved conditional generation confrontation network is proposed. The system includes an acquisition module and an output module;
所述获取模块,配置为获取包含绝缘子的图像,作为输入图像;The acquisition module is configured to acquire an image containing an insulator as an input image;
所述输出模块,配置为基于所述输入图像,通过绝缘子分割模型获取绝缘子分割图像;The output module is configured to obtain an insulator segmentation image through an insulator segmentation model based on the input image;
所述绝缘子分割模型基于条件生成对抗网络cGAN的生成器构建;所述生成器基于自编码器构建,其包括编码器和解码器;所述编码器包括非对称卷积层、最大池化层;所述解码器包括非对称卷积层、上采样层;所述绝缘子分割模型的训练样本包括输入图像样本、及其中所包含的绝缘子的真实分割图像。The insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
本发明的第三方面,提出了一种存储装置,其中存储有多条程序,所述程序应用由处理器加载并执行以实现上述的基于改进的条件生成对抗网络的绝缘子分割方法。In a third aspect of the present invention, a storage device is provided, in which a plurality of programs are stored, and the program applications are loaded and executed by a processor to realize the above-mentioned insulator segmentation method based on the improved conditional generation confrontation network.
本发明的第四方面,提出了一种处理装置,包括处理器、存储装置;处理器,适用于执行各条程序;存储装置,适用于存储多条程序;所述程序适用于由处理器加载并执行以实现上述的基于改进的条件生成对抗网络的绝缘子分割方法。In the fourth aspect of the present invention, a processing device is proposed, including a processor and a storage device; the processor is suitable for executing each program; the storage device is suitable for storing multiple programs; the program is suitable for being loaded by the processor And execute to realize the above-mentioned insulator segmentation method based on the improved condition to generate the confrontation network.
本发明的有益效果:The beneficial effects of the present invention:
本发明通过改进的条件生成对抗网络,提升了绝缘子的分割精度和效率。本发明通过构建包含非对称的卷积层的编码器、解码器,组成自编码器网络,将其作为改进的条件生成对抗网络cGAN的生成器,降低了绝缘子分割的计算量,提高分割效率。The invention generates a confrontation network through an improved condition, which improves the accuracy and efficiency of the insulator segmentation. The present invention forms a self-encoder network by constructing encoders and decoders containing asymmetric convolutional layers, and uses them as an improved conditional generation counter-network cGAN generator, which reduces the calculation amount of insulator segmentation and improves segmentation efficiency.
同时本发明将条件生成对抗网络cGAN的判别器的输出改为16×16的矩阵,可以判别生成器输出的绝缘子分割图像各区域的分割结果,基于判别器输出的结果更新生成器(绝缘子分割模型),相较于现有的判别器输出的0、1值,训练的绝缘子模型具有更高的精度,实现了在背景复杂、种类姿态多样的绝缘子图像中高质量的分割。At the same time, the present invention changes the output of the discriminator of the conditional generation against network cGAN to a 16×16 matrix, which can discriminate the segmentation results of each region of the insulator segmented image output by the generator, and update the generator (insulator segmentation model) based on the result output by the discriminator ), compared with the 0 and 1 values output by the existing discriminator, the trained insulator model has higher accuracy, and achieves high-quality segmentation in insulator images with complex backgrounds and diverse types and poses.
附图说明Description of the drawings
通过阅读参照以下附图所做的对非限制性实施例所做的详细描述,本申请的其他特征、目的和优点将会变得更明显。By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes, and advantages of the present application will become more apparent.
图1是本发明一种实施例的基于改进的条件生成对抗网络的绝缘子分割方法的流程示意图;FIG. 1 is a schematic flowchart of an insulator segmentation method based on an improved conditional generation confrontation network according to an embodiment of the present invention;
图2是本发明一种实施例的基于改进的条件生成对抗网络的绝缘子分割系统的框架示意图;2 is a schematic diagram of an insulator segmentation system based on an improved conditional generation confrontation network according to an embodiment of the present invention;
图3是本发明一种实施例的绝缘子模型的训练方法的流程示意图;FIG. 3 is a schematic flowchart of a training method of an insulator model according to an embodiment of the present invention;
图4是本发明一种实施例的改进的条件生成对抗网络的示例图;4 is an example diagram of an improved conditional generation confrontation network according to an embodiment of the present invention;
图5是本发明一种实施例的不同网络模型的检测结果对比的示例图;FIG. 5 is an example diagram of comparison of detection results of different network models according to an embodiment of the present invention; FIG.
图6是本发明一种实施例的本发明的检测结果的示例图。Fig. 6 is an exemplary diagram of the detection result of the present invention according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not All examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described here are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for ease of description, only the parts related to the relevant invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other if there is no conflict.
本发明的基于改进的条件生成对抗网络的绝缘子分割方法,如图1所示,包括以下步骤:The insulator segmentation method based on the improved condition generation confrontation network of the present invention, as shown in Fig. 1, includes the following steps:
步骤S100,获取包含绝缘子的图像,作为输入图像;Step S100: Obtain an image containing an insulator as an input image;
步骤S200,基于所述输入图像,通过绝缘子分割模型获取绝缘子分割图像;Step S200, based on the input image, obtain an insulator segmentation image through an insulator segmentation model;
所述绝缘子分割模型基于条件生成对抗网络cGAN的生成器构建;所述生成器基于自编码器构建,其包括编码器和解码器;所述编码器包括非对称卷积层、最大池化层;所述解码器包括非对称卷积层、上采样层;所述绝缘子分割模型的训练样本包括输入图像样本、及其中所包含的绝缘子的真实分割图像。The insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
为了更清晰地对本发明基于改进的条件生成对抗网络的绝缘子分割方法进行说明,下面结合附图对本发明方法一种实施例中各步骤进行展开详述。In order to more clearly describe the insulator segmentation method of the present invention based on the improved condition generation countermeasure network, the steps in an embodiment of the method of the present invention will be described in detail below with reference to the accompanying drawings.
下文优选实施例中,先对的绝缘子分割模型的训练方法进行详述,在对基于改进的条件生成对抗网络的绝缘子分割方法获取绝缘子分割图像进行详述。In the following preferred embodiments, the training method of the insulator segmentation model will be described in detail first, and the insulator segmentation method based on the improved condition generation adversarial network will be described in detail.
1、绝缘子分割模型的训练方法1. Training method of insulator segmentation model
绝缘子分割模型,如图3所示,包括以下步骤:The insulator segmentation model, as shown in Figure 3, includes the following steps:
步骤A100,获取包含绝缘子的图像,通过预设的图像增强方法构建样本集,所述样本集包括输入图像样本、及其中所包含的绝缘子的真实分割图像;将所述样本集拆分为训练样本集和测试样本集;Step A100: Obtain an image containing insulators, and construct a sample set by a preset image enhancement method, the sample set including input image samples and real segmentation images of the insulators contained therein; split the sample set into training samples Set and test sample set;
步骤A200,基于所述训练样本集中的输入图像样本通过绝缘子分割模型获取绝缘子分割图像;将其作为绝缘子生成分割图像;Step A200: Obtain an insulator segmentation image through an insulator segmentation model based on the input image samples in the training sample set; use it as an insulator to generate a segmentation image;
步骤A300,根据所述绝缘子生成分割图像及对应训练样本的绝缘子真实分割图像,通过条件生成对抗网络cGAN的判别器得到所述绝缘子分割图像中各区域的分割结果,并获取绝缘子分割模型的损失值;Step A300: Generate a segmented image according to the insulator and the real segmented image of the insulator corresponding to the training sample, obtain the segmentation results of each region in the insulator segmented image through the conditional generation against the network cGAN discriminator, and obtain the loss value of the insulator segmentation model ;
步骤A400,获取当前迭代次数,若所述损失值小于预设的训练损失值阈值或所述迭代次数大于预设的训练迭代次数,输出训练好的绝缘子分割模型,将其作为第一模型,跳转步骤A500;否则基于所述损失值,通过反向传播算法,更新所述绝缘子分割模型的参数,令迭代次数加1,跳转步骤A200;Step A400: Obtain the current number of iterations. If the loss value is less than the preset training loss threshold or the number of iterations is greater than the preset number of training iterations, output the trained insulator segmentation model and use it as the first model. Go to step A500; otherwise, based on the loss value, use the backpropagation algorithm to update the parameters of the insulator segmentation model, increase the number of iterations by 1, and skip to step A200;
步骤A500,通过所述第一模型获取所述测试样本集中所有输入图像样本的绝缘子分割图像,并将所述绝缘子分割图像和所述测试样本集中所包含的绝缘子的真实分割图像进行对比,获取mIoU评估值;Step A500: Obtain insulator segmentation images of all input image samples in the test sample set through the first model, and compare the insulator segmentation images with the real segmentation images of the insulators contained in the test sample set to obtain mIoU The assessed value;
步骤A600,若所述mIoU评估值大于预设的评估值,将所述第一模型作为最终训练好的绝缘子分割模型,否则,跳转步骤A200。Step A600, if the mIoU evaluation value is greater than the preset evaluation value, use the first model as the finally trained insulator segmentation model; otherwise, skip to step A200.
下文针对以上的训练步骤进行详细展开,具体如下:The following is a detailed expansion of the above training steps, as follows:
步骤A100,获取包含绝缘子的图像,通过预设的图像增强方法构建样本集,所述样本集包括输入图像样本、及其中所包含的绝缘子的真实分割图像;将所述样本集拆分为训练样本集和测试样本集。Step A100: Obtain an image containing insulators, and construct a sample set by a preset image enhancement method, the sample set including input image samples and real segmentation images of the insulators contained therein; split the sample set into training samples Set and test sample set.
步骤A101,获取包含绝缘子的图像,作为原始图像。Step A101: Obtain an image containing the insulator as the original image.
步骤A102,为了丰富样本,本发明对原始图像进行亮度处理和旋转处理。Step A102, in order to enrich the samples, the present invention performs brightness processing and rotation processing on the original image.
亮度处理方法为:使用0.5至1.5倍于原始图片亮度的范围内随机选取两个值对原始图像亮度进行处理。The brightness processing method is: randomly select two values in the range of 0.5 to 1.5 times the brightness of the original image to process the brightness of the original image.
旋转处理:对原始图像每24°进行旋转一次,每张图像可得到15张增强图像。本发明优选的是每24°进行旋转一次,在其他优选实施例中,可以根据实际情况进行设置。Rotation processing: Rotate the original image once every 24°, and each image can get 15 enhanced images. The present invention preferably rotates once every 24°. In other preferred embodiments, it can be set according to actual conditions.
在本发明中,使用以上的图像增强方法,对350张绝缘子图像进行处理,得到6000张增强后的图像。In the present invention, the above image enhancement method is used to process 350 insulator images to obtain 6000 enhanced images.
步骤A103,将增强后的图像缩放为256×256大小,并按照1.jpg到6000.jpg命名,并对样本集图像进行标注,得到绝缘子分割图,完成图像样本集的制作。In step A103, the enhanced image is scaled to a size of 256×256, and named according to 1.jpg to 6000.jpg, and the sample set image is annotated to obtain the insulator segmentation map, and the production of the image sample set is completed.
样本集包括输入图像样本、及其中所包含的绝缘子的真实分割图像。The sample set includes input image samples and real segmented images of the insulators contained therein.
将样本集拆分为训练样本集和测试样本集,其中,5000张作为训练样本集,1000张作为测试样本集。The sample set is divided into a training sample set and a test sample set, where 5000 sheets are used as the training sample set and 1000 sheets are used as the test sample set.
步骤A200,基于所述训练样本集中的输入图像样本通过绝缘子分割模型获取绝缘子分割图像;将其作为绝缘子生成分割图像。Step A200: Obtain an insulator segmented image through an insulator segmentation model based on the input image samples in the training sample set; use it as an insulator to generate a segmented image.
在本实施例中,条件生成对抗网络cGAN基于生成器和判别器组成,如图4所示。绝缘子分割模型基于条件生成对抗网络cGAN的生成器构建,生成器为自编码器,包括编码器和解码器,即编码部分和 解码部分。将编码部分的采样索引进行保存,并将其传递给上采样层,从而降低信息损失。将绝缘子的真实分割图像及其对应的图像样本、生成器输出的绝缘子分割图像及其对应的输入图像样本,作为真、假图像对。基于真、假图像对中的生成器输出的绝缘子分割图像和绝缘子的真实分割图像,作为输入,通过判别器输出16×16的矩阵,矩阵的每一个元素代表对应的patch(区域)属于真还是假。In this embodiment, the conditional generation confrontation network cGAN is composed of a generator and a discriminator, as shown in FIG. 4. The insulator segmentation model is constructed based on the generator of the conditional generation confrontation network cGAN. The generator is a self-encoder, including an encoder and a decoder, that is, the encoding part and the decoding part. Save the sampling index of the coding part and pass it to the up-sampling layer, thereby reducing information loss. The real segmented image of the insulator and its corresponding image sample, the segmented image of the insulator output by the generator and its corresponding input image sample are regarded as a true and false image pair. Based on the insulator segmentation image output by the generator in the true and false image pair and the real segmentation image of the insulator, as input, a 16×16 matrix is output through the discriminator, and each element of the matrix represents whether the corresponding patch (region) is true or not false.
生成器中每一个编码器包含非对称卷积层和最大池化层。非对称卷积层由卷积函数、批量归一化函数、线性整流函数构成,即Conv+BN+ReLU的结构,可以加深网络复杂度的同时减少网络参数。解码器包含非对称卷积层、上采样层;解码器和编码器对称,采用反卷积函数、批量归一化函数、线性整流函数,即Conv+BN+ReLU的结构。如表1所示:Each encoder in the generator includes an asymmetric convolutional layer and a maximum pooling layer. The asymmetric convolution layer is composed of a convolution function, a batch normalization function, and a linear rectification function, that is, the structure of Conv+BN+ReLU, which can deepen the network complexity while reducing network parameters. The decoder includes an asymmetric convolution layer and an up-sampling layer; the decoder and the encoder are symmetrical, using a deconvolution function, a batch normalization function, and a linear rectification function, that is, the structure of Conv+BN+ReLU. As shown in Table 1:
表1Table 1
SetSet Layer nameLayer name Type of layersType of layers Output sizeOutput size
InputInput RGB imageRGB image  To 256×256×3256×256×3
Encoder1Encoder1 Conv1Conv1 Conv+BN+ReLU,fs=(3,1)Conv+BN+ReLU,fs=(3,1) 256×256×64256×256×64
 To Conv2Conv2 Conv+BN+ReLU,fs=(1,3)Conv+BN+ReLU,fs=(1,3) 256×256×64256×256×64
 To MP1MP1 Max-pooling(window 2×2)Max-pooling(window 2×2) 128×128×64128×128×64
Encoder2Encoder2 Conv3Conv3 Conv+BN+ReLU,fs=(3,1)Conv+BN+ReLU,fs=(3,1) 128×128×128128×128×128
 To Conv4Conv4 Conv+BN+ReLU,fs=(1,3)Conv+BN+ReLU,fs=(1,3) 128×128×128128×128×128
 To MP2MP2 Max-pooling(window 2×2)Max-pooling(window 2×2) 64×64×12864×64×128
Encoder3Encoder3 Conv5Conv5 Conv+BN+ReLU,fs=(3,1)Conv+BN+ReLU,fs=(3,1) 64×64×25664×64×256
 To Conv6Conv6 Conv+BN+ReLU,fs=(1,3)Conv+BN+ReLU,fs=(1,3) 64×64×25664×64×256
 To Conv7Conv7 Conv+BN+ReLU,fs=(3,3)Conv+BN+ReLU,fs=(3,3) 64×64×25664×64×256
 To MP3MP3 Max-pooling(window 2×2)Max-pooling(window 2×2) 32×32×25632×32×256
Encoder4Encoder4 Conv8Conv8 Conv+BN+ReLU,fs=(3,1)Conv+BN+ReLU,fs=(3,1) 32×32×51232×32×512
 To Conv9Conv9 Conv+BN+ReLU,fs=(1,3)Conv+BN+ReLU,fs=(1,3) 32×32×51232×32×512
 To Conv10Conv10 Conv+BN+ReLU,fs=(3,3)Conv+BN+ReLU,fs=(3,3) 32×32×51232×32×512
 To MP4MP4 Max-pooling(window 2×2)Max-pooling(window 2×2) 16×16×51216×16×512
Encoder5Encoder5 Conv11Conv11 Conv+BN+ReLU,fs=(3,1)Conv+BN+ReLU,fs=(3,1) 16×16×51216×16×512
 To Conv12Conv12 Conv+BN+ReLU,fs=(1,3)Conv+BN+ReLU,fs=(1,3) 16×16×51216×16×512
 To Conv13Conv13 Conv+BN+ReLU,fs=(3,3)Conv+BN+ReLU,fs=(3,3) 16×16×51216×16×512
 To MP5MP5 Max-pooling(window 2×2)Max-pooling(window 2×2) 8×8×5128×8×512
Decoder1Decoder1 UP1UP1 UpSamplingUpSampling 16×16×51216×16×512
 To Deconv1Deconv1 Deconv+BN+ReLU,fs=(3,1)Deconv+BN+ReLU,fs=(3,1) 16×16×51216×16×512
 To Deconv2Deconv2 Deconv+BN+ReLU,fs=(1,3)Deconv+BN+ReLU,fs=(1,3) 16×16×51216×16×512
 To Deconv3Deconv3 Deconv+BN+ReLU,fs=(3,3)Deconv+BN+ReLU,fs=(3,3) 16×16×51216×16×512
Decoder2Decoder2 UP2UP2 UpSamplingUpSampling 32×32×51232×32×512
 To Deconv4Deconv4 Deconv+BN+ReLU,fs=(3,1)Deconv+BN+ReLU,fs=(3,1) 32×32×51232×32×512
 To Deconv5Deconv5 Deconv+BN+ReLU,fs=(1,3)Deconv+BN+ReLU,fs=(1,3) 32×32×51232×32×512
 To Deconv6Deconv6 Deconv+BN+ReLU,fs=(3,3)Deconv+BN+ReLU,fs=(3,3) 32×32×25632×32×256
Decoder3Decoder3 UP3UP3 UpSamplingUpSampling 64×64×25664×64×256
 To Deconv7Deconv7 Deconv+BN+ReLU,fs=(3,1)Deconv+BN+ReLU,fs=(3,1) 64×64×25664×64×256
 To Deconv8Deconv8 Deconv+BN+ReLU,fs=(1,3)Deconv+BN+ReLU,fs=(1,3) 64×64×25664×64×256
 To Deconv9Deconv9 Deconv+BN+ReLU,fs=(3,3)Deconv+BN+ReLU,fs=(3,3) 64×64×12864×64×128
Decoder4Decoder4 UP4UP4 UpSamplingUpSampling 128×128×128128×128×128
 To Deconv10Deconv10 Deconv+BN+ReLU,fs=(3,1)Deconv+BN+ReLU,fs=(3,1) 128×128×128128×128×128
 To Deconv11Deconv11 Deconv+BN+ReLU,fs=(1,3)Deconv+BN+ReLU,fs=(1,3) 128×128×64128×128×64
Decoder5Decoder5 UP5UP5 UpSamplingUpSampling 256×256×64256×256×64
 To Deconv12Deconv12 Deconv+BN+ReLU,fs=(3,3)Deconv+BN+ReLU,fs=(3,3) 256×256×64256×256×64
 To Deconv13Deconv13 Deconv+tanh,fs=(4,4)Deconv+tanh,fs=(4,4) 256×256×3256×256×3
表1中,Set为框架,包括Input(输入)、Encoder1-Encoder5(编码器)、Decoder1-Decoder5(解码器),Layer name表示生成器中各层的命名,RGB image为输入图像,Conv表示卷积层,MP表示最大池化层,Deconv表示反卷积层、UP表示上采样层,Type of layers为层类型,fs为卷积核,window为窗口大小,Max-pooling为最大池化,UpSampling为上采样,Output size表示输出尺寸。In Table 1, Set is the frame, including Input, Encoder1-Encoder5 (encoder), Decoder1-Decoder5 (decoder), Layer name represents the name of each layer in the generator, RGB image is the input image, Conv represents the volume Multiplying layer, MP means maximum pooling layer, Deconv means deconvolution layer, UP means upsampling layer, Type of layers means layer type, fs means convolution kernel, window means window size, Max-pooling means maximum pooling, UpSampling For upsampling, Output size represents the output size.
将所述训练样本集中的输入图像样本输入到生成器,输入图像样本的分辨率为256×256×3,获取绝缘子分割图像;将其作为绝缘子生成分割图像。The input image samples in the training sample set are input to the generator, and the resolution of the input image samples is 256×256×3, and the insulator segmentation image is obtained; and the segmentation image is generated as the insulator.
在对绝缘子分割模型进行训练时,对条件生成对抗网络cGAN的各个参数进行初始化,本发明将一次性送入训练模型的批量设为8,初始学习率设为0.0001,优化器参数为β 1=0.9,β 2=0.99,最大训练迭代次数设为50000。 When training the insulator segmentation model, initialize the various parameters of the conditional generation against network cGAN. The present invention sets the batch sent to the training model at one time to 8, the initial learning rate is set to 0.0001, and the optimizer parameter is β 1 = 0.9, β 2 =0.99, and the maximum number of training iterations is set to 50000.
步骤A300,根据所述绝缘子生成分割图像及对应训练样本的绝缘子真实分割图像,通过条件生成对抗网络cGAN的判别器得到所述绝缘子分割图像中各区域的分割结果,并获取绝缘子分割模型的损失值。Step A300: Generate a segmented image according to the insulator and the real segmented image of the insulator corresponding to the training sample, obtain the segmentation results of each region in the insulator segmented image through the conditional generation against the network cGAN discriminator, and obtain the loss value of the insulator segmentation model .
在本实施例中,条件生成对抗网络cGAN的判别器主要由五层编码器组成,即五层卷积层,第一层卷积层由卷积函数、Leaky ReLU函数构成;最后一层由卷积函数构成,其余三层卷积层由卷积函数、Leaky ReLU函数、批量归一化函数构成,即Conv+Leaky ReLU+BN,卷积核采用4×4,步长为2。如表2所示:In this embodiment, the discriminator of the conditional generation adversarial network cGAN is mainly composed of five-layer encoders, that is, five-layer convolutional layers. The first convolutional layer is composed of convolutional functions and Leaky ReLU functions; and the last layer is composed of convolutional functions and Leaky ReLU functions. The other three convolutional layers are composed of convolution function, Leaky ReLU function, and batch normalization function, namely Conv+Leaky ReLU+BN. The convolution kernel adopts 4×4, and the step size is 2. As shown in table 2:
表2Table 2
Figure PCTCN2019117494-appb-000001
Figure PCTCN2019117494-appb-000001
Figure PCTCN2019117494-appb-000002
Figure PCTCN2019117494-appb-000002
表2中,RGB image and generated image为生成器的生成图像及对应训练样本的绝缘子真实分割图像。In Table 2, RGB image and generated image are the generated image of the generator and the real segmentation image of the insulator corresponding to the training sample.
判别器输入为生成器的生成图及对应训练样本的绝缘子真实分割图像,输出16×16大小的矩阵,矩阵的每一个元素代表对应的patch属于真还是假。The input of the discriminator is the generated image of the generator and the real segmentation image of the insulator corresponding to the training sample, and the output is a 16×16 matrix. Each element of the matrix represents whether the corresponding patch is true or false.
根据绝缘子生成分割图像及对应训练样本的绝缘子真实分割图像,通过条件生成对抗网络cGAN的判别器得到绝缘子分割图像中各区域的分割结果。让输入样本在网络中进行前馈传导,经过比较生成的分割图与真实分割图获得训练误差,根据当前网络参数值,经过生成器、判别器不断对读取的训练样本进行操作,直到网络输出生成器和判别器的训练损失值。According to the insulator, the segmented image and the real segmented image of the insulator corresponding to the training sample are generated, and the segmentation results of each region in the insulator segmented image are obtained through the conditional generation of the discriminator against the network cGAN. Let the input samples conduct feedforward conduction in the network, and obtain the training error after comparing the generated segmentation map with the real segmentation map. According to the current network parameter values, the generator and discriminator continue to operate on the read training samples until the network output Training loss value of generator and discriminator.
步骤A400,获取当前迭代次数,若所述损失值小于预设的训练损失值阈值或所述迭代次数大于预设的训练迭代次数,输出训练好的绝缘子分割模型,将其作为第一模型,跳转步骤A500;否则基于所述损失值,通过反向传播算法,更新所述绝缘子分割模型的参数,令迭代次数加1,跳转步骤A200。Step A400: Obtain the current number of iterations. If the loss value is less than the preset training loss threshold or the number of iterations is greater than the preset number of training iterations, output the trained insulator segmentation model and use it as the first model. Go to step A500; otherwise, based on the loss value, use the back propagation algorithm to update the parameters of the insulator segmentation model, increase the number of iterations by 1, and skip to step A200.
在本实施例中,根据当前的迭代次数或者损失值阈值,来判断训练是否继续还是终止,若终止,则获取训练好的绝缘子分割模型, 否则,基于损失值,通过反向传播,获取条件生成对抗网络cGAN的变化量,进行参数的更新,令迭代次数加1,跳转步骤A200。In this embodiment, according to the current number of iterations or the loss value threshold, it is judged whether the training is continued or terminated. If it is terminated, the trained insulator segmentation model is obtained; otherwise, based on the loss value, the conditional generation is obtained through backpropagation. Fight against the change of the network cGAN, update the parameters, increase the number of iterations by 1, and jump to step A200.
步骤A500,通过所述第一模型获取所述测试样本集中所有输入图像样本的绝缘子分割图像,并将所述绝缘子分割图像和所述测试样本集中所包含的绝缘子的真实分割图像进行对比,获取mIoU评估值。Step A500: Obtain insulator segmentation images of all input image samples in the test sample set through the first model, and compare the insulator segmentation images with the real segmentation images of the insulators contained in the test sample set to obtain mIoU The assessed value.
在本实施例中,基于步骤S400训练好的绝缘子分割模型,通过测试样本集对模型进行测试。即将测试样本集中的输入图像样本全部生成绝缘子分割图像,与测试样本集中所包含的绝缘子的真实分割图像进行对比,获得mIoU评估值,并统计平均的测试时间。In this embodiment, based on the insulator segmentation model trained in step S400, the model is tested through a test sample set. That is to say, all the input image samples in the test sample set generate insulator segmentation images, which are compared with the real segmentation images of the insulators contained in the test sample set to obtain the mIoU evaluation value and calculate the average test time.
步骤A600,若所述mIoU评估值大于预设的评估值,将所述第一模型作为最终训练好的绝缘子分割模型,否则,跳转步骤A200。Step A600, if the mIoU evaluation value is greater than the preset evaluation value, use the first model as the finally trained insulator segmentation model; otherwise, skip to step A200.
一般来说,mIoU评估值越高,说明平均分割效果越好,所以获取的mIoU值若大于预设的评估值,则表示当前训练的模型效果较好,否则进行重新训练。Generally speaking, the higher the mIoU evaluation value, the better the average segmentation effect. Therefore, if the obtained mIoU value is greater than the preset evaluation value, it means that the current training model has a better effect, otherwise it will be retrained.
本发明为了评估改进的条件生成对抗网络的绝缘子分割效果,将本网络与其他经典网络模型相比较,实验结果如表3所示:In order to evaluate the insulator segmentation effect of the improved conditional generation adversarial network, the present invention compares this network with other classic network models. The experimental results are shown in Table 3:
表3table 3
Figure PCTCN2019117494-appb-000003
Figure PCTCN2019117494-appb-000003
其中,表3中Models表示实验使用的网络模型,Ours为本发明提取的改进的网络,即图5和6中的本网络,Pix2pix、SegNet、Unet、FCN为像素对像素模型、语义分割网络、深度学习分割网络、全卷积神经网络,Trainable Para(M)表示训练参数量,Time表示平均的测试时间, 由表3可以看出,本发明中的分割的mIoU评估值最高,说明平均分割效果最好。与此同时,该网络所需参数最少,这很大程度上减少了网络复杂度,提高了分割效率。图5表示了最终的分割结果图。可以看出本发明的网络因为加入判别器,可以提高绝缘子的分割精度,在微小细节处也可以完成像素级分割。Among them, Models in Table 3 represents the network model used in the experiment, Ours is the improved network extracted by the present invention, that is, the network in Figures 5 and 6, Pix2pix, SegNet, Unet, and FCN are pixel-to-pixel models, semantic segmentation networks, Deep learning segmentation network, full convolutional neural network, Trainable Para(M) represents the amount of training parameters, and Time represents the average test time. It can be seen from Table 3 that the mIoU evaluation value of the segmentation in the present invention is the highest, indicating the average segmentation effect the best. At the same time, the network requires the least parameters, which greatly reduces network complexity and improves segmentation efficiency. Figure 5 shows the final segmentation result. It can be seen that because the discriminator is added to the network of the present invention, the segmentation accuracy of the insulator can be improved, and pixel-level segmentation can also be completed in minute details.
为了验证本网络对不同尺度的绝缘子的分割能力,我们挑选背景较为复杂,背景物体远大于绝缘子大小的图像作为测试对象,做了绝缘子分割实验。如图6所示,即使背景非常复杂,物体大于绝缘子大小,但是本网络仍然可以准确的识别出绝缘子的位置,并将其高精度的分割。由此可以看出本网络解决了复杂环境下绝缘子检测较为困难的问题。In order to verify the ability of this network to segment insulators of different scales, we selected images with more complex backgrounds and background objects much larger than the size of the insulators as the test objects, and conducted an insulator segmentation experiment. As shown in Figure 6, even if the background is very complex and the object is larger than the size of the insulator, the network can still accurately identify the position of the insulator and segment it with high precision. It can be seen that this network solves the difficult problem of insulator detection in a complex environment.
2、基于改进的条件生成对抗网络的绝缘子分割方法2. Insulator segmentation method based on improved conditional generation confrontation network
步骤S100,获取包含绝缘子的图像,作为输入图像。In step S100, an image containing an insulator is obtained as an input image.
在本实施例中,基于实际获取的包含绝缘子的图像,作为输入图像。包含绝缘子的图像可以通过人工拍摄,也可以通过航拍或者其他途径获取。In this embodiment, an image containing an insulator actually acquired is used as the input image. The image containing the insulator can be taken manually, or obtained by aerial photography or other means.
步骤S200,基于所述输入图像,通过绝缘子分割模型获取绝缘子分割图像。Step S200, based on the input image, obtain an insulator segmentation image through an insulator segmentation model.
在本实施例中,基于获取的包含绝缘子的图像,通过训练好的绝缘子分割模型,获取绝缘子分割图像。In this embodiment, based on the acquired image containing the insulator, the insulator segmentation image is acquired through the trained insulator segmentation model.
本发明第二实施例的一种基于改进的条件生成对抗网络的绝缘子分割系统,如图2所示,包括:获取模块100、输出模块200;According to the second embodiment of the present invention, an insulator segmentation system based on an improved condition generation confrontation network, as shown in FIG. 2, includes: an acquisition module 100 and an output module 200;
所述获取模块100,配置为获取包含绝缘子的图像,作为输入图像;The acquiring module 100 is configured to acquire an image containing an insulator as an input image;
所述输出模块200,配置为基于所述输入图像,通过绝缘子分割模型获取绝缘子分割图像;The output module 200 is configured to obtain an insulator segmentation image through an insulator segmentation model based on the input image;
所述绝缘子分割模型基于条件生成对抗网络cGAN的生成器构建;所述生成器基于自编码器构建,其包括编码器和解码器;所述编码器包括非对称卷积层、最大池化层;所述解码器包括非对称卷积层、上采样层;所述绝缘子分割模型的训练样本包括输入图像样本、及其中所包含的绝缘子的真实分割图像。The insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
所述技术领域的技术人员可以清楚的了解到,为描述的方便和简洁,上述描述的系统的具体的工作过程及有关说明,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the technical field can clearly understand that, for the convenience and conciseness of description, the specific working process and related description of the system described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
需要说明的是,上述实施例提供的基于改进的条件生成对抗网络的绝缘子分割系统,仅以上述各功能模块的划分进行举例说明,在实际应用中,可以根据需要而将上述功能分配由不同的功能模块来完成,即将本发明实施例中的模块或者步骤再分解或者组合,例如,上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块,以完成以上描述的全部或者部分功能。对于本发明实施例中涉及的模块、步骤的名称,仅仅是为了区分各个模块或者步骤,不视为对本发明的不当限定。It should be noted that the insulator segmentation system based on the improved condition to generate the confrontation network provided by the above embodiment only uses the division of the above functional modules as an example. In practical applications, the above function can be assigned to different functions according to needs. Functional modules are implemented, that is, the modules or steps in the embodiments of the present invention are further decomposed or combined. For example, the modules of the above-mentioned embodiments can be combined into one module, or further divided into multiple sub-modules to complete all or the steps described above. Part of the function. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing each module or step, and are not regarded as improper limitations on the present invention.
本发明第三实施例的一种存储装置,其中存储有多条程序,所述程序适用于由处理器加载并实现上述的基于改进的条件生成对抗网络的绝缘子分割方法。In a storage device according to a third embodiment of the present invention, a plurality of programs are stored therein, and the programs are suitable for being loaded by a processor and implementing the above-mentioned insulator segmentation method based on the improved condition generation confrontation network.
本发明第四实施例的一种处理装置,包括处理器、存储装置;处理器,适于执行各条程序;存储装置,适于存储多条程序;所述程序适于由处理器加载并执行以实现上述的基于改进的条件生成对抗网络的绝缘子分割方法。A processing device according to a fourth embodiment of the present invention includes a processor and a storage device; the processor is suitable for executing each program; the storage device is suitable for storing multiple programs; the program is suitable for being loaded and executed by the processor In order to realize the above-mentioned insulator segmentation method based on the improved condition to generate the confrontation network.
所述技术领域的技术人员可以清楚的了解到,未描述的方便和简洁,上述描述的存储装置、处理装置的具体工作过程及有关说明,可以参考前述方法实例中的对应过程,在此不再赘述。Those skilled in the technical field can clearly understand that what is not described is convenient and concise. For the specific working process and related description of the storage device and processing device described above, you can refer to the corresponding process in the foregoing method example, and will not be repeated here. Go into details.
本领域技术人员应该能够意识到,结合本文中所公开的实施例描述的各示例的模块、方法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,软件模块、方法步骤对应的程序可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。为了清楚地说明电子硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以电子硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art should be able to realize that the modules and method steps of the examples described in the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two, and the software modules and method steps correspond to the program Can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or known in the technical field Any other form of storage medium. In order to clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described in accordance with the function in the above description. Whether these functions are performed by electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the present invention.
术语“第一”、“第二”等是用于区别类似的对象,而不是用于描述或表示特定的顺序或先后次序。The terms "first", "second", etc. are used to distinguish similar objects, rather than to describe or indicate a specific order or sequence.
术语“包括”或者任何其它类似用语旨在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备/装置不仅包括那些要素,而且还包括没有明确列出的其它要素,或者还包括这些过程、方法、物品或者设备/装置所固有的要素。The term "including" or any other similar term is intended to cover non-exclusive inclusion, so that a process, method, article or device/device including a series of elements includes not only those elements, but also other elements not explicitly listed, or It also includes the inherent elements of these processes, methods, articles, or equipment/devices.
至此,已经结合附图所示的优选实施方式描述了本发明的技术方案,但是,本领域技术人员容易理解的是,本发明的保护范围显然不局限于这些具体实施方式。在不偏离本发明的原理的前提下,本领域技术人员可以对相关技术特征作出等同的更改或替换,这些更改或替换之后的技术方案都将落入本发明的保护范围之内。So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims (9)

  1. 一种基于改进的条件生成对抗网络的绝缘子分割方法,其特征在于,该方法包括以下步骤:An insulator segmentation method based on an improved conditional generation confrontation network is characterized in that the method includes the following steps:
    步骤S100,获取包含绝缘子的图像,作为输入图像;Step S100: Obtain an image containing an insulator as an input image;
    步骤S200,基于所述输入图像,通过绝缘子分割模型获取绝缘子分割图像;Step S200, based on the input image, obtain an insulator segmentation image through an insulator segmentation model;
    所述绝缘子分割模型基于条件生成对抗网络cGAN的生成器构建;所述生成器基于自编码器构建,其包括编码器和解码器;所述编码器包括非对称卷积层、最大池化层;所述解码器包括非对称卷积层、上采样层;所述绝缘子分割模型的训练样本包括输入图像样本、及其中所包含的绝缘子的真实分割图像。The insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
  2. 根据权利要求1所述的基于改进的条件生成对抗网络的绝缘子分割方法,其特征在于,所述编码器的非对称卷积层由卷积函数、批量归一化函数、线性整流函数构成;所述解码器的非对称卷积层由反卷积函数、批量归一化函数、线性整流函数构成。The insulator segmentation method based on the improved conditional generation confrontation network according to claim 1, wherein the asymmetric convolution layer of the encoder is composed of a convolution function, a batch normalization function, and a linear rectification function; The asymmetric convolutional layer of the decoder is composed of a deconvolution function, a batch normalization function, and a linear rectification function.
  3. 根据权利要求1所述的基于改进的条件生成对抗网络的绝缘子分割方法,其特征在于,所述绝缘子分割模型,其训练方法为:The insulator segmentation method based on the improved conditional generation adversarial network according to claim 1, wherein the training method of the insulator segmentation model is:
    步骤A100,获取包含绝缘子的图像,通过预设的图像增强方法构建样本集,所述样本集包括输入图像样本、及其中所包含的绝缘子的真实分割图像;将所述样本集拆分为训练样本集和测试样本集;Step A100: Obtain an image containing insulators, and construct a sample set by a preset image enhancement method, the sample set including input image samples and real segmentation images of the insulators contained therein; split the sample set into training samples Set and test sample set;
    步骤A200,基于所述训练样本集中的输入图像样本通过绝缘子分割模型获取绝缘子分割图像;将其作为绝缘子生成分割图像;Step A200: Obtain an insulator segmentation image through an insulator segmentation model based on the input image samples in the training sample set; use it as an insulator to generate a segmentation image;
    步骤A300,根据所述绝缘子生成分割图像及对应训练样本的绝缘子 真实分割图像,通过条件生成对抗网络cGAN的判别器得到所述绝缘子分割图像中各区域的分割结果,并获取绝缘子分割模型的损失值;Step A300: Generate a segmented image according to the insulator and the real segmented image of the insulator corresponding to the training sample, obtain the segmentation results of each region in the insulator segmented image through the conditional generation against the network cGAN discriminator, and obtain the loss value of the insulator segmentation model ;
    步骤A400,获取当前迭代次数,若所述损失值小于预设的训练损失值阈值或所述迭代次数大于预设的训练迭代次数,输出训练好的绝缘子分割模型,将其作为第一模型,跳转步骤A500;否则基于所述损失值,通过反向传播算法,更新所述绝缘子分割模型的参数,令迭代次数加1,跳转步骤A200;Step A400: Obtain the current number of iterations. If the loss value is less than the preset training loss threshold or the number of iterations is greater than the preset number of training iterations, output the trained insulator segmentation model and use it as the first model. Go to step A500; otherwise, based on the loss value, use the backpropagation algorithm to update the parameters of the insulator segmentation model, increase the number of iterations by 1, and skip to step A200;
    步骤A500,通过所述第一模型获取所述测试样本集中所有输入图像样本的绝缘子分割图像,并将所述绝缘子分割图像和所述测试样本集中所包含的绝缘子的真实分割图像进行对比,获取mIoU评估值;Step A500: Obtain insulator segmentation images of all input image samples in the test sample set through the first model, and compare the insulator segmentation images with the real segmentation images of the insulators contained in the test sample set to obtain mIoU The assessed value;
    步骤A600,若所述mIoU评估值大于预设的评估值,将所述第一模型作为最终训练好的绝缘子分割模型,否则,跳转步骤A200。Step A600, if the mIoU evaluation value is greater than the preset evaluation value, use the first model as the finally trained insulator segmentation model; otherwise, skip to step A200.
  4. 根据权利要求3所述的基于改进的条件生成对抗网络的绝缘子分割方法,其特征在于,步骤A100中“通过预设的图像增强方法构建样本集”,其方法为:The insulator segmentation method based on the improved conditional generation confrontation network according to claim 3, characterized in that, in step A100, the method of "constructing a sample set through a preset image enhancement method" is:
    获取包含绝缘子的图像,作为预处理图像样本;Obtain an image containing insulators as a pre-processed image sample;
    基于预设的亮度倍数集合,随机选取亮度倍数对所述预处理图像样本进行亮度处理,得到亮度处理图像样本;Based on a preset set of brightness multiples, randomly select a brightness multiple to perform brightness processing on the preprocessed image sample to obtain a brightness processed image sample;
    对所述预处理图像样本进行旋转,得到多张旋转处理图像样本;Rotate the preprocessed image samples to obtain multiple rotated processed image samples;
    将所述亮度处理图像样本和所述旋转处理图像样本缩放至预设尺寸;基于缩放后的图像,构建样本集。The brightness processed image sample and the rotation processed image sample are scaled to a preset size; and a sample set is constructed based on the scaled image.
  5. 根据权利要求3所述的基于改进的条件生成对抗网络的绝缘子分割方法,其特征在于,所述条件生成对抗网络cGAN的判别器由五层卷积层组成;第一层卷积层由卷积函数、Leaky ReLU函数构成,最后一层由 卷积函数构成,其余三层卷积层由卷积函数、Leaky ReLU函数、批量归一化函数构成。The insulator segmentation method based on the improved conditional generation confrontation network according to claim 3, wherein the discriminator of the conditional generation confrontation network cGAN is composed of five layers of convolutional layers; the first layer of convolutional layer is composed of convolutional layers. Function, Leaky ReLU function, the last layer is composed of convolution function, and the remaining three convolution layers are composed of Convolution function, Leaky ReLU function, and batch normalization function.
  6. 根据权利要求5所述的基于改进的条件生成对抗网络的绝缘子分割方法,其特征在于,所述条件生成对抗网络cGAN的判别器其输出为16×16大小的矩阵。The insulator segmentation method based on an improved conditional generation confrontation network according to claim 5, wherein the discriminator of the conditional generation confrontation network cGAN has an output of a 16×16 matrix.
  7. 一种基于改进的条件生成对抗网络的绝缘子分割系统,其特征在于,该系统包括获取模块、输出模块;An insulator segmentation system based on an improved conditional generation confrontation network, which is characterized in that the system includes an acquisition module and an output module;
    所述获取模块,配置为获取包含绝缘子的图像,作为输入图像;The acquisition module is configured to acquire an image containing an insulator as an input image;
    所述输出模块,配置为基于所述输入图像,通过绝缘子分割模型获取绝缘子分割图像;The output module is configured to obtain an insulator segmentation image through an insulator segmentation model based on the input image;
    所述绝缘子分割模型基于条件生成对抗网络cGAN的生成器构建;所述生成器基于自编码器构建,其包括编码器和解码器;所述编码器包括非对称卷积层、最大池化层;所述解码器包括非对称卷积层、上采样层;所述绝缘子分割模型的训练样本包括输入图像样本、及其中所包含的绝缘子的真实分割图像。The insulator segmentation model is constructed based on a generator of the conditional generation confrontation network cGAN; the generator is constructed based on a self-encoder, which includes an encoder and a decoder; the encoder includes an asymmetric convolutional layer and a maximum pooling layer; The decoder includes an asymmetric convolutional layer and an up-sampling layer; the training samples of the insulator segmentation model include input image samples and real segmented images of the insulators contained therein.
  8. 一种存储装置,其中存储有多条程序,其特征在于,所述程序应用由处理器加载并执行以实现权利要求1-6任一项所述的基于改进的条件生成对抗网络的绝缘子分割方法。A storage device, wherein a plurality of programs are stored, wherein the program application is loaded and executed by a processor to realize the insulator segmentation method based on the improved condition generation confrontation network according to any one of claims 1-6 .
  9. 一种处理装置,包括处理器、存储装置;处理器,适用于执行各条程序;存储装置,适用于存储多条程序;其特征在于,所述程序适用于由处理器加载并执行以实现权利要求1-6任一项所述的基于改进的条件生成对抗网络的绝缘子分割方法。A processing device, including a processor and a storage device; a processor, suitable for executing each program; a storage device, suitable for storing multiple programs; characterized in that the program is suitable for being loaded and executed by the processor to realize rights The insulator segmentation method based on the improved condition generation counter network described in any one of claims 1-6.
PCT/CN2019/117494 2019-11-04 2019-11-12 Insulator segmentation method based on improved conditional generative adversarial network WO2021088101A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911066870.8 2019-11-04
CN201911066870.8A CN110827297A (en) 2019-11-04 2019-11-04 Insulator segmentation method for generating countermeasure network based on improved conditions

Publications (1)

Publication Number Publication Date
WO2021088101A1 true WO2021088101A1 (en) 2021-05-14

Family

ID=69552793

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117494 WO2021088101A1 (en) 2019-11-04 2019-11-12 Insulator segmentation method based on improved conditional generative adversarial network

Country Status (2)

Country Link
CN (1) CN110827297A (en)
WO (1) WO2021088101A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113534837A (en) * 2021-07-06 2021-10-22 深圳市科卫泰实业发展有限公司 Unmanned aerial vehicle flight state fusion control system and control method based on generation of countermeasure network
CN113627073A (en) * 2021-07-01 2021-11-09 武汉大学 Underwater vehicle flow field result prediction method based on improved Unet + + network
CN117315354A (en) * 2023-09-27 2023-12-29 南京航空航天大学 Insulator anomaly detection method based on multi-discriminant composite coding GAN network
CN117914656A (en) * 2024-03-13 2024-04-19 北京航空航天大学 End-to-end communication system design method based on neural network

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111429464B (en) * 2020-03-11 2023-04-25 深圳先进技术研究院 Medical image segmentation method, medical image segmentation device and terminal equipment
CN112085162B (en) * 2020-08-12 2024-02-09 北京师范大学 Neural network-based magnetic resonance brain tissue segmentation method, device, computing equipment and storage medium
CN112733756B (en) * 2021-01-15 2023-01-20 成都大学 Remote sensing image semantic segmentation method based on W divergence countermeasure network
CN112927220A (en) * 2021-03-25 2021-06-08 郑州大学 Method and device for detecting insulator fault based on counterstudy and terminal equipment
CN113762120A (en) * 2021-08-27 2021-12-07 南京南瑞信息通信科技有限公司 Insulator image segmentation method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106960178A (en) * 2017-02-23 2017-07-18 中国科学院自动化研究所 The training method of insulator identification model and the identification of insulator and localization method
CN108520503A (en) * 2018-04-13 2018-09-11 湘潭大学 A method of based on self-encoding encoder and generating confrontation network restoration face Incomplete image
CN109753929A (en) * 2019-01-03 2019-05-14 华东交通大学 A kind of united high-speed rail insulator inspection image-recognizing method of picture library
US10387753B1 (en) * 2019-01-23 2019-08-20 StradVision, Inc. Learning method and learning device for convolutional neural network using 1×1 convolution for image recognition to be used for hardware optimization, and testing method and testing device using the same
CN110223304A (en) * 2019-05-20 2019-09-10 山东大学 A kind of image partition method, device and computer readable storage medium based on multipath polymerization
CN110222837A (en) * 2019-04-28 2019-09-10 天津大学 A kind of the network structure ArcGAN and method of the picture training based on CycleGAN

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107680090A (en) * 2017-10-11 2018-02-09 电子科技大学 Based on the electric transmission line isolator state identification method for improving full convolutional neural networks
US11011275B2 (en) * 2018-02-12 2021-05-18 Ai.Skopy, Inc. System and method for diagnosing gastrointestinal neoplasm
CN108961235B (en) * 2018-06-29 2021-05-14 山东大学 Defective insulator identification method based on YOLOv3 network and particle filter algorithm
CN109166126B (en) * 2018-08-13 2022-02-18 苏州比格威医疗科技有限公司 Method for segmenting paint cracks on ICGA image based on condition generation type countermeasure network
CN110060774B (en) * 2019-04-29 2022-12-09 赵蕾 Thyroid nodule identification method based on generative confrontation network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106960178A (en) * 2017-02-23 2017-07-18 中国科学院自动化研究所 The training method of insulator identification model and the identification of insulator and localization method
CN108520503A (en) * 2018-04-13 2018-09-11 湘潭大学 A method of based on self-encoding encoder and generating confrontation network restoration face Incomplete image
CN109753929A (en) * 2019-01-03 2019-05-14 华东交通大学 A kind of united high-speed rail insulator inspection image-recognizing method of picture library
US10387753B1 (en) * 2019-01-23 2019-08-20 StradVision, Inc. Learning method and learning device for convolutional neural network using 1×1 convolution for image recognition to be used for hardware optimization, and testing method and testing device using the same
CN110222837A (en) * 2019-04-28 2019-09-10 天津大学 A kind of the network structure ArcGAN and method of the picture training based on CycleGAN
CN110223304A (en) * 2019-05-20 2019-09-10 山东大学 A kind of image partition method, device and computer readable storage medium based on multipath polymerization

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113627073A (en) * 2021-07-01 2021-11-09 武汉大学 Underwater vehicle flow field result prediction method based on improved Unet + + network
CN113627073B (en) * 2021-07-01 2023-09-19 武汉大学 Underwater vehicle flow field result prediction method based on improved Unet++ network
CN113534837A (en) * 2021-07-06 2021-10-22 深圳市科卫泰实业发展有限公司 Unmanned aerial vehicle flight state fusion control system and control method based on generation of countermeasure network
CN113534837B (en) * 2021-07-06 2024-03-22 深圳市科卫泰实业发展有限公司 Unmanned aerial vehicle flight state fusion control system and control method based on generation countermeasure network
CN117315354A (en) * 2023-09-27 2023-12-29 南京航空航天大学 Insulator anomaly detection method based on multi-discriminant composite coding GAN network
CN117315354B (en) * 2023-09-27 2024-04-02 南京航空航天大学 Insulator anomaly detection method based on multi-discriminant composite coding GAN network
CN117914656A (en) * 2024-03-13 2024-04-19 北京航空航天大学 End-to-end communication system design method based on neural network
CN117914656B (en) * 2024-03-13 2024-05-10 北京航空航天大学 End-to-end communication system design method based on neural network

Also Published As

Publication number Publication date
CN110827297A (en) 2020-02-21

Similar Documents

Publication Publication Date Title
WO2021088101A1 (en) Insulator segmentation method based on improved conditional generative adversarial network
US11878433B2 (en) Method for detecting grasping position of robot in grasping object
CN107564025B (en) Electric power equipment infrared image semantic segmentation method based on deep neural network
US20210209410A1 (en) Method and apparatus for classification of wafer defect patterns as well as storage medium and electronic device
CN110991311B (en) Target detection method based on dense connection deep network
US10096121B2 (en) Human-shape image segmentation method
CN113033537B (en) Method, apparatus, device, medium and program product for training a model
CN109961107B (en) Training method and device for target detection model, electronic equipment and storage medium
CN110472695B (en) Abnormal working condition detection and classification method in industrial production process
CN109934826A (en) A kind of characteristics of image dividing method based on figure convolutional network
CN111027576B (en) Cooperative significance detection method based on cooperative significance generation type countermeasure network
CN115880298B (en) Glass surface defect detection system based on unsupervised pre-training
CN113763327B (en) Power plant pipeline high-pressure steam leakage detection method based on CBAM-Res_Unet
CN110880176B (en) Semi-supervised industrial image defect segmentation method based on countermeasure generation network
WO2020123288A1 (en) Improper neural network input detection and handling
JP2023531350A (en) A method for incrementing a sample image, a method for training an image detection model and a method for image detection
WO2023116632A1 (en) Video instance segmentation method and apparatus based on spatio-temporal memory information
CN115861715B (en) Knowledge representation enhancement-based image target relationship recognition algorithm
CN110334775B (en) Unmanned aerial vehicle line fault identification method and device based on width learning
CN116452810A (en) Multi-level semantic segmentation method and device, electronic equipment and storage medium
CN116091823A (en) Single-feature anchor-frame-free target detection method based on fast grouping residual error module
CN111079930A (en) Method and device for determining quality parameters of data set and electronic equipment
CN114639102A (en) Cell segmentation method and device based on key point and size regression
CN117636298A (en) Vehicle re-identification method, system and storage medium based on multi-scale feature learning
CN108459585B (en) Power station fan fault diagnosis method based on sparse local embedded deep convolutional network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19951633

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19951633

Country of ref document: EP

Kind code of ref document: A1