Processing Method, Device, and Processing Equipment for an Image Generation Model of Intracerebral Hemorrhage Samples
By acquiring cerebral hemorrhage samples images, configuring tags, performing data augmentation and image erasing, high-quality cerebral hemorrhage images are generated, which solves the problem of insufficient training samples in the prior art and improves the training accuracy of the cerebral hemorrhage prediction model.
Patent Information
- Application Number
- CN202510360904.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-26
AI Technical Summary
In the prior art, when training cerebral hemorrhage prediction models, high-quality training samples are lacking, especially for rare cases of cerebral hemorrhage, it is difficult to generate diverse and high-quality samples.
A method for processing the image generation model of cerebral hemorrhage samples is proposed. By acquiring cerebral hemorrhage samples images, configuring tags, performing data augmentation, image erasing and model training, high-quality cerebral hemorrhage images are generated.
This method can generate better sample quality, meet the high-quality training sample requirements of the cerebral hemorrhage prediction model, improve the training accuracy of the model, and meet the high-quality application needs of clinical medical staff for cerebral hemorrhage prediction.
Smart Images

Figure CN119889606B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical technology, and particularly to a processing method, device, and processing equipment for an intracerebral hemorrhage sample image generation model. Background Art
[0002] With the development of technology, in clinical work, attempts have been made to assist in the diagnosis of intracerebral hemorrhage through artificial intelligence (AI), and based on computed tomography (CT) images and / or magnetic resonance imaging (MRI) images to predict the presence of intracerebral hemorrhage and locate the position of intracerebral hemorrhage. Corresponding to the application of the intracerebral hemorrhage prediction model, it may involve the configuration work of training samples.
[0003] For the traditional model training mechanism, usually, sample images of intracerebral hemorrhage cases are manually configured to meet the requirements of model training. However, in actual situations, intracerebral hemorrhage cases are usually scarce, especially some specific types of intracerebral hemorrhage cases are particularly rare, which leads to a problem of lack of samples.
[0004] In this case, obtaining a large number of diverse intracerebral hemorrhage samples through AI can obviously effectively expand the training samples, enabling the intracerebral hemorrhage prediction model to come into contact with more samples during training, so that the model has better generalization ability and prediction accuracy for different types of intracerebral hemorrhage cases.
[0005] The inventors of this application found that the existing related technologies generally focus on improving the prediction accuracy of the prediction model from aspects such as model architecture and loss function, while how to better configure training samples is a place that is habitually ignored. This situation is more prominent when introducing AI to generate training samples, and the general training sample configuration scheme cannot well adapt to the training sample configuration scenario of the intracerebral hemorrhage prediction model. Summary of the Invention
[0006] This application provides a processing method, device, and processing equipment for an intracerebral hemorrhage sample image generation model. On the basis of introducing AI to generate intracerebral hemorrhage images for model training, a more novel intracerebral hemorrhage sample image generation model configuration scheme that can promote better sample quality is proposed. Thus, it can meet the high-quality training sample configuration requirements of the intracerebral hemorrhage prediction model, and further can promote the training of a higher-precision intracerebral hemorrhage prediction model to meet the high-quality application requirements of clinical medical staff for the auxiliary function service of intracerebral hemorrhage prediction.
[0007] In a first aspect, the present application provides a method for processing a cerebral hemorrhage sample image generation model, the method comprising:
[0008] Obtain a first cerebral hemorrhage sample image, where the first cerebral hemorrhage sample image specifically includes at least one of a computed tomography image and a magnetic resonance imaging image;
[0009] Configure a corresponding first label for the first cerebral hemorrhage sample image, where the first label is used to indicate the cerebral hemorrhage area in the first cerebral hemorrhage sample image;
[0010] Perform a first data augmentation operation on the first label, and use the second label after the shape change as prior knowledge for generating a lesion image;
[0011] Perform an image erasure operation on the cerebral hemorrhage area in the first cerebral hemorrhage sample image to obtain a second cerebral hemorrhage sample image;
[0012] Based on the first cerebral hemorrhage sample image, the second cerebral hemorrhage sample image, and the second label, train a cerebral hemorrhage sample image generation model, where the cerebral hemorrhage sample image generation model is used to generate a corresponding cerebral hemorrhage image according to the normal image and the preset label input into the model.
[0013] In a second aspect, the present application provides a processing device for a cerebral hemorrhage sample image generation model, the device comprising:
[0014] An image acquisition unit for obtaining a first cerebral hemorrhage sample image, where the first cerebral hemorrhage sample image specifically includes at least one of a computed tomography image and a magnetic resonance imaging image;
[0015] A label configuration unit for configuring a corresponding first label for the first cerebral hemorrhage sample image, where the first label is used to indicate the cerebral hemorrhage area in the first cerebral hemorrhage sample image;
[0016] A data augmentation unit for performing a first data augmentation operation on the first label, and using the second label after the shape change as prior knowledge for generating a lesion image;
[0017] An image erasure unit for performing an image erasure operation on the cerebral hemorrhage area in the first cerebral hemorrhage sample image to obtain a second cerebral hemorrhage sample image;
[0018] A model training unit for training a cerebral hemorrhage sample image generation model based on the first cerebral hemorrhage sample image, the second cerebral hemorrhage sample image, and the second label, where the cerebral hemorrhage sample image generation model is used to generate a corresponding cerebral hemorrhage image according to the normal image and the preset label input into the model.
[0019] In a third aspect, the present application provides a processing device, including a processor and a memory. A computer program is stored in the memory. When the processor calls the computer program in the memory, it executes the method provided in the first aspect of the present application or any possible implementation manner of the first aspect of the present application.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the method provided in the first aspect of the present application or any possible implementation manner of the first aspect of the present application.
[0021] From the above content, it can be concluded that the present application has the following beneficial effects:
[0022] Aiming at the training sample configuration target of the intracerebral hemorrhage prediction model, the present application obtains a first intracerebral hemorrhage sample image, configures a corresponding first label for the first intracerebral hemorrhage sample image. The first label is used to indicate the intracerebral hemorrhage area in the first intracerebral hemorrhage sample image. A first data enhancement operation is performed on the first label, and the second label after shape change is used as prior knowledge for generating lesion images. An image erasing operation is performed on the intracerebral hemorrhage area in the first intracerebral hemorrhage sample image to obtain a second intracerebral hemorrhage sample image. Based on the first intracerebral hemorrhage sample image, the second intracerebral hemorrhage sample image, and the second label, an intracerebral hemorrhage sample image generation model is trained. The intracerebral hemorrhage sample image generation model is used to generate corresponding intracerebral hemorrhage images according to the normal images and preset labels input into the model. In this way, on the basis of introducing AI to generate intracerebral hemorrhage images for the training samples required for training the model, a more novel intracerebral hemorrhage sample image generation model configuration scheme that can promote obtaining better sample quality is proposed. Thereby, the high-quality training sample configuration requirements of the intracerebral hemorrhage prediction model can be met, and further, a higher-precision intracerebral hemorrhage prediction model can be trained to meet the high-quality application requirements of clinical medical staff for the auxiliary function service of intracerebral hemorrhage prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0024] Figure 1 It is a schematic flowchart of a processing method of an intracerebral hemorrhage sample image generation model of the present application;
[0025] Figure 2 It is a schematic structural diagram of a processing device of an intracerebral hemorrhage sample image generation model of the present application;
[0026] Figure 3 This is a schematic structural diagram of the processing device of the present application. Detailed implementation manners
[0027] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0028] Terms such as "first" and "second" in the specification, claims and above-mentioned drawings of the present application are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order different from that shown or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or modules does not necessarily have to be limited to those steps or modules clearly listed, but may include other steps or modules not clearly listed or inherent to these processes, methods, products or devices. In the present application, the naming or numbering of steps does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The named or numbered process steps can be changed in the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0029] The division of modules in the present application is a logical division. In actual implementation, there may be other division methods. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections to each other may be through some interfaces. The indirect couplings or communication connections between modules may be electrical or other similar forms, which are not limited in the present application. And the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed to multiple circuit modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present application.
[0030] Before introducing the processing method of the cerebral hemorrhage sample image generation model provided by the present application, the background content involved in the present application will be introduced first.
[0031] The processing method, device, and computer-readable storage medium for the intracerebral hemorrhage sample image generation model provided by this application can be applied to a processing device. On the basis of introducing AI to generate intracerebral hemorrhage images for training the model, a more novel configuration scheme for the intracerebral hemorrhage sample image generation model that can promote better sample quality is proposed. Thus, the high-quality training sample configuration requirements of the intracerebral hemorrhage prediction model can be met, and then a higher-precision intracerebral hemorrhage prediction model can be trained to meet the high-quality application requirements of clinical medical staff for the auxiliary function service of intracerebral hemorrhage prediction.
[0032] The processing method of the intracerebral hemorrhage sample image generation model mentioned in this application can be executed by a processing device for the intracerebral hemorrhage sample image generation model, or different types of processing devices such as a server, a physical host, or a user equipment (UE) that integrates the processing device for the intracerebral hemorrhage sample image generation model. Among them, the processing device for the intracerebral hemorrhage sample image generation model can be implemented in hardware or software. The UE can specifically be a terminal device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, or a personal digital assistant (PDA). The processing device can be set up in the form of a device cluster.
[0033] It can be understood that for a processing device that executes the processing method of the intracerebral hemorrhage sample image generation model of this application, or a processing device that runs the application service corresponding to the processing method of the intracerebral hemorrhage sample image generation model of this application, considering that the focus of the solution of this application is on the training work of the intracerebral hemorrhage sample image generation model, it only needs to have the corresponding data processing ability.
[0034] If the processing device also needs to be further involved in the actual application of the intracerebral hemorrhage sample image generation model, the intracerebral hemorrhage prediction model can be trained with the training samples generated by the intracerebral hemorrhage sample image generation model. In this case, the processing device can be split into a first device for training the intracerebral hemorrhage sample image generation model and a second device for training the intracerebral hemorrhage prediction model.
[0035] If it is further involved in the actual application of the intracerebral hemorrhage prediction model, it needs to be combined with clinical applications. It can be deployed on a device dedicated to intracerebral hemorrhage diagnosis work, or on a device that is responsible for other work in addition to intracerebral hemorrhage diagnosis work (such as other clinical diagnoses or even routine office work).
[0036] At this time, similar to the above situation, the training and application of the intracerebral hemorrhage prediction model can also be executed by different device parts at this time. For example, the training of the intracerebral hemorrhage sample image generation model can be performed by the first server in the background, and then the training of the intracerebral hemorrhage prediction model can be performed by the second server. Then, the intracerebral hemorrhage prediction model is sent to the foreground (doctor side) through remote service for specific application.
[0037] Next, the processing method of the intracerebral hemorrhage sample image generation model provided by the present application will be introduced.
[0038] First, refer to Figure 1 , Figure 1 FIG. shows a schematic flowchart of a processing method of the intracerebral hemorrhage sample image generation model of the present application. The processing method of the intracerebral hemorrhage sample image generation model provided by the present application may specifically include the following steps S101 to step S105:
[0039] Step S101, obtain a first intracerebral hemorrhage sample image, where the first intracerebral hemorrhage sample image specifically includes at least one of a computed tomography image and a magnetic resonance imaging image;
[0040] It can be understood that the acquisition process of the first intracerebral hemorrhage sample image here is usually the acquisition process of ready-made images. It can be either manual input of images, receiving images sent by other devices, or reading local images, all of which are possible.
[0041] Of course, it does not exclude the possibility of real-time image acquisition when applying the solution of the present application in actual situations, and it can be adjusted according to the flexible application requirements in actual situations.
[0042] For the first intracerebral hemorrhage sample image, it can only contain a computed tomography image (i.e., CT image), or only contain a magnetic resonance imaging image (i.e., MRI image), or contain both, which can be adjusted according to actual needs. These images can also be referred to as images or slices in actual situations.
[0043] In addition, it should be noted that for the convenience of description, the intracerebral hemorrhage sample images in different links are distinguished by prefixes such as the first and the second, and the same applies to the subsequent labels and data augmentation operations.
[0044] Step S102, configure a corresponding first label for the first intracerebral hemorrhage sample image, where the first label is used to indicate the intracerebral hemorrhage area in the first intracerebral hemorrhage sample image;
[0045] It can be understood that corresponding to the model training objective, a corresponding first label needs to be configured for the basic first intracerebral hemorrhage sample image. This first label can also be understood in terms of the annotation result and is used to indicate the intracerebral hemorrhage area in the first intracerebral hemorrhage sample image.
[0046] For the processing of the label, it can be completed through manual or automatic annotation tools and adjusted according to actual needs. Among them, the automatic annotation tool needs to pre-configure the corresponding automatic annotation logic / strategy during use.
[0047] As an example, the first intracerebral hemorrhage sample image can be denoted as x (i) 。
[0048] Step S103, perform a first data augmentation operation on the first label, and use the second label after the shape change as prior knowledge for generating the lesion image;
[0049] After completing the label processing of the first intracerebral hemorrhage sample image, the first data augmentation operation involved in this application can be carried out on it.
[0050] It can be seen that the purpose here is to change the shape of the first label configured previously. By transforming the shape in this way, different second labels are obtained, forming a richer label shape / content. When used as prior knowledge in the subsequent training process of the intracerebral hemorrhage sample image generation model, it can provide a richer sample volume.
[0051] In addition, it can be seen that the label involved in this application indicates the lesion, that is, the intracerebral hemorrhage area, in the corresponding image in the form of a specific shape at the image level, typically such as a mask (Mask).
[0052] As an exemplary embodiment here, the first data augmentation operation may specifically include at least two of the following methods:
[0053] Do not perform any transformation on the original label shape;
[0054] Adjust the original label shape to the smallest rectangle containing the original label shape;
[0055] Adjust the original label shape to contain the center point of the original label shape;
[0056] Adjust the original label shape to the convex hull of the original label shape.
[0057] For the four specific data augmentation operations of the first data augmentation operation shown here, it can be understood that if the label shape is not transformed, it is to let the model generate a consistent lesion area according to the label shape, which is for the subsequent segmentation task of the generated data; if the label shape is the smallest rectangle, it is to let the generated data be used for the subsequent detection task; if the label shape is the center point, it is to let the generated data be used for the subsequent lesion localization task; if the label shape is the convex hull, it is to generate lesions of arbitrary shapes within the specified range.
[0058] From this, it can be obtained that in the exemplary embodiments here, the four specific types of the first data augmentation operation can effectively strengthen the training effect of the subsequent intracerebral hemorrhage sample image generation model in different aspects, and thus can effectively promote the acquisition of an intracerebral hemorrhage sample image generation model with better prediction effect.
[0059] As an example, the second label can be denoted as y (i) 。
[0060] Step S104, perform an image erasing operation on the intracerebral hemorrhage area in the first intracerebral hemorrhage sample image to obtain a second intracerebral hemorrhage sample image;
[0061] It can be understood that the role of the intracerebral hemorrhage sample image generation model to be trained in this application is to generate intracerebral hemorrhage images corresponding to more abundant intracerebral hemorrhage cases. For the training of this model, in the process of model training in this application, it may involve inputting the first intracerebral hemorrhage sample image with the intracerebral hemorrhage area erased, and letting the model try to predict the intracerebral hemorrhage area before erasure under the guidance of the position indicated by the label during the training process. In this way, through continuous training, an intracerebral hemorrhage sample image generation model that can be put into actual use is finally obtained.
[0062] In this case, an image erasing operation can be performed on the intracerebral hemorrhage area in the first intracerebral hemorrhage sample image obtained previously to meet the requirements of model training.
[0063] Among them, the erasure of the intracerebral hemorrhage area in the image can be performed manually or automatically by a device. In the automatic erasure operation, specifically, the image area indicated by the label can be erased to achieve the purpose of erasing the intracerebral hemorrhage area.
[0064] For the convenience of understanding, this image erasing operation can also be referred to as image cropping.
[0065] As an example, the intracerebral hemorrhage area can be filled with all 0 values.
[0066] The tags relied on in the automatic erasure operation are usually the second tags after the first data augmentation operation. In the above exemplary embodiment, the second tag may become the center point. In this case, the automatic erasure operation can be performed according to the first tag before the shape change.
[0067] As an example, the second cerebral hemorrhage sample image with the cerebral hemorrhage area erased can be denoted as x_ (i) .
[0068] Step S105: Based on the first cerebral hemorrhage sample image, the second cerebral hemorrhage sample image, and the second tag, train a cerebral hemorrhage sample image generation model, where the cerebral hemorrhage sample image generation model is used to generate corresponding cerebral hemorrhage images according to the normal images and preset tags input into the model.
[0069] After obtaining the original first cerebral hemorrhage sample image, the second cerebral hemorrhage sample image with the cerebral hemorrhage area erased, and the second tag with the changed label shape, the specific model training session can be carried out. Among them, the original first cerebral hemorrhage sample image is the cerebral hemorrhage image that the model theoretically needs to predict / generate, the second cerebral hemorrhage sample image with the cerebral hemorrhage area erased corresponds to the normal image in the actual use process of the model (the image does not contain the cerebral hemorrhage area, and is used for the model to add lesions and fill the cerebral hemorrhage area), and the second tag is used as an indication of the location where the model needs to predict the cerebral hemorrhage area.
[0070] In this way, after completing the training of the model, a cerebral hemorrhage sample image generation model that can be put into actual use can be obtained, and rich training samples involving different cerebral hemorrhage cases can be generated when training a cerebral hemorrhage prediction model in the future.
[0071] Among them, for the model architecture adopted by the cerebral hemorrhage sample image generation model, as well as for the model training architecture and loss function adopted by the cerebral hemorrhage sample image generation model during the model training process, either existing solutions can be adopted, or corresponding optimization and improvement can be carried out on the basis of existing solutions, or self-developed and novel solutions can be adopted, which are all possible in actual situations.
[0072] As an example, the number of second cerebral hemorrhage sample images can be N, which are divided into a training set, a validation set, and a test set according to a ratio of 8:1:1. The other first cerebral hemorrhage images and second tags are divided into the training set, the validation set, and the test set along with the corresponding second cerebral hemorrhage sample images. Among them, the training set is used to train the model, the validation set is used to select the best-performing model from the trained models, and the test set is used to evaluate the performance of the model.
[0073] From Figure 1As can be seen from the illustrated embodiments, for the training sample configuration objective of the intracerebral hemorrhage prediction model, the present application obtains a first intracerebral hemorrhage sample image, configures a corresponding first label for the first intracerebral hemorrhage sample image, where the first label is used to indicate the intracerebral hemorrhage region in the first intracerebral hemorrhage sample image, performs a first data augmentation operation on the first label, and uses the second label after the shape change as prior knowledge for generating a lesion image. An image erasing operation is performed on the intracerebral hemorrhage region in the first intracerebral hemorrhage sample image to obtain a second intracerebral hemorrhage sample image. Based on the first intracerebral hemorrhage sample image, the second intracerebral hemorrhage sample image, and the second label, an intracerebral hemorrhage sample image generation model is trained. The intracerebral hemorrhage sample image generation model is used to generate a corresponding intracerebral hemorrhage image according to the normal image and the preset label input into the model. In this way, on the basis of introducing AI to generate intracerebral hemorrhage images for the training samples required for training the model, a more novel intracerebral hemorrhage sample image generation model configuration scheme that can promote better sample quality is proposed. Thereby, the high-quality training sample configuration requirements of the intracerebral hemorrhage prediction model can be met, and further, a higher-precision intracerebral hemorrhage prediction model can be trained to meet the high-quality application requirements of clinical medical staff for the auxiliary function service of intracerebral hemorrhage prediction.
[0074] Continue to elaborate in detail on each step of the above Figure 1 illustrated embodiments and their possible implementation manners in practical applications.
[0075] To further improve the quality of the training samples and thereby strengthen the training effect and prediction accuracy of the subsequent intracerebral hemorrhage sample image generation model, data augmentation can also be carried out from several aspects.
[0076] As an exemplary embodiment, before performing the first data augmentation operation on the first label, another aspect of data augmentation can also be performed on the first label. Specifically, the method of the present application can further include:
[0077] Performing a second data augmentation operation on the first label, where the second data augmentation operation includes at least one of the following methods:
[0078] Only dilating the original label;
[0079] Only eroding the original label;
[0080] Dilating the original label first and then eroding it.
[0081] Among them, it can be understood that the operation of only dilating the original label can slightly expand the label range; the operation of only eroding the original label can slightly shrink the label range; and the operation of dilating the original label first and then eroding it can make the label edge smoother.
[0082] Thus, before the first label undergoes shape change through the first data augmentation operation, the above three optional second data augmentation operations can be used to make fine adjustments to the first label, further enabling the label shape to better meet the actual requirements.
[0083] Furthermore, focusing on the image data. Before performing the image erasure operation on the cerebral hemorrhage region in the first cerebral hemorrhage sample image, the present application can also perform corresponding processing on the first cerebral hemorrhage sample image.
[0084] Specifically, as another exemplary embodiment, the method of the present application may further include:
[0085] In a series of consecutive first cerebral hemorrhage sample images, based on a randomly selected z-axis position and taking three consecutive images as a unit, image selection is performed to complete the update of the first cerebral hemorrhage sample image, corresponding to the processing unit of the input images corresponding to the three channels of the subsequent model, and the first label is updated with reference to the updated first cerebral hemorrhage sample image;
[0086] Under the selected window width and window level, a normalization operation is performed on the first cerebral hemorrhage sample image to make the pixel values between 0 and 1.
[0087] It should be noted that here, the processing of the processing unit of three consecutive images is involved, which corresponds to the input setting of the cerebral hemorrhage sample image generation model of the present application, and it can input three images for processing simultaneously.
[0088] Correspondingly, as an example, an input of the cerebral hemorrhage sample image generation model can have a specification of 3×w×d.
[0089] After setting the processing unit based on three images, it is necessary to update the corresponding first label according to this setting to form data settings with different processing units (each processing unit involves three images and three labels).
[0090] In addition, it can also be seen that for the first cerebral hemorrhage sample image, a normalization operation / processing can also be involved, so as to scale the image data into the range of [0, 1], which is convenient for subsequent data processing.
[0091] In addition, on the other hand, before performing the image erasure operation on the cerebral hemorrhage region in the first cerebral hemorrhage sample image, as another exemplary embodiment, the method of the present application may further include:
[0092] Perform a third data augmentation operation on the first cerebral hemorrhage sample image in terms of image transformation and perform a corresponding transformation on the first label, where the third data augmentation operation includes rotation, translation, and elastic deformation.
[0093] It can be easily seen that in order to further increase the sample size of the first intracerebral hemorrhage sample image, in the embodiments herein, a third data augmentation operation involving image transformation such as rotation, translation, and elastic deformation can be adopted to effectively achieve this goal.
[0094] In the case where the first intracerebral hemorrhage sample image has been subjected to image transformation, the corresponding first label can be transformed accordingly to maintain the matching relationship between the image and the label.
[0095] Meanwhile, in addition to performing image transformation involving shape change on the first intracerebral hemorrhage sample image, the clarity effect of the image itself can also be fine-tuned to promote the increase in the sample size.
[0096] In this case, as another exemplary embodiment, after performing the third data augmentation operation on the first intracerebral hemorrhage sample image in terms of image transformation, the method of the present application may further include:
[0097] Performing a fourth data augmentation operation on the first intracerebral hemorrhage sample image, where the fourth data augmentation operation includes adding noise, sharpening, and smoothing.
[0098] It can be understood that the fourth data augmentation operation including adding noise, sharpening, and smoothing is mainly adjusted from the aspect of clarity effect. It can be considered that the intracerebral hemorrhage area in the image remains unchanged. Therefore, there is no need to make corresponding contrastive adjustment settings for the labels. Multiple images obtained after performing the fourth data augmentation operation on the same image can share the same original label to indicate the intracerebral hemorrhage area in the image.
[0099] In addition, as an example, the intracerebral hemorrhage sample image generation model configured in the present application can specifically adopt a diffusion model, that is, the model architecture of an existing diffusion model can be directly adopted, or further optimized and improved on the basis of the model architecture of the existing diffusion model.
[0100] For the diffusion model, its model structure involves the application of a residual convolutional network and a self-attention mechanism. Briefly speaking, its core idea is as follows: First, a process of gradually transforming the data distribution into a Gaussian noise distribution (forward diffusion) is defined, and this process can be regarded as a series of steps of gradually adding noise; subsequently, the model learns how to perform the inverse operation of this process, that is, starting from pure noise, gradually "denoising" through a series of inverse steps, and finally generating samples close to the original data distribution (backward diffusion). This inverse process usually involves complex probability distribution estimation and needs to ensure that the generated samples have high fidelity and diversity.
[0101] This is more suitable for the goal of the present application to generate an intracerebral hemorrhage sample image by generating an intracerebral hemorrhage area based on a normal image. Through forward diffusion and reverse diffusion, the model is allowed to learn how to predict the original image with an intracerebral hemorrhage area.
[0102] For this, based on the corresponding model application architecture, the training process of the intracerebral hemorrhage sample image generation model of the present application will be described.
[0103] As another exemplary embodiment, the intracerebral hemorrhage sample image generation model of the present application may specifically adopt a diffusion model. Correspondingly, based on the second intracerebral hemorrhage sample image and the second label, training the intracerebral hemorrhage sample image generation model may specifically include:
[0104] Encoding the second label using a label encoding network to obtain a label shape encoding feature, where the label encoding network is a multi-layer convolutional neural network;
[0105] During the forward process of the diffusion model, generating actual noise and adding noise to the input first intracerebral hemorrhage sample image T times to obtain a corresponding sequence of noisy image data;
[0106] During the reverse process of the diffusion model, inputting the second intracerebral hemorrhage sample image, the label shape encoding feature, any time point t, and the noisy image data corresponding to the time point t into the intracerebral hemorrhage sample image generation model to predict the noise added during the forward process of the diffusion model, where the label shape encoding feature is input into the bottom layer network of the intracerebral hemorrhage sample image generation model;
[0107] Calculating the loss value between the actual noise and the noise prediction result based on the mean square error, and updating the model parameters according to the calculation result of the loss value.
[0108] Among them, as an example, the label shape encoding feature obtained by encoding the second label can be denoted as z (i) , the generated actual noise can be denoted as ε1 (i) , and each piece of noisy image data of each noise addition included in the sequence of noisy image data can be denoted as x1 (i) , x2 (i) , …, x T (i) , and the noise prediction result can be denoted as ε2 (i) .
[0109] In addition, in addition to being able to see the training logic of the intracerebral hemorrhage sample image generation model, it can also be seen that the loss function adopted in the training process of the present application specifically uses the mean square error (MSE). The mean square error itself is a common existing evaluation index, so no more specific description will be given here.
[0110] After the training of the intracerebral hemorrhage sample image generation model is completed, it can obviously be put into actual use. In this regard, the present application can also involve the application link of the intracerebral hemorrhage sample image generation model, which is usually to meet the usage requirements of the intracerebral hemorrhage prediction model for training samples.
[0111] Correspondingly, as another exemplary embodiment, after training the intracerebral hemorrhage sample image generation model based on the second intracerebral hemorrhage sample image and the second label, the method of the present application may further include:
[0112] Obtain a normal image that does not contain an intracerebral hemorrhage area;
[0113] Obtain a preset label;
[0114] Input the normal image and the preset label into the intracerebral hemorrhage sample image generation model;
[0115] Extract the intracerebral hemorrhage image output by the intracerebral hemorrhage sample image generation model.
[0116] After obtaining the intracerebral hemorrhage image (intracerebral hemorrhage case prediction result), corresponding to the work requirements in the clinical aspect, it is obvious that further data applications can still be involved, such as result display, result saving, result forwarding, outputting a completion processing prompt, corresponding data analysis processing, or training of the intracerebral hemorrhage prediction model. The specific data applications can be configured according to actual needs, and the present application does not make specific limitations.
[0117] As an example, after determining the finally selected and best-performing model as the output during the training process, that is, the intracerebral hemorrhage sample image generation model that can be put into actual use, a normal brain CT image x and an artificial label y can be input to generate a brain CT image z with lesions.
[0118] After obtaining the intracerebral hemorrhage image, as another exemplary embodiment, the method of the present application may further include:
[0119] Train an intracerebral hemorrhage prediction model based on the intracerebral hemorrhage image.
[0120] It can be understood that for the intracerebral hemorrhage image used for training the model, it is also necessary to add annotations to the corresponding lesions, that is, the intracerebral hemorrhage area, and the trained intracerebral hemorrhage prediction model is specifically used to predict the intracerebral hemorrhage area in the input image according to the model, and further can predict the corresponding intracerebral hemorrhage type (corresponding to this prediction target, the intracerebral hemorrhage image as a training sample needs to be annotated with the corresponding intracerebral hemorrhage type).
[0121] After the training of the intracerebral hemorrhage prediction model is completed, as another exemplary embodiment, the method of the present application obviously may further include:
[0122] Obtain a target image;
[0123] Input the target image into the cerebral hemorrhage prediction model;
[0124] Extract the cerebral hemorrhage prediction result output by the cerebral hemorrhage prediction model.
[0125] It can be understood that considering the training and application links of the cerebral hemorrhage prediction model, which are not the focus of the solution of this application, reference can be made to the prior art and the corresponding processing content of the previous cerebral hemorrhage sample image generation model, so specific descriptions will not be elaborated here.
[0126] The above is an introduction to the processing method of the cerebral hemorrhage sample image generation model provided by this application. To facilitate better implementation of the processing method of the cerebral hemorrhage sample image generation model provided by this application, this application also provides a processing device for the cerebral hemorrhage sample image generation model from the perspective of functional modules.
[0127] Refer to Figure 2 , Figure 2 FIG.
[0128] An image acquisition unit 201, configured to acquire a first cerebral hemorrhage sample image, where the first cerebral hemorrhage sample image specifically includes at least one of a computed tomography image and a magnetic resonance imaging image;
[0129] A label configuration unit 202, configured to configure a corresponding first label for the first cerebral hemorrhage sample image, where the first label is used to indicate the cerebral hemorrhage area in the first cerebral hemorrhage sample image;
[0130] A data enhancement unit 203, configured to perform a first data enhancement operation on the first label, and use the second label after shape change as prior knowledge for generating a lesion image;
[0131] An image erasure unit 204, configured to perform an image erasure operation on the cerebral hemorrhage area in the first cerebral hemorrhage sample image to obtain a second cerebral hemorrhage sample image;
[0132] A model training unit 205, configured to train a cerebral hemorrhage sample image generation model based on the first cerebral hemorrhage sample image, the second cerebral hemorrhage sample image, and the second label, where the cerebral hemorrhage sample image generation model is used to generate a corresponding cerebral hemorrhage image according to the normal image and the preset label input into the model.
[0133] In an exemplary embodiment, the data enhancement unit 203 is further configured to:
[0134] Perform a second data augmentation operation on the first label, where the second data augmentation operation includes at least one of the following methods:
[0135] Only dilate the original label;
[0136] Only erode the original label;
[0137] First dilate the original label and then erode it.
[0138] In another exemplary embodiment, the data augmentation unit 203 is further configured to:
[0139] In a series of consecutive first cerebral hemorrhage sample images, based on a randomly selected z-axis position, select images in units of three consecutive images to complete the update of the first cerebral hemorrhage sample images, which is the processing unit corresponding to the input images of the subsequent model's three channels, and update the first label with reference to the updated first cerebral hemorrhage sample images;
[0140] Under the selected window width and window level, perform a normalization operation on the first cerebral hemorrhage sample images so that the pixel values are between 0 and 1.
[0141] In another exemplary embodiment, the data augmentation unit 203 is further configured to:
[0142] Perform a third data augmentation operation on the first cerebral hemorrhage sample images in terms of image transformation and perform a corresponding transformation on the first label, where the third data augmentation operation includes rotation, translation, and elastic deformation.
[0143] In another exemplary embodiment, the data augmentation unit 203 is further configured to:
[0144] Perform a fourth data augmentation operation on the first cerebral hemorrhage sample images, where the fourth data augmentation operation includes adding noise, sharpening, and smoothing.
[0145] In another exemplary embodiment, the first data augmentation operation includes at least two of the following methods:
[0146] Do not perform any transformation on the shape of the original label;
[0147] Adjust the shape of the original label to the smallest rectangular box containing the shape of the original label;
[0148] Adjust the shape of the original label to include the center point of the shape of the original label;
[0149] Adjust the shape of the original label to the convex hull of the shape of the original label.
[0150] In another exemplary embodiment, the cerebral hemorrhage sample image generation model specifically adopts a diffusion model, and the model training unit 205 is specifically configured to:
[0151] Encode the second label using a label encoding network to obtain label shape encoding features, where the label encoding network is a multi-layer convolutional neural network;
[0152] During the forward process of the diffusion model, generate actual noise, and add noise to the input first cerebral hemorrhage sample image T times to obtain the corresponding noisy image data sequence;
[0153] During the reverse process of the diffusion model, input the second cerebral hemorrhage sample image, the label shape encoding features, any time point t, and the noisy image data corresponding to time point t into the cerebral hemorrhage sample image generation model to predict the noise added during the forward process of the diffusion model, where the label shape encoding features are input into the bottom layer network of the cerebral hemorrhage sample image generation model;
[0154] Calculate the loss value between the actual noise and the noise prediction result based on the mean square error, and update the model parameters according to the calculation result of the loss value.
[0155] This application also provides a processing device from the perspective of the hardware structure. Refer to Figure 3 , Figure 3 FIG. shows a schematic structural diagram of the processing device of this application. Specifically, the processing device of this application may include a processor 301, a memory 302, and an input / output device 303. The processor 301 is used to implement the steps of the processing method of the cerebral hemorrhage sample image generation model in the corresponding embodiment when executing the computer program stored in the memory 302; or, the processor 301 is used to implement the functions of each unit in the corresponding embodiment when executing the computer program stored in the memory 302. The memory 302 is used to store the computer program required for the processor 301 to execute the processing method of the cerebral hemorrhage sample image generation model in the above Figure 1 corresponding embodiment; or, the processor 301 is used to implement the functions of each unit in the corresponding embodiment when executing the computer program stored in the memory 302. The memory 302 is used to store the computer program required for the processor 301 to execute the processing method of the cerebral hemorrhage sample image generation model in the above Figure 2 corresponding embodiment. Figure 1 corresponding embodiment.
[0156] Exemplarily, the computer program can be divided into one or more modules / units. One or more modules / units are stored in the memory 302 and executed by the processor 301 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of completing specific functions, and these instruction segments are used to describe the execution process of the computer program in the computer device.
[0157] The processing device may include, but is not limited to, a processor 301, a memory 302, and an input / output device 303. Those skilled in the art can understand that the illustration is merely an example of the processing device and does not constitute a limitation on the processing device. It may include more or fewer components than shown, or combine certain components, or different components. For example, the processing device may also include a network access device, a bus, etc. The processor 301, the memory 302, the input / output device 303, etc. are connected via a bus.
[0158] The processor 301 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the processing device and connects various parts of the entire device using various interfaces and lines.
[0159] The memory 302 can be used to store computer programs and / or modules. The processor 301 realizes various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 302, and by calling the data stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function, etc.; the data storage area may store data created according to the use of the processing device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0160] When the processor 301 is used to execute the computer program stored in the memory 302, the following functions can be specifically realized:
[0161] Obtain a first intracerebral hemorrhage sample image, where the first intracerebral hemorrhage sample image specifically includes at least one of a computed tomography image and a magnetic resonance imaging image;
[0162] Configure a corresponding first label for the first intracerebral hemorrhage sample image, where the first label is used to indicate the intracerebral hemorrhage area in the first intracerebral hemorrhage sample image;
[0163] Perform a first data augmentation operation on the first label, and use the second label after shape change as prior knowledge for generating lesion images;
[0164] Perform an image erasure operation on the intracerebral hemorrhage area in the first intracerebral hemorrhage sample image to obtain a second intracerebral hemorrhage sample image;
[0165] Based on the first intracerebral hemorrhage sample image, the second intracerebral hemorrhage sample image, and the second label, train an intracerebral hemorrhage sample image generation model, where the intracerebral hemorrhage sample image generation model is used to generate corresponding intracerebral hemorrhage images according to the normal images and preset labels input into the model.
[0166] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the processing device, processing equipment, and their corresponding units of the intracerebral hemorrhage sample image generation model described above can refer to, for example, Figure 1 The description of the processing method of the intracerebral hemorrhage sample image generation model in the corresponding embodiment, which will not be elaborated here specifically.
[0167] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0168] Therefore, this application provides a computer-readable storage medium, which stores multiple instructions that can be loaded by a processor to execute the steps of the processing method of the intracerebral hemorrhage sample image generation model in this application as, for example, Figure 1 The description of the processing method of the intracerebral hemorrhage sample image generation model in the corresponding embodiment, and the specific operations can refer to, for example, Figure 1 The description of the processing method of the intracerebral hemorrhage sample image generation model in the corresponding embodiment, which will not be elaborated here.
[0169] Among them, the computer-readable storage medium may include: Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk, optical disk, etc.
[0170] Since the instructions stored in the computer-readable storage medium can execute the steps of the processing method of the intracerebral hemorrhage sample image generation model in this application as, for example, Figure 1 The description of the processing method of the intracerebral hemorrhage sample image generation model in the corresponding embodiment, therefore, the steps of the processing method of the intracerebral hemorrhage sample image generation model in this application can be implemented as, for example, Figure 1For the beneficial effects that can be achieved by the processing method of the intracerebral hemorrhage sample image generation model in the corresponding embodiment, please refer to the previous description and will not be elaborated here.
[0171] The above has introduced in detail the processing method, device, processing equipment and computer-readable storage medium of the intracerebral hemorrhage sample image generation model provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for processing a brain hemorrhage sample image generation model, characterized in that: The method comprises: Acquire a first cerebral hemorrhage sample image, wherein the first cerebral hemorrhage sample image specifically includes at least one of a computed tomography image and a magnetic resonance imaging image; Configuring a corresponding first label for the first cerebral hemorrhage sample image, wherein the first label is used to indicate a cerebral hemorrhage area in the first cerebral hemorrhage sample image; Performing a first data enhancement operation on the first label, and using the second label after the shape change as prior knowledge for generating a lesion image; Performing an image erasing operation on the cerebral hemorrhage area in the first cerebral hemorrhage sample image to obtain a second cerebral hemorrhage sample image; Based on the first cerebral hemorrhage sample image, the second cerebral hemorrhage sample image and the second label, training a cerebral hemorrhage sample image generation model, wherein the cerebral hemorrhage sample image generation model is used to generate a corresponding cerebral hemorrhage image according to a normal image and a preset label input into the model; The cerebral hemorrhage sample image generation model specifically adopts a diffusion model. The training of the cerebral hemorrhage sample image generation model based on the first cerebral hemorrhage sample image, the second cerebral hemorrhage sample image and the second label includes: Encoding the second label using a label encoding network to obtain a label shape encoding feature, wherein the label encoding network is a multi-layer convolutional neural network; In the forward process of the diffusion model, actual noise is generated, and the first cerebral hemorrhage sample image input is subjected to T times of noise addition to obtain a corresponding noise-added image data sequence; In the reverse process of the diffusion model, the second cerebral hemorrhage sample image, the label shape coding feature, an arbitrary time point t and the noise-added image data corresponding to the time point t are input into the cerebral hemorrhage sample image generation model to predict the noise added in the forward process of the diffusion model, wherein the label shape coding feature is input into the bottom layer network of the cerebral hemorrhage sample image generation model; The loss value between the actual noise and the noise prediction result is calculated based on the mean square error, and the model parameters are updated according to the loss value calculation result.
2. The method according to claim 1, characterized in that Before performing the first data enhancement operation on the first label, the method further includes: Performing a second data enhancement operation on the first label, wherein the second data enhancement operation includes at least one of the following methods: Only expand the original label; The original label is only corroded; The original label is first expanded and then corroded.
3. The method according to claim 1, characterized in that Before performing the image erasing operation on the cerebral hemorrhage area in the first cerebral hemorrhage sample image, the method further includes: In the continuous first cerebral hemorrhage sample images, based on the randomly selected z-axis position, three consecutive images are used as units to select images, complete the update of the first cerebral hemorrhage sample images, corresponding to the processing units of the input images corresponding to the three channels of the subsequent model, and update the first label in accordance with the updated first cerebral hemorrhage sample images; Under the selected window width and window level, a normalization operation is performed on the first cerebral hemorrhage sample image so that the pixel value is between 0 and 1.
4. The method according to claim 1, characterized in that: Before performing the image erasing operation on the cerebral hemorrhage area in the first cerebral hemorrhage sample image, the method further includes: A third data enhancement operation in terms of image transformation is performed on the first cerebral hemorrhage sample image, and a comparison transformation is performed on the first label, wherein the third data enhancement operation includes rotation, translation and elastic deformation.
5. The method according to claim 4, characterized in that After performing the third data enhancement operation in terms of image transformation on the first cerebral hemorrhage sample image, the method further includes: A fourth data enhancement operation is performed on the first cerebral hemorrhage sample image, wherein the fourth data enhancement operation includes adding noise, sharpening, and smoothing.
6. The method according to claim 1, characterized in that The first data enhancement operation includes at least two of the following methods: No changes are made to the original label shape; The original label shape is adjusted to a minimum rectangular frame that includes the original label shape; The original label shape is adjusted to include the center point of the original label shape; The original label shape is adjusted to the convex hull of the original label shape.
7. A processing device for generating a model for a sample image of cerebral hemorrhage, characterized in that: The device comprises: An image acquisition unit, configured to acquire a first cerebral hemorrhage sample image, wherein the first cerebral hemorrhage sample image specifically comprises at least one of a computed tomography image and a magnetic resonance imaging image; a label configuration unit, configured to configure a corresponding first label for the first cerebral hemorrhage sample image, wherein the first label is used to indicate a cerebral hemorrhage area in the first cerebral hemorrhage sample image; A data enhancement unit, configured to perform a first data enhancement operation on the first label, and use the second label after the shape change as prior knowledge for generating a lesion image; An image erasing unit, configured to perform an image erasing operation on the cerebral hemorrhage region in the first cerebral hemorrhage sample image to obtain a second cerebral hemorrhage sample image; A model training unit, used for training a brain hemorrhage sample image generation model based on the first brain hemorrhage sample image, the second brain hemorrhage sample image and the second label, wherein the brain hemorrhage sample image generation model is used for generating a corresponding brain hemorrhage image according to a normal image and a preset label input into the model; The cerebral hemorrhage sample image generation model specifically adopts a diffusion model, and the model training unit is specifically used for: Encoding the second label using a label encoding network to obtain a label shape encoding feature, wherein the label encoding network is a multi-layer convolutional neural network; In the forward process of the diffusion model, actual noise is generated, and the first cerebral hemorrhage sample image input is subjected to T times of noise addition to obtain a corresponding noise-added image data sequence; In the reverse process of the diffusion model, the second cerebral hemorrhage sample image, the label shape coding feature, an arbitrary time point t and the noise-added image data corresponding to the time point t are input into the cerebral hemorrhage sample image generation model to predict the noise added in the forward process of the diffusion model, wherein the label shape coding feature is input into the bottom layer network of the cerebral hemorrhage sample image generation model; The loss value between the actual noise and the noise prediction result is calculated based on the mean square error, and the model parameters are updated according to the loss value calculation result.
8. A processing device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the method according to any one of claims 1 to 6 is executed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Brain tumor segmentation data enhancement method based on generative adversarial network
CN111833359A
Cerebrovascular image-label two-stage generation method and device and storage medium
CN115719335A