A training method for a classifier model based on deep learning
By manually classifying and cropping medical images, and using data augmentation and generative adversarial networks to generate expanded images, the problem of not being able to expand the training data set in the prior art is solved, and efficient training of deep learning models and high recognition accuracy are achieved.
Patent Information
- Application Number
- CN202011534218.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-22
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2040-12-22
AI Technical Summary
The prior art cannot expand the training data set of medical images without changing the deep-level features of the image, resulting in the inability of deep learning models to achieve ideal classification recognition accuracy.
By manually classifying the original medical images and adding classification labels, the images of the region of interest are cropped, and preliminary expansion images are generated through flip, rotate, and scale operations, and then the generative adversarial network model is used to generate further expansion images to form an expanded training set to train the deep learning model.
While ensuring that the deep-level features of the image remain unchanged, the images in the training set are expanded, the efficiency of image generation is improved, the amount of training data of the deep learning model is enhanced, and the recognition accuracy is achieved.
Smart Images

Figure HDA0002852825870000011
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a training method for a classifier model based on deep learning. Background Art
[0002] In the field of medical image processing, traditional statistical modeling methods have been used to collect and extract original features of medical images (for example, CT images). However, since this method lacks exploration of the deep-level features of the image, the accuracy of the model is often poor and it is difficult to meet the true standards for image case classification.
[0003] With the widespread application of artificial intelligence technology, it has become an inevitable trend to use related technologies to replace traditional statistical modeling methods. In recent years, some people have proposed using deep learning methods to learn the characteristics of images. Deep learning can better learn the deep-level characteristics of images, but to create a high-precision deep learning model, a large amount of data is required for model training to prevent the model from overfitting and achieve good image recognition and classification effects. There are too few existing medical images, so in order to achieve the ideal model accuracy, the amount of training data needs to be expanded before training the deep learning model. However, existing technologies cannot expand the training image data set without changing the deep-level characteristics of the image to provide sufficient data basis for the accurate recognition of the model.
[0004] In view of the above-mentioned defects of the prior art, the field urgently needs a solution that can expand the training set images without changing the deep-level features of the images, so that the deep learning model can be fully trained to achieve ideal classification and recognition accuracy. Summary of the invention
[0005] In view of this, the purpose of an embodiment of the present invention is to propose a training method for a classifier model based on deep learning, which can solve the problems that the above-mentioned prior art cannot expand the training image data set without changing the deep-level features of the image, resulting in the deep learning model not being fully trained and failing to achieve the ideal classification and recognition accuracy.
[0006] Based on the above purpose, an aspect of an embodiment of the present invention provides a training method for a classifier model based on deep learning, comprising the following steps:
[0007] Step 1: manually classify the original medical images according to a preset classification standard and add classification labels, and the original medical images with the classification labels constitute a first data set;
[0008] Step 2: acquiring a region of interest image from the original medical image in the first data set, wherein the region of interest image constitutes a second data set;
[0009] Step 3, performing flipping, rotation, and scaling operations on the image of the region of interest in the second data set to obtain a preliminary expanded image, wherein the preliminary expanded image constitutes a third data set;
[0010] Step 4: using a pre-created generator of a generative adversarial network model based on a deep neural network to generate a further expanded image corresponding to the image of the region of interest, wherein the further expanded image constitutes a fourth data set;
[0011] Step 5: training a target classifier model using a portion of the region of interest images in the second data set;
[0012] Step 6: using another part of the region of interest images in the second data set to verify the accuracy of the target classifier model and obtain a classification accuracy value q1, using the third data set to verify the accuracy of the target classifier model and obtain a classification accuracy value q2, and using the fourth data set to verify the accuracy of the target classifier model and obtain a classification accuracy value q3, the absolute value of the difference between q2 and q1 and the absolute value of the difference between q3 and q1 are both less than a preset threshold; and
[0013] Step 7: Input the second data set, the third data set and the fourth data set into the target classifier model for retraining and obtain a classification accuracy value q4, where q4 is greater than q1, q2 or q3 respectively.
[0014] The data volumes of the second data set, the third data set and the fourth data set are equal.
[0015] In some embodiments, the training process of the generative adversarial network model is: alternately training the generator and the discriminator of the generative adversarial network model based on the second data set and preset randomly distributed noise.
[0016] In some embodiments, alternately training the generator and the discriminator of the generative adversarial network model based on the second data set and the preset randomly distributed noise includes:
[0017] Generating step: fixing the parameters of the discriminator, inputting the preset random distribution noise into the generator to output a generated image;
[0018] Discriminant step: fixing the parameters of the generator, inputting the generated image and the second data set into the discriminator to output true or false probability values;
[0019] Optimization step: passing the true and false probability values to the generator, and using an optimizer to optimize the discriminator and the generator;
[0020] Repeat the generation step, the discrimination step and the optimization step until a loss function value that meets a preset condition is obtained, thereby obtaining a trained generator and discriminator.
[0021] In some embodiments, the step 4 further includes: inputting the preset randomly distributed noise into the trained generator to generate the further expanded image.
[0022] In some embodiments, the preset randomly distributed noise is 100-dimensional random Gaussian noise.
[0023] In some implementations, the images in the second data set, the third data set, and the fourth data set all contain the classification labels.
[0024] In some embodiments, the above step 2 further comprises:
[0025] Calculating a region of interest in the original medical image in the first data set; and
[0026] The region of interest is cropped from the original medical image as the region of interest image.
[0027] In some embodiments, q1=q2=q3.
[0028] The present invention has the following beneficial technical effects:
[0029] A training method for a classifier model based on deep learning provided in an embodiment of the present invention is aimed at a deep learning model with only a small amount of training data set. The method can select areas of interest by cropping while ensuring that the deep features of the image are not changed, accurately locate the deep features of the image, improve the efficiency of image generation, expand the images of the training set, and use the expanded training set images to train the deep learning model so as to achieve a higher recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0031] Figure 1 The present invention is a schematic flowchart of a method for training a classifier model based on deep learning according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0033] It should be noted that all expressions using "first", "second", "third", "fourth", etc. in the embodiments of the present invention are for distinguishing multiple non-identical entities with the same name or non-identical parameters. It can be seen that "first", "second", "third", "fourth", etc. are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0034] Based on the above objectives, the present invention proposes an embodiment of a training method for a classifier model based on deep learning. Figure 1 Shown is a schematic flow chart of the training method. The method first crops the original image, removes the featureless area, obtains the region of interest image containing deep features, and subsequently generates an extended image based on the region of interest image, thereby improving the efficiency of generating effective images. The present invention expands the training set images in two ways: one is to perform conventional data enhancement on the region of interest images to obtain a batch of extended images; the other is to use a generator model of a generative adversarial network based on a deep neural network to generate another batch of extended images that approximate the true distribution of the region of interest images. Combining the two batches of extended images with the region of interest images to form a training set to train the classifier model can enable it to achieve a higher recognition accuracy.
[0035] Specifically, if Figure 1 As shown in , the training method of the deep learning-based classifier model includes the following steps:
[0036] Step S1: manually classify the original medical images according to a preset classification standard and add classification labels, and the original medical images with the classification labels constitute a first data set.
[0037] Step S2: acquiring a region of interest image from the original medical image in the first data set, wherein the region of interest image constitutes a second data set, and the region of interest image contains the classification label.
[0038] Step S3, performing conventional data enhancement operations such as flipping, rotating (for example, flipping and rotating the image 60 degrees, 90 degrees, 120 degrees, and 180 degrees), and scaling on the image of the region of interest in the second data set to obtain a preliminary expanded image, wherein the preliminary expanded image constitutes a third data set, and the preliminary expanded image includes the classification label.
[0039] Step S4: using a pre-created generator of a generative adversarial network model based on a deep neural network to generate a further expanded image corresponding to the image of the region of interest, wherein the further expanded image constitutes a fourth data set, and the further expanded image contains the classification label.
[0040] The above steps are training data expansion steps. Preferably, the data volume of the expanded third data set and the fourth data set is respectively equal to the data volume of the second data set. The process of training the classifier model using the above training data will be described in detail below.
[0041] Step S5: Use a portion of the region of interest images in the second data set (for example, 80% of the region of interest images) to train a target classifier model.
[0042] Step S6, using another part of the region of interest images in the second data set (the remaining 20% of the region of interest images) to verify the accuracy of the target classifier model and obtain the classification accuracy value q1, using the third data set to verify the accuracy of the target classifier model and obtain the classification accuracy value q2, using the fourth data set to verify the accuracy of the target classifier model and obtain the classification accuracy value q3, after comparison, the absolute value of the difference between q2 and q1 and the absolute value of the difference between q3 and q1 are both less than the preset threshold, optimally q1 = q2 = q3, that is, the classification effect of the trained classifier on the expanded image is the same as that of the second data set, achieving the expected data enhancement purpose. Next, the target classifier model can be enhanced learning using the amplified data.
[0043] Step S7: input the second data set, the third data set and the fourth data set into the target classifier model for retraining and obtain a classification accuracy value q4, and q4 will be greater than q1, q2 or q3 respectively.
[0044] In a preferred embodiment, the training process of the generative adversarial network model is: alternately training the generator and the discriminator of the generative adversarial network model based on the second data set and preset randomly distributed noise.
[0045] The first step is to construct a generative adversarial network model, which consists of a generator G and a discriminator D, and select a suitable loss function to train the model; the constructed generator G has 4 convolutional layers, each convolutional layer uses a transposed convolution operation with a stride of 2, and BN is added (except the last output layer), and all layers use ReLU (except the last output layer uses Tanh); the constructed discriminator D has 4 convolutional layers, each convolutional layer uses a transposed convolution operation with a stride of 2, and BN is added (except the last output layer), and all layers use LeakyReLU.
[0046] In the second step, given a randomly distributed noise z is input to the generator G, the generator G generates a fake sample x through the following complex mapping function:
[0047] x=G(z;θg)
[0048] In the third step, the discriminator D uses the following complex mapping function to judge the real sample or the generated fake sample x of the input second data set and output a value between 0 and 1. The larger the value, the more likely it is a real sample:
[0049] s=D(x;θd)
[0050] Repeat the second and third steps, through the adversarial training between the generator G and the discriminator D, until the image data x that meets the conditions is generated, and then stop the training to obtain the final generator G used for the purpose of the present invention. The overall objective function expression is as follows:
[0051] min(G)max(D)V(D,G)=Ex~pdata[logD(x)]+Ez~pz[log(1-D(G(Z)))]
[0052] The present invention introduces a deep neural network to construct a generative adversarial network model based on the traditional generative adversarial network, so that its learning ability is enhanced and training data that is more suitable for deep neural network learning can be generated.
[0053] In a preferred embodiment, the generator and the discriminator of the generative adversarial network model are alternately trained based on the second data set and the preset randomly distributed noise, including:
[0054] Generating step: fixing the parameters of the discriminator, inputting the preset random distribution noise into the generator to output a generated image;
[0055] Discriminant step: fixing the parameters of the generator, inputting the generated image and the second data set into the discriminator to output true or false probability values;
[0056] Optimization step: passing the true and false probability values to the generator, and using an optimizer to optimize the discriminator and the generator;
[0057] Repeat the generation step, the discrimination step and the optimization step until a loss function value that meets a preset condition is obtained, thereby obtaining a trained generator and discriminator.
[0058] The following example illustrates the specific training process of the generator and discriminator.
[0059] Step 1: Fix the discriminator and input a 100-dimensional random Gaussian noise into the generator fully connected layer to obtain 512 16×16 pixel output feature maps of the generator fully connected layer.
[0060] Step 2: Input the output feature map of the generator fully connected layer to the generator micro-stride convolution layer, perform nonlinear ReLU transformation and transposed convolution operation with a stride of 2 on it, and obtain 256 32×32 pixel output feature maps of the generator convolution layer;
[0061] Step 3: Input the output feature map of the generator fully connected layer to the generator micro-stride convolution layer, perform nonlinear ReLU transformation and transposed convolution operation with a stride of 2 on it, and obtain 128 64×64 pixel generator convolution layer output feature maps;
[0062] Step 4: Input the output feature map of the generator fully connected layer to the generator micro-stride convolution layer, perform nonlinear ReLU transformation and transposed convolution operation with a stride of 2, and obtain 64 128×128 pixel generator convolution layer output feature maps;
[0063] Step 5: Input the output feature map of the generator fully connected layer to the generator micro-stride convolution layer, perform nonlinear ReLU transformation and transposed convolution operation with a stride of 2 on it, and obtain 32 256×256 pixel generator convolution layer output feature maps;
[0064] Step 6: Fix the generator, input the generated image of 256x256 pixels and the real image of the second data set into the discriminator convolution layer, perform convolution operation on it, and output the discriminator convolution layer output feature map of 128x128 pixels;
[0065] Step 7: Input the discriminator convolution layer output feature map to the discriminator convolution layer, perform convolution operation with a stride of 2 and nonlinear ReLU transformation on it in sequence, and output the discriminator convolution layer output feature map with a size of 64x64 pixels;
[0066] Step 8: Input the discriminator convolution layer output feature map to the discriminator convolution layer, perform convolution operation with a stride of 2 and nonlinear ReLU transformation on it in sequence, and output the discriminator convolution layer output feature map of 32x32 pixels;
[0067] Step 9: Input the discriminator convolution layer output feature map to the discriminator convolution layer, perform convolution operation with a stride of 2 and nonlinear ReLU transformation on it in turn, and output the discriminator convolution layer output feature map with a size of 16x16 pixels;
[0068] Step 10: Input the output feature map of the discriminator convolutional layer into the discriminator fully connected layer, perform nonlinear transformation on it, and obtain the output probability of the discriminator fully connected layer;
[0069] In step 11, the output probability of the fully connected layer of the discriminator is passed to the generator, and the optimizer is used to optimize the discriminator and generator to obtain the loss function value.
[0070] In a preferred embodiment, the above step 4 further includes: inputting the preset randomly distributed noise (100-dimensional random Gaussian noise) into the trained generator to generate the further expanded image.
[0071] In a preferred embodiment, the step S2 further comprises:
[0072] Calculating a region of interest in the original medical image in the first data set; and
[0073] The region of interest is cropped from the original medical image as the region of interest image.
[0074] The training method of the classifier model based on deep learning provided by the present invention is aimed at the deep learning model with only a small amount of training data set. It can select the area of interest by cropping and accurately locate the deep features of the image without changing the deep features of the image, thereby improving the efficiency of image generation, expanding the images of the training set, and using the expanded training set images to train the deep learning model so as to achieve a higher recognition accuracy.
[0075] It should be noted that those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned operation embodiments. The computer program can achieve the same or similar effects as the corresponding above-mentioned operation embodiments.
[0076] In addition, it should be understood that the computer-readable storage medium (e.g., memory) used to implement the operation of the present invention can be a volatile memory or a non-volatile memory, or can include both a volatile memory and a non-volatile memory. As an example and not by way of limitation, a non-volatile memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. A volatile memory can include a random access memory (RAM), which can act as an external cache memory. As an example and not by way of limitation, RAM can be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
[0077] It will also be appreciated by those skilled in the art that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein may be implemented or executed using the following components designed to perform the functions described herein: a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general purpose processor may be a microprocessor, but alternatively, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and / or any other such configuration.
[0078] In one or more exemplary designs, the functions can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored on a computer-readable medium or transmitted via a computer-readable medium as one or more instructions or codes. Computer-readable media include computer storage media and communication media, and the communication media include any media that helps to transfer a computer program from one location to another. The storage medium can be any available medium that can be accessed by a general or special-purpose computer. As an example and not limiting, the computer-readable medium can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, disk storage devices or other magnetic storage devices, or can be used to carry or store the required program code in the form of instructions or data structures and can be accessed by a general or special-purpose computer or a general or special-purpose processor. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwaves are used to send software from a website, server or other remote source, the above-mentioned coaxial cable, optical fiber cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwaves are all included in the definition of the medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, Blu-ray disc, wherein disks usually reproduce data magnetically, while optical discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0079] The above are exemplary embodiments disclosed in the present invention. The order disclosed in the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. However, it should be noted that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope (including claims) disclosed in the embodiments of the present invention is limited to these examples. Various changes and modifications may be made without departing from the scope defined in the claims. The functions, steps and / or actions of the claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
Claims
1. A training method for a classifier model based on deep learning, characterized in that: The following steps are involved: Step 1: manually classify the original medical images according to a preset classification standard and add classification labels, and the original medical images with the classification labels constitute a first data set; Step 2: acquiring a region of interest image from the original medical image in the first data set, wherein the region of interest image constitutes a second data set; Step 3, performing flipping, rotation, and scaling operations on the image of the region of interest in the second data set to obtain a preliminary expanded image, wherein the preliminary expanded image constitutes a third data set; Step 4: using a pre-created generator of a generative adversarial network model based on a deep neural network to generate a further expanded image corresponding to the image of the region of interest, wherein the further expanded image constitutes a fourth data set; Step 5: training a target classifier model using a portion of the region of interest images in the second data set; Step 6: Use another part of the region of interest images in the second data set to verify the accuracy of the target classifier model and obtain a classification accuracy value q1, use the third data set to verify the accuracy of the target classifier model and obtain a classification accuracy value q2, and use the fourth data set to verify the accuracy of the target classifier model and obtain a classification accuracy value q3, and the absolute value of the difference between q2 and q1 and the absolute value of the difference between q3 and q1 are both less than a preset threshold; as well as Step 7: Input the second data set, the third data set and the fourth data set into the target classifier model for retraining and obtain a classification accuracy value q4, where q4 is greater than q1, q2 or q3 respectively. Wherein, the data volumes of the second data set, the third data set and the fourth data set are equal; The training process of the generative adversarial network model is: alternately training the generator and the discriminator of the generative adversarial network model based on the second data set and the preset random distribution noise; The generator and the discriminator of the generative adversarial network model are alternately trained based on the second data set and the preset randomly distributed noise, including: Generating step: fixing the parameters of the discriminator, inputting the preset random distribution noise into the generator to output a generated image; Discriminant step: fixing the parameters of the generator, inputting the generated image and the second data set into the discriminator to output true or false probability values; Optimization step: passing the true and false probability values to the generator, and using an optimizer to optimize the discriminator and the generator; Repeat the generating step, the discriminating step and the optimizing step until a loss function value that satisfies a preset condition is obtained, thereby obtaining a trained generator and discriminator; The step 4 further includes: inputting the preset randomly distributed noise into the trained generator to generate the further expanded image.
2. The training method of the classifier model based on deep learning according to claim 1, characterized in that: The preset randomly distributed noise is 100-dimensional random Gaussian noise.
3. The training method of the classifier model based on deep learning according to claim 1, characterized in that: The images in the second data set, the third data set, and the fourth data set all contain the classification label.
4. The training method of the classifier model based on deep learning according to claim 1, characterized in that: The step 2 further comprises: Calculating a region of interest in the original medical image in the first data set; and The region of interest is cropped from the original medical image as the region of interest image.
5. The training method of the classifier model based on deep learning according to claim 1, characterized in that: q1=q2=q3.
Citation Information
Patent Citations
Image classification method based on convolution neural network
CN107341518A
Chromosome classification method and device based on generative adversarial network
CN108763874A