An infectious disease image-oriented data enhancement method and system thereof
By using the MergeMix method to augment infectious disease images, the problem of insufficient dataset size was solved, the generalization ability and image quality of the model were improved, and higher classification accuracy and robustness were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF POSTS & TELECOMM
- Filing Date
- 2022-09-07
- Publication Date
- 2026-07-24
AI Technical Summary
Due to the limited number of infectious disease image datasets, existing data augmentation models cannot effectively improve the generalization ability and robustness of the models. Furthermore, medical images often exhibit low resolution or low contrast, requiring augmentation processing to improve image quality.
The MergeMix method is used to perform data augmentation on infectious disease images, including single-sample data augmentation and multi-sample data augmentation. The processing strategy and parameters are randomly selected and trained in conjunction with the DenseNet architecture model.
It improves the robustness of images, alleviates the gradient vanishing problem, enhances feature propagation, and improves the model's generalization ability and classification accuracy.
Smart Images

Figure CN116228611B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image data processing technology, specifically relating to a method and system for enhancing image data related to infectious diseases. Background Technology
[0002] In the early stages of an infectious disease outbreak, due to insufficient datasets, deep learning methods for monitoring often suffer from inaccuracies due to overfitting. Furthermore, previous deep learning methods involved finding the most suitable model and adjusting its parameters to achieve an optimal selection, which reduced the generalization and robustness of the monitoring. Data augmentation is the solution to this problem.
[0003] Data augmentation aims to reduce overfitting in networks. By transforming training images, networks with stronger generalization abilities can be obtained, better adapting to application scenarios. Data augmentation can be divided into supervised and unsupervised methods. Supervised data augmentation can be further divided into single-sample and multi-sample data augmentation. Single-sample data augmentation includes geometric transformations, color transformations, etc. Multi-sample data augmentation differs from single-sample data augmentation; it utilizes multiple samples to generate new samples. Unsupervised data augmentation methods include two categories: those that learn the data distribution through the model and randomly generate images consistent with the training dataset distribution, represented by GANs; and those that learn a data augmentation method suitable for the current task through the model, represented by AutoAugment.
[0004] To address the issue of limited initial data samples, this invention proposes an augmentation method for small datasets. By augmenting the small dataset, the robustness of the data is improved, thereby enhancing the performance and generalization ability of the model. The proposed data augmentation method is an improvement upon supervised data augmentation, addressing the aforementioned problems. Summary of the Invention
[0005] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.
[0006] In view of the aforementioned existing problems, the present invention is proposed.
[0007] Therefore, the technical problems solved by this invention are: 1) Due to the limitations of imaging hardware, the obtained medical images often present low resolution or low contrast, and it is necessary to improve the contrast of medical images or emphasize features through enhancement processing; 2) Existing data enhancement models cannot make robust generalizations between transitions in the data distribution; 3) The number of initial data samples for existing images is relatively small.
[0008] To address the aforementioned technical problems, this invention provides a data augmentation method for infectious disease images, comprising:
[0009] Image dataset classification yields a prediction set and a training set;
[0010] The training set is processed using data augmentation methods;
[0011] The data augmentation method is defined as the MergeMix method, which includes performing single-sample data augmentation on each sample in the dataset, randomly selecting samples for multi-sample data augmentation, and summing the results of the two augmentations.
[0012] As a preferred embodiment of the data augmentation method for infectious disease images described in this invention, the classification includes dividing the image dataset according to the degree of infectious disease infection, and then evenly dividing it into a training set and a test set in a 4:1 ratio. The image data and categories are stored in torch.utils.data.Dataset format, represented as follows:
[0013] list = {image, class}
[0014] Here, list is the final data, image is the image, and class indicates the different infection levels.
[0015] As a preferred embodiment of the data augmentation method for infectious disease images described in this invention, the single-sample data augmentation is achieved by randomly selecting multiple processing strategies and randomly assigning parameters; the multi-sample data augmentation is achieved by linearly fusing multiple samples and then enhancing them using the single-sample data augmentation method.
[0016] As a preferred embodiment of the data augmentation method for infectious disease images described in this invention, the plurality of processing strategies include Randomcrop processing, Cutout processing, edgenoise processing, RandomRotation processing, and RandomHorizontalFlip processing.
[0017] As a preferred embodiment of the data augmentation method for infectious disease images described in this invention, the Randomcrop processing is represented as follows:
[0018] image=image.crop((x,y,x+new_w,y+new_h))
[0019] Where image represents the image, crop function represents the region cropped from the image, x and y represent the initial positions of the horizontal and vertical axes respectively, and new_w and new_h represent the width and height of the new image;
[0020] The Cutout process is represented as follows:
[0021] image=image.paste((x,y,x+w,y+h))
[0022] Where image represents the image, paste function represents the area filled by the image, x and y represent the initial positions of the horizontal and vertical axes respectively, and w and h represent the width and height of the area filled by the new image.
[0023] The edgenoise processing is represented as follows:
[0024] image[x left ,y,:]=0,image[x right ,y,:]=0,
[0025] image[x,y up ,:]=0,image[x,y down ,:]=0,
[0026] image[x left ,y,:]=255,image[x right ,y,:]=255,
[0027] image[x,y up ,:]=255,image[x,y down ,:]=255
[0028] Where image represents an image, and x and y represent random functions on the horizontal and vertical axes, respectively. left x right y up y down Represents random functions on the edges of the horizontal and vertical axes;
[0029] The RandomRotation process is represented as follows:
[0030] image=transform.RandomRotation(theta)(image)
[0031] Where image represents the image, transform.RandomRotation represents the rotation operation, and theta represents the rotation degree;
[0032] The RandomHorizontalFlip processing is represented as follows:
[0033] image=transform.RandomHorizontalFlip(p)(image)
[0034] Here, image represents an image, transform.randomHorizontalflip represents a flip operation, and p represents the degree of flip.
[0035] As a preferred embodiment of the data augmentation method for infectious disease images described in this invention, the random selection of multiple processing strategies is expressed as follows:
[0036] result = random
[0037] (Randomcrop,Cutout,edgenoise,RandomRotation,RandomHorizontalFlip)*n
[0038] Where, result is the result data generated by single-sample data augmentation, random is a random function, indicating that a strategy is randomly adopted, Randomcrop, Cutout, edgenoise, RandomRotation, and RandomHorizontalFilp are the single-sample data augmentation processing strategies mentioned above, and n represents the number of random layers, indicating how many times the random function is used;
[0039] The strategy is represented by randomized parameters as follows:
[0040] m = random(x, y)
[0041] Where m represents the parameter, random represents the random function, and x and y represent the upper and lower limits of the random parameter;
[0042] The image obtained after the above processing is the result of single-sample data augmentation.
[0043] As a preferred embodiment of the data augmentation method for infectious disease images described in this invention, wherein:
[0044] The multi-sample data augmentation processing strategy is expressed as follows:
[0045] image=Single(Image.blend(image1,image2,theta))
[0046] label = theta > 0.5? image1 :label image2
[0047] Where image represents the enhanced image, label represents the enhanced category, image1 and image2 represent two sample images, and label... image1 label image2 This indicates the categories of image1 and image2. Image.blend represents the image blending function, Single represents the overall function for single-sample image enhancement, theta represents the proportion of blended image synthesis, and the ? indicates that theta > 0.5, and label = label. image1 The condition label = label is not satisfied. image2 ;
[0048] The obtained images are then subjected to single-sample data augmentation to obtain the result of multi-sample data augmentation.
[0049] To address the aforementioned technical problems, the present invention also provides a data augmentation system for infectious disease images: comprising,
[0050] The dataset preprocessing module is used to classify image datasets to obtain prediction sets and training sets;
[0051] The image data augmentation module is used to augment the image data in the training set.
[0052] As a preferred embodiment of the data enhancement system for infectious disease images according to the present invention, the image data enhancement module includes:
[0053] The single-sample data augmentation module is used to perform single-sample data augmentation on each sample in the training set.
[0054] The multi-sample data augmentation module is used to randomly select training set samples for multi-sample data augmentation.
[0055] As a preferred embodiment of the data augmentation system for infectious disease images described in this invention, the system further includes:
[0056] The image training module is used to normalize the dataset and train it using the Densnet121 model to obtain the trained model.
[0057] The beneficial effects of this invention are:
[0058] (1) The present invention designs a data augmentation method for images of lung infectious diseases. The method enhances the image through a multi-layer random function. The method can be called multiple times, and the enhanced image generated each time has a different effect, thereby improving the robustness of the image.
[0059] (2) The method of the present invention is based on the Densenet structure model, which can alleviate gradient vanishing, enhance feature propagation, and reduce overfitting caused by a small training set.
[0060] (3) This invention provides a system for data augmentation of infectious disease images. The system has a simple structure, low time complexity, and the trained model can achieve intelligent classification of images, thereby enabling effective prediction and analysis of infectious diseases. Attached Figure Description
[0061] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0062] Figure 1 This is a basic flowchart of a data augmentation method for infectious disease images provided in Embodiment 1 of the present invention;
[0063] Figure 2 This is a diagram showing the effect of the single-sample data augmentation strategy provided in Embodiment 1 of the present invention before Cutout processing;
[0064] Figure 3 This is a diagram showing the effect of the single-sample data augmentation strategy Cutout provided in Embodiment 1 of the present invention after processing;
[0065] Figure 4 The image shows the effect of edgenoise, a commonly used single-sample data augmentation strategy, on lung CT images.
[0066] Figure 5 This is an image showing the effect of the edgenoise single-sample data augmentation strategy provided in Embodiment 1 of the present invention on processing lung CT images;
[0067] Figure 6 This is a system diagram of a data augmentation method for infectious disease images provided in Embodiment 2 of the present invention;
[0068] Figure 7 These are normal lung images from the dataset of this invention;
[0069] Figure 8These are images of pneumonia collected in the dataset of this invention. Detailed Implementation
[0070] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0071] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0072] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0073] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.
[0074] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0075] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0076] The evaluation indicators for the experimental results in this invention are as follows:
[0077] TP: Predicted to be non-infected, and actually is;
[0078] FP: Predicted as non-infected, but actually infected;
[0079] TN: Predicted to be infected, and actually is infected;
[0080] FN: Predicted as infected, but actually not infected;
[0081] Recall, also known as recall or sensitivity, is the ratio of the predicted true value to the sum of the predicted true value and the predicted false negatives. The formula is as follows:
[0082] Recall=Sensitivity=TP / TP+FN
[0083] Precision, or accuracy, represents the relationship between the true predicted value and the all-positive predicted value. The formula is as follows:
[0084] Precision = TP / TP + FP
[0085] The F1-score is a comprehensive measure of model accuracy that combines precision and recall. It is twice the product of the precision and recall metrics, expressed by the following formula:
[0086] F1-score=2*precision*Recall / Precision+Recall
[0087] Accuracy is the most important metric for the results of our deep learning classifier. It is simply the sum of true and true negative values divided by the sum of the components of the confusion matrix. The components of the confusion matrix must be calculated as follows:
[0088] Accuracy = TP + TN / TP + FP + FN + TN
[0089] AUC is defined as the area under the ROC curve and the coordinate axes, ranging from 0.5 to 1. The closer the AUC is to 1.0, the higher the reliability of the detection method. In the ROC space, the false positive rate (FPR) is defined on the X-axis, and the true positive rate (TPR) is defined on the Y-axis. The formulas are as follows:
[0090] TPR: The percentage of samples that are actually positive that are correctly identified as positive.
[0091] TPR = TP / TP + FN
[0092] FPR: The percentage of samples that are actually negative but are incorrectly identified as positive.
[0093] FPR = FP / FP + TN
[0094] Example 1
[0095] Reference Figures 1-5 As one embodiment of the present invention, a data augmentation method for infectious disease images is provided, comprising:
[0096] S1: Image dataset classification yields a prediction set and a training set;
[0097] A1: The image dataset is divided according to the degree of infectious disease infection. The first category is 0, the second category is 1, and so on, with the nth category being n-1.
[0098] A2: Divide the dataset evenly into training and test sets in a 4:1 ratio, and store the image data and categories in torch.utils.data.Dataset format, represented as follows:
[0099] list = {image, class}
[0100] Here, list is the final data, image is the image, and class indicates the different infection levels.
[0101] It should be noted that torch.utils.data.Dataset is an abstract dataset class, which is the parent class of all other dataset classes. When inheriting from it, you need to override the methods __len__ and __getitem__. __len__ is the method that provides the size of the dataset, and __getitem__ is the method that can find the data by its index.
[0102] S2: Process the training set using data augmentation methods;
[0103] The data augmentation method is defined as the MergeMix method, which includes performing single-sample data augmentation on each sample in the dataset, randomly selecting samples for multi-sample data augmentation, and summing the results of the two augmentations.
[0104] Further single-sample data augmentation includes:
[0105] B1: Randomly select from multiple processing strategies;
[0106] Specifically, random selection is represented as:
[0107] result = random
[0108] (Randomcrop,Cutout,edgenoise,RandomRotation,RandomHorizontalFlip)*n
[0109] Where, result is the result data generated by single-sample data augmentation, random is a random function, indicating that a strategy is randomly adopted, Randomcrop, Cutout, edgenoise, RandomRotation, and RandomHorizontalFilp are the single-sample data augmentation processing strategies mentioned above, and n represents the number of random layers, indicating how many times the random function is used;
[0110] More specifically, the single-sample data augmentation strategies are expressed as follows:
[0111] Randomcrop is represented as:
[0112] image=image.crop((x,y,x+new_w,y+new_h))
[0113] Where image represents the image, crop function represents the region cropped from the image, x and y represent the initial positions of the horizontal and vertical axes respectively, and new_w and new_h represent the width and height of the new image;
[0114] It should be noted that Randomcrop is a method of single-sample data augmentation that can crop an image into random patches;
[0115] Cutout is represented as:
[0116] image=image.paste((x,y,x+w,y+h))
[0117] Where image represents the image, paste function represents the area filled by the image, x and y represent the initial positions of the horizontal and vertical axes respectively, and w and h represent the width and height of the area filled by the new image.
[0118] It should be noted that Cutout is a method in single-sample data augmentation that fills parts of an image with blanks, using a rectangle as the erasure space and a fixed-size matrix to occlude the image. Within the rectangular region, all values are set to 0. Figure 2 , Figure 3 The images show the before and after effects of the Cutout process.
[0119] edgenoise is represented as:
[0120] image[xleft ,y,:]=0,image[x right ,y,:]=0,
[0121] image[x,y up ,:]=0,image[x,y down ,:]=0,
[0122] image[x left ,y,:]=255,image[x right ,y,:]=255,
[0123] image[x,y up ,:]=255,image[x,y down ,:]=255
[0124] Where image represents an image, and x and y represent random functions on the horizontal and vertical axes, respectively. left x right y up y down Represents random functions on the edges of the horizontal and vertical axes;
[0125] It should be noted that edgenoise is a single-sample data augmentation method, specifically designed for lung CT images based on commonly used random noise. It generates salt-and-pepper noise at the image edges, which is evident in its effectiveness. Figure 4 , Figure 5 The diagram shows a comparison between commonly used random noise methods and the edgenoise method of this invention.
[0126] RandomRotation is represented as:
[0127] image=transform.RandomRotation(theta)(image)
[0128] Where image represents the image, transform.RandomRotation represents the rotation operation, and theta represents the rotation degree;
[0129] It should be noted that RandomRotation is a method for single-sample data augmentation that can rotate images.
[0130] RandomHorizontalFlip is represented as:
[0131] image=transform.RandomHorizontalFlip(p)(image)
[0132] Where image represents the image, transform.randomHorizontalflip represents the flip operation, and p represents the degree of flip;
[0133] It should be noted that RandomRotation is a method for single-sample data augmentation that can flip images.
[0134] B2: Randomize the parameters of the strategy;
[0135] Furthermore, the strategy is represented by randomized parameters as follows:
[0136] m = random(x, y)
[0137] Where m represents the parameter, random represents the random function, and x and y represent the upper and lower limits of the random parameter;
[0138] B3: Obtain the single-sample image data augmentation result.
[0139] Furthermore, multi-sample image data augmentation includes:
[0140] C1: Linear fusion of multiple samples;
[0141] Furthermore, two images are randomly selected from the dataset, and new data is generated through linear fusion, specifically as follows:
[0142] image=Single(Image.blend(image1,image2,theta))
[0143] label = theta > 0.5? image1 :label image2
[0144] Where image represents the enhanced image, label represents the enhanced category, image1 and image2 represent two sample images, and label... image1 label image2 This indicates the categories of image1 and image2. Image.blend represents the image blending function, Single represents the overall function for single-sample image enhancement, theta represents the proportion of blended image synthesis, and the ? indicates that theta > 0.5, and label = label. image1 The condition label = label is not satisfied. image2 ;
[0145] C2: The fused result is then enhanced using a single-sample data augmentation method to obtain the multi-sample image data augmentation result.
[0146] S3: Integrate the results of single-sample data augmentation with the results of multi-sample data augmentation to obtain the final result.
[0147] Example 2
[0148] Reference Figure 6 In another embodiment of the present invention, a data augmentation method system for infectious disease images is provided, comprising a dataset preprocessing module, an image data augmentation module, and an image training module;
[0149] S1: Input the infectious disease image dataset into the dataset preprocessing module;
[0150] Furthermore, in the dataset preprocessing module, the images are divided according to the degree of infectious disease infection, and then evenly divided into training set and test set in a 4:1 ratio. The classified image data and categories are stored in torch.utils.data.Dataset format.
[0151] S2: Input the preprocessed training set into the image data augmentation module;
[0152] Furthermore, this module includes single-sample image data augmentation and multi-sample image data augmentation, processing the input image using the data augmentation method of Example 1;
[0153] In the single-sample data augmentation module, multiple processing strategies and parameters are randomly selected. In the multi-sample data augmentation module, multiple samples are linearly fused and then augmented using the single-sample data augmentation method.
[0154] S3: Integrate the results of single-sample data augmentation with the results of multi-sample data augmentation to obtain the final result.
[0155] S4: Input the augmented sample data results into the image training module;
[0156] Furthermore, the dataset is normalized.
[0157] It should be noted that normalization is performed to process the data better by mapping all data to the range of 0-1. The normalized dataset is then used to train the Densnet121 model to obtain the final trained model.
[0158] S5: Input the image data to be classified into the training model to obtain the classification result.
[0159] Example 3
[0160] Reference Figures 7-8 As one embodiment of the present invention, this embodiment is scientifically demonstrated through practical application in order to verify the beneficial effects of the method of the present invention.
[0161] Figure 7 , Figure 8 Images of normal lungs and pneumonia are shown separately. In this embodiment, 80% of the pneumonia images and normal images are used as the training set, and the remaining pneumonia images and normal images are used as the test set. Experiments were conducted on the DenseNet169 network model, and the performance of the initial model and the model using the data augmentation method of this invention were compared. The results are shown in Table 1:
[0162] Table 1 Comparison of MergeMix method performance on Densenet169 model
[0163]
[0164] As can be seen, the method of this invention can effectively improve the performance of detection metrics such as recall, precision, F1, accuracy, and AUC on the Densenet169 network model, demonstrating the effectiveness of the method of this invention.
[0165] Example 4
[0166] This embodiment differs from the previous two embodiments in that, in order to verify and illustrate the technical effects used in this method, this embodiment uses a traditional technical solution to conduct a comparative test with the method of the present invention, and compares the test results using scientific demonstration methods to verify the real effect of this method.
[0167] This embodiment compares the performance of the present invention's MergeMix method with common image flipping enhancement methods MergeMixEN and MergeMixRE, which uses random parameters in the MLRandom part of MergeMix to be changed to random increments and random decrements, on ResNet50 and DenseNet121 network models. The results are shown in Tables 2 and 3, respectively.
[0168] Table 2 Comparison of the effects of different enhancement methods on the ResNet50 network model.
[0169]
[0170] Table 3 Comparison of the effects of different enhancement methods on the Densenet121 network model.
[0171]
[0172] The comparison results in Tables 2 and 3 show that, regardless of the network model used, the augmentation method of this invention achieves better technical results in every metric compared to other augmentation methods. This indicates that the data augmentation method MergeMix proposed in this invention can effectively reduce data augmentation time, combining single-sample and multi-sample data augmentation methods, and employing parameter randomization to improve the method's generalization and robustness. Compared with conventional augmentation methods, the MergeMix method exhibits superior performance in the classification experiment of lung infectious disease images. Experiments show that MergeMix can improve the recognition of important details and targets in images, thus facilitating the improvement of classification augmentation effects for lung infectious disease images.
[0173] It should be recognized that embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can be implemented using standard programming techniques—including a non-transitory computer-readable storage medium configured with a computer program, wherein such a storage medium causes the computer to operate in a specific and predefined manner—according to the methods and drawings described in the specific embodiments. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).
[0174] Furthermore, the procedures described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by the context. The procedures described herein (or variations and / or combinations thereof) may be executed under the control of one or more computer systems configured with executable instructions, and may be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program comprises a plurality of instructions executable by one or more processors.
[0175] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques described herein, the invention also includes the computer itself. A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the invention, the converted data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on a display.
[0176] As used herein, the terms “component,” “module,” “system,” etc., are intended to refer to a computer-related entity, which may be hardware, firmware, a combination of hardware and software, software, or running software. For example, a component may be, but is not limited to, a process running on a processor, a processor, an object, an executable file, a running thread, a program, and / or a computer. As an example, an application running on a computing device and the computing device itself can both be components. One or more components may reside in a running process and / or thread, and components may be located in a single computer and / or distributed among two or more computers. Furthermore, these components are capable of execution from various computer-readable media having various data structures thereon. These components may communicate locally and / or remotely via signals, such as based on one or more data packets (e.g., data from a component that interacts with a local system, another component in a distributed system, and / or signals that interact with other systems via a network such as the Internet).
[0177] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A data augmentation method for infectious disease images, characterized in that, include: Image dataset classification yields a prediction set and a training set; The classification includes dividing the image dataset according to the degree of infectious disease infection, then evenly dividing it into training and test sets in a 4:1 ratio, and storing the image data and categories in torch.utils.data.Dataset format, as follows: list={image,class} Here, list is the final data, image is the image, and class indicates the different infection levels; The training set is processed using data augmentation methods; The data augmentation method is defined as the MergeMix method, which includes performing single-sample data augmentation on each sample in the training set, randomly selecting samples for multi-sample data augmentation, and summing the results of the two augmentations. The single-sample data augmentation is achieved by randomly selecting multiple processing strategies and randomizing parameters; the multi-sample data augmentation is achieved by linearly fusing multiple samples and then enhancing them using the single-sample data augmentation method. The multiple processing strategies include Randomcrop processing, Cutout processing, edgenoise processing, RandomRotation processing, and RandomHorizontalFlip processing; The random selection of multiple processing strategies is represented as follows: result=random (Randomcrop,Cutout,edgenoise,RandomRotation,RandomHorizontalFlip)*n Where, result is the result data generated by single-sample data augmentation, random is a random function, indicating that a strategy is randomly adopted, Randomcrop, Cutout, edgenoise, RandomRotation, and RandomHorizontalFilp are the single-sample data augmentation processing strategies mentioned above, and n represents the number of random layers, indicating how many times the random function is used; The strategy is represented by randomized parameters as follows: m=random(x,y) Where m represents the parameter, random represents the random function, and x and y represent the upper and lower limits of the random parameter; The image obtained after the above processing is the single-sample data augmentation result; The multi-sample data augmentation processing strategy is expressed as follows: image=Single(Image.blend(image1,image2,theta)) label=theta>0.5?label image1 :label image2 Where image represents the enhanced image, label represents the enhanced category, image1 and image2 represent two sample images, and label... image1 label image2 This indicates the categories of image1 and image2, image.blend represents the image blending function, Single represents the overall function for single-sample data augmentation, theta represents the proportion of blended image synthesis, and ? indicates that theta > 0.5, label = label image1 The condition label = label is not satisfied. image2 .
2. The data augmentation method for infectious disease images as described in claim 1, characterized in that: include, The Randomcrop process is represented as follows: image = image.crop((x, y, x+new_w, y +new_h)) Where image represents the image, crop function represents the region cropped from the image, x and y represent the initial positions of the horizontal and vertical axes respectively, and new_w and new_h represent the width and height of the new image; The Cutout process is represented as follows: image = image.paste((x, y, x+ w, y + h)) Where image represents the image, paste function represents the area filled by the image, x and y represent the initial positions of the horizontal and vertical axes respectively, and w and h represent the width and height of the area filled by the new image. The edgenoise processing is represented as follows: Image[x left ,y,:]=0,image[x right ,y,:]=0, Image[x,y up ,:]=0,image[x,y down ,:]=0, Image[x left ,y,:]=255,image[x right ,y,:]=255, Image[x,y up ,:]=255,image[x,y down ,:]=255, Where image represents an image, and x and y represent random functions on the horizontal and vertical axes, respectively. left x right y up y down Represents random functions on the edges of the horizontal and vertical axes; The RandomRotation process is represented as follows: image=transform.RandomRotation(theta)(image) Where image represents the image, transform.RandomRotation represents the rotation operation, and theta represents the rotation degree; The RandomHorizontalFilp processing is represented as follows: image=transform.RandomHorizontalFlip(p)(image) Here, image represents an image, transform.RandomHorizontalFilp represents a flip operation, and p represents the degree of flip.
3. A data augmentation system for infectious disease images, characterized in that: The data augmentation method for infectious disease images according to claim 1 includes, The dataset preprocessing module is used to classify image datasets to obtain prediction sets and training sets; The image data augmentation module is used to augment the image data in the training set.
4. The data augmentation system for infectious disease images as described in claim 3, characterized in that, The image data enhancement module includes: The single-sample data augmentation module is used to perform single-sample data augmentation on each sample in the training set. The multi-sample data augmentation module is used to randomly select training set samples for multi-sample data augmentation.
5. The data augmentation system for infectious disease images as described in claim 3, characterized in that: The system also includes, The image training module is used to normalize the dataset and train it using the Densnet121 model to obtain the trained model.
Citation Information
Patent Citations
Image data augmentation strategy selection method and system
CN111275129A
Information processing method and model training method for chest X-ray film recognition
CN113076993A
Tongue picture constitution distinguishing method based on deep learning
CN114882995A