CN109919890B - Data enhancement method applied to medicine identification - Google Patents

Data enhancement method applied to medicine identification Download PDF

Info

Publication number
CN109919890B
CN109919890B CN201910168797.9A CN201910168797A CN109919890B CN 109919890 B CN109919890 B CN 109919890B CN 201910168797 A CN201910168797 A CN 201910168797A CN 109919890 B CN109919890 B CN 109919890B
Authority
CN
China
Prior art keywords
picture
training
data enhancement
pictures
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910168797.9A
Other languages
Chinese (zh)
Other versions
CN109919890A (en
Inventor
袁杨
许慧
张群华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yibao Medical Technology Shanghai Co ltd
Original Assignee
Yibao Medical Technology Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yibao Medical Technology Shanghai Co ltd filed Critical Yibao Medical Technology Shanghai Co ltd
Priority to CN201910168797.9A priority Critical patent/CN109919890B/en
Publication of CN109919890A publication Critical patent/CN109919890A/en
Application granted granted Critical
Publication of CN109919890B publication Critical patent/CN109919890B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a data enhancement method applied to medicine identification, which comprises the following steps: 1. performing data enhancement on the pictures in the training set by using a traditional data enhancement technology to obtain new pictures; 2. constructing and generating a new picture generated by the countermeasure network; 3. performing data enhancement on the training set picture by using the alternative background color, and storing a new picture; 4. combining the pictures of the original training set with new pictures generated by the traditional data enhancement technology, new pictures generated by the countermeasure network and new pictures generated by the background color replacement technology into a training sample, and sending the training sample into the traditional Chinese medicine material identification artificial intelligence model for training. The correlation between the new picture and the original picture generated by the method is small, and by using the data enhancement technology, the purpose of expanding the data set can be achieved, meanwhile, the overfitting problem possibly brought by the traditional data enhancement technology is avoided, so that the artificial intelligence model based on the traditional Chinese medicine material picture data set has better generalization capability.

Description

Data enhancement method applied to medicine identification
Technical Field
The invention relates to a data enhancement method, in particular to a data enhancement method applied to medicine identification.
Background
In recent years, with the rapid development of artificial intelligence and big data technology, the application of artificial intelligence algorithm in the field of traditional Chinese medicine material identification is also increasingly popularized. Existing artificial intelligence techniques, such as image recognition techniques, use deep learning algorithms. The deep neural network has numerous parameters and a complex structure, and a large number of samples are required for model training. Common things such as automobiles and human faces can obtain a large number of picture samples from a network, but due to the particularity of the traditional Chinese medicinal materials, all the picture samples need to be obtained by shooting by self, so that the number of the samples is usually insufficient.
Data enhancement is a common data preprocessing mode in deep learning, and overfitting of a model can be well prevented by increasing the number of training samples through a data enhancement technology, so that the generalization capability of the model is improved. Conventional data enhancement techniques such as: mirror the original picture, randomly flip, translate, scale to a particular scale, etc. The enhanced picture samples have good effects in the initial stage, but because a new picture generated by the conventional data enhancement technology is formed by only slightly changing the original picture, the generated picture and the original picture still have completely consistent information contained in some parts, and as the data enhancement continues, the effect of improving the model is more and more unobvious as the number of the samples increases.
Disclosure of Invention
The invention aims to provide a data enhancement method applied to medicine identification, which can completely solve the defects of the prior art.
The purpose of the invention is realized by the following technical scheme:
a data enhancement method applied to medicine identification comprises the following steps:
1) Dividing the shot traditional Chinese medicine pictures into a training set and a test set, wherein the training set is used for training the model, and when the number of the training sets is insufficient, the training set is used for data enhancement; the test set is used for testing the generalization ability of the trained model, does not need data enhancement processing and remains unchanged;
2) Performing data enhancement on the pictures in the training set by using a traditional data enhancement technology to obtain new pictures;
3) Constructing a generated confrontation network, wherein the confrontation network consists of a generation model and a discrimination model, the generation model is used for generating a new picture, and the discrimination model is used for judging whether the generated new picture is the same as the original picture or not;
4) Using the alternative background color to enhance the data of the picture in the training set, firstly converting the picture from an RGB format to an HSV format, taking pixel values of 4 top points of the picture at the upper left, upper right, lower left and lower right, and obtaining the background color of the original picture according to the pixel values and a pixel threshold table of an HSV color interval; setting a pixel threshold interval of the background color, identifying a background area in the whole picture, setting a pixel threshold for replacing the target background color, and replacing pixel values of all pixel points in the background area with the threshold of the target background color; converting the HSV format picture into an RGB format, storing a new picture, and completing the replacement of the background color;
5) Combining the picture of the original training set with a new picture generated by the traditional data enhancement technology, a new picture generated by the countermeasure network and a new picture generated by the background color replacement technology into a training sample, and sending the training sample into the traditional Chinese medicine material identification artificial intelligence model for training.
Further, the method 1) divides the shot traditional Chinese medicine picture data into a training set and a testing set according to the ratio of 4: 1.
Further, the method for generating the countermeasure network in the method 3) is to enable the generation model and the discrimination model to play games, and the two models are enhanced simultaneously through mutual competition in the training process.
Further, traditional Chinese medicine pictures in the training set are used as training samples for generating the confrontation network.
Further, the pictures in the training set are preprocessed to ensure that the pixel of each picture is 512x512.
Compared with the prior art, the invention has the beneficial effects that: the traditional data enhancement technology only carries out linear transformation on an original picture, and the generalization capability is not strong. The traditional Chinese medicine image data enhancement technology designed by the invention has small correlation between a new image and an original image, and by using the data enhancement technology, the purpose of expanding a data set can be achieved, and meanwhile, the overfitting problem possibly brought by the traditional data enhancement technology is avoided, so that an artificial intelligence model based on the traditional Chinese medicine image data set has better generalization capability.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a flow chart of the steps of a method of generating a countermeasure network;
FIG. 3 is a flow chart of the steps of a method of replacing a background color;
FIG. 4 is a diagram of the effect of replacing background with Bulbus Fritillariae Cirrhosae;
fig. 5 is an HSV color interval pixel threshold table.
Detailed Description
The invention is further described below with reference to specific embodiments and the accompanying drawings.
As shown in fig. 1 to 5, a data enhancement method applied to medicine identification is disclosed, which is a method different from the conventional data enhancement technology. Firstly, the generated confrontation network is used for carrying out data enhancement on the picture, and different from the traditional data enhancement, the new picture generated by the generated confrontation network does not carry out linear transformation on the original picture, but uses the original picture sample as a training sample of the confrontation network, learns the characteristics of each classification of the original picture and generates new pictures which do not exist originally and meet the classification of the original picture. In addition, replacing the background color of the picture is also a good data enhancement method. Generally, picture pixel values are represented in RGB format. The HSV format is a common model for representing colors by cylindrical coordinates, can remap an RGB model, and is more visually intuitive than the RGB model. The alternative background method converts the original picture from the RGB format to the HSV format, identifies the background area, and then replaces the background area with other colors. Compared with the traditional data enhancement technology which only carries out linear transformation on an original picture, the information contained in the new picture generated by the method of the invention can be different from the original picture as much as possible, and the final generalization capability of the model can be enhanced by using the picture for training. The specific method comprises the following steps:
1. and (3) the shot traditional Chinese medicine picture data is divided into 4: a ratio of 1 is divided into a training set and a test set. The training set is used for training the model, and when the data quantity is insufficient, data enhancement processing needs to be carried out; the test set is used for testing the generalization ability of the trained model, and does not need any change.
2. The traditional data enhancement technology (such as mirroring, random inversion, translation transformation, shearing and scaling, noise increasing and other methods) is used for enhancing data of the pictures in the training set, the enhancement proportion is generally determined according to the size of the original data volume and the complexity of an artificial intelligence model, and the number of the enhanced pictures is generally 2-3 times that of the original pictures.
3. Establishing a generation countermeasure network, wherein the network consists of a generation model and a discrimination model, the generation model is used for generating a new picture, and the discrimination model is used for judging whether the generated new picture is the same as the original picture or not; the method for generating the confrontation network is characterized in that a game is played by a generating model and a distinguishing model, and the two models are enhanced simultaneously through mutual competition in the training process. Traditional Chinese medicine pictures in a training set are used as training samples for generating the antagonistic network, the pictures are pre-processed to enable the pixel of each picture to be 512x512 and then are led into the network, after the antagonistic network is generated through training, a new traditional Chinese medicine picture is generated by using a generation model in the antagonistic network.
4. And performing data enhancement on the traditional Chinese medicine picture by using the alternative background color. Firstly, converting an image from an RGB format to an HSV format, taking pixel values of 4 top left, top right, bottom left and bottom right vertexes of the image, and obtaining the background color of an original image according to the pixel values and a pixel threshold value table of an HSV color interval; setting a pixel threshold interval of the background color, identifying a background area in the whole picture, setting a pixel threshold for replacing the target background color, and replacing pixel values of all pixel points in the background area with the threshold of the target background color; and converting the HSV-format picture into an RGB format, storing a new picture, and finishing the replacement of the background color. Taking Chuan Bei as an example, see the diagram of the background effect replaced by Chuan Bei photo in FIG. 4.
5. Combining an original training set with new pictures generated by a traditional enhancement technology, a generated confrontation network and a background color replacement technology into a training sample with larger data volume, and sending the training sample into a traditional Chinese medicine material recognition artificial intelligence model for training.
Among them, generation of a countermeasure network (GAN) is a deep learning model, and is one of the most promising methods for unsupervised learning in complex distribution in recent years. The model passes through at least two modules in the framework: the mutual game learning of the Generative Model (Generative Model) and the Discriminative Model (Discriminative Model) yields a reasonably good output. In practice, a deep neural network is generally used as the generation model G and the discrimination model D. Generating a model G: continuously learning the probability distribution of real data in a training set, and aiming at converting input random noise into pictures which can be falsified, the generated pictures are better similar to the pictures in the training set. And (3) judging a model D: and judging whether one picture is a real picture or not, wherein the aim is to distinguish a false picture generated by the generated model G from a true picture in a training set.
Data enhancement using generative countermeasure networks: training the generation confrontation network, and generating a new picture sample by using the generation model after training. The specific method comprises the following steps:
1. defining the structure of the generated countermeasure network, and establishing a generation model G and a discrimination model D of the generated countermeasure network.
2. Training a discrimination model and freezing a generation model (freezing means not training, the neural network only forwards propagates, does not reversely propagate, and does not perform gradient descent on parameters of the generation model). And taking the picture of the training set as a correct sample, taking the picture generated by the generated model as a false sample, and training the discrimination model to ensure that the discrimination model correctly predicts true data as true and correctly predicts false data as false.
3. And freezing the discrimination model, and training the generation model. After the discrimination model is trained, the generated model is trained by using the predicted value as a mark, the generated model is trained to confuse the discrimination model, and the aim is to make the picture generated by the generated model be judged to be true by the discrimination model.
4. Repeating the steps 2,3 for a plurality of times.
5. The dummy data is checked manually for plausibility. If the result is reasonable, stopping training, otherwise returning to the step 2. This is a manual task and manually evaluating data is the best way to check its level of impersonation.
6. A new picture is generated using a generative model in the generative confrontation network.
Meanwhile, the artificial intelligence model in the method is a deep convolutional neural network, and increasing the number of correctly labeled picture samples can improve the generalization capability of the deep convolutional neural network, which is a common method for solving model overfitting. The deep neural network has a large number of hidden layers and a large number of parameters, and overfitting is easily caused if the number of picture samples is small during model training, namely, a good fitting effect is achieved on a training set, and a poor fitting effect is achieved on a test set, namely, generalization capability is poor. The most common way to solve the overfitting is to increase the number of training pictures.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (5)

1. A data enhancement method applied to medicine identification is characterized by comprising the following steps:
1) Dividing the shot traditional Chinese medicine pictures into a training set and a testing set, wherein the training set is used for training a model, and when the number of the training sets is insufficient, the training set is subjected to data enhancement processing; the test set is used for testing the generalization ability of the trained model, does not need data enhancement processing and remains unchanged;
2) Performing data enhancement on the pictures in the training set by using a traditional data enhancement technology to obtain new pictures;
3) Constructing a generated confrontation network, wherein the confrontation network consists of a generation model and a discrimination model, the generation model is used for generating a new picture, and the discrimination model is used for judging whether the generated new picture is the same as the original picture or not;
4) Using the alternative background color to enhance the data of the picture in the training set, firstly converting the picture from an RGB format to an HSV format, taking pixel values of 4 top points of the picture at the upper left, upper right, lower left and lower right, and obtaining the background color of the original picture according to the pixel values and a pixel threshold table of an HSV color interval; setting a pixel threshold interval of the background color, identifying a background area in the whole picture, setting a pixel threshold for replacing the target background color, and replacing pixel values of all pixel points in the background area with the threshold of the target background color; converting the HSV-format picture into an RGB format, storing a new picture, and completing the replacement of the background color;
5) Combining the pictures of the original training set with new pictures generated by the traditional data enhancement technology, new pictures generated by the countermeasure network and new pictures generated by the background color replacement technology into a training sample, and sending the training sample into the traditional Chinese medicine material identification artificial intelligence model for training.
2. The data enhancement method applied to medicine identification according to claim 1, wherein in the method 1), shot traditional Chinese medicine picture data is divided into a training set and a testing set according to a ratio of 4: 1.
3. The data enhancement method applied to medicine identification, as claimed in claim 1, wherein the method for generating the confrontation network in the method 3) is implemented by gaming the generative model and the discriminant model, and the two models are simultaneously enhanced by competing with each other in the training process.
4. The data enhancement method applied to medicine identification, according to claim 3, is characterized in that the traditional Chinese medicine pictures in the training set are used as training samples for generating the countermeasure network.
5. The method as claimed in claim 4, wherein the pictures in the training set are pre-processed to ensure that each picture has 512x512 pixels.
CN201910168797.9A 2019-03-06 2019-03-06 Data enhancement method applied to medicine identification Active CN109919890B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910168797.9A CN109919890B (en) 2019-03-06 2019-03-06 Data enhancement method applied to medicine identification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910168797.9A CN109919890B (en) 2019-03-06 2019-03-06 Data enhancement method applied to medicine identification

Publications (2)

Publication Number Publication Date
CN109919890A CN109919890A (en) 2019-06-21
CN109919890B true CN109919890B (en) 2023-01-20

Family

ID=66963502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910168797.9A Active CN109919890B (en) 2019-03-06 2019-03-06 Data enhancement method applied to medicine identification

Country Status (1)

Country Link
CN (1) CN109919890B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110675353A (en) * 2019-08-31 2020-01-10 电子科技大学 Selective segmentation image synthesis method based on conditional generation countermeasure network
CN110910467B (en) * 2019-12-03 2023-04-18 浙江啄云智能科技有限公司 X-ray image sample generation method, system and application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106570503A (en) * 2016-05-26 2017-04-19 北京羽医甘蓝信息技术有限公司 Method and system for identifying vehicle body color
WO2018028255A1 (en) * 2016-08-11 2018-02-15 深圳市未来媒体技术研究院 Image saliency detection method based on adversarial network
WO2018205467A1 (en) * 2017-05-10 2018-11-15 平安科技(深圳)有限公司 Automobile damage part recognition method, system and electronic device and storage medium
CN108921123A (en) * 2018-07-17 2018-11-30 重庆科技学院 A kind of face identification method based on double data enhancing
CN109255364A (en) * 2018-07-12 2019-01-22 杭州电子科技大学 A kind of scene recognition method generating confrontation network based on depth convolution

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106570503A (en) * 2016-05-26 2017-04-19 北京羽医甘蓝信息技术有限公司 Method and system for identifying vehicle body color
WO2018028255A1 (en) * 2016-08-11 2018-02-15 深圳市未来媒体技术研究院 Image saliency detection method based on adversarial network
WO2018205467A1 (en) * 2017-05-10 2018-11-15 平安科技(深圳)有限公司 Automobile damage part recognition method, system and electronic device and storage medium
CN109255364A (en) * 2018-07-12 2019-01-22 杭州电子科技大学 A kind of scene recognition method generating confrontation network based on depth convolution
CN108921123A (en) * 2018-07-17 2018-11-30 重庆科技学院 A kind of face identification method based on double data enhancing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于条件生成式对抗网络的数据增强方法;陈文兵等;《计算机应用》;20181110(第11期);全文 *
生成对抗网络理论模型和应用综述;徐一峰;《金华职业技术学院学报》;20170501(第03期);全文 *

Also Published As

Publication number Publication date
CN109919890A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
WO2021134871A1 (en) Forensics method for synthesized face image based on local binary pattern and deep learning
CN109614996A (en) The recognition methods merged based on the weakly visible light for generating confrontation network with infrared image
CN109558832A (en) A kind of human body attitude detection method, device, equipment and storage medium
CN111524205A (en) Image coloring processing method and device based on loop generation countermeasure network
CN110136154A (en) Remote sensing images semantic segmentation method based on full convolutional network and Morphological scale-space
CN106778852A (en) A kind of picture material recognition methods for correcting erroneous judgement
CN110009057A (en) A kind of graphical verification code recognition methods based on deep learning
US20210065367A1 (en) Automatic abnormal cell recognition method based on image splicing
CN113642621B (en) Zero sample image classification method based on generation countermeasure network
CN114998220B (en) Tongue image detection and positioning method based on improved Tiny-YOLO v4 natural environment
CN111428556A (en) Traffic sign recognition method based on capsule neural network
CN110399888B (en) Weiqi judging system based on MLP neural network and computer vision
CN111611851B (en) Model generation method, iris detection method and device
CN114067444A (en) Face spoofing detection method and system based on meta-pseudo label and illumination invariant feature
CN109919890B (en) Data enhancement method applied to medicine identification
CN111028203B (en) CNN blind image quality evaluation method based on significance
CN112686104A (en) Deep learning-based multi-vocal music score identification method
CN113159045A (en) Verification code identification method combining image preprocessing and convolutional neural network
CN112926652A (en) Fish fine-grained image identification method based on deep learning
Ueda et al. AR food changer using deep learning and cross-modal effects
CN111080754A (en) Character animation production method and device for connecting characteristic points of head and limbs
WO2022156214A1 (en) Liveness detection method and apparatus
CN110598718A (en) Image feature extraction method based on attention mechanism and convolutional neural network
CN116543001B (en) Color image edge detection method and device, equipment and storage medium
CN117495718A (en) Multi-scale self-adaptive remote sensing image defogging method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant