Method for generating pseudo-healthy images of brain hemorrhage based on pathological decoupling

By employing a pathology-based decoupling method, utilizing segmenters, generators, and reconstructors, combined with an attention module, the problems of lost subject identity and inconsistent reconstruction of pathological regions in pathological images are solved, resulting in more effective and accurate pseudo-healthy images and reconstructed pathological images.

CN116630272BActive Publication Date: 2026-08-25CHONGQING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310599879.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-25
Publication Date
2026-08-25
Estimated Expiration
2043-05-25

AI Technical Summary

Technical Problem

Existing methods for generating pseudo-healthy images of cerebral hemorrhage suffer from problems such as loss of the subject's identity in the pathological image and inconsistency in the reconstruction of the pathological region, resulting in poor effectiveness in generating pseudo-healthy images and reconstructing pathological images.

Method used

A pathology-based decoupling method is adopted. The pathological region mask is segmented from the pathological image by a segmenter, a pseudo-healthy image is generated by a generator, and the pathological image is reconstructed by a reconstructor. The attention score of the pathological region and the image residual is calculated by an attention module to repair the pathological region. The pseudo-image generation model is trained to achieve decoupling and one-to-one mapping of the pathological region.

Benefits of technology

It improves the effectiveness of pseudo-healthy images and the accuracy of pathological image reconstruction, avoids the problems of subject identity loss and inconsistent pathological area reconstruction, and generates pseudo-healthy images that are closer to the identity of the original pathological images, making the reconstructed pathological images more accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116630272B_ABST
    Figure CN116630272B_ABST
Patent Text Reader

Abstract

The application particularly relates to a brain hemorrhage pseudo-health image generation method based on pathological decoupling, which comprises the following steps: constructing and training a pseudo-image generation model; in each training iteration: firstly, inputting a pathological image serving as training data into a segmenter, segmenting a pathological region mask from the pathological image through the segmenter; then, inputting the pathological region mask and the pathological image into a generator, generating a pseudo-health image through the generator; subsequently, inputting the pseudo-health image and the pathological region mask into a reconstructor, generating a reconstructed pathological image through the reconstructor; finally, training the pseudo-image generation model based on a total loss of the segmenter, the generator and the reconstructor; and generating a corresponding pseudo-health image through the generator of the trained pseudo-image generation model. The application can ensure that the original identity of a pathological image remains unchanged when removing a pathological region, and can realize one-to-one mapping of the pathological region in the process of generating a reconstructed pathological image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of big data and artificial intelligence, specifically to a method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling. Background Technology

[0002] Intracranial hemorrhage (ICH) is a life-threatening and urgent condition with a high morbidity and mortality rate, seriously endangering the life and health of patients. There are many causes of ICH, common causes include trauma, congenital abnormalities, and vascular diseases. The direct manifestation of ICH is the leakage or rupture of one or more blood vessels.

[0003] The primary diagnostic method for cerebral hemorrhage is computed tomography (CT). CT imaging plays a crucial role in the detection and diagnosis of hemorrhage due to its speed, low cost, and ability to capture highly contrasting images. Based on CT images, doctors can pinpoint the exact location of the hemorrhage, its size, the presence of cerebral edema, and whether the hemorrhage has penetrated into the ventricles. This information is vital for patient diagnosis and treatment. Depending on the specific hemorrhage, doctors employ appropriate treatment methods. Some hemorrhages can be treated with medication, while others may require neurosurgery to remove blood clots, relieve pressure on the brain, and save lives.

[0004] To better detect intracranial abnormalities and understand the changes in various intracranial parts caused by disease, the generation of pseudo-healthy images for brain hemorrhage has become a hot research topic. Pseudo-healthy image generation is the task of creating a "healthy" image of a specific subject from a pathological image. Pseudo-healthy images help doctors detect abnormalities in pathological images, and by comparing pseudo-healthy images with pathological images, doctors and patients can understand how the disease has changed normal tissues. In the process of pseudo-healthy image generation, in addition to considering how to generate the pseudo-healthy image, to generate higher-quality pseudo-healthy images, it is also common to consider how to reconstruct the pathological image from the pseudo-healthy image.

[0005] However, existing methods for generating pseudo-healthy images of cerebral hemorrhage mainly suffer from the following problems: First, while removing the pathological area, the original subject identity is lost; that is, the generated image superficially appears to originate from a different subject than the original pathological image, such as... Figure 1 First, the pathological image (a) and the pseudo-healthy image (b) do not belong to the same patient; second, when reconstructing the pathological image from the generated pseudo-healthy image, there is a one-to-many problem, that is, the bleeding area in the reconstructed pathological image is inconsistent with the original pathological image, and the bleeding area appears in different locations, such as... Figure 1The pathological images (a) and (c) in the text result in poor effectiveness in generating pseudo-healthy images and reconstructing pathological images. Therefore, designing a method to improve the effectiveness of generating pseudo-healthy images and reconstructing pathological images is an urgent technical problem to be solved. Summary of the Invention

[0006] To address the shortcomings of the existing technologies, the technical problem to be solved by this invention is: how to provide a method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling, which can ensure that the original identity of the pathological image remains unchanged when removing the pathological region, and can achieve a one-to-one mapping of the pathological region during the generation and reconstruction of the pathological image, thereby improving the effectiveness of generating pseudo-healthy images and reconstructing pathological images.

[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0008] A method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling includes:

[0009] S1: Acquire the pathological image to be processed;

[0010] S2: Construct and train a pseudo-image generation model;

[0011] In each training iteration, the pseudo-image generation model works as follows: First, the pathological image used as training data is input into the segmenter, which segments out the pathological region mask from the pathological image; then, the pathological region mask and the pathological image are input into the generator, which generates a pseudo-healthy image; subsequently, the pseudo-healthy image and the pathological region mask are input into the reconstructor, which generates a reconstructed pathological image; finally, the model's total loss is calculated based on the losses of the segmenter, generator, and reconstructor to train the pseudo-image generation model.

[0012] S3: Input the pathological image to be processed into the trained pseudo-image generation model, and generate the corresponding pseudo-healthy image through the generator.

[0013] Preferably, when the generator generates a pseudo-healthy image, it first generates a pathological image based on the pathological image and the pathological region mask, and then removes the pathological region mask from the pathological image residual; then it calculates the attention score between the pathological region mask and the pathological image residual through the attention module; finally, it combines the attention score to repair the pathological region of the pathological image residual to generate a pseudo-healthy image.

[0014] Preferably, the pseudo-image generation model is trained through the following steps:

[0015] S211: Divide each training iteration into three loops;

[0016] S212: Pathology-Pseudo-Healthy Loop: First, a pathological region mask is segmented from a pathological image containing pathological regions using a segmenter. Then, a pseudo-healthy image is generated based on the pathological region mask and the corresponding pathological image using a generator. Next, a reconstructed pathological image is generated based on the pseudo-healthy image and the pathological region mask using a reconstructor. Finally, the model loss for this loop is calculated.

[0017] S213: Healthy-Pseudo-Healthy Loop: First, a pseudo-pathological image is generated by the reconstructor based on the mask image of the non-pathological region and the healthy image of the non-pathological region. Second, the pseudo-non-pathological region mask is segmented from the pseudo-pathological image by the segmenter. Then, the pseudo-healthy image is generated by the generator based on the pseudo-non-pathological region mask and the corresponding pseudo-pathological image. Finally, the model loss of this loop is calculated.

[0018] S214: Deformation-Pseudo-Healthy Loop: First, a non-pathological region mask is segmented from a deformed image with deformation but no pathological region using a segmenter. Second, a pseudo-healthy image is generated based on the non-pathological region mask and the corresponding deformed image using a generator. Then, a reconstructed deformed image is generated based on the pseudo-healthy image and the non-pathological region mask using a reconstructor. Finally, the model loss for this loop is calculated.

[0019] S215: The model loss of the three cycles of pathology-pseudo-health, health-pseudo-health and deformation-pseudo-health is added together to obtain the total model loss of this training iteration, which is used to train the pseudo-image generation model.

[0020] S216: Repeat steps S211 to S215 until the pseudo-image generation model converges.

[0021] Preferably, the pathology-pseudo-health cycle is achieved through the following steps:

[0022] S2121: Pathological images of areas containing pathological features x p As input to the pseudo-image generation model;

[0023] S2122: From pathological image x via segmenter p The pathological area is segmented and masked. p ;

[0024] S2123: Mask the pathological area m p and the corresponding pathological image x p As input to the generator, a pseudo-healthy image x is generated. gh ;

[0025] S2124: Transfer the pseudo-health image x gh and pathological area mask m p As input to the reconstructor, the reconstructed pathological image x is generated by the reconstructor. rp ;

[0026] S2125: Calculate the loss of the segmenter, generator, and reconstructor.

[0027] Preferably, in the pathological-pseudo-healthy cycle, the losses of the segmenter, generator, and reconstructor are calculated using the following formula:

[0028] 1) Losses of the divider;

[0029] When there is a mask annotation, the loss of the segmenter is calculated using the following formula:

[0030]

[0031] In the formula: x P And m represents a paired pathological image and a standard segmentation mask; SeN(x P ) represents the pathological region mask predicted by the segmenter; Dice(·) represents the dice coefficient loss;

[0032] When there is no mask annotation, the loss of the segmenter is calculated using the following formula:

[0033]

[0034]

[0035] In the formula: x p Represents pathological images; m mp It is a pathological image x p The pathological region mask is randomly extracted from other pathological images; DmN represents the classification segmentation mask GeN(x p ) and randomly extracted pathological area mask m mp Mask discriminator;

[0036] 2) Generator loss:

[0037]

[0038]

[0039] In the formula: x p Represents pathological images; GeN(x p ) represents x p Corresponding pseudo-health image; x h1 DhN represents a health image; DhN represents a health discriminator that distinguishes between real and fake health images. This represents the gradient penalty loss involved in stable training; σ is set to 10.

[0040] 3) Loss of the reconstructor:

[0041]

[0042] In the formula: x p Represents pathological images; GeN(x p ) is x p The corresponding pseudo-health image; SeN(x) p ReN(SeN(x) represents the pathological region mask segmented by the segmenter; p ),GeN(x p )) indicates that the reconstructor is based on GeN(x) p ) and SeN(x p The reconstructed pathological images generated.

[0043] Preferably, the health-pseudo-health cycle is achieved through the following steps:

[0044] S2131: X image of a healthy region without pathological areas h As input to the pseudo-image generation model;

[0045] S2132: X image of a healthy region without pathological areas h and its health mask m h As input to the reconstructor, a pseudo-pathological image x is generated by the reconstructor. rh ;

[0046] S2133: From pseudo-pathological images x using a segmenter rh The pseudo-pathological area mask is segmented in the middle. sh ;

[0047] S2134: Mask the pseudo-pathological areas m sh and the corresponding pseudo-pathological image x rh As input to the generator, a pseudo-healthy image x is generated. hh ;

[0048] S2135: Calculate the loss of the segmenter, generator, and reconstructor.

[0049] Preferably, in the healthy-pseudo-healthy cycle, the losses of the segmenter, generator, and reconstructor are calculated using the following formula:

[0050] 1) Losses of the divider:

[0051]

[0052] In the formula: x h and m h ReN(x) represents the health image and the corresponding health mask, respectively; h ,m h ) indicates that the reconstructor is based on the healthy image x h and health mask m hGenerated pseudo-pathological images; SeN(ReN(x h ,m h )) represents a pseudo-pathological image ReN(x h ,m h () a mask for pseudo-pathological areas;

[0053] 2) Generator loss:

[0054]

[0055] In the formula: x h and m h ReN(x) represents the health image and the corresponding health mask, respectively; h ,m h ) indicates that the reconstructor is based on the healthy image x h and health mask m h Generated pseudo-pathological images; GeN(ReN(x) h ,m h The generator is based on the pseudo-pathological image ReN(x). h ,m h The generated pseudo-health image;

[0056] 3) Loss of the reconstructor:

[0057]

[0058]

[0059] In the formula: x h and x h2 Let m represent two different health images extracted from the health image distribution H; h Image x representing health h The corresponding health mask; ReN(x) h ,m h ) indicates that the reconstructor is based on the healthy image x h and health mask m h The generated pseudo-pathological image.

[0060] Preferably, the deformation-pseudo-health cycle is achieved through the following steps:

[0061] S2141: Transform deformed images (x) that show deformation but no pathological areas. dp As input to the pseudo-image generation model;

[0062] S2142: From the deformed image x using a segmenter dp The non-pathological area was segmented and masked. dh ;

[0063] S2143: Mask for areas without pathology mdh and the corresponding deformation image x dp As input to the generator, a pseudo-healthy image x is generated. gdh ;

[0064] S2144: Transfer the pseudo-health image x gdh and non-pathological area mask m dh As input to the reconstructor, the reconstructed deformed image x is generated by the reconstructor. rdp ;

[0065] S2145: Calculate the loss of the segmenter, generator, and reconstructor.

[0066] Preferably, in the deformation-pseudo-healthy loop, the losses of the segmenter, generator, and reconstructor are calculated as follows:

[0067] 1) Divider loss:

[0068]

[0069] In the formula: x dP and m dh Represents a pair of deformed images and masks; SeN(x) dP ) indicates that the segmenter is based on x dP Masking of the segmented non-pathological areas;

[0070] 2) Generator loss:

[0071]

[0072]

[0073] In the formula: x dp Represents a deformed image; GeN(x) dp ) indicates that the generator is based on x dp The generated pseudo-healthy image; x h3 DhN represents a healthy image; DhN represents a discriminator that distinguishes between real and synthetic healthy images. This represents the gradient penalty loss involved in stable training; σ is set to 10.

[0074] 3) Loss of the reconstructor:

[0075]

[0076] In the formula: x dp Represents a deformed image; GeN(x) dp ) indicates that the generator is based on x dp Generated pseudo-healthy image; SeN(x) dP ) indicates that the segmenter is based on x dPMasking of the segmented non-pathological regions; ReN(SeN(x) dp ),GeN(x dp )) indicates that the reconstructor is based on GeN(x) dp ) and SeN(x dp The reconstructed deformed image generated.

[0077] Preferably, the total model loss is calculated using the following formula:

[0078] 1) When there are mask markings, calculate the total loss:

[0079]

[0080] In the formula: L pe This represents the total model loss when mask annotations are used; to This indicates the weight parameters that are set;

[0081] 2) Calculate the total loss when there is no mask annotation.

[0082]

[0083] In the formula: L upe This represents the total model loss without mask annotation.

[0084] The method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling in this invention has the following beneficial effects:

[0085] The pseudo-image generation model of this invention segments a pathological region mask from a pathological image using a segmenter, thereby decoupling the pathological region from the original pathological image. Then, it generates a pseudo-healthy image based on the pathological region mask and the pathological image. This allows the generator to selectively repair (remove) the pathological region of the pathological image based on the pathological region mask without changing the non-pathological regions of the pathological image. This reduces the risk of edge loss in the pathological image and ensures that the original identity of the pathological image remains unchanged when removing the pathological region. It avoids the problem of losing the subject identity during the generation of pseudo-healthy images, thus improving the effectiveness of generating pseudo-healthy images. Attached Figure Description

[0086] To make the objectives, technical solutions, and advantages of the invention clearer, the invention will now be described in further detail with reference to the accompanying drawings, wherein:

[0087] Figure 1 Examples of pseudo-healthy images generated: (a) original pathological image; (b) pseudo-healthy image with lost identity; (c) pathological image inconsistent with the original pathological region; (d) high-quality pseudo-healthy image;

[0088] Figure 2The detailed network structure of the splitter;

[0089] Figure 3 The detailed network structure of the generator;

[0090] Figure 4 The detailed network structure of the reconstructor;

[0091] Figure 5 The detailed network structure of the discriminator;

[0092] Figure 6 This is a pseudo-image generation model based on pathological decoupling—the pathology-pseudo-health cycle (PPHC);

[0093] Figure 7 Image examples in the pathology-pseudo-healthy cycle: (a) original pathology image; (b) segmentation mask; (c) generated pseudo-healthy image; (d) reconstructed pathology image;

[0094] Figure 8 A pseudo-image generation model based on pathological decoupling—Health-Pseudo-Health Cycle (HPHC);

[0095] Figure 9 Image examples in the healthy-pseudo-healthy cycle: (a) original pathological image; (b) segmentation mask; (c) generated pseudo-healthy image; (d) reconstructed pathological image;

[0096] Figure 10 This is a pseudo-image generation model based on pathological decoupling—the Deformation-Pseudo-Health Cycle (DPHC).

[0097] Figure 11 Image examples in the deformation-pseudo-health cycle: (a) original pathological image; (b) segmentation mask; (c) generated pseudo-healthy image; (d) reconstructed pathological image;

[0098] Figure 12 This refers to images of deformed pathological images and their edges extracted.

[0099] Figure 13 Examples comparing the quality of pseudo-healthy images generated by different methods;

[0100] Figure 14 Pseudo-healthy images generated by different comparison methods;

[0101] Figure 15 This is a sample of a composite pseudo-pathological image. Detailed Implementation

[0102] The following detailed explanation illustrates the specific implementation methods:

[0103] Example:

[0104] This embodiment discloses a method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling.

[0105] like Figure 1 As shown, the method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling includes:

[0106] S1: Acquire the pathological image to be processed;

[0107] In this embodiment, the pathological image refers to a brain hemorrhage pathological image with a bleeding area. The original brain hemorrhage image with the pathological (bleeding) area is preprocessed by removing the skull and noise, etc., to generate the pathological image.

[0108] S2: Construct and train a pseudo-image generation model;

[0109] In each training iteration, the pseudo-image generation model works as follows: First, the pathological image used as training data is input into the segmenter, which segments out the pathological region mask (i.e., the pathological region mask) from the pathological image; then, the pathological region mask and the pathological image are input into the generator, which generates a pseudo-healthy image; subsequently, the pseudo-healthy image and the pathological region mask are input into the reconstructor, which generates a reconstructed pathological image; finally, the model's total loss is calculated based on the losses of the segmenter, generator, and reconstructor to train the pseudo-image generation model.

[0110] S3: Input the pathological image to be processed into the trained pseudo-image generation model, and output the corresponding pseudo-healthy image.

[0111] The pseudo-image generation model of this invention segments a pathological region mask from a pathological image using a segmenter, thereby decoupling the pathological region from the original pathological image. Then, it generates a pseudo-healthy image based on the pathological region mask and the pathological image. This allows the generator to selectively repair (remove) the pathological region of the pathological image based on the pathological region mask without changing the non-pathological regions of the pathological image. This reduces the risk of edge loss in the pathological image and ensures that the original identity of the pathological image remains unchanged when removing the pathological region. It avoids the problem of losing the subject identity during the generation of pseudo-healthy images, thus improving the effectiveness of generating pseudo-healthy images.

[0112] This invention, building upon the segmentation of pathological region masks and the generation of pseudo-healthy images, further utilizes a reconstructor to generate reconstructed pathological images based on the pseudo-healthy images and pathological region masks. On one hand, the reconstructor of this invention integrates the pathological region mask during image reconstruction, enabling better localization of pathological regions based on the mask. This achieves a one-to-one mapping of pathological regions and resolves the one-to-many problem, thereby improving the effectiveness of generating reconstructed pathological images. On the other hand, this invention trains the model based on the total loss of the segmenter, generator, and reconstructor, allowing for the reverse optimization of pathological region mask and pseudo-healthy image generation through the generation of reconstructed pathological images. In other words, it enables better generators and segmenters through reconstructor-assisted training, further improving the quality of generated pseudo-healthy images.

[0113] In the specific implementation process, when the generator generates a pseudo-healthy image, it first generates a pathological image based on the pathological image and the pathological region mask, and then removes the pathological region mask from the pathological image residual. Then, it calculates the attention score between the pathological region mask and the pathological image residual through the attention module. Finally, it combines the attention score to repair the pathological region of the pathological image residual to generate a pseudo-healthy image.

[0114] Based on the decoupling of pathological regions and original pathological images, this invention enables the generator to more effectively repair (remove) pathological regions from pathological images. By calculating the attention score between the pathological region mask and the pathological image residual through an attention module, the generator combines the attention score to repair the pathological regions of the pathological image residual. This allows the generator to focus more on the characteristics of pathological regions, thereby repairing (removing) pathological regions from pathological images better and more accurately, thus improving the quality and effectiveness of generating pseudo-healthy images.

[0115] Specifically, pseudo-image generation models mainly include segmenter networks, generator networks, reconstructor networks, and discriminator networks.

[0116] ①Splitter Network

[0117] The main purpose of the segmenter is to segment pathological regions so that they can be well located when reconstructing pathological images. In the proposed model, pathological masks are only segmented when the input image is a pathological image. When the input image is a healthy image or a deformed pathological image, pathological masks are not segmented; that is, the segmented masks follow the distribution of healthy masks, and the masks are pure black. The segmenter of this invention adopts the U-net architecture of Ronneberger (from O. Ronneberger, P. Fischer, T. Brox. U-Net: Convolutional Networks for Biomedical Image Segmentation), which is an existing mesh structure. The advantage of this structure is that the network structure is not complex and it has good segmentation effect. The specific network structure of the segmenter is as follows: Figure 2 As shown.

[0118] ② Generator Network

[0119] The generator's primary function is to convert pathological images, healthy images, and deformed pathological images into pseudo-healthy images. For pathological images with hemorrhage areas, the generator network needs to focus on repairing the pathological regions corresponding to the pathological masks segmented by the segmenter and correcting deformed feature textures to generate high-quality pseudo-healthy images. For healthy images, the generator also needs to generate corresponding pseudo-healthy images, but its main purpose is to stabilize the network model. For deformed pathological images, the generator needs to focus on correcting deformed feature textures to generate pseudo-healthy images. This generator module uses a residual network with downsampling and upsampling paths to focus on repairing the pathological regions of the image. In the downsampling path, long-skip connections are made between the attention module and the upsampling block, which helps to better preserve the details of the input image and can also target the repair of pathological regions, thus producing a clearer output. The detailed architecture of this generator is as follows: Figure 3 As shown.

[0120] The generator's attention module calculates the attention score between the pathological region mask and the pathological image residual using a contextual attention mechanism. This attention score is then used to specifically repair the pathological regions within the residual. It should be noted that image inpainting using attention scores is a well-established technology; this invention simply applies the logic of this existing technology to the inpainting of natural images, specifically to images of brain hemorrhage. Specifically, the attention score is first used to fill the feature map corresponding to the pathological region in the intermediate layer of the network, and then the attention score is used to fill the pathological region portion of the pathological image. The final result of this comprehensive filling is a pseudo-healthy image.

[0121] Contextual attention mechanisms refer to methods that borrow pixels from other locations in the original image to fill in missing regions by establishing long-term spatial dependencies required during the construction of internal feature textures. A typical contextual attention mechanism has two phases in its attention layer: "matching" and "participation." In the "matching" phase, an attention score is calculated by obtaining the similarity between patches of internal and external regions. In the "participation" phase, patches are copied and aggregated from the weighted context based on the attention score to fill the gaps.

[0122] To calculate the attention score, the input image first needs to be decomposed into low-frequency components and high-frequency components. In the case of using the contextual attention mechanism to repair the pathological region feature texture of the pathological image of the brain hemorrhage area, the low-frequency component here refers to the corresponding hemorrhage area in the pathological image, while the high-frequency component (i.e., the image residual) refers to the other areas obtained by subtracting the original pathological image from the low-frequency component.

[0123] Attention scores are calculated by the Attention Computing Module (ACM), which calculates the contextual residual by subtracting the hemorrhage area image from the original input pathological image. The contextual residual and attention score are then combined, and the aggregated residual of the mask region is calculated by the Attention Transfer Module (ATM). Note that the same padding is used in the generator, and all convolutional layers use ELUs (from DEClevert, T. Unterthiner, SHIter. Fast and accurate deep network learning by exponential linear units (elus)) as activation functions. Batch normalization layers are used appropriately because they weaken color coherence (from S. Iizuka, E. Simo-Serra, H. Ishikawa. Globally and locally consistent image completion).

[0124] The contextual attention mechanism (from J. Yu, Z. Lin, J. Yang, et al. Generative Image Inpainting with Contextual Attention) utilizes contextual information to fill in bleeding regions. Similarly, the Contextual Residual Aggregation (CRA) mechanism borrows information from the context region. However, the CRA mechanism not only borrows features from the context but also from the residuals. In particular, this generator employs the idea of ​​contextual attention, calculating an attention score by obtaining the regional similarity between patches inside and outside the bleeding region. Therefore, context-related features and residual information can be transferred to the region corresponding to the mask through the CRA mechanism. This mechanism includes two key modules: an attention calculation module and an attention transfer module.

[0125] 1) Attention Calculation Module (ACM)

[0126] Attention scores are based on high-level feature maps ( Figure 3 The similarity of regions M in the equation is calculated.

[0127] M is divided into patches. ACM calculates the cosine similarity between patches inside and outside the missing region. The calculation formula is shown in the following formula.

[0128]

[0129] Where, m i The i-th patch extracted from outside the mask in M, m j This is the j-th patch extracted from the mask corresponding to M. Then, softmax is applied to the similarity score to obtain the attention score for each patch, as shown in the following formula.

[0130]

[0131] Where N represents the number of patches outside the mask. In the proposed model, each patch is 3×3 in size, and M is 32×32, thus a total of 1024 patches can be extracted. In practical applications, the number of patches inside the mask may vary depending on the size of the mask. A uniform 1024×1024 matrix is ​​used to store the similarity scores between any possible patch pairs.

[0132] 2) Note the transfer module (ATM)

[0133] After obtaining the attention score from M, the lower-level feature map (M) c The corresponding vulnerabilities in the ) can be filled with attention score-weighted context patches, as shown in the following formula.

[0134]

[0135] Where c∈{1,2,3} is the layer number. For the i-th patch extracted outside the cover area, The j-th patch fills the masked area. N represents the number of context patches. After calculating all hole patches, the final filling feature M is obtained. c Since the size of the feature map varies with each layer, the patch size will also vary accordingly. Assuming the feature map size is 1282 and the attention score is calculated from 322 patches, then the patch size should be greater than or equal to (128 / 32)² = 42, so that all pixels can be covered. If the patch size is greater than 4×4, some pixels will overlap, which is fine because the subsequent layers of the network can learn to adapt.

[0136] 3) Residual Aggregation (RA)

[0137] Residual aggregation is an operation that patches the residual image within a hole region based on the similarity between the inside and outside of the hole region, as shown in the formula below. The goal is to restore the clear details of the missing contents.

[0138]

[0139] Where Q is the residual image, Q i For the i-th patch extracted from the context residual image outside the mask, Q j This is the j-th patch to be filled within the mask. The patch is correctly sized to precisely cover all pixels without overlapping, ensuring that the fill residual is consistent with the surrounding area.

[0140] ③ Reconstructor Network

[0141] The reconstruction network module employs a residual-based reconstruction method (from K. He, X. Zhang, S. Ren, et al. Deep Residual Learning for Image Recognition). A pseudo-healthy image and a corresponding segmentation mask are taken and input together into the reconstructor to reconstruct a pathological image consistent with the original input pathological image. The detailed architecture of the reconstructor is as follows: Figure 4 As shown, the network structure of the reconstructor is basically the same as that of the generator. The reconstructor is mainly used to reconstruct pathological regions, while the context information of the pathological regions is the healthy regions. Therefore, the reconstructor omits the attention module, which also saves some computation. In addition, the generator has a single-channel input, while the reconstructor has a dual-channel input.

[0142] ④ Discriminator Network

[0143] The model involves two discriminators for adversarial training. One is a discriminator for pseudo-healthy images (denoted as DhN), which encourages the generation of realistic pseudo-healthy images. The other is a discriminator (denoted as DmN) used to help segment pathology masks, and is used to train the segmenter when there are no paired pathology images and masks. The architecture of these two discriminators is as follows: Figure 5 As shown, adversarial training is performed using Wasserstein loss and gradient penalty (from T. Zhang, Z. Li, Q. Zhu, et al. Improved Procedures for Training Primal Wasserstein GANs).

[0144] In the specific implementation process, the pseudo-image generation model is trained through the following steps:

[0145] S200: Construct a training dataset for training the pseudo-image generation model using existing mature methods.

[0146] S211: Divide each training iteration into three loops;

[0147] S212: Pathology-Pseudo Health Cycle (PPHC): First, a pathology region mask is segmented from a pathology image containing pathology regions using a segmenter. Then, a pseudo-health image is generated based on the pathology region mask and the corresponding pathology image using a generator. Next, a reconstructed pathology image is generated based on the pseudo-health image and the pathology region mask using a reconstructor. Finally, the model loss of this cycle is calculated.

[0148] S213: Healthy-Pseudo Health Cycle (HPHC): First, a pseudo-pathological image is generated by a reconstructor based on a mask image of a pathological region and a healthy image of a pathological region. Second, a pseudo-pathological region mask is segmented from the pseudo-pathological image by a segmenter. Then, a pseudo-healthy image is generated by a generator based on the pseudo-pathological region mask and the corresponding pseudo-pathological image. Finally, the model loss of this cycle is calculated.

[0149] S214: Deformation-Pseudo Health Cycle (DPHC): First, a segmenter segments a mask of the non-pathological region from a deformed image that has deformation but no pathological region. Second, a generator generates a pseudo-healthy image based on the mask of the non-pathological region and the corresponding deformed image. Then, a reconstructor generates a reconstructed deformed image based on the pseudo-healthy image and the mask of the non-pathological region. Finally, the model loss of this cycle is calculated.

[0150] S215: The model loss of the three cycles of pathology-pseudo-health, health-pseudo-health and deformation-pseudo-health is added together to obtain the total model loss of this training iteration, which is used to train the pseudo-image generation model.

[0151] S216: Repeat steps S211 to S215 until the pseudo-image generation model converges.

[0152] This invention trains the model using a method of three sub-loops as one cycle (training iteration). Specifically, each sub-loop trains one type of image, and the losses of the three sub-loops are added together as a cycle loss to train the model. The three sub-loops are pathology-pseudo-healthy loop, health-pseudo-healthy loop, and deformation-pseudo-healthy loop.

[0153] The pathological-pseudo-healthy cycle (PPHC) Figure 6 As shown, this means that the input to this loop is a pathological image with bleeding areas. The generator produces a pseudo-health image. To train for better pseudo-health images and to make the model more stable, two loops are added: the health-pseudo-health loop (HPHC) and the deformation-pseudo-health loop (DPHC). The HPHC loop means that the input to this loop is a health image (HI), the image generated by the generator is also a pseudo-health image, and the reconstructor naturally reconstructs a health image. The main purpose of this loop is to prevent the segmenter from missegmenting pathological masks when the input image is a health image. Therefore, this loop ensures that the model will not segment pathological masks from the input health image, thus achieving the effect of stabilizing the model. Recurrent DPHC means that the input to this loop is a deformed image (DI) with deformation but no bleeding area. The image generated by the generator is also a pseudo-healthy image. The main purpose of this loop is to strengthen and correct the pathological image caused by deformation and promote the generation of pseudo-healthy images. The segmenter will still not segment the pathological mask for images with deformation but no bleeding area. Unlike recurrent HPHC, the order of the input images in different modules is different, and the loss function referenced is different, but all of them are to make the entire generative model more stable so as to generate better pseudo-healthy images.

[0154] This invention, based on the existing training method (i.e., the pathology-pseudo-healthy loop), further adds a health-pseudo-healthy loop and a deformation-pseudo-healthy loop. On one hand, the health-pseudo-healthy loop prevents the segmenter from missegmenting pathological masks when the input image is healthy, ensuring that the model will not segment pathological masks from healthy input images, thereby stabilizing the model and improving the quality of pseudo-healthy image generation. On the other hand, the deformation-pseudo-healthy loop strengthens the correction of pathological images caused by deformation, promoting the generation of pseudo-healthy images. The segmenter will still not segment pathological masks from images with deformation but no bleeding areas, similarly achieving the effect of stabilizing the model and improving the quality of pseudo-healthy image generation.

[0155] ① Pathological-Pseudo-healthy Cycle (PPHC)

[0156] Combination Figure 6 As shown, in the pathology-pseudo-healthy cycle (PPHC), the original pathological image with hemorrhage areas, after preprocessing such as skull removal and noise reduction, yields the pathological image x. p , where x p Following a pathological distribution, i.e., x p ~P, x p After passing through the segmenter (SeN), the pathological area mask, i.e., the mask m, is segmented out. p m p =SeN(x p ), and m p It conforms to the distribution of pathological masks, i.e., m p ~P m The segmented mask m p Compared with pathological images x p As input to the generator (GeN), the pathological image is transformed into a pseudo-healthy image. gh x gh =GeN(x p ,m p ), where x gh Follows a healthy distribution, i.e., x gh ~H, the generated pseudo-healthy image should retain the identity of the subject and be healthy; pseudo-healthy image x gh Masked image of pathological region m p As input to the Reconstructor (ReN), it is reconstructed into a pathological image x. rp x rp =ReN9x gh ,m p The pathology-pseudo-health cycle (PPHC) is achieved through the following steps:

[0157] S2121: Pathological images of areas containing pathological features x pAs input to the pseudo-image generation model, x p Following a pathological distribution, i.e., x p ~P;

[0158] S2122: From pathological image x via segmenter p The pathological area mask is segmented out from the middle, i.e., the pathological area mask m p m p =SeN(x p ), and m p It conforms to the distribution of the pathological region mask, i.e., m p ~P m ;

[0159] S2123: Mask the pathological area m p and the corresponding pathological image x p As input to the generator, a pseudo-healthy image x is generated. gh x gh =GeN(x p ,m p ), where x gh Follows a healthy distribution, i.e., x gh ~H, the generated pseudo-healthy image should retain the identity of the subject and show that the subject is healthy;

[0160] S2124: Transfer the pseudo-health image x gh and pathological area mask m p As input to the reconstructor, the reconstructed pathological image x is generated by the reconstructor. rp x pp =ReN(x gh ,m p );

[0161] S2125: Calculate the loss of the segmenter, generator, and reconstructor.

[0162] Figure 7 The paper presents image examples output by each module in the Pathology-Pseudo-Health Cycle (PPHC). This invention, through the Pathology-Pseudo-Health Cycle (PPHC), enables the reverse optimization of pathological region masks and pseudo-health images by generating reconstructed pathological images. In other words, it allows for better generator and segmenter training assisted by the reconstructor, thereby further improving the quality of the generated pseudo-health images.

[0163] ②The Health-Pseudo-Health Cycle (HPHC)

[0164] Consider that if the input image itself is healthy, then the mask output by the segmenter should not have any pathological regions. However, experiments have shown that some healthy images are still segmented into pathological regions by the segmenter, which is not conducive to the synthesis of pseudo-healthy images and the reconstruction of pathological images. Therefore, this invention designs a loop HPHC. This loop helps the model to avoid being segmented into pathological regions by the segmenter when given a healthy image, and also helps to reconstruct a more ideal pathological image and enhance the stability of the model.

[0165] Combination Figure 8 As shown, in the Health-Pseudo-Healthy Loop (HPHC), compared to PPHC, the input in this loop is a healthy image. Besides the different input image, the position of the input image in the model also differs. Specifically, the mask image m of the non-pathological region is first... h With health image x h As input to the Reconstructor (ReN), it is reconstructed into a pseudo-pathological image ①x rh x rh =ReN(x h ,m h ), where the health image x h Follows a healthy distribution, i.e., x h ~H, and m h It follows the health mask distribution, i.e., m h ~H m x rh Follows a healthy distribution, i.e., x h ~H; Pseudo-pathological image x rh After passing through the segmenter (SeN), a pseudo-pathological region mask m is segmented. sh m sh =SeN(x rh ), where m sh It follows the health mask distribution, i.e., m sh ~H m The mask appears as pure black; the mask for pseudo-pathological areas is m. sh With pseudo-pathological images x rh As input to the generator (GeN), a pseudo-healthy image x is generated. hh x hh =GeN(m sh ,x rh ), and pseudo-healthy image x hh Follows a healthy distribution, i.e., x hh ~H. Achieve a health-pseudo-health cycle (HPHC) through the following steps:

[0166] S2131: X image of a healthy region without pathological areas h As input to the pseudo-image generation model;

[0167] S2132: X image of a healthy region without pathological areas h and its health mask m h As input to the reconstructor, a pseudo-pathological image x is generated by the reconstructor. rh x rh =ReN(x h ,m h ), where the health image x h Follows a healthy distribution, i.e., x h ~H, and m h It follows the health mask distribution, i.e., m h ~H m x rh Follows a healthy distribution, i.e., x h ~H;

[0168] S2133: From pseudo-pathological images x using a segmenter rh The pseudo-pathological area mask is segmented in the middle. sh m sh =SeN(x rh ), where m sh It follows the health mask distribution, i.e., m sh ~H m The mask appears as pure black;

[0169] S2134: Mask the pseudo-pathological areas m sh and the corresponding pseudo-pathological image x rh As input to the generator, a pseudo-healthy image x is generated. hh x hh =GeN(m sh ,x rh ), and pseudo-healthy image x hh Follows a healthy distribution, i.e., x hh ~H;

[0170] S2135: Calculate the loss of the segmenter, generator, and reconstructor.

[0171] Figure 9 The image examples output by each module in the Health-Pseudo-Health Loop (HPHC) are shown. This invention, through the Health-Pseudo-Health Loop, prevents the segmenter from missegmenting pathological masks when the input image is healthy. This ensures that the model will not segment pathological masks from the input healthy image, thereby stabilizing the model and improving the quality of pseudo-healthy image generation.

[0172] ③ Deformation-Pseudo-Healthy Cycle (DPHC)

[0173] Consider that if the input image itself is deformed, and only has deformation without bleeding areas, then the mask output by the segmenter should also lack pathological regions, meaning it won't segment out disease information (pathological regions), and the reconstructed image will conform to the deformation distribution. This situation wasn't considered in the previous two loops. Therefore, this invention also designs a cyclic DPHC loop. This loop helps correct deformed images, particularly enhancing the generation of pseudo-healthy images with only deformation but no bleeding areas. This allows the model to better correct deformed regions, generate higher-quality pseudo-healthy images, and also makes the model more stable.

[0174] Combination Figure 10 As shown, in the Deformation-Pseudo-Healthy Cycle (DPHC), the pathological image x, after preprocessing such as craniotomy and noise reduction, shows only deformation without hemorrhage areas. dp , where x dp It follows the pathological distribution of deformation, i.e., x dp ~DP, x dp After passing through the segmenter (SeN), the pathological area mask, i.e., the mask m, is segmented out. dh m dh =SeN(x dp ), and m dh It follows the health mask distribution, i.e., m dh ~H m The segmented mask m dh Compared with pathological images x dp As input to the generator (GeN), the pathological image is transformed into a pseudo-healthy image. gdh x gdh =GeN(x dp ,m dh ), where x gdh Follows a healthy distribution, i.e., x gdh ~H, and the generated pseudo-healthy image should retain the identity of the subject; pseudo-healthy image x gdh Masked image of pathological region m dh As input to the Reconstructor (ReN), it is reconstructed into a pathological image x. rdp x rdp =ReN(x gd ,m dh ), where x rdp It follows the pathological distribution of deformation, i.e., x rd ~DP. Note that the mask m here... dh Although attention is included as input to the generator, the attention mechanism is ineffective because it only applies to pathological regions of the image. The Deformation-Pseudo-Health Cycle (DPHC) is achieved through the following steps:

[0175] S2141: Transform deformed images (x) that show deformation but no pathological areas. dp As input to the pseudo-image generation model, x dp It follows the pathological distribution of deformation, i.e., x dp ~DP;

[0176] S2142: From the deformed image x using a segmenter dp The deformed, pathology-free area mask is segmented out from the middle, i.e., the pathology-free area mask m dh m dh =SeN(x dp ), and m dh It follows the health mask distribution, i.e., m dh ~H m ;

[0177] S2143: Mask for areas without pathology m dh and the corresponding deformation image x dp As input to the generator, a pseudo-healthy image x is generated. gdh x gdh =GeN(x dp ,m dh ), where x gdh Follows a healthy distribution, i.e., x gdh ~H, and the generated pseudo-healthy image should retain the identity of the subject;

[0178] S2144: Transfer the pseudo-health image x gdh and non-pathological area mask m dh As input to the reconstructor, the reconstructed deformed image x is generated by the reconstructor. rdp x rdp =ReN(x gdh ,m dh ), where x rdp It follows the pathological distribution of deformation, i.e., x rdp ~DP;

[0179] S2145: Calculate the loss of the segmenter, generator, and reconstructor.

[0180] Figure 11 The image examples output by each module in the Deformation-Pseudo-Health Cycle (DPHC) are shown. This invention, through the Deformation-Pseudo-Health Cycle, can enhance the correction of pathological images caused by deformation and promote the generation of pseudo-health images. The segmenter will still not segment out the pathological mask for images with deformation but no bleeding areas, thus achieving the same effect of stabilizing the model and improving the quality of pseudo-health image generation.

[0181] The training loss of pseudo-image generation models can be divided into three categories: adversarial loss, periodic consistency loss, and segmentation loss. (Combined) Figure 6 , Figure 8 ,and Figure 10 As shown, L d1 L d2 and L d3 This is the Wasserstein loss with gradient penalty (i.e., resistance loss). L p L h1 L h2 and L dp This is periodic consistency loss, which helps maintain the identity of the subject in the input image. sp L sd and L sup For segmentation loss, the segmenter has two training loss settings. When the pathological image has a corresponding standard segmentation mask, a dice coefficient loss is used, which is called the paired loss setting; when the pathological image does not have a corresponding labeled segmentation mask, an adversarial loss is used, which is called the unpaired loss setting.

[0182] In the pathological-pseudo-healthy cycle, the losses of the segmenter, generator, and reconstructor are calculated using the following formula:

[0183] 1) Losses of the divider;

[0184] When there is a mask annotation (i.e., when the pathological image has a corresponding standard segmentation mask), the segmenter loss is:

[0185]

[0186] In the formula: x P And m represents a pair of pathological images and standard segmentation masks (i.e., mask annotations); SeN(x P ) represents the pathological region mask predicted by the segmenter; Dice(·) represents the dice coefficient loss;

[0187] When there is no mask annotation (i.e., when the pathological image does not have a corresponding standard segmentation mask), the segmenter loss is:

[0188]

[0189]

[0190] In the formula: x p Represents pathological images; m mp It is a pathological image x p The pathological region mask is randomly extracted from other pathological images; DmN represents the classification segmentation mask GeN(x p ) and randomly extracted pathological area mask m mp Mask discriminator;

[0191] 2) Generator loss:

[0192]

[0193]

[0194] In the formula: x p Represents pathological images; GeN(x p ) represents x p The corresponding pseudo-health image; x h1 represents a healthy image; DhN represents a health discriminator that distinguishes between real and fake healthy images, with the first two terms measuring the Wasserstein distance between real and fake healthy images; This represents the gradient penalty loss involved in stable training; σ is set to 10.

[0195] 3) Loss of the reconstructor:

[0196]

[0197] In the formula: x p Represents pathological images; GeN(x) p ) is x p The corresponding pseudo-health image; SeN(x) p ReN(SeN(x) represents the pathological region mask segmented by the segmenter; p ),GeN(x p )) indicates that the reconstructor is based on GeN(x) p ) and SeN(x p The reconstructed pathological image generated.

[0198] In the healthy-pseudo-healthy loop, the losses of the segmenter, generator, and reconstructor are calculated using the following formula:

[0199] 1) Losses of the divider:

[0200]

[0201] In the formula: x h and m h ReN(x) represents the health image and the corresponding health mask, respectively; h ,m h ) indicates that the reconstructor is based on the healthy image x h and health mask m h Generated pseudo-pathological images (fake "healthy" images); SeN(ReN(x h ,m h )) represents a pseudo-pathological image ReN(x h ,m h A mask for pseudo-pathological areas;

[0202] 2) Generator loss:

[0203]

[0204] In the formula: x h and m h ReN(x) represents the health image and the corresponding health mask, respectively; h ,m h ) indicates that the reconstructor is based on the healthy image x h and health mask m h Generated pseudo-pathological images; GeN(ReN(x) h ,m h The generator is based on the pseudo-pathological image ReN(x). h ,m h The generated pseudo-health image;

[0205] 3) Loss of the reconstructor:

[0206]

[0207]

[0208] In the formula: x h and x h2 Let m represent two different health images extracted from the health image distribution H; h Image x representing health h The corresponding health mask, i.e., the black mask; ReN(x h ,m h ) indicates that the reconstructor is based on the healthy image x h and health mask m h The generated pseudo-pathological image.

[0209] In the deformation-pseudo-healthy loop, the losses of the segmenter, generator, and reconstructor are calculated as follows:

[0210] 1) Divider loss:

[0211]

[0212] In the formula: x dP and m dh Represents a pair of deformed images and masks; SeN(x) dP ) indicates that the segmenter is based on x dP Masking of the segmented non-pathological areas;

[0213] 2) Generator loss:

[0214]

[0215]

[0216] In the formula: x dp Represents a deformed image; GeN(x) dp ) indicates that the generator is based on x dp The generated pseudo-healthy image; x h3 represents a healthy image; DhN represents a discriminator that distinguishes between real and synthetic healthy images, with the first two terms measuring the Wasserstein distance between real and synthetic healthy images; This represents the gradient penalty loss involved in stable training; σ is set to 10.

[0217] 3) Loss of the reconstructor:

[0218]

[0219] In the formula: x dp Represents a deformed image; GeN(x) dp ) indicates that the generator is based on x dp Generated pseudo-healthy image; SeN(x) dP ) indicates that the segmenter is based on x dP Masking of the segmented non-pathological regions; ReN(SeN(x) dp ),GeN(x dp )) indicates that the reconstructor is based on GeN(x) dp ) and SeN(x dp The reconstructed deformed image generated.

[0220] The total loss of the model is calculated using the following formula:

[0221] 1) When there are mask markings, calculate the total loss:

[0222]

[0223] In the formula: L pe This represents the total model loss when mask annotations are used; to This indicates the weight parameters that are set.

[0224] 2) Calculate the total loss when there is no mask annotation.

[0225]

[0226] Where: LK upe This represents the total model loss without mask annotation.

[0227] To better illustrate the advantages of the technical solution of the present invention, the following experiments are disclosed in this embodiment.

[0228] 1. Dataset and Preprocessing

[0229] The experimental data includes 1300 healthy CT slices extracted from the First Affiliated Hospital of Chongqing Medical University, 1300 pathological cerebral hemorrhage CT slices with doctor-annotated masks, 1300 unannotated pathological cerebral hemorrhage CT slices, and 200 CT slices without cerebral hemorrhage but with midline shift or space-occupying lesions caused by hematoma. After image preprocessing, a dataset that can be directly used for training and validation was obtained.

[0230] 2. Model Evaluation

[0231] Since pathological images and corresponding healthy images of the same subject cannot coexist under normal circumstances, there are no real healthy images to directly evaluate the quality of the generated pseudo-healthy images. In previous studies, the quality of generated images has also rarely been directly evaluated. To address this issue, this experiment proposes four numerical evaluation metrics to assess the quality of the generated images: health level, identity verification (from T. Xia, A. Chartsias, SATsaftaris. Adversarial pseudo healthy synthesis needs pathology factorization), distortion correction effect, and pixel distribution difference from healthy images. An expert evaluation study was also conducted on a subset of the experiments.

[0232] ① Machine Evaluation (Formula Evaluation)

[0233] 1) Health

[0234] To evaluate the “health” level of the pseudo-healthy image, a segmenter was pre-trained and fine-tuned on the validation set. The main function of the segmenter is to segment the pathological region from the generated pseudo-healthy image and also from the original pathological image. The percentage of the sum of the two pathological region pixels represents the “health” level of the pseudo-healthy image. The higher the percentage, the larger the pathological region in the generated pseudo-healthy image, and therefore the lower its health level. In form, the health level (Health, H) is represented by H, and the calculation formula is shown in Equation (1).

[0235]

[0236] Where x p It is a pathological image, f p It is a pre-trained segmenter, and N(·) is the segmenter trained by f. p The number of pixels labeled as pathological regions. The denominator uses the pathological image f. p (x p The segmentation mask, rather than the real m pThis is to offset potential biases caused by the pre-trained segmenter. Subtracting this term from 1 will increase H when the pathological mask becomes smaller, indicating a higher level of health.

[0237] 2) Identity retention

[0238] Identity retention measures the degree to which the generated pseudo-healthy image preserves the identity of the subject, i.e., the probability that the synthesized pseudo-healthy image and the input pathological image come from the same subject. This is achieved by evaluating the structural similarity between the pseudo-healthy image and the corresponding pathological image outside the pathological region, using the Multiscale Structural Similarity Index (MS-SSIM) (from Z. Wang, Esimoncelli, ACBovik. Multiscale structural similarity for imagequality assessment) to evaluate identity retention. Formally, identity retention (IR) is denoted by I, and the calculation formula is shown in Equation (2):

[0239] I = MS - SSIM[(1-m p )⊙x hp ,(1-m p )⊙x p ] = MS-SSIM[(1-m p )⊙GeN(x p ),(1-m p )⊙x p (2) where x p For pathological images, m p Here is the corresponding pathological mask, and ⊙ represents pixel-by-pixel multiplication.

[0240] 3) Deformation correction

[0241] In some cases, large hematomas can form within the brain due to significant bleeding, compressing surrounding tissues and causing deformation. Repairing these deformations is challenging because it requires not only repairing the hemorrhagic area but also altering the structure of other brain tissues. This poses a significant challenge to subject identity preservation, as health measures whether the generated pseudo-healthy image contains hemorrhagic areas, while identity preservation depends on the positional correspondence between the original pathological image and the generated pseudo-healthy image window pixels. Therefore, health and identity preservation cannot accurately measure whether deformed tissue within the brain has been repaired, and the better the deformation of the pathological image is corrected, the worse the subject identity preservation may be. Therefore, Deformation Correction (DC), denoted by D, measures the degree of deformation correction in the pseudo-healthy image, aiming to assess whether the generator has repaired the deformed tissue in the pathological image.

[0242] Normally, doctors determine whether an image has pathological features of deformation by observing whether there is obvious pushing between tissues. If there is pushing between tissues, the corresponding tissue will appear as a distortion at the tissue edge in the image. Since deformation is mainly judged by observing pushing between tissues, to facilitate observation, the intensity deviation inside the tissue can be eliminated by extracting tissue edge information. Figure 12 This image shows a deformed CT image of a brain hemorrhage and its extracted edge image, where the deformation indicated by the arrow can be observed.

[0243] Based on the aforementioned judgment principle, the deformation correction degree is defined as follows: First, a classifier is pre-trained. The main function of this classifier is to classify the corresponding edge extraction maps of slices with and without deformation. According to experiments, the pre-trained classifier has an average accuracy of 90.2%, which means that the classifier can distinguish between healthy edges and deformed edges. The output of this classifier is a continuous number between 0 and 1, which represents the probability that the synthesized pseudo-healthy image is without deformation, and this probability is used to represent the deformation correction degree.

[0244] 4) Difference in pixel grayscale distribution between the image and the healthy image

[0245] a. Calculation method

[0246] For a set of healthy images, the value of each pixel in each image follows a normal distribution. By comparing the normal distribution of each pixel in the pseudo-healthy image with the corresponding pixel in the registered healthy image, we can observe where the value of each pixel in the pseudo-healthy image falls within the normal distribution. By calculating the difference between the pixel value and the expected value of the corresponding normal distribution, we can determine the distribution difference between the pixel and the healthy image pixels. The pixel distribution difference with the healthy image (PDDHI) is denoted by P, and its value is the average area formed by the pixel grayscale values ​​of the generated pseudo-healthy image and the average pixel grayscale values ​​of the healthy image on the probability distribution function. This experiment uses the registration method of Sun (from Sun Tao, "Registration and Segmentation of Two-Dimensional Cranial CT Images Based on Feature Vectors"). It is assumed that the i-th pixel of the registered healthy image... The probability density function (PDF) that follows a normal distribution is: The calculation formula is shown in equation (3).

[0247]

[0248] in The pseudo-healthy image x after registration h The i-th pixel is used as a variable. Let represent the expected value of the normal distribution of the i-th pixel in the registered health image. For convenience, the average value is used instead. The calculation formula is shown in equation (4). Let represent the variance of the i-th pixel in the registered health image, calculated as shown in equation (5).

[0249]

[0250]

[0251] Where K represents K registered images x j , This represents the value of the i-th pixel in the j-th image.

[0252] Corresponding to probability density function The cumulative distribution function is shown in equation (6).

[0253]

[0254] As can be seen from the definition of the difference in pixel distribution between the healthy image and the image, the formula for calculating P is shown in equation (7).

[0255]

[0256] in Let P represent the value of the i-th pixel in the pseudo-healthy image to be evaluated, and N represent the total number of pixels in the pseudo-healthy image. Numerically, P represents the average area between the expected values ​​of all pixels in the pseudo-healthy image and the expected values ​​of all pixels in the registered healthy image, spread across the probability density functions. The smaller the area, the closer the value of the i-th pixel in the pseudo-healthy image is to the expected value of the i-th pixel in the registered healthy image, meaning the healthier the pseudo-healthy image is.

[0257] b. Justification of evaluation indicators

[0258] To demonstrate that the pixel distribution difference index proposed in this experiment can reasonably assess the quality of generated pseudo-healthy images, an experiment was conducted: Three experts each selected 300 pseudo-healthy images of cerebral hemorrhage generated by different models. These 300 images were generated from 50 original pathological images corresponding to 6 different models, i.e., each group contained 6 images, for a total of 50 groups. The experts ranked each group of images according to their subjective judgment, from high to low quality. The experts were required to spend no more than 2 minutes scoring each group. The pixel distribution difference value between the selected generated images and the healthy images was calculated using the proposed index P. The results showed that the average Pearson correlation coefficient between the image sequence number ranked by the three experts and the sequence number of the proposed index P was 0.99, indicating that the proposed pixel distribution difference index can correctly assess the quality of the generated images. Figure 13 This is a set of examples comparing the quality of pseudo-healthy images generated by different models. The table shows the experts' ranking of the quality, with the best number being 1, the second best number being 2, and so on. The value of the difference P between the pixel grayscale distribution of the pseudo-healthy images and the healthy images is shown in the table. The smaller the area, the closer it is to 0, the better the quality of the pseudo-healthy image. The data in the figure shows that the proposed index is basically consistent with the expert evaluation results, indicating that the proposed index can reasonably evaluate the quality of pseudo-healthy images.

[0259] ② Expert Evaluation

[0260] Currently, there is no well-defined method for evaluating the quality of generated pseudo-healthy images. To demonstrate that the proposed machine evaluation metrics can effectively assess the quality of pseudo-healthy images, especially for the "quality" evaluation of generated images in this comprehensive task, an expert evaluation is introduced. Experts visually inspect the synthesized pseudo-healthy images and score them according to the four metrics mentioned above. This further verifies whether the proposed calculation methods for health, identity preservation, and deformation correction correctly evaluate the quality of the synthesized pseudo-healthy images. Forty pathological image slices were extracted from the validation set to obtain the output of synthesized pseudo-healthy images. Then, three medical image analysis researchers were asked to independently score each evaluation metric of the synthesized images using binary scoring. The scoring rules for each metric of the expert evaluation of the quality of each synthesized pseudo-healthy image are defined as follows:

[0261] Health score: represented by h, which evaluates whether the synthesized pseudo-healthy image is healthy. A score of 1 indicates health and 0 indicates unhealthiness.

[0262] Identity Preservation: Represented by i, it evaluates whether the synthesized pseudo-healthy image belongs to the same topic as the original image. A score of 1 is given if they belong to the same topic, and a score of 0 is given if they do not belong to the same topic.

[0263] Deformation correction degree: denoted by d, it evaluates whether the deformation of the synthesized pseudo-healthy image has been corrected. A score of 1 indicates that the deformation has been corrected, and a score of 0 indicates that the deformation has not been corrected.

[0264] Each image set associated with a given image includes: the input pathological image and a pseudo-healthy image output by the test algorithm. Experts are unaware of which algorithm generated the pseudo-healthy images they are evaluating; the arrangement of images within each set is randomized. Experts only know that the first image is the algorithm's input image. In total, each expert evaluates 40 sets of images, each set containing 7 images: the algorithm's input image and the algorithm's output image. Each algorithm's output image is scored by the expert based on three metrics, providing a total of 720 scores. With 3 experts scoring, there are a total of 2160 scores. Experts are required to spend no more than 2 minutes scoring a single set.

[0265] 3. Training Strategies

[0266] ① Three cycles of periodic training

[0267] Inspired by Zhu et al. (from J.Zhhu, T.Park, P.Isola, et al. Unpaired Image-to-ImageTranslation using Cycle-Consistent Adversarial Networks), the model is trained using three sub-loops as a cycle. Figure 6As shown, the first loop is PPHC, which aims to train the model to perform mask segmentation of pathological images with hemorrhage areas, generation of pseudo-healthy images, and reconstruction of pathological images with hemorrhage areas. The second loop is HPHC, which aims to increase the model's stability. The reconstructor first takes a healthy image and a "healthy" mask (i.e., an image with all pixels at zero) as input and generates a pseudo-healthy image. Then, this pseudo-healthy image is passed as input to the generator and segmenter to generate the input healthy image and healthy mask, respectively.

[0268] The recurrent HPHC loop is designed for several reasons. First, it aims to prevent the reconstructor from generating an image with pathological regions when given a healthy mask as input. Second, it encourages the generator to produce images that better preserve their identity; that is, when the generator's input is a "healthy" image, the output should also be a "healthy" image, and none of the network modules should detect any pathological information in their outputs. If the output mask is unhealthy, it means the reconstructor is not well-trained, i.e., it generates pathological information itself, or the segmenter, due to poor training, detects non-existent pathology. In this case, both the reconstructor and segmenter will be penalized, prompting the segmenter to optimize so that it does not hide information useful for reconstruction. Therefore, all the information needed by the generator is contained only in the pseudo-healthy image.

[0269] The third cycle is DPHC, which aims to correct deformed parts in pathological images. Compared to Cycle PH, DPHC takes input pathological images without bleeding areas but with deformation due to compression. Therefore, the mask obtained by the segmenter should be a "healthy" mask. Like Cycle HPHC, this cycle also helps stabilize the model.

[0270] ② Paired and unpaired losses

[0271] Based on whether the pathological image has a corresponding labeled mask, the loss of the training model is divided into paired and unpaired cases. The first case, called paired loss, occurs when the pathological image has a corresponding labeled mask. In this case, the segmenter is trained using a dice-based segmentation loss, directly utilizing the difference between the real pathological mask and the segmented mask. The second case, called unpaired loss, occurs when the pathological image does not have a corresponding labeled mask. In this case, supervised training is not possible; instead, a mask discriminator called DmN is used to distinguish between the segmented mask and the real pathological mask, thereby learning the prior knowledge of the pathological region shape. This mask discriminator is then inversely trained, using real pathological masks randomly selected from pathological image slices. This experiment provides a detailed mathematical description of the periodic consistency loss, adversarial loss, and segmentation loss.

[0272] In the first case, the overall pairing loss L pe The calculation formula is shown in equation (8).

[0273] The parameters are set as follows:

[0274] In the second case, the overall unpaired loss L upe The calculation formula is shown in equation (9).

[0275] The parameters are set as follows:

[0276] The parameter values ​​were set experimentally, similar to the previous work by Xia et al. (from T. Xia, A. Chartsias, SATsaftaris. Adversarial pseudo-healthy synthesis needs pathology factorization). Cyclic PPHC It is a circulating HPHC twice as much as and Because the focus of the experiment was on synthesizing pseudo-healthy images from pathological images. Furthermore, L p of It is L d1 of 10 times, that is and at last, In the paired settings, it is set to 10 to encourage accurate splitting, as splitting is a challenging task. Unpaired settings. The value settings are similar, except... It is set to 1 because this is a GAN loss, and this setting helps to balance the losses of the segmenter and the mask discriminator. The value is set the same as PPHC, but halved, because the main purpose of this loop is to correct deformation and is used to assist training.

[0277] ③ Implementation details

[0278] Training runs for 300 epochs, alternating between updating the discriminator and generator weights. Since Wasserstein GAN requires the discriminator to approach the optimal solution during training, for every generator update, the discriminator requires 5 iterations of updates. In the first 20 epochs, for every generator update, the discriminator requires 50 iterations of updates. A Keras framework is used, trained with the Adam optimizer (from DPKingma, J.Ba. Adam: a method for stochastic optimization) at a learning rate of 0.0001 and β1 of 0.5. Table 1 shows the training algorithm for the proposed pseudo-image generation model.

[0279] All experimental results were obtained through triple cross-validation. For all types of data, 5 / 8 of the data was used for training, 1 / 8 for validation, and 1 / 4 for testing.

[0280] Table 1 Algorithm for Generating Pseudo-Healthy Images of Cerebral Hemorrhage Based on Pathological Decoupling

[0281]

[0282]

[0283] 4. Experimental Comparison and Analysis

[0284] All results were obtained on the test set, and the results shown are averages. For each metric, the best-performing test result is indicated in bold, and a star (*) is used to indicate a test result that shows significant superiority over the baseline method.

[0285] ① Comparative experiment

[0286] In this experiment, the pseudo-health image generation algorithm proposed in this invention is compared with the performance of four other better pseudo-health image generation algorithms. The other five algorithms are Conditional GAN, Cycle GAN, AAE, VaGAN, and ANT-GAN.

[0287] Conditional GAN ​​(from M. Mirza and S. Osindero, Conditional generative adversarial nets): This is an adversarial training algorithm and serves as a baseline method. Mirza's Conditional GAN ​​outputs the input image conditionally without using a segmentation mask. This baseline method uses a generator and a discriminator, and it shares some of the same architecture as the proposed method.

[0288] Cycle GAN (from J.Zhhu, T.Park, P.Isola, et al. Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks): This is an adversarial training algorithm, also used as a baseline method. Zhu's Cycle GAN involves training in two domain cycles: one P to H to P, and the other H to P to H ("P" refers to the pathological domain, and "H" refers to the healthy domain), without using segmentation masks. The generator and discriminator of Cycle GAN also have the same architecture as the proposed method.

[0289] AAE (from X. Chen, E. Konukoglu. Unsupervised detection of lesions in brain MRI using constrained adversarial auto-encoders): Chen's autoencoder-based method is a recently proposed approach aimed at solving similar problems. It trains an adversarial autoencoder (AAE) only on healthy images and uses the trained model for pseudo-healthy synthesis. This method does not use segmentation masks or pathological data.

[0290] VaGAN (from CFB Baumgartner, LMKoch, KCTezcan, et al. Visual Feature Attribution using Wasserstein GANs): Baumgartner's method, this is another proposed pseudo-healthy image generation approach that modifies 2D slicing. This method utilizes residual mapping, which is then added to the input image to generate pseudo-healthy images, employing L2 loss. This method does not use segmentation masks.

[0291] ANT-GAN (from L. Sun, J. Wang, Y. Huang, et al. An adversarial learning approach to medical image synthesis for lesion detection): Sun proposed an abnormal-normal translation generative adversarial network method that aims to generate a corresponding normal image from an abnormal image containing lesions. By using a generator and a discriminator, a cycle consistency is formed. Like other methods, no real normal image can be used. Finally, a normal image that looks corresponding is obtained, with only the abnormal region modified.

[0292] All methods are trained using two sets of data: "healthy" data consisting of images without labeled lesion masks, and a "pathological" set containing lesion regions. The only exception is Chen's AAE method, which only requires the "healthy" image dataset for training. For the proposed method, approximately 60 masks are used to train the mask discriminator in the unpaired case. It is important to note that these comparison methods do not require pathological masks for training.

[0293] 1) Qualitative evaluation

[0294] Figure 14 This paper showcases pseudo-healthy images generated by different methods. From top to bottom, the rows represent the original pathological image and pseudo-healthy images generated by Conditional GAN, Cycle GAN, AAE, VaGAN, ANT-GAN, and the proposed method in both unpaired and paired cases. The figures show that the proposed method generates clear pseudo-healthy images, preserving details and maintaining a good identity consistent with the subject. It also shows good repair effects on areas of compression and deformation. Cycle GAN, in generating pseudo-healthy images, needs to retain information about the pathological areas in the image, which makes its pseudo-healthy images quite blurry. The pseudo-healthy images generated by the Cycle GAN model have poor health conditions; as can be seen from the figures, their health condition is not as good as that of VaGAN and GAN. VaGAN uses a 1 loss between the input and generated images, while Conditional GAN ​​does not. In the generated pseudo-healthy images, different problems can be observed between the two methods. VaGAN's results preserve the brain's outline, but lack detail. Conditional GAN's pseudo-healthy images mostly show outline loss, but internal details are preserved relatively well. The AAE model's pseudo-healthy images are the worst, exhibiting artifacts in pathological areas, suggesting that the pathological areas were not properly removed, and occasionally showing bottom gaps. This is because there is no significant loss to ensure the generated image retains the subject's identity, nor is there a loss to explicitly ensure the model's pathological area repair. ANT-GAN's pseudo-healthy images maintain good outlines, but internal details are still insufficiently preserved.

[0295] 2) Quantitative evaluation

[0296] The results of the quantitative evaluation are shown in Table 2. The table presents the quality assessment of the pseudo-healthy images generated by six methods, evaluated using the assessment method proposed in this experiment. Both machine and expert assessments were conducted. All values ​​shown are averages calculated based on the test results. For each metric, 1 is the best and 0 is the worst. The expert assessment results (last three columns) show the best average in bold. Statistical significance (5% level) of the proposed method compared to the best baseline is indicated by an asterisk (*). The table shows that the model trained with the proposed method generates the best quality pseudo-healthy images in the paired case, followed by the model trained in the unpaired case. The quality of the pseudo-healthy images generated in both paired and unpaired cases is superior to all other comparative and baseline methods. A key reason why the proposed method can improve the quality of generated pseudo-healthy images is the pathological decoupling concept. This concept allows for accurate reconstruction of the input pathological image without hiding pathological information in the pseudo-healthy image.

[0297] Table 2 Evaluation results of pseudo-health images generated by different comparison methods

[0298]

[0299] The data in Table 2 demonstrates that the pseudo-healthy images obtained using the Cycle GAN method have superior health scores. Cycle GAN also achieves the third-best result in terms of identity preservation, showing the benefit of cycle consistency loss in preserving subject identity. The table also presents the h, i, and d evaluations made by experts according to the given requirements. The scores given by several experts are averaged to obtain a single consensus score for each method for each image, used to calculate the statistical analysis. From the expert's perspective, the proposed method still outperforms the baseline and other comparative methods, showing significant improvements across all metrics. Furthermore, the ranking of the metric scores by experts remains largely unchanged compared to the ranking obtained by machine evaluation. Specifically, the pseudo-healthy images generated by Cycle GAN can "fool" the pre-trained segmenter, resulting in high health scores by machine evaluation but only average health scores by experts. These experimental results also indicate that although the results of machine evaluation and expert evaluation are largely consistent, there is still room for improvement. Furthermore, the correlation coefficients between the machine evaluation results and the expert evaluation results were calculated, with health score, identity retention score, and deformation correction score being 0.94, 0.93, and 0.74, respectively. This indicates a significant linear positive correlation between the machine evaluation results and the expert evaluation results.

[0300] ② Experiment on the synthesis of pseudo-pathological images

[0301] According to the model, given a healthy image and a suitable pathological mask, the reconstructor should be able to synthesize a "pathological" image, i.e., a pseudo-pathological image (PPI). In this experiment, suitable masks and healthy images were randomly sampled to generate pseudo-pathological images. Figure 15 Examples of synthesizing pseudo-pathological images using a reconstructor are shown. Columns 1 and 4 display healthy images, columns 2 and 5 display random pathological masks, and columns 3 and 6 display pseudo-pathological images synthesized by the reconstructor. It can be observed that although the proposed model was never trained to synthesize pseudo-disease images, the reconstructor is still able to synthesize a pseudo-pathological image when given a healthy image and a suitable pathological mask.

[0302] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit the technical solutions. Those skilled in the art should understand that any modifications or equivalent substitutions to the technical solutions of the present invention without departing from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.

Claims

1. A method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling, characterized in that, include: S1: Acquire the pathological image to be processed; S2: Construct and train a pseudo-image generation model; In each training iteration, the pseudo-image generation model first inputs the pathological image, which serves as training data, into the segmenter, and the segmenter segments out the pathological region mask from the pathological image; then, the pathological region mask and the pathological image are input into the generator, and the generator generates a pseudo-healthy image. The pseudo-healthy image and the pathological region mask are then input into the reconstructor, which generates a reconstructed pathological image. Finally, the pseudo-image generation model is trained by calculating the total loss of the model based on the losses of the segmenter, generator, and reconstructor. The pseudo-image generation model is trained using the following steps: S211: Divide each training iteration into three loops; S212: Pathology-Pseudo-Health Cycle: First, a pathological region mask is segmented from a pathological image containing pathological regions using a segmenter. Secondly, a generator based on a pathological region mask is used. Generating pseudo-healthy images from corresponding pathological images Then, based on the pseudo-health image, a reconstructor is used. and pathological area mask Generate reconstructed pathological images, and finally calculate the model loss for this loop; S213: Health-Pseudo-Health Cycle: First, a pseudo-pathological image is generated using a reconstructor based on a mask image of a pathological region and a healthy image of a pathological region. Secondly, the segmenter extracts pseudo-pathological images. Masking the pseudo-pathological areas in the middle segment Then, the generator is used to create a mask based on pseudo-pathologically unaffected regions. and corresponding pseudo-pathological images Generating fake health images Finally, the model loss for this loop is calculated. Achieve a health-pseudo-health cycle through the following steps: S2131: Images of healthy areas without pathological regions As input to the pseudo-image generation model; S2132: Images of healthy areas without pathological regions and its health mask The pseudo-pathological image is generated by the reconstructor as input to the reconstructor. ; S2133: From pseudo-pathological images via segmenter Masking the pseudo-pathological areas in the middle segment ; S2134: Masking pseudo-pathological areas and corresponding pseudo-pathological images As input to the generator, a pseudo-health image is generated. ; S2135: Calculate the loss of the segmenter, generator, and reconstructor; In the healthy-pseudo-healthy loop, the losses of the segmenter, generator, and reconstructor are calculated using the following formula: 1) Losses of the divider: ; In the formula: and These represent the health image and the corresponding health mask, respectively. The reconstructor is based on a healthy image. and health mask The generated pseudo-pathological images; Indicating pseudo-pathological images A mask for pseudo-pathological areas; 2) Generator loss: ; In the formula: and These represent the health image and the corresponding health mask, respectively. The reconstructor is based on a healthy image. and health mask The generated pseudo-pathological images; The generator is based on pseudo-pathological images. The generated pseudo-health image; 3) Loss of the reconstructor: ; ; In the formula: and These represent two different health images extracted from the health image distribution H; Representing health images Corresponding health mask; The reconstructor is based on a healthy image. and health mask The generated pseudo-pathological images; S214: Deformation-Pseudo-Health Cycle: First, a mask of non-pathological regions is segmented from a deformed image with deformation but no pathological regions using a segmenter. Secondly, a generator is used based on a mask of non-pathological regions. Generating pseudo-health images from the corresponding deformed images Then, the reconstructor is used based on the pseudo-health image. and masking of non-pathological areas Generate a reconstructed deformed image, and finally calculate the model loss for this loop; S215: The model loss of the three cycles of pathology-pseudo-health, health-pseudo-health and deformation-pseudo-health is added together to obtain the total model loss of this training iteration, which is used to train the pseudo-image generation model. S216: Repeat steps S211 to S215 until the pseudo-image generation model converges; S3: Input the pathological image to be processed into the trained pseudo-image generation model, and generate the corresponding pseudo-healthy image through the generator.

2. The method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling as described in claim 1, characterized in that: When the generator generates a pseudo-healthy image, it first generates a pathological image based on the pathological image and the pathological region mask, and then removes the pathological region mask from the pathological image residual; then it calculates the attention score between the pathological region mask and the pathological image residual through the attention module. Finally, attention scores are used to repair the pathological areas of the residual pathological images to generate pseudo-healthy images.

3. The method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling as described in claim 1, characterized in that, The pathology-pseudo-health cycle is achieved through the following steps: S2121: Pathological images containing pathological areas As input to the pseudo-image generation model; S2122: From pathological images via segmenter Masking the pathological area in the middle ; S2123: Mask the pathological area and corresponding pathological images As input to the generator, a pseudo-health image is generated. ; S2124: False health images and pathological area mask As input to the reconstructor, the reconstructed pathological image is generated by the reconstructor. ; S2125: Calculate the loss of the segmenter, generator, and reconstructor.

4. The method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling as described in claim 3, characterized in that, In the pathological-pseudo-healthy cycle, the losses of the segmenter, generator, and reconstructor are calculated using the following formula: 1) Losses of the divider; When there is a mask annotation, the loss of the segmenter is calculated using the following formula: ; In the formula: and Represents paired pathological images and standard segmentation masks; This represents the mask for the pathological region predicted by the segmenter. Indicates the loss of dice coefficients; When there is no mask annotation, the loss of the segmenter is calculated using the following formula: ; ; In the formula: Representing pathological images; It is a non-pathological image A pathological region mask randomly extracted from other pathological images; Represents a segmented mask for classification and randomly extracted pathological area masks Mask discriminator; 2) Generator loss: ; ; In the formula: Representing pathological images; express The corresponding pseudo-health image; Represents a health image; A health discriminator that distinguishes between real and fake health images; This represents the gradient penalty loss involved in stable training; Set to 10; 3) Loss of the reconstructor: ; In the formula: Representing pathological images; yes The corresponding pseudo-health image; A mask representing the pathological region segmented by the segmenter; The reconstructor is based on and The generated reconstructed pathological image.

5. The method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling as described in claim 1, characterized in that, Achieve the deformation-pseudo-health cycle through the following steps: S2141: Deformation images showing deformation but no pathological areas. As input to the pseudo-image generation model; S2142: From a deformed image via a segmenter Masking the non-pathological areas in the middle segment ; S2143: Masking of areas without pathology and the corresponding deformation image As input to the generator, a pseudo-health image is generated. ; S2144: False health images and masking of non-pathological areas As input to the reconstructor, the reconstructed deformed image is generated by the reconstructor. ; S2145: Calculate the loss of the segmenter, generator, and reconstructor.

6. The method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling as described in claim 5, characterized in that, In the deformation-pseudo-healthy loop, the losses of the segmenter, generator, and reconstructor are calculated as follows: 1) Divider loss: ; In the formula: and Represents pairs of deformed images and masks; The segmenter is based on Masking of the segmented non-pathological areas; 2) Generator loss: ; ; In the formula: Represents a deformed image; The generator is based on The generated pseudo-health image; Represents a healthy image; This represents a discriminator that distinguishes between real and synthetic health images; This represents the gradient penalty loss involved in stable training; Set to 10; 3) Loss of the reconstructor: ; In the formula: Represents a deformed image; The generator is based on The generated pseudo-health image; The segmenter is based on Masking of the segmented non-pathological areas; The reconstructor is based on and The generated reconstructed deformed image.

7. The method for generating pseudo-healthy images of cerebral hemorrhage based on pathological decoupling as described in claim 1, characterized in that, The total loss of the model is calculated using the following formula: 1) When mask annotation is present, calculate the total model loss: ; In the formula: This represents the total model loss when mask annotations are used; to This indicates the weight parameters that are set; 2) When there is no mask annotation, calculate the total model loss: ; In the formula: This represents the total model loss without mask annotation.