WO2019242329A1 - 一种卷积神经网络训练方法及装置 - Google Patents

一种卷积神经网络训练方法及装置 Download PDF

Info

Publication number
WO2019242329A1
WO2019242329A1 PCT/CN2019/077248 CN2019077248W WO2019242329A1 WO 2019242329 A1 WO2019242329 A1 WO 2019242329A1 CN 2019077248 W CN2019077248 W CN 2019077248W WO 2019242329 A1 WO2019242329 A1 WO 2019242329A1
Authority
WO
WIPO (PCT)
Prior art keywords
training
image
segmented image
standard
neural network
Prior art date
Application number
PCT/CN2019/077248
Other languages
English (en)
French (fr)
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 WO2019242329A1 publication Critical patent/WO2019242329A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • 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
    • 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 present application relates to the field of image processing, and in particular, to a method and a device for training a convolutional neural network.
  • Image segmentation is a process of grouping pixels of an image to form several non-overlapping regions according to certain visual characteristics of the image. Specifically, image segmentation is to add category labels to each pixel of the image to distinguish regions of different categories by different colors.
  • image segmentation requires first training the convolutional neural network, and then using the trained convolutional neural network to perform image segmentation.
  • the image to be segmented is first input to the convolutional neural network to be trained, the image is segmented by the convolutional neural network to be trained, the training segmented image is output, and then the training segmentation output from the convolutional neural network to be trained is segmented
  • the category labels of the image are compared with the category labels of the standard segmented image, and the convolutional neural network to be trained is trained according to the comparison result.
  • the trained convolutional neural network obtained by the above method has lower accuracy when performing image segmentation, and the segmentation effect is poor.
  • embodiments of the present application provide a convolutional neural network training method and device, which are used to improve the accuracy of image segmentation.
  • An embodiment of the present application provides a convolutional neural network training method, and the method includes:
  • the neural network is trained to obtain the target convolutional neural network.
  • the training of the convolutional neural network to be trained includes:
  • the difference between the texture feature of the training segmented image and the texture feature of the standard segmentation image, and the category difference of each pixel between the training segmentation image and the standard segmentation image To obtain the value of the loss function of the convolutional neural network to be trained, including:
  • the weighted sum of the differences between the texture features of the training segmented image and the texture features of the standard segmented image and the category differences of each pixel between the training segmented image and the standard segmented image are obtained A value of a loss function of the convolutional neural network to be trained.
  • obtaining the texture feature of the standard segmented image according to the color corresponding to the category label carried by each pixel of the standard segmented image includes:
  • the difference between the texture feature of the training segmented image and the texture feature of the standard segmented image and the category label difference of each pixel between the training segmented image and the standard segmented image are compared to the to-be-trained Convolutional neural network training, including:
  • the convolutional neural network to be trained according to the difference between the entropy of the training segmented image and the entropy of the standard segmented image, and the category label difference of each pixel between the training segmented image and the standard segmented image Training.
  • the method further includes:
  • the training the convolutional neural network to be trained includes:
  • An embodiment of the present application further provides a convolutional neural network training device, where the device includes:
  • a first image obtaining unit configured to obtain an image to be divided and a standard divided image of the image to be divided
  • a first texture feature obtaining unit configured to obtain a texture feature of the standard segmented image according to a color corresponding to a category label carried by each pixel of the standard segmented image
  • a second image acquisition unit configured to input the image to be segmented into a convolutional neural network to be trained for image segmentation to obtain a training segmented image
  • a second texture feature obtaining unit configured to obtain a texture feature of the training segmented image according to a color corresponding to a category label carried by each pixel of the training segmented image
  • the training unit is configured to detect the difference between the texture features of the training segmented image and the texture features of the standard segmented image and the category label difference of each pixel between the training segmented image and the standard segmented image. Describe the convolutional neural network to be trained to obtain the target convolutional neural network.
  • the training unit includes:
  • the loss function obtaining unit is configured to be based on a difference between a texture feature of the training segmented image and a texture feature of the standard segmentation image, and a category of each pixel between the training segmentation image and the standard segmentation image Label differences to obtain the value of the loss function of the convolutional neural network to be trained;
  • the parameter updating unit is configured to update a model parameter of the convolutional neural network to be trained according to a value of the loss function to obtain a target convolutional neural network.
  • the loss function obtaining unit is set as:
  • the weighted sum of the differences between the texture features of the training segmented image and the texture features of the standard segmented image and the category differences of each pixel between the training segmented image and the standard segmented image are obtained A value of a loss function of the convolutional neural network to be trained.
  • the first texture feature obtaining unit is set as:
  • the second texture feature acquisition unit is set to:
  • the training unit is set as:
  • the convolutional neural network to be trained according to the difference between the entropy of the training segmented image and the entropy of the standard segmented image, and the category label difference of each pixel between the training segmented image and the standard segmented image Perform training to get the target convolutional neural network.
  • the device further includes:
  • a preset unit which is set to preset the number of training rounds for training the convolutional neural network to be trained
  • the training unit is set as:
  • the convolutional neural network to be trained is trained to obtain a target convolutional neural network.
  • the convolutional neural network training method and device provided in the embodiments of the present application obtain a texture feature of a standard segmented image by acquiring a to-be-segmented image and a standard segmented image of the to-segment image, and according to a color corresponding to a category label carried by each pixel of the standard segmented image;
  • the image to be segmented is input to the convolutional neural network to be trained for image segmentation to obtain a training segmented image.
  • the texture features of the training segmented image are obtained according to the colors corresponding to the category labels carried by each pixel of the training segmented image;
  • the differences between the texture features of the standard segmentation image and the class label differences between the training segmentation image and the standard segmentation image are used to train the training convolutional neural network to obtain the target convolutional neural network.
  • the standard segmentation image is a standard image obtained by segmenting the image to be segmented through the convolutional neural network, which can be used as the quality of the training segmentation image.
  • the measure is that the closer the training segmentation image is to the standard segmentation image, the better the quality of the training segmentation image and the better the segmentation effect of the corresponding convolutional neural network to be trained.
  • the texture features of the training segmented image and the standard segmented image are also considered.
  • the differences between the texture features of the image, so that the differences between the training segmentation image and the standard segmentation image are more comprehensive. According to the comprehensive differences, the training convolutional neural network is trained, and the accuracy of the target convolutional neural network is higher. To achieve better segmentation results.
  • FIG. 1 is a flowchart of a convolutional neural network training method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of an image to be segmented and a standard segmented image according to an embodiment of the present application
  • FIG. 3 is a structural block diagram of a convolutional neural network training device according to an embodiment of the present application.
  • image segmentation is usually performed by a convolutional neural network.
  • the image to be segmented is first input to the convolutional neural network to be trained, and the image is performed by the convolutional neural network to be trained. Segmentation and output to obtain the training segmentation image.
  • the category labels of the training segmentation image output from the convolutional neural network to be trained are compared with the category labels of the standard segmentation image, and the convolutional neural network to be trained is trained according to the comparison result.
  • the category label is used to distinguish between different categories. Since the category labels of the training segmented image and the standard segmented image are compared, the segmentation of the pixels as a whole is considered, and the error of a small number of pixels is not considered. The segmentation results in a smaller number of color errors in the resulting segmented image. For example, in the area formed by the pixels whose color corresponds to the category label is red, there are a few green pixels, that is, noise appears in a single block. , Thereby reducing the user experience.
  • the difference between the training segmentation image and the standard segmentation image is reflected, and not only the category of the training segmentation image output by the convolutional neural network to be trained is considered.
  • the difference between the label and the category label of the standard segmented image also takes into account the differences between the texture features of the training segmented image output from the convolutional neural network to be trained and the texture features of the standard segmented image, so that the difference between the training segmented image and the standard segmented image.
  • the embodiment is more comprehensive. According to this comprehensive difference, the training convolutional neural network is trained to obtain a higher accuracy rate of the target convolutional neural network, thereby achieving better segmentation results.
  • FIG. 1 is a flowchart of a convolutional neural network training method according to an embodiment of the present application. As shown in FIG. 1, the method includes the following steps.
  • the to-be-divided image is the role object in the image segmentation process. It can be a color image or a grayscale image. Through image segmentation, the pixels in the to-be-divided image can be assigned respective category labels, so that the generated segmented image carries a category. label.
  • the standard segmented image of the image to be segmented is the segmented image corresponding to the image to be segmented obtained through the convolutional neural network.
  • each pixel carries a category label.
  • the category label can be manually
  • the images to be segmented are identified and added, or they can be added by other methods.
  • Category tags are tags used to distinguish different categories. After segmenting pixels, pixels of the same category can carry the same category tags, and pixels of different categories can carry different category tags.
  • Category labels can be reflected by colors, and different category labels correspond to different colors.
  • the category label can be, for example, the pixel value of the corresponding color, for example, the pixel value of red is (255,0,0), or the name or code of the color. For example, you can use "r" to represent red and "g" to Indicates green, and the category label can also take other forms.
  • FIG. 2 is a schematic diagram of an image to be segmented and a standard segmentation image in an embodiment of the present application.
  • FIG. 2 (a) is an image to be segmented, and its main content is that a person is riding a horse and is to be segmented.
  • the pixels in the image are assigned standard tags to form a standard segmented image.
  • the rendered image can refer to Figure 2 (b), where the color corresponding to the category tags carried by the pixels in the area of the person is light gray, and the horse is located The color corresponding to the category label carried by the pixels in the area is dark gray, the area other than the human area and the horse area is the background area, and the color corresponding to the category label carried by the pixels in the background area is black.
  • the texture features of a standard segmented image can be obtained by statistics on the pixel information of the image, such as the relative distance and direction characteristics of pixels with a specific category label, etc., or can be obtained by other methods.
  • the texture characteristics of a standard segmented image are used to reflect the pixel distribution of the standard segmented image. For example, the color corresponding to the category label carried by pixels in the area where the person is located in the standard segmented image is red. The pixels in each distance and direction have the same category labels, and their corresponding colors are red.
  • the texture features of a standard segmented image can be obtained in a variety of ways, such as Gray-Level Co-occurrence Matrix (GLCM), Local Binary Patterns (LBP), and other methods.
  • GLCM Gray-Level Co-occurrence Matrix
  • LBP Local Binary Patterns
  • the gray level co-occurrence matrix is a statistical feature of the image, which can reflect the texture characteristics of the image to a certain extent. The following takes gray level co-occurrence matrix as an example to introduce the acquisition of the texture features of a standard segmented image.
  • the standard segmented image is a color image
  • it can be converted into a grayscale image, and then the grayscale co-occurrence matrix of the image is obtained according to the grayscale value of the converted standard segmented image.
  • the calculation formula of the gray level symbiosis matrix H (i, j, d, ⁇ ) can be:
  • i and j represent gray values, and the range is 0 to 255;
  • d represents the distance between pixels in a standard segmented image, which can be a positive integer less than the length, width, or hypotenuse of the standard segmented image.
  • the value of d It can be related to ⁇ ;
  • indicates the relative direction of two pixels, which can be an angle with respect to the vertical direction, or an angle with respect to the horizontal direction, for example, an angle with respect to the horizontal direction to the right, such as ⁇ 0 ° indicates the horizontal direction, ⁇ is 45 ° indicates the diagonal direction in the upper right;
  • m indicates the number of pixel pairs that meet the preset conditions in the standard segmented image.
  • the first pixel and the distance from the first pixel in the ⁇ direction constitutes a pixel pair of d pixels.
  • the preset condition may be: the gray value of the first pixel in the standard segmented image is i, and the gray value of the second pixel is j; n represents the standard segmentation.
  • the total number of pixel pairs in the image with a distance of d pixels in the ⁇ direction that is, the number of pixel pairs formed by the first pixel and the second pixel; p (i, j) indicates that in a standard segmented image, the Probability of occurrence of pixel pairs with preset conditions rate.
  • the second pixel is to the right of the first pixel, and the distance from the first pixel is 1 pixel.
  • the preset conditions are: The pixel value of the first pixel is 50, and the pixel value of the second pixel is 50.
  • the pixel value of a pixel in a standard segmented image Then there are 2 pairs of pixel pairs with a distance of 1 in the horizontal direction in the first row. Similarly, there are 2 pairs of pixel pairs with a distance of 1 in the horizontal direction in the second and third rows.
  • the entropy (Entropy, ENT) of the standard segmented image is calculated according to the gray level co-occurrence matrix of the standard segmented image.
  • the entropy of the standard segmented image can be used as a measure of the amount of information that the standard segmented image has. It is used to indicate the complexity of a standard segmentation image. When the complexity is high, the entropy value is large, and vice versa.
  • the calculation formula for the entropy value ENT of a standard segmented image can be:
  • log p (i, j) is the logarithm of p (i, j), that is, the entropy value ENT of a standard segmented image is the probability of the occurrence of a pair of pixels in the standard segmented image that satisfies a preset condition in the ⁇ direction p ( The product of i, j) and log p (i, j) is summed along i and j. The inverse of the sum is the entropy value ENT of the standard segmented image.
  • entropy values can also be obtained according to p (i, j) values, and each entropy value can form an entropy value vector.
  • the image to be segmented is input to a convolutional neural network to be trained for image segmentation, and a training segmented image is obtained.
  • the convolutional neural network to be trained is a convolutional neural network with initialized model parameters.
  • the initialized model parameters can be set by the user or can be set automatically.
  • the model parameters represent the characteristics of the convolutional neural network to be trained. Modifying the model parameters can change the function of the convolutional neural network to be trained and achieve the update of the convolutional neural network to be trained.
  • the image to be segmented is input to the convolutional neural network to be trained for image segmentation, and the training segmented image is obtained.
  • the training segmented image is analyzed by the algorithm in the convolutional neural network to be trained, and the pixels of the image to be segmented are analyzed according to the analysis result. Add category tags.
  • the number of to-be-segmented images input to the convolutional neural network to be trained for image segmentation may be multiple.
  • the to-be-segmented image segmentation may be performed.
  • the image carries an image label, which is convenient for one-to-one correspondence with the obtained training segmentation image.
  • the texture features of the training segmented image can be obtained by statistics of the pixel information of the image, such as the relative distance and direction characteristics of pixels with a specific category label, etc. It can also be obtained by other methods.
  • the texture features of the training segmented image are used to reflect the training The pixel distribution of the segmented image.
  • the method of obtaining texture features of training segmented images can also be obtained by means of gray level co-occurrence matrix and local binary mode.
  • the process of obtaining the texture features of the training segmented image by using the gray level co-occurrence matrix refer to the process of obtaining the texture features of the standard segmented image by using the gray level co-occurrence matrix in S102, which is not repeated here.
  • the standard segmented image is a standard image obtained by segmenting the segmented image through a convolutional neural network, so it can be used as a measure of the quality of the training segmented image. That is, the closer the training segmented image is to the standard segmented image, the better the quality of the training segmented image. The better the segmentation effect of the corresponding convolutional neural network to be trained.
  • the convolutional neural network to be trained can be trained according to the difference between the training segmented image and the standard segmented image, so that the training segmented image obtained by segmenting the image to be segmented by the trained convolutional neural network to be trained can be closer to the standard segmentation image.
  • the difference between the training segmentation image and the standard segmentation image can be determined by the difference between the texture features of the training segmentation image and the texture feature of the standard segmentation image, and the category label of each pixel between the training segmentation image and the standard segmentation image.
  • the difference is embodied, that is, the training convolutional neural network can be trained according to the difference between the texture features of the training segmented image and the texture features of the standard segmented image, and the class label difference of each pixel between the training segmented image and the standard segmented image.
  • the class label differences of the pixels in a certain region between the training segmented image and the standard segmented image are often reflected. For example, in a certain area, the class labels of most pixels The difference between the texture features of the training segmentation image and the texture features of the standard segmentation image is often reflected in a certain area, and the differences in the texture features, such as whether the category labels of pixels around a pixel are the same as the The category labels of the pixels are the same.
  • the differences between the training segmented image and the standard segmented image are more comprehensive, and the convolutional neural network is treated according to the comprehensive differences. Training can make the target convolutional neural network more accurate and achieve better segmentation results.
  • the to-be-trained can be obtained according to the difference between the texture features of the training segmented image and the texture features of the standard segmented image, and the category label difference of each pixel between the training segmented image and the standard segmented image.
  • the value of the loss function of the convolutional neural network, and the model parameters of the convolutional neural network to be trained are updated according to the value of the loss function.
  • the class label difference of each pixel between the training segmented image and the standard segmented image can be represented by the value of the first loss function. If the class labels of the pixels in the training segmented image and the standard segmented image are both pixels of the pixel Value, the value loss1 of the first loss function may be specifically the second norm of the difference between the pixel value y2 corresponding to each pixel in the training segmented image and the pixel value y1 corresponding to each pixel in the standard segmentation image, that is,
  • y1 and y2 can both be embodied in the form of a matrix.
  • the difference between the texture features of the training segmentation image and the texture features of the standard segmentation image can be represented by the value of the second loss function loss2. If the texture features of the training segmentation image and the standard segmentation image are represented by their respective entropies, then The value of the two loss function loss2 can be specifically: the second norm of the entropy vector ENT (y1) of the training segmented image and the entropy vector ENT (y2) of the standard segmented image, that is,
  • ENT (y1) is the entropy value vector of the standard segmented image obtained by the gray level co-occurrence matrix
  • ENT (y2) is the entropy value vector of the training segmented image obtained by the gray level co-occurrence matrix.
  • the difference between the training segmentation image and the standard segmentation image can be represented by the value loss of the loss function of the convolutional neural network to be trained, and the loss
  • the value loss of the function may be the result of directly adding the value loss1 of the first loss function and the value loss2 of the second loss function, for example,
  • is a weight value
  • the weight value can be determined according to the actual situation.
  • the model parameters of the convolutional neural network to be trained can be updated according to the value of the loss function of the convolutional neural network to be trained.
  • the gradient function can be used to minimize the loss function of the convolutional neural network to be trained, and then update the model parameters of the convolutional neural network to be trained.
  • the new convolutional neural network obtained can be segmented according to the new convolutional neural network to obtain an updated training segmentation image.
  • the difference between the training segmentation image and the standard segmentation image, the model parameters of the new convolutional neural network are updated, and the target convolutional neural network is obtained after updating the model parameters multiple times.
  • the training hyperparameters can also be set in order to train the convolutional neural network to be trained according to the trained hyperparameters.
  • the hyperparameters can be, for example, the number of training rounds. n, at least one of the learning rate lr and the number of batches bn.
  • the number of training rounds n refers to the number of updates to the model parameters, that is, the convolutional neural network obtained by updating the model parameters n times is the target convolutional neural network; the learning rate lr is used to control the adjustment of the model parameters based on the loss gradient.
  • the number of batches bn is the number of images to be segmented in each batch.
  • the images to be segmented are processed. According to the obtained training segmentation image and standard training image, the convolutional neural network to be trained is trained.
  • the convolutional neural network training method obtaineds the texture features of the standard segmented image by acquiring the image to be segmented and the standard segmented image of the image to be segmented, and according to the color corresponding to the category label carried by each pixel of the standard segmented image;
  • the segmented image is input to the convolutional neural network to be trained for image segmentation to obtain a training segmented image.
  • the texture features of the training segmented image are obtained according to the colors corresponding to the category labels carried by each pixel of the training segmented image; the texture features of the training segmented image and the standard segmentation are obtained.
  • the differences between the texture features of the images and the differences in the class labels of each pixel between the training segmentation image and the standard segmentation image are to be trained on the trained convolutional neural network to obtain the target convolutional neural network.
  • the texture characteristics of the training segmented image and the texture of the standard segmented image are also considered.
  • the differences between features make the differences between the training segmentation image and the standard segmentation image more comprehensive. According to the comprehensive differences, the training convolutional neural network is trained to make the target convolutional neural network more accurate. Achieve better segmentation results.
  • the embodiment of the present application further provides a convolutional neural network training device.
  • the working principle is described in detail below with reference to the accompanying drawings.
  • FIG. 3 is a structural block diagram of a convolutional neural network training device according to an embodiment of the present application. As shown in FIG. 3, the device includes:
  • a first image obtaining unit configured to obtain an image to be divided and a standard divided image of the image to be divided
  • a first texture feature obtaining unit configured to obtain a texture feature of the standard segmented image according to a color corresponding to a category label carried by each pixel of the standard segmented image
  • a second image acquisition unit configured to input the image to be segmented into a convolutional neural network to be trained for image segmentation to obtain a training segmented image
  • a second texture feature obtaining unit configured to obtain a texture feature of the training segmented image according to a color corresponding to a category label carried by each pixel of the training segmented image
  • the training unit is configured to detect the difference between the texture features of the training segmented image and the texture features of the standard segmented image and the category label difference of each pixel between the training segmented image and the standard segmented image. Describe the convolutional neural network to be trained to obtain the target convolutional neural network.
  • the training unit includes:
  • the loss function acquisition unit is configured to be based on a difference between a texture feature of the training segmented image and a texture feature of the standard segmentation image, and a category of each pixel between the training segmentation image and the standard segmentation image. Label differences to obtain the value of the loss function of the convolutional neural network to be trained;
  • the parameter updating unit is configured to update a model parameter of the convolutional neural network to be trained according to a value of the loss function, to obtain a target convolutional neural network.
  • the loss function obtaining unit is set as:
  • the weighted sum of the differences between the texture features of the training segmented image and the texture features of the standard segmented image and the category differences of each pixel between the training segmented image and the standard segmented image are obtained A value of a loss function of the convolutional neural network to be trained.
  • the first texture feature obtaining unit is set as:
  • the second texture feature acquisition unit is set to:
  • the training unit is set as:
  • the convolutional neural network to be trained according to the difference between the entropy of the training segmented image and the entropy of the standard segmented image, and the category label difference of each pixel between the training segmented image and the standard segmented image Perform training to get the target convolutional neural network.
  • the device further includes:
  • a preset unit which is set to preset the number of training rounds for training the convolutional neural network to be trained
  • the training unit is set as:
  • the convolutional neural network to be trained is trained to obtain a target convolutional neural network.
  • the convolutional neural network training device obtains the texture features of the standard segmented image by acquiring the image to be segmented and the standard segmented image of the image to be segmented, and according to the color corresponding to the category label carried by each pixel of the standard segmented image;
  • the segmented image is input to the convolutional neural network to be trained for image segmentation to obtain a training segmented image.
  • the texture features of the training segmented image are obtained according to the colors corresponding to the category labels carried by each pixel of the training segmented image; the texture features of the training segmented image and the standard segmentation are obtained.
  • the differences between the texture features of the images and the differences in the class labels of each pixel between the training segmentation image and the standard segmentation image are to be trained on the trained convolutional neural network to obtain the target convolutional neural network.
  • the training convolutional neural network is trained to obtain a higher accuracy rate of the target convolutional neural network. Achieve better segmentation results.
  • the program can be stored in a computer-readable storage In the medium, when the program is executed, it may include the processes of the foregoing method embodiments.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).

Landscapes

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

Abstract

一种卷积神经网络训练方法,通过获取待分割图像以及待分割图像的标准分割图像,根据标准分割图像获取标准分割图像的纹理特征;将待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像,根据训练分割图像获取训练分割图像的纹理特征;根据训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,以及训练分割图像与标准分割图像之间各像素的类别标签差异对待训练卷积神经网络进行训练,得到目标卷积神经网络。

Description

一种卷积神经网络训练方法及装置 技术领域
本申请涉及图像处理领域,尤其涉及一种卷积神经网络训练方法及装置。
背景技术
图像分割(Image Segmentation),是根据图像的某些视觉特征对图像的像素进行分组形成若干个不重叠区域的过程。具体的,图像分割就是将图像各个像素添加类别标签,以将不同类别的区域通过不同的颜色区别开来。
目前,图像分割需要先对卷积神经网络进行训练,然后利用训练得到的卷积神经网络对待处理图像进行图像分割。在训练的过程中,首先将待分割图像输入到待训练卷积神经网络中,通过待训练卷积神经网络进行图像分割,输出得到训练分割图像,然后将待训练卷积神经网络输出的训练分割图像的类别标签和标准分割图像的类别标签进行比对,根据比对结果对待训练卷积神经网络进行训练。
然而,通过上述方法得到的完成训练的卷积神经网络,在进行图像分割时准确率较低,分割效果较差。
发明内容
为了解决现有技术中图像分割准确率低,分割效果差的问题,本申请实施例提供了一种卷积神经网络训练方法及装置,用于提高图像分割的准确率。
本申请实施例提供了一种卷积神经网络训练方法,所述方法包括:
获取待分割图像以及所述待分割图像的标准分割图像;
根据所述标准分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征;
将所述待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像;
根据所述训练分割图像各像素携带的类别标签对应的颜色获取所述训练分割图像的纹理特征;
根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
可选的,所述根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,包括:
根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别标签差异,得到所述待训练卷积神经网络的损失函数的值,根据所述损失函数的值更新所述待训练卷积神经网络的模型参数。
可选的,所述根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别差异,得到所述待训练卷积神经网络的损失函数的值,包括:
对所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别差异进行加权求和,得到所述待训练卷积神经网络的损失函数的值。
可选的,所述根据所述标准分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征,包括:
根据所述标准分割图像各像素携带的类别标签对应的灰度值得到所述标准分割图像的灰度共生矩阵,根据所述标准分割图像的灰度共生矩阵计算所述标准分割图像的熵;
所述根据所述训练分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征,包括:
根据所述训练分割图像各像素携带的类别标签对应的灰度值得到所述训练分割图像的灰度共生矩阵,根据所述训练分割图像的灰度共生矩阵计算所述训练分割图像的熵;
所述根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,包括:
根据所述训练分割图像的熵与所述标准分割图像的熵之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练。
可选的,所述方法还包括:
预先设置对待训练卷积神经网络进行训练的训练轮数;
所述对所述待训练卷积神经网络进行训练包括:
根据所述训练轮数对所述待训练卷积神经网络进行训练。
本申请实施例还提供了一种卷积神经网络训练装置,所述装置包括:
第一图像获取单元,设置为获取待分割图像以及所述待分割图像的标准分割图像;
第一纹理特征获取单元,设置为根据所述标准分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征;
第二图像获取单元,设置为将所述待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像;
第二纹理特征获取单元,设置为根据所述训练分割图像各像素携带的类别标签对应的颜色获取所述训练分割图像的纹理特征;
训练单元,设置为根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
可选的,所述训练单元包括:
损失函数获取单元,设置为根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别标签差异,得到所述待训练卷积神经网络的损失函数的值;
参数更新单元,设置为根据所述损失函数的值更新所述待训练卷积神 经网络的模型参数,得到目标卷积神经网络。
可选的,所述损失函数获取单元设置为:
对所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别差异进行加权求和,得到所述待训练卷积神经网络的损失函数的值。
可选的,所述第一纹理特征获取单元设置为:
根据所述标准分割图像各像素携带的类别标签对应的灰度值得到所述标准分割图像的灰度共生矩阵,根据所述标准分割图像的灰度共生矩阵计算所述标准分割图像的熵;
第二纹理特征获取单元设置为:
根据所述训练分割图像各像素携带的类别标签对应的灰度值得到所述训练分割图像的灰度共生矩阵,根据所述训练分割图像的灰度共生矩阵计算所述训练分割图像的熵;
所述训练单元设置为:
根据所述训练分割图像的熵与所述标准分割图像的熵之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
可选的,所述装置还包括:
预设单元,设置为预先设置对待训练卷积神经网络进行训练的训练轮数;
所述训练单元设置为:
根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异,以及所述训练轮数对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
本申请实施例提供的卷积神经网络训练方法及装置,通过获取待分割图像以及待分割图像的标准分割图像,根据标准分割图像各像素携带的类别标签对应的颜色获取标准分割图像的纹理特征;将待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像,根据训练分割图像 各像素携带的类别标签对应的颜色获取训练分割图像的纹理特征;根据训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,以及训练分割图像与标准分割图像之间各像素的类别标签差异对待训练卷积神经网络进行训练,得到目标卷积神经网络。
由于训练分割图像是待分割图像通过待训练卷积神经网络进行图像分割得到的,标准分割图像是想要通过卷积神经网络对待分割图像进行分割得到的标准图像,可作为对训练分割图像的质量的衡量标准,训练分割图像越接近标准分割图像,则训练分割图像的质量越好,对应的待训练卷积神经网络的分割效果越好。本申请实施例中,对于训练分割图像和标准分割图像的差异的衡量,除了考虑训练分割图像与标准分割图像之间各像素的类别标签差异,还考虑了训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,从而使训练分割图像与标准分割图像的差异体现的更加全面,根据全面的差异来对待训练卷积神经网络进行训练,得到的目标卷积神经网络的准确率更高,从而实现更好的分割效果。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为本申请实施例提供的一种卷积神经网络训练方法的流程图;
图2为本申请实施例中待分割图像和标准分割图像的示意图;
图3为本申请实施例提供的一种卷积神经网络训练装置的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。 基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
现有技术中,通常通过卷积神经网络进行图像分割,而在卷积神经网络的训练过程中,首先将待分割图像输入到待训练卷积神经网络中,通过待训练卷积神经网络进行图像分割,输出得到训练分割图像,将待训练卷积神经网络输出的训练分割图像的类别标签和标准分割图像的类别标签进行比对,根据比对结果对待训练卷积神经网络进行训练。
在上述技术中,类别标签是用来区分不同类别的标签,由于比对的是训练分割图像和标准分割图像的类别标签,考虑了整体上对于像素的分割情况,而没有考虑对少数像素的错误分割的情况,导致得到的分割图像中会出现较少量的颜色错误,例如在类别标签对应的颜色为红色的像素形成的区域内,有少数绿色的像素,即在单一物块中出现杂色,从而降低了用户体验。
为了解决上述技术问题,本申请实施例中,在卷积神经网络的训练过程中,对训练分割图像与标准分割图像的差异的体现,不只考虑待训练卷积神经网络输出的训练分割图像的类别标签和标准分割图像的类别标签差异,还考虑了待训练卷积神经网络输出的训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,从而使训练分割图像与标准分割图像的差异体现的更加全面,根据这种全面的差异对待训练卷积神经网络进行训练,得到的目标卷积神经网络的准确率更高,从而实现更好的分割效果。
图1为本申请实施例提供的一种卷积神经网络训练方法的流程图,如图1所示,该方法包括以下步骤。
S101,获取待分割图像以及待分割图像的标准分割图像。
待分割图像是图像分割过程中的作用对象,可以是彩色图,也可以是灰度图,通过图像分割可以为待分割图像中的像素赋予各自的类别标签,从而使生成的分割图像携带有类别标签。
待分割图像的标准分割图像是想要通过卷积神经网络得到的待分割图像对应的分割后的图像,待分割图像的标准分割图像中,各像素携带有类别标签,该类别标签可以是通过人工对待分割图像进行识别并添加的,也 可以是通过其他方式添加的。
类别标签是用来区分不同类别的标签,在对像素进行分割后,相同类别的像素可以携带有相同的类别标签,不同类别的像素可以携带有不同的类别标签。类别标签可以通过颜色体现出来,不同的类别标签对应不同的颜色。类别标签例如可以是对应的颜色的像素值,例如红色的像素值为(255,0,0),也可以是颜色的名称或者代号,例如可以用“r”来表示红色,用“g”来表示绿色,类别标签还可以是其他形式。
图2为本申请实施例中待分割图像和标准分割图像的示意图,如图2所示,图2(a)所示为待分割图像,其主要内容是人骑着一匹马,为待分割图像中的像素赋予类别标签后形成标准分割图像,其呈现出来的图像可以参考图2(b)所示,其中,人所在的区域内的像素携带的类别标签对应的颜色为浅灰色,马所在的区域内的像素携带的类别标签对应的颜色为深灰色,人的区域和马的区域之外的其他区域为背景区域,背景区域内的像素携带的类别标签对应的颜色为黑色。
S102,根据标准分割图像各像素携带的类别标签对应的颜色获取标准分割图像的纹理特征。
标准分割图像的纹理特征可以通过对图像的像素信息进行统计来获取,例如具有特定类别标签的像素的相对距离和方向特征等,也可以通过其他方式来获取。标准分割图像的纹理特征是用来反映标准分割图像的像素分布的,例如标准分割图像中人物所在的区域内的像素携带的类别标签对应的颜色为红色,则在该人物所在的区域中,对于各个距离和方向上的像素,其类别标签均相同,其对应的颜色均为红色。
标准分割图像的纹理特征可以通过多种方式获取,例如灰度共生矩阵(Gray-Level Co-occurrence Matrix,GLCM)、局部二值模式(Local Binary Patterns,LBP)等方式。灰度共生矩阵是对图像的一种统计特征,在一定程度上可以反映图像的纹理特征,下面以灰度共生矩阵为例,对标准分割图像的纹理特征的获取进行介绍。
具体的,如果标准分割图像是彩色图,可以将其转换为灰度图,再根据转换后的标准分割图像的灰度值得到图像的灰度共生矩阵。灰度共生矩 阵H(i,j,d,θ)的计算公式可以为:
H(i,j,d,θ)=p(i,j)=m/n,
其中,i和j表示灰度值,其范围为0~255;d表示标准分割图像中的像素的距离,可以是小于标准分割图像的长度、宽度或斜边的正整数,d的取值大小可以和θ相关;θ表示两个像素的相对方向,可以是相对于竖直方向的夹角,也可以是相对于水平方向的夹角,例如相对于水平方向向右方向的夹角,例如θ为0°表示水平方向,θ为45°表示右上方的对角线方向;m表示标准分割图像中满足预设条件的像素对的数量,以第一像素和在θ方向上与第一像素距离为d个像素的第二像素构成像素对为例,预设条件可以是:标准分割图像中的第一像素的灰度值为i,且第二像素的灰度值为j;n表示标准分割图像中在θ方向上距离为d个像素的像素对的总数量,即第一像素和第二像素构成的像素对的数量;p(i,j)表示标准分割图像中,在θ方向上满足预设条件的像素对出现的概率。
举例来说,若i=50,j=50,d=1,θ=0°,第二像素在第一像素的右侧,且与第一像素的距离为1个像素,预设条件为:第一像素的像素值为50,第二像素的像素值为50。标准分割图像中的像素的像素值为
Figure PCTCN2019077248-appb-000001
则在第一行中水平方向上距离为1的像素对总共有2对,同理,第二行和第三行中水平方向上距离为1的像素对均有2对,则可以确定n=6;在这6对像素对中,满足预设条件的只有第一行第一个像素和第二个像素构成的像素对,以及第三行第二个像素和第三个像素构成的像素对,即m=2,由此可知,
H(50,50,1,0)=p(50,50)=1/3。
实际操作中,还可以通过对d和θ进行设置,得到不同的p(i,j),可选的,可以将得到的p(i,j)求平均值,得到最终的p(i,j)的值。
在得到标准分割图像的灰度共生矩阵后,根据标准分割图像的灰度共生矩阵计算标准分割图像的熵(Entropy,ENT),标准分割图像的熵可以作为标准分割图像具有的信息量的度量,用于表示标准分割图像的复杂程度,当复杂程度很高时,熵值较大,反之则较小。标准分割图像的熵值ENT的 计算公式可以为:
Figure PCTCN2019077248-appb-000002
其中,log p(i,j)为p(i,j)的对数,即标准分割图像的熵值ENT为将标准分割图像中在θ方向上满足预设条件的像素对出现的概率p(i,j)和log p(i,j)的乘积沿着i和j进行求和,得到的和的相反数为标准分割图像的熵值ENT。
对于不同d和θ得到的标准分割图像的p(i,j),也可以分别根据p(i,j)值求熵值,各个熵值可以组成熵值向量。
S103,将待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像。
待训练卷积神经网络是具有初始化的模型参数的卷积神经网络,初始化的模型参数可以由用户设置,也可以是自动设置的。模型参数表示待训练卷积神经网络的特性,修改模型参数可以改变待训练卷积神经网络的功能,实现对待训练卷积神经网络的更新。
将待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像,训练分割图像是通过待训练卷积神经网络中的算法对待分割图像进行分析,并根据分析结果对待分割图像的像素添加类别标签得到的。
另外,输入到待训练卷积神经网络进行图像分割的待分割图像可以是多个,可以在输入的待分割图像的数量达到预设个时,进行对待分割图像的分割,其中,每个待分割图像携带有图像标签,便于与得到的训练分割图像一一对应。
S104,根据训练分割图像各像素携带的类别标签对应的颜色获取训练分割图像的纹理特征。
训练分割图像的纹理特征可以通过图像的像素信息进行统计来获取,例如具有特定类别标签的像素的相对距离和方向特征等,也可以通过其他方式获取,训练分割图像的纹理特征是用来反应训练分割图像的像素分布的。
类比于标准分割图像的纹理特征的获取方式,训练分割图像的纹理特征的获取方式也可以通过灰度共生矩阵、局部二值模式等方式。通过灰度 共生矩阵获取训练分割图像的纹理特征的过程,可以参考S102中通过灰度共生矩阵获取标准分割图像的纹理特征的过程,在此不再赘述。
S105,根据训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,以及训练分割图像与标准分割图像之间各像素的类别标签差异对待训练卷积神经网络进行训练,得到目标卷积神经网络。
由于训练分割图像是待分割图像通过待训练卷积神经网络进行图像分割得到的,其分割的效果是与待训练卷积神经网络的模型参数相关的,由于待训练卷积神经网络的模型参数是通过初始化生成的,通常对应的分割效果较差。而标准分割图像是想通过卷积神经网络对待分割图像进行分割得到的标准图像,因此可作为训练分割图像的质量的衡量标准,即训练分割图像越接近标准分割图像,训练分割图像的质量越好,对应的待训练卷积神经网络的分割效果越好。
因此,可以根据训练分割图像和标准分割图像之间的差异,对待训练卷积神经网络进行训练,使通过训练的待训练卷积神经网络对待分割图像进行分割得到的训练分割图像能够更接近标准分割图像。
具体的,训练分割图像和标准分割图像之间的差异,可以通过训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,以及训练分割图像与标准分割图像之间各像素的类别标签差异来体现,即可以根据训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,以及训练分割图像与标准分割图像之间各像素的类别标签差异对待训练卷积神经网络进行训练。
由于训练分割图像与标准分割图像之间各像素的类别标签差异,往往体现训练分割图像与标准分割图像在某一区域内像素的类别标签差异,例如在某一区域内,大部分像素的类别标签相同;而训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,往往体现在某一区域内,其纹理特征上的差异,例如在某一像素周围的像素的类别标签是否与该像素的类别标签相同,因此,通过综合考虑图片的各像素的类别标签差异和纹理特征差异,使训练分割图像与标准分割图像的差异体现的更加全面,根据全面的差异来对待训练卷积神经网络进行训练,可以使得到的目标卷积神 经网络的准确率更高,实现更好的分割效果。
作为一种可能的实现方式,可以根据训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,以及训练分割图像与标准分割图像的之间的各像素的类别标签差异,得到待训练卷积神经网络的损失函数的值,根据损失函数的值更新待训练卷积神经网络的模型参数。
训练分割图像与标准分割图像的之间的各像素的类别标签差异,可以通过第一损失函数的值loss1来表示,若训练分割图像与标准分割图像中的像素的类别标签均为该像素的像素值,则第一损失函数的值loss1可以具体为训练分割图像中的各个像素对应的像素值y2与标准分割图像中的各个像素对应的像素值y1的差的二范数,即
loss1=||y2-y1||,
其中,y1和y2可以都以矩阵的形式体现。
训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,可以通过第二损失函数的值loss2来表示,若训练分割图像与标准分割图像的纹理特征通过各自的熵来表示,则第二损失函数的值loss2可以具体为:训练分割图像的熵值向量ENT(y1)与标准分割图像的熵值向量ENT(y2)的二范数,即
loss2=||ENT(y2)-ENT(y1)||,
其中,ENT(y1)为通过灰度共生矩阵得到的标准分割图像的熵值向量,ENT(y2)为通过灰度共生矩阵得到的训练分割图像的熵值向量。
在得到第一损失函数的值loss1和第二损失函数的值loss2后,训练分割图像与标准分割图像之间的差异,可以通过待训练卷积神经网络的损失函数的值loss来表示,该损失函数的值loss可以是第一损失函数的值loss1和第二损失函数的值loss2直接相加的结果,例如,
loss=loss1+loss2,
也可以是第一损失函数的值loss1和第二损失函数的值loss2进行加权相加的结果,例如,
loss=loss1+λ*loss2,
其中λ为权重值,该权重值可以根据实际情况而确定。
在得到图像损失函数的值后,可以根据待训练卷积神经网络的损失函数的值更新待训练卷积神经网络的模型参数。具体的,可以通过梯度下降法来最小化待训练卷积神经网络的损失函数,进而更新待训练卷积神经网络的模型参数。
在对待训练卷及神经网络的模型参数进行更新后,得到的新的卷积神经网络,可根据新的卷积神经网络对待分割图像进行分割,得到更新后的训练分割图像,在根据更新后的训练分割图像和标准分割图像的差异,对新的卷积神经网络的模型参数进行更新,在多次模型参数的更新后,得到目标卷积神经网络。
需要说明的是,在对待训练卷积神经网络的模型参数进行初始化时,还可以设置训练的超参数,以便根据训练的超参数对待训练卷积神经网络进行训练,超参数例如可以是训练轮数n、学习率lr和批处理数量bn的其中至少一项。其中训练轮数n是指对模型参数的更新次数,即在对模型参数进行n次更新得到的卷积神经网络即为目标卷积神经网络;学习率lr用于控制基于损失梯度调整模型参数的速度,学习率越小,沿着损失梯度下降的速度越慢;批处理数量bn是表征每一批待分割图像的数量,在输入的待分割图像的数量达到预设个时,进行对待分割图像的分割,进而根据得到的训练分割图像和标准训练图像实现对待训练卷积神经网络的训练。
本申请实施例提供的卷积神经网络训练方法,通过获取待分割图像以及待分割图像的标准分割图像,根据标准分割图像各像素携带的类别标签对应的颜色获取标准分割图像的纹理特征;将待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像,根据训练分割图像各像素携带的类别标签对应的颜色获取训练分割图像的纹理特征;根据训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,以及训练分割图像与标准分割图像之间各像素的类别标签差异对待训练卷积神经网络进行训练,得到目标卷积神经网络。该方法中,对于训练分割图像和标准分割图像的差异的衡量,除了考虑训练分割图像与标准分割图像之间各像素的类别标签差异,还考虑了训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,从而使训练分割图像与标准分割图像的差异体现的更加 全面,根据全面的差异来对待训练卷积神经网络进行训练,使得到的目标卷积神经网络的准确率更高,实现更好的分割效果。
基于以上实施例提供的一种卷积神经网络训练方法,本申请实施例还提供了一种卷积神经网络训练装置,下面结合附图来详细说明其工作原理。
图3为本申请实施例提供的一种卷积神经网络训练装置的结构框图,如图3所示,该装置包括:
第一图像获取单元,设置为获取待分割图像以及所述待分割图像的标准分割图像;
第一纹理特征获取单元,设置为根据所述标准分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征;
第二图像获取单元,设置为将所述待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像;
第二纹理特征获取单元,设置为根据所述训练分割图像各像素携带的类别标签对应的颜色获取所述训练分割图像的纹理特征;
训练单元,设置为根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
可选的,所述训练单元包括:
损失函数获取单元,设置为根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别标签差异,得到所述待训练卷积神经网络的损失函数的值;
参数更新单元,设置为根据所述损失函数的值更新所述待训练卷积神经网络的模型参数,得到目标卷积神经网络。
可选的,所述损失函数获取单元设置为:
对所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类 别差异进行加权求和,得到所述待训练卷积神经网络的损失函数的值。
可选的,所述第一纹理特征获取单元设置为:
根据所述标准分割图像各像素携带的类别标签对应的灰度值得到所述标准分割图像的灰度共生矩阵,根据所述标准分割图像的灰度共生矩阵计算所述标准分割图像的熵;
第二纹理特征获取单元设置为:
根据所述训练分割图像各像素携带的类别标签对应的灰度值得到所述训练分割图像的灰度共生矩阵,根据所述训练分割图像的灰度共生矩阵计算所述训练分割图像的熵;
所述训练单元设置为:
根据所述训练分割图像的熵与所述标准分割图像的熵之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
可选的,所述装置还包括:
预设单元,设置为预先设置对待训练卷积神经网络进行训练的训练轮数;
所述训练单元设置为:
根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异,以及所述训练轮数对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
本申请实施例提供的卷积神经网络训练装置,通过获取待分割图像以及待分割图像的标准分割图像,根据标准分割图像各像素携带的类别标签对应的颜色获取标准分割图像的纹理特征;将待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像,根据训练分割图像各像素携带的类别标签对应的颜色获取训练分割图像的纹理特征;根据训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,以及训练分割图像与标准分割图像之间各像素的类别标签差异对待训练卷积神经网络进行训练,得到目标卷积神经网络。
该装置中,对于训练分割图像和标准分割图像的差异的衡量,除了考虑训练分割图像与标准分割图像之间各像素的类别标签差异,还考虑了训练分割图像的纹理特征与标准分割图像的纹理特征之间的差异,从而使训练分割图像与标准分割图像的差异体现的更加全面,根据全面的差异来对待训练卷积神经网络进行训练,得到的目标卷积神经网络的准确率更高,从而实现更好的分割效果。
当介绍本申请的各种实施例的元件时,冠词“一”、“一个”、“这个”和“所述”都意图表示有一个或多个元件。词语“包括”、“包含”和“具有”都是包括性的并意味着除了列出的元件之外,还可以有其它元件。
需要说明的是,本领域普通技术人员可以理解实现上述方法实施例中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元及模块可以是或者也可以不是物理上分开的。另外,还可以根据实际的需要选择其中的部分或者全部单元和模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅是本申请的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (12)

  1. 一种卷积神经网络训练方法,所述方法包括:
    获取待分割图像以及所述待分割图像的标准分割图像;
    根据所述标准分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征;
    将所述待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像;
    根据所述训练分割图像各像素携带的类别标签对应的颜色获取所述训练分割图像的纹理特征;
    根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
  2. 根据权利要求1所述的方法,其中,所述根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,包括:
    根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别标签差异,得到所述待训练卷积神经网络的损失函数的值,根据所述损失函数的值更新所述待训练卷积神经网络的模型参数。
  3. 根据权利要求2所述的方法,其中,所述根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别差异,得到所述待训练卷积神经网络的损失函数的值,包括:
    对所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别差异进行加权求和,得到所述待训练卷积神经网络的损失函数的值。
  4. 根据权利要求1所述的方法,其中,所述根据所述标准分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征,包括:
    根据所述标准分割图像各像素携带的类别标签对应的灰度值得到所述 标准分割图像的灰度共生矩阵,根据所述标准分割图像的灰度共生矩阵计算所述标准分割图像的熵;
    所述根据所述训练分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征,包括:
    根据所述训练分割图像各像素携带的类别标签对应的灰度值得到所述训练分割图像的灰度共生矩阵,根据所述训练分割图像的灰度共生矩阵计算所述训练分割图像的熵;
    所述根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,包括:
    根据所述训练分割图像的熵与所述标准分割图像的熵之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练。
  5. 根据权利要求1所述的方法,其中,所述方法还包括:
    预先设置对待训练卷积神经网络进行训练的训练轮数;
    所述对所述待训练卷积神经网络进行训练包括:
    根据所述训练轮数对所述待训练卷积神经网络进行训练。
  6. 一种卷积神经网络训练装置,所述装置包括:
    第一图像获取单元,设置为获取待分割图像以及所述待分割图像的标准分割图像;
    第一纹理特征获取单元,设置为根据所述标准分割图像各像素携带的类别标签对应的颜色获取所述标准分割图像的纹理特征;
    第二图像获取单元,设置为将所述待分割图像输入到待训练卷积神经网络进行图像分割,得到训练分割图像;
    第二纹理特征获取单元,设置为根据所述训练分割图像各像素携带的类别标签对应的颜色获取所述训练分割图像的纹理特征;
    训练单元,设置为根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,得到目 标卷积神经网络。
  7. 根据权利要求6所述的装置,其中,所述训练单元包括:
    损失函数获取单元,设置为根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别标签差异,得到所述待训练卷积神经网络的损失函数的值;
    参数更新单元,设置为根据所述损失函数的值更新所述待训练卷积神经网络的模型参数,得到目标卷积神经网络。
  8. 根据权利要求7所述的装置,其中,所述损失函数获取单元设置为:
    对所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像的之间的各像素的类别差异进行加权求和,得到所述待训练卷积神经网络的损失函数的值。
  9. 根据权利要求6所述的装置,其中,所述第一纹理特征获取单元具体设置为:
    根据所述标准分割图像各像素携带的类别标签对应的灰度值得到所述标准分割图像的灰度共生矩阵,根据所述标准分割图像的灰度共生矩阵计算所述标准分割图像的熵;
    第二纹理特征获取单元设置为:
    根据所述训练分割图像各像素携带的类别标签对应的灰度值得到所述训练分割图像的灰度共生矩阵,根据所述训练分割图像的灰度共生矩阵计算所述训练分割图像的熵;
    所述训练单元设置为:
    根据所述训练分割图像的熵与所述标准分割图像的熵之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
  10. 根据权利要求6所述的装置,其中,所述装置还包括:
    预设单元,设置为预先设置对待训练卷积神经网络进行训练的训练轮数;
    所述训练单元设置为:
    根据所述训练分割图像的纹理特征与所述标准分割图像的纹理特征之间的差异,以及所述训练分割图像与所述标准分割图像之间各像素的类别标签差异,以及所述训练轮数对所述待训练卷积神经网络进行训练,得到目标卷积神经网络。
  11. 一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行权利要求1至5中任意一项所述的卷积神经网络训练方法。
  12. 一种设备,包括存储器和处理器,
    所述存储器存储有计算机程序;
    所述处理器,设置为执行所述存储器中存储的计算机程序,所述计算机程序运行时执行权利要求1至5中任意一项所述的卷积神经网络训练方法。
PCT/CN2019/077248 2018-06-20 2019-03-07 一种卷积神经网络训练方法及装置 WO2019242329A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810638376.3A CN108765423B (zh) 2018-06-20 2018-06-20 一种卷积神经网络训练方法及装置
CN201810638376.3 2018-06-20

Publications (1)

Publication Number Publication Date
WO2019242329A1 true WO2019242329A1 (zh) 2019-12-26

Family

ID=63979512

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/077248 WO2019242329A1 (zh) 2018-06-20 2019-03-07 一种卷积神经网络训练方法及装置

Country Status (2)

Country Link
CN (1) CN108765423B (zh)
WO (1) WO2019242329A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112330607A (zh) * 2020-10-20 2021-02-05 精英数智科技股份有限公司 基于图像识别技术的煤矸识别方法、装置及系统
CN114255203A (zh) * 2020-09-22 2022-03-29 中国农业大学 一种鱼苗数量估计方法及系统

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108765423B (zh) * 2018-06-20 2020-07-28 北京七鑫易维信息技术有限公司 一种卷积神经网络训练方法及装置
CN111161274B (zh) 2018-11-08 2023-07-07 上海市第六人民医院 腹部图像分割方法、计算机设备
CN109472789A (zh) * 2018-11-20 2019-03-15 北京贝叶科技有限公司 一种用于皮肤病理图像处理的神经网络训练方法及装置
JP7086878B2 (ja) * 2019-02-20 2022-06-20 株式会社東芝 学習装置、学習方法、プログラムおよび認識装置
CN111192252B (zh) * 2019-12-30 2023-03-31 深圳大学 一种图像分割结果优化方法、装置、智能终端及存储介质
CN111415333B (zh) * 2020-03-05 2023-12-01 北京深睿博联科技有限责任公司 乳腺x射线影像反对称生成分析模型训练方法和装置
CN111915598B (zh) * 2020-08-07 2023-10-13 温州医科大学 一种基于深度学习的医疗图像处理方法和装置
CN112085746B (zh) * 2020-09-08 2024-02-02 中国科学院计算技术研究所厦门数据智能研究院 一种基于增强特征表示的图像分割方法
CN112541463A (zh) * 2020-12-21 2021-03-23 上海眼控科技股份有限公司 模型训练方法、外观分割方法、设备及存储介质
CN112651880B (zh) * 2020-12-25 2022-12-30 北京市商汤科技开发有限公司 视频数据处理方法及装置、电子设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107506761A (zh) * 2017-08-30 2017-12-22 山东大学 基于显著性学习卷积神经网络的脑部图像分割方法及系统
CN107993191A (zh) * 2017-11-30 2018-05-04 腾讯科技(深圳)有限公司 一种图像处理方法和装置
CN108765423A (zh) * 2018-06-20 2018-11-06 北京七鑫易维信息技术有限公司 一种卷积神经网络训练方法及装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3171297A1 (en) * 2015-11-18 2017-05-24 CentraleSupélec Joint boundary detection image segmentation and object recognition using deep learning
CN106408595A (zh) * 2016-08-31 2017-02-15 上海交通大学 一种基于神经网络画风学习的图像渲染方法
CN106529568A (zh) * 2016-10-11 2017-03-22 浙江工业大学 一种基于bp神经网络的珍珠多分类方法
CN106874840B (zh) * 2016-12-30 2019-10-22 东软集团股份有限公司 车辆信息识别方法及装置
CN107122809B (zh) * 2017-04-24 2020-04-28 北京工业大学 基于图像自编码的神经网络特征学习方法
CN107169956B (zh) * 2017-04-28 2020-02-14 西安工程大学 基于卷积神经网络的色织物疵点检测方法
CN107169974A (zh) * 2017-05-26 2017-09-15 中国科学技术大学 一种基于多监督全卷积神经网络的图像分割方法
CN107330446B (zh) * 2017-06-05 2020-08-04 浙江工业大学 一种面向图像分类的深度卷积神经网络的优化方法
CN107742122A (zh) * 2017-10-27 2018-02-27 浙江大华技术股份有限公司 一种x光图像的分割方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107506761A (zh) * 2017-08-30 2017-12-22 山东大学 基于显著性学习卷积神经网络的脑部图像分割方法及系统
CN107993191A (zh) * 2017-11-30 2018-05-04 腾讯科技(深圳)有限公司 一种图像处理方法和装置
CN108765423A (zh) * 2018-06-20 2018-11-06 北京七鑫易维信息技术有限公司 一种卷积神经网络训练方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114255203A (zh) * 2020-09-22 2022-03-29 中国农业大学 一种鱼苗数量估计方法及系统
CN114255203B (zh) * 2020-09-22 2024-04-09 中国农业大学 一种鱼苗数量估计方法及系统
CN112330607A (zh) * 2020-10-20 2021-02-05 精英数智科技股份有限公司 基于图像识别技术的煤矸识别方法、装置及系统

Also Published As

Publication number Publication date
CN108765423B (zh) 2020-07-28
CN108765423A (zh) 2018-11-06

Similar Documents

Publication Publication Date Title
WO2019242329A1 (zh) 一种卷积神经网络训练方法及装置
TWI742382B (zh) 透過電腦執行的、用於車輛零件識別的神經網路系統、透過神經網路系統進行車輛零件識別的方法、進行車輛零件識別的裝置和計算設備
CN110046673B (zh) 基于多特征融合的无参考色调映射图像质量评价方法
CN107610087B (zh) 一种基于深度学习的舌苔自动分割方法
CN109754017B (zh) 基于可分离的三维残差网络和迁移学习高光谱图像分类方法
WO2022012110A1 (zh) 胚胎光镜图像中细胞的识别方法及系统、设备及存储介质
JP2020537204A (ja) ディープニューラルネットワークの正規化方法および装置、機器、ならびに記憶媒体
CN110443778B (zh) 一种检测工业品不规则缺陷的方法
Rahaman et al. An efficient multilevel thresholding based satellite image segmentation approach using a new adaptive cuckoo search algorithm
CN107507153B (zh) 图像去噪方法和装置
CN112101328A (zh) 一种深度学习中识别并处理标签噪声的方法
CN109685743A (zh) 基于噪声学习神经网络模型的图像混合噪声消除方法
CN104036493B (zh) 一种基于多重分形谱的无参考图像质量评价方法
CN110996096B (zh) 一种基于结构相似性差异度的色调映射图像质量评价方法
CN111127360B (zh) 一种基于自动编码器的灰度图像迁移学习方法
Liu et al. No-reference image quality assessment method based on visual parameters
CN116091455A (zh) 基于机器视觉的钢网表面缺陷判定方法
CN114066857A (zh) 红外图像质量评价方法、装置、电子设备及可读存储介质
CN114926407A (zh) 一种基于深度学习的钢材表面缺陷检测系统
CN111882555B (zh) 基于深度学习的网衣检测方法、装置、设备及存储介质
CN109410158B (zh) 一种基于卷积神经网络的多焦点图像融合方法
CN111626335B (zh) 一种像素增强的神经网络的改进难例挖掘训练方法及系统
Saraswat et al. Plant Disease Identification Using Plant Images
CN110910480A (zh) 基于颜色模式映射关系的环境监测图像渲染方法
CN106997590A (zh) 一种基于检测产品特性的图像处理与检测系统

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: 19823178

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.03.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19823178

Country of ref document: EP

Kind code of ref document: A1