A method and system for detecting stroke lesions

The stroke lesion detection system, constructed through multi-scale feature extraction and fine-grained prototype construction, solves the problem of inaccurate lesion segmentation under weak supervision, and achieves accurate detection and segmentation of stroke lesions, improving detection accuracy and robustness.

CN121504917BActive Publication Date: 2026-03-13HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-12
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing stroke detection algorithms struggle to accurately segment lesion regions under weakly supervised learning conditions. In particular, the poor contrast between stroke lesions and normal brain tissue in plain CT scans leads to scattered and blurry regional responses generated by CAM, and ignores the differences in brain anatomy between different cross-sections, resulting in misjudgment and inaccurate segmentation.

Method used

The feature extraction module extracts multi-scale feature maps and stitches them together. Combined with the classifier and region detection module, pseudo-label maps are generated. Fine-grained foreground and background prototypes are constructed through the class prototype generation module. The feature distribution is estimated using a Gaussian mixture model, and spatial consistency constraints are introduced. The training objective minimizes the differences within the same class and maximizes the differences between different classes to improve feature discriminativeness.

Benefits of technology

It enables accurate detection of stroke lesions under weak supervision, improves the accuracy of segmentation boundaries and regional integrity, enhances the ability to distinguish complex background structures, and improves detection accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504917B_ABST
    Figure CN121504917B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for detecting stroke lesions, belonging to the field of medical image detection technology. The method involves extracting a fused feature map of a brain image; for each region type, acquiring the representative feature carrying the corresponding region type label from the class prototype set that has the highest feature similarity to each pixel in the fused feature map, thereby determining the region type of each pixel in the fused feature map and obtaining the corresponding pseudo-label map; the class prototype set includes representative features of different region types, obtained during system training, and the feature distribution of different region types in the memory bank is calculated using a Gaussian mixture model; for each region type, sampling is performed based on its feature distribution to obtain multiple representative features; the class prototype set in this invention possesses true global context awareness, enabling clearer differentiation of lesions from various complex background structures and accurate stroke detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical image detection technology, and more specifically, relates to a method and system for detecting stroke lesions. Background Technology

[0002] Acute stroke is one of the leading causes of death and disability worldwide, posing a serious threat to public health. The treatment of acute stroke is strictly time-dependent. Therefore, if stroke can be accurately diagnosed and lesion areas segmented based on initial brain CT scans, doctors can take appropriate clinical measures according to the patient's stroke type and risk level, which will greatly improve the timeliness, effectiveness, and targeted nature of treatment.

[0003] Currently, most existing stroke detection algorithms are based on a fully supervised learning paradigm, which assumes that each sample has a corresponding pixel-level lesion label. However, in real-world medical scenarios, constructing a sufficient and high-quality dataset for stroke image detection is extremely challenging. Fine-grained annotation of these stroke images is not only tedious and time-consuming but also requires extensive expertise. Therefore, developing weakly supervised stroke detection methods that can reduce annotation costs is crucial.

[0004] Given that slice-level labels are the cheapest to obtain, researching a method for accurate stroke detection using these weak labels is of great significance. A key challenge is effectively transferring slice-level supervision signals to the pixel level. Existing weakly supervised detection methods largely rely on Class Activation Maps (CAMs) and their variants to generate pixel-level pseudo-labels. These methods are based on the assumption that the model's classification decision for the entire slice should be dominated by the lesion region. Therefore, reverse localization can roughly delineate the lesion region. Furthermore, some studies have attempted to optimize CAMs using strategies such as erasure and expansion to obtain a more complete lesion region. However, in stroke detection tasks, these methods often fail to achieve ideal results. This is because the contrast between stroke lesions and normal brain tissue in plain CT scans is poor, resulting in scattered and blurry responses in the CAM-generated regions, making it difficult to focus on the true lesion boundaries. Simultaneously, stroke lesions exhibit high diversity in location, shape, and size. This morphological heterogeneity makes it easy for the model to learn non-critical features, leading to false activations. Furthermore, existing methods mostly distinguish lesions from normal tissue independently on two-dimensional slices, ignoring the significant differences in brain anatomy between different cross-sections. Due to the lack of perception of such global structural changes, the models often misidentify normal tissue in a specific cross-section as a lesion, and cannot accurately detect stroke. Summary of the Invention

[0005] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides a method and system for detecting stroke lesions, so as to solve the technical problem that the existing technology cannot accurately detect stroke.

[0006] To achieve the above objectives, in a first aspect, the present invention provides a stroke lesion detection system, comprising:

[0007] The feature extraction module is used to extract feature maps at multiple scales from the input brain image, scale them to the same preset size, and then stitch them together along the channel dimension to obtain a fused feature map F.

[0008] A classifier is used to map the fused feature map F to a logistic prediction score map, thereby obtaining a classification result of whether a brain image is a stroke image;

[0009] The region detection module, when the brain image is a stroke image, inputs the fused feature map F into the probability map generation module to obtain probability maps for the corresponding foreground and background region types. For each pixel position p in the feature map F, it compares the probability values ​​of the corresponding pixel positions in the probability maps of the two region types, and takes the region type corresponding to the larger pixel value as the region type to which position p belongs, thus obtaining the pseudo-label map corresponding to the feature map F, and finally obtaining the detection result of the stroke lesion region in the brain image. The probability map generation module is used to obtain the features at each pixel position p' in the input fused feature map T from the class prototype set for each region type. The most similar representative features carrying the corresponding region type label ,Will and After the cosine similarity value is processed by the ReLU function, the probability that position p' belongs to the corresponding region type is obtained, and then the probability map under the corresponding region type is constructed.

[0010] Among them, the region types include: foreground region and background region; the class prototype set is obtained during the system training process;

[0011] During the system's training process, for each input brain image sample, the fused feature map extracted by the feature extraction module is input into the class prototype generation module to obtain representative features carrying region type labels, and then added to the class prototype set.

[0012] The class prototype generation module generates a corresponding class activation map based on the input fused feature map F'. Regions with activation values ​​greater than a preset threshold in the class activation map are designated as foreground regions, and regions with activation values ​​of 0 are designated as background regions. Features at each pixel location belonging to the foreground region and at each pixel location belonging to the background region are extracted from the feature map F' and stored in a memory bank. The feature distribution of different region types in the memory bank is calculated using a Gaussian mixture model. For each region type, sampling is performed based on its feature distribution to obtain multiple representative features, and each representative feature carries a label corresponding to its region type.

[0013] Secondly, the present invention provides a training method for the above-mentioned stroke lesion detection system, comprising:

[0014] Obtain the training set; the training set includes: multiple brain image samples; each image sample carries a classification label indicating whether the image sample is a stroke image;

[0015] Each image sample T in the training set is input into the feature extraction module of the system to obtain the corresponding fused feature map F';

[0016] The fused feature map F' is input into the system's classifier to obtain the corresponding logistic prediction score map and the classification result of whether the image sample T is a stroke image. Then, the difference loss between the classification result and the corresponding classification label is calculated as the first classification loss.

[0017] The fused feature map F' is input into the class prototype generation module to obtain representative features carrying region type labels, and added to the class prototype set. At the same time, the features belonging to the foreground region and the features belonging to the background region in the feature map F' are recorded.

[0018] Construct training objectives, and simultaneously train the feature extraction module, classifier, and class prototype generation module based on the training objectives;

[0019] The training objectives include: minimizing the first classification loss, and minimizing the difference loss between the features at the pixel positions belonging to the foreground region and the features at the pixel positions belonging to the background region in the feature map F', respectively, and maximizing the difference loss between the features at the pixel positions belonging to the foreground region and the features at the pixel positions belonging to the background region, while maximizing the difference loss between the features at the pixel positions belonging to the background region and the features at the pixel positions belonging to the background region.

[0020] More preferably, the above training method further includes:

[0021] The fused feature map F' is input into the probability map generation module to obtain the probability maps under the corresponding foreground and background region types, and then the maps are stitched together in the channel dimension to obtain the prototype class activation map corresponding to feature map F'.

[0022] The image obtained after spatial transformation of image sample T is denoted as the transformed image.

[0023] The transformed image is input into the feature extraction module to obtain the fused feature map F'';

[0024] The fused feature map F'' is input into the classifier to obtain the classification result of whether the transformed image is a stroke image. Then, the difference loss between the classification result and the corresponding classification label is calculated as the second classification loss.

[0025] The fused feature map F'' is input into the probability map generation module to obtain the probability maps under the corresponding foreground and background region types, and then spliced ​​in the channel dimension to obtain the prototype class activation map corresponding to feature map F'';

[0026] After performing an inverse space transformation on the prototype class activation map corresponding to feature map F'', the target class activation map is obtained;

[0027] Calculate the difference loss between the target class activation map and the prototype class activation map corresponding to the feature map F', and use it as the consistency loss;

[0028] The training objectives mentioned above also include minimizing the second classification loss and minimizing the consistency loss.

[0029] More preferably, the above-mentioned features at the pixel positions belonging to the foreground region and the pixel positions belonging to the background region in the feature map F' are respectively targeted to minimize the difference loss between them and representative features of the same region type, while maximizing the difference loss between them and representative features of different region types by minimizing the prototype contrast loss.

[0030] The expression for the prototype contrast loss is as follows:

[0031]

[0032] in, It is the set of all representative features carrying foreground region type labels obtained based on feature map F'; for The number of representative features; It is the set of features at each pixel location in the feature map F' that belongs to the candidate foreground region; express Features in; express Representative features; Indicates the temperature coefficient; It is the set of features at each pixel location in the feature map F' that belongs to the candidate background region; express Features in; It is the set of all representative features carrying background region type labels obtained based on feature map F'; express Representative features; The dot product operator is represented; the candidate foreground region is the region where the activation value in both the class activation map and the prototype class activation map corresponding to the feature map F' is greater than a preset threshold; the candidate background region is the region where the activation value in both the class activation map and the prototype class activation map corresponding to the feature map F' is 0; the class activation map corresponding to the feature map F' is obtained during the calculation process of inputting the fused feature map F' into the class prototype generation module; the prototype class activation map corresponding to the feature map F' is obtained by splicing the probability maps of the foreground and background region types obtained after inputting the fused feature map F'' into the probability map generation module in the channel dimension.

[0033] Thirdly, the present invention provides a method for detecting stroke, comprising:

[0034] The brain image to be detected is input into the stroke lesion detection system provided in the first aspect of the present invention to obtain the stroke detection result;

[0035] Stroke detection results include: classification results of whether the brain image is a stroke image, and detection results of the stroke lesion area when the brain image is a stroke image.

[0036] Fourthly, the present invention provides an electronic device comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the method provided in the second or third aspect of the present invention.

[0037] Fifthly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein the computer program, when executed by a processor, controls the device in which the storage medium is located to perform the method provided in the second or third aspect of the present invention.

[0038] In a sixth aspect, the invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the method provided in the second or third aspect of the invention.

[0039] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects:

[0040] 1. This invention provides a stroke lesion detection system that extracts a fused feature map of a brain image. For each region type, it obtains the representative features with the highest feature similarity to each pixel in the fused feature map from the class prototype set, carrying the corresponding region type label, thereby determining the region type to which each pixel in the fused feature map belongs, and thus obtaining the corresponding pseudo-label map. The class prototype set includes representative features of different region types, obtained during the system training process, and the feature distribution of different region types in the memory bank is calculated separately using a Gaussian mixture model. For each region type, sampling is performed based on its feature distribution to obtain multiple representative features. This process does not treat the background region as a whole, but rather estimates its complex internal data distribution and samples to generate multiple, fine-grained background prototypes. These background prototypes can correspond to and capture the feature patterns of different parts of the brain image, such as the skull, brain parenchyma, and ventricles. Meanwhile, for the foreground region, the process also establishes a more robust and representative prototype through a cross-batch set of representative features; based on this, the class prototype set in this invention has true global context awareness, which can more clearly distinguish lesions from various complex background structures and accurately detect stroke.

[0041] 2. The stroke lesion detection system provided by this invention proposes a novel global feature distribution estimation mechanism. This mechanism saves high-confidence features from multiple batches and uses a Gaussian mixture model to calculate the statistical index of the saved features as a global feature distribution estimate. This distribution provides a stable and robust feature prior, which helps the system to more accurately distinguish lesion areas from normal tissues in complex brain images. It effectively guides the network to focus on key features related to stroke lesions, suppresses background interference, and thus significantly improves the accuracy of segmentation boundaries and the integrity of regions.

[0042] 3. This invention provides a training method for a stroke lesion detection system. The training objective minimizes the difference between feature distributions of the same region type and maximizes the difference between feature distributions of different region types. This ensures improved feature discriminativeness while avoiding noise interference from uncertain features. Based on this, the training objective in this invention effectively avoids overlap between foreground and background distributions, enabling the system to learn more discriminative stroke characteristics and further improving detection accuracy.

[0043] 4. Furthermore, the training method of the stroke lesion detection system provided by the present invention proposes a spatial consistency constraint method. This method utilizes the spatial invariance of the stroke region to generate a corresponding prototype class activation map based on the brain CT image after spatial transformation, and calculates the difference between the prototype class activation map and the class activation map after inverse spatial transformation as part of the training loss, which can further improve the detection accuracy. Attached Figure Description

[0044] Figure 1 This is a flowchart of the class prototype generation module in Embodiment 1 of the present invention.

[0045] Figure 2 This is a schematic diagram of the prototype class activation graph of different context class prototypes provided in Embodiment 2 of the present invention.

[0046] Figure 3 This is a training process diagram of the stroke lesion detection system provided in an optional embodiment of Embodiment 2 of the present invention.

[0047] Figure 4 This is a schematic diagram of all relevant output results during the training process provided in Embodiment 2 of the present invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0049] Under weak supervision, model training relies solely on slice-level labels, lacking fine-grained guidance from pixel-level annotations. This deficiency makes it difficult for the model to accurately identify lesion regions from complex brain tissue backgrounds. Furthermore, the complex feature distribution caused by multi-scale classification networks makes the transition between lesions and normal tissue in the feature space smoother, lacking clear decision boundaries. This makes it even harder for the model to determine the precise spatial extent of lesions, resulting in a coexistence of undersegmentation (inability to identify all lesion regions) and oversegmentation (misclassifying some normal tissue as lesions). To address this issue, this invention provides a stroke lesion detection system, training method, and stroke detection method. The overall approach involves estimating the global feature distribution for each category in addition to classification loss and designing a reasonable prototype contrast loss to widen the distance between distributions. This allows the system to perceive global contextual information during training, guiding the feature extraction module and classifier to learn more discriminative knowledge during training. This effectively identifies the entire stroke region while avoiding oversegmentation, thereby improving diagnostic and segmentation accuracy.

[0050] The following is an example.

[0051] Example 1

[0052] This embodiment provides a stroke lesion detection system, including:

[0053] The feature extraction module is used to extract features from the input brain image at multiple scales. After obtaining feature maps at multiple scales, they are scaled to the same preset size and then stitched together in the channel dimension to obtain a fused feature map F.

[0054] A classifier maps the fused feature map F to a logistic prediction score map (the pixel value at each pixel position in the logistic prediction score map is the prediction score in the input fused feature map F that the corresponding pixel position is predicted to belong to the foreground region (i.e., the stroke region), thereby obtaining the classification result of whether the brain image is a stroke image; in this embodiment, the result map is obtained by performing max pooling or average pooling operations on the logistic prediction score map; when there are pixel values ​​in the result map that are greater than a preset threshold (generally 0.5), the corresponding pixel belongs to the foreground region, that is, the brain image is a stroke image.

[0055] The region detection module, when the brain image is a stroke image, inputs the fused feature map F into the probability map generation module to obtain probability maps for the corresponding foreground and background region types. For each pixel position p in the feature map F, it compares the probability values ​​of the corresponding pixel positions in the probability maps of the two region types, and takes the region type corresponding to the larger pixel value as the region type to which position p belongs, thus obtaining the pseudo-label map corresponding to the feature map F, and finally obtaining the detection result of the stroke lesion region in the brain image. The probability map generation module is used to obtain the features at each pixel position p' in the input fused feature map T from the class prototype set for each region type. The most similar representative features carrying the corresponding region type label ,Will and After the cosine similarity value is processed by the ReLU function, the probability that position p' belongs to the corresponding region type is obtained, and then the probability map under the corresponding region type is constructed.

[0056] Among them, the region types include: foreground region and background region; the class prototype set is obtained during the system training process;

[0057] During the system's training process, for each input brain image sample, the fused feature map extracted by the feature extraction module is input into the class prototype generation module to obtain representative features carrying region type labels, and then added to the class prototype set.

[0058] The class prototype generation module generates a corresponding class activation map based on the input fused feature map F'. Regions with activation values ​​greater than a preset threshold in the class activation map are designated as foreground regions, and regions with activation values ​​of 0 are designated as background regions. Features at each pixel location belonging to the foreground region and at each pixel location belonging to the background region are extracted from the feature map F' and stored in a memory bank. The feature distribution of different region types in the memory bank is calculated using a Gaussian mixture model. For each region type, sampling is performed based on its feature distribution to obtain multiple representative features (serving as class prototypes for the corresponding region type), and each of these representative features carries a label for the corresponding region type.

[0059] like Figure 1 The diagram shows the workflow of the above-mentioned class prototype generation module.

[0060] It should be noted that in the feature extraction module, CNN models, ConFormer, Swin-Transformer, etc., can be used to extract multi-scale features from brain images, and no limitation is made here. In this embodiment, a CNN model is preferred.

[0061] In this embodiment, a Gaussian mixture model is used for distribution estimation, and its region type... c The probability distribution expression for the feature is:

[0062]

[0063] Among them, regional types c Foreground or background area; K It is the number of Gaussian distributions in the Gaussian mixture model; It is the first k The weights of each component; It is a region type c The Middle k The mean vector of each component; It is a region type c The covariance matrix of the k-th component; This represents the features in the memory bank.

[0064] Subsequently, a momentum update strategy is used to update the mean and covariance matrices, further expanding the receptive field to the entire dataset, and sampling from these feature distributions to generate region types. c Several representative features with context-aware capabilities ,in, N It refers to the number of samples.

[0065] It should be noted that there are various methods for generating class activation maps, such as the CAM algorithm, Grad-CAM algorithm, Layer-CAM algorithm, and Score-CAM algorithm, which will not be elaborated here. Using class activation map technology, a class activation map can be constructed based on the attention heatmap that contributes most to classification among the features, representing the confidence that each pixel belongs to a stroke region.

[0066] Considering the significant challenges posed by the diversity of lesion morphology, location, and manifestation in weakly supervised stroke detection tasks based on prototype learning, traditional methods treat the background category as a single homogeneous category and represent it with only one prototype. However, the background region actually contains various anatomical structures such as the skull and brain parenchyma, which have vastly different distributions in the feature space. Compressing all this information into a single prototype introduces a large amount of noise and obfuscation, leading to a decrease in the final segmentation accuracy. To further improve the accuracy of weakly supervised stroke region segmentation, this embodiment improves the prototype construction mechanism by proposing a global class feature distribution estimation mechanism.

[0067] The global feature distribution estimation mechanism aims to address the problems arising from the aforementioned background homogenization assumption and improve the utilization of global contextual information. Instead of treating the background as a single entity, this mechanism estimates its complex internal data distribution and samples to generate multiple, fine-grained background prototypes. These prototypes can correspond to and capture feature patterns from different subcategories, such as the skull, brain parenchyma, and ventricles. Simultaneously, for the foreground (hemorrhage, ischemia), the mechanism also builds more robust and representative prototypes through cross-batch high-confidence feature sets. This gives the prototypes obtained by the model true global context awareness, enabling a clearer distinction between lesions and various complex background structures.

[0068] It should be noted that the modules in the aforementioned stroke lesion detection system can be pre-trained modules on their own, or modules obtained through end-to-end training of the entire stroke lesion detection system; no limitation is made here. End-to-end training is preferred.

[0069] Example 2

[0070] This embodiment provides a training method for a stroke lesion detection system, which is the system provided in Embodiment 1 above;

[0071] The above training methods include:

[0072] Obtain the training set; the training set includes: multiple brain image samples; each image sample carries a classification label indicating whether the image sample is a stroke image;

[0073] Each image sample T in the training set is input into the feature extraction module of the system to obtain the corresponding fused feature map F';

[0074] The fused feature map F' is input into the system's classifier to obtain the corresponding logistic prediction score map and the classification result of whether the image sample T is a stroke image. Then, the difference loss between the classification result and the corresponding classification label is calculated as the first classification loss.

[0075] The fused feature map F' is input into the class prototype generation module to obtain representative features carrying region type labels, and added to the class prototype set. At the same time, the features belonging to the foreground region and the features belonging to the background region in the feature map F' are recorded.

[0076] Construct training objectives, and simultaneously train the feature extraction module, classifier, and class prototype generation module based on the training objectives;

[0077] The training objectives include: minimizing the first classification loss, and minimizing the difference loss between the features at the pixel positions belonging to the foreground region and the features at the pixel positions belonging to the background region in the feature map F', respectively, and maximizing the difference loss between the features at the pixel positions belonging to the foreground region and the features at the pixel positions belonging to the background region, while maximizing the difference loss between the features at the pixel positions belonging to the background region and the features at the pixel positions belonging to the background region.

[0078] This embodiment introduces a global class feature distribution estimation mechanism to construct fine-grained background and foreground prototypes, effectively solving the noise and confusion problems caused by the background homogenization assumption. Simultaneously, by combining prototype contrast loss and self-supervised loss, the discriminative power of feature representations is improved under weak supervision, enhancing the model's ability to distinguish lesions from complex background structures.

[0079] Preferably, in an optional implementation, considering that brain medical images often have different shooting angles and orientations in clinical practice, the system needs to be robust to such spatial transformations in order to ensure the stability and reliability of the segmentation results.

[0080] Based on this, the above training methods also include:

[0081] The fused feature map F' is input into the probability map generation module to obtain the probability maps under the corresponding foreground and background region types, and then the maps are stitched together in the channel dimension to obtain the prototype class activation map corresponding to feature map F'.

[0082] The image obtained after spatial transformation of image sample T is denoted as the transformed image.

[0083] The transformed image is input into the feature extraction module to obtain the fused feature map F'';

[0084] The fused feature map F'' is input into the classifier to obtain the classification result of whether the transformed image is a stroke image. Then, the difference loss between the classification result and the corresponding classification label is calculated as the second classification loss.

[0085] The fused feature map F'' is input into the probability map generation module to obtain the probability maps under the corresponding foreground and background region types, and then spliced ​​in the channel dimension to obtain the prototype class activation map corresponding to feature map F'';

[0086] After performing an inverse space transformation on the prototype class activation map corresponding to feature map F'', the target class activation map is obtained;

[0087] Calculate the difference loss between the target class activation map and the prototype class activation map corresponding to the feature map F', and use it as the consistency loss;

[0088] The training objectives mentioned above also include minimizing the second classification loss and minimizing the consistency loss.

[0089] This constraint mechanism forces the system to learn space-invariant feature representations, ensuring that the model maintains a stable activation response regardless of the geometric transformations of the input image. Under weak supervision, this consistency requirement provides the model with additional self-supervised signals, effectively mitigating the overfitting problem caused by insufficient annotation, enabling the model to better capture the essential features of stroke lesions, thereby significantly improving the accuracy and robustness of the segmentation results.

[0090] It should be noted that the spatial transformations described above can include operations such as rotation and flipping, and are not limited here. The inverse spatial transformation described above is the reverse operation of the spatial transformation described above.

[0091] It should be noted that there are various ways to measure the difference loss mentioned above, such as using L1 norm, L2 norm, cosine pixel value, etc., and no limitation is made here. In addition to these measurement methods, the classification loss can also be measured using cross-entropy loss. Preferably, in one optional implementation, the classification loss is measured using cross-entropy loss; the consistency loss is measured using L1 norm.

[0092] It should be noted that the above-mentioned fused feature map has the same spatial size as the corresponding activation map, prototype class activation map, and target class activation map.

[0093] like Figure 2 The diagram shown is a schematic diagram of the prototype class activation graph of different context class prototypes provided in this embodiment.

[0094] In one alternative implementation, the above-mentioned features belonging to the foreground region and features belonging to the background region in feature map F' are respectively targeted by minimizing the difference loss between them and representative features of the same region type, while maximizing the difference loss between them and representative features of different region types by minimizing the prototype contrast loss.

[0095] Specifically, the expression for the prototype contrast loss is as follows:

[0096]

[0097] In the above formula, It is the set of all representative features carrying foreground region type labels obtained based on feature map F'; for The number of representative features; This represents the features in feature map F' that belong to the foreground region; for Representative features carrying foreground region type labels; It represents the temperature coefficient, used to control the system's ability to distinguish negative samples (i.e., features of the background region); This represents the features in feature map F' that belong to the background region; for Representative features carrying foreground region type labels; It is the set of all representative features carrying background region type labels obtained based on feature map F'; This represents the dot product operator.

[0098] The core of this loss mechanism lies in constructing high-quality positive and negative sample pairs to narrow the distance between foreground features and their corresponding class prototypes, while simultaneously widening the distance between them and the background class prototypes. However, under weak supervision, samples directly segmented based on class activation maps often contain a large amount of noise, meaning that some regions labeled as foreground or background may be misclassified. Considering the sensitivity of contrastive learning to annotation accuracy, to ensure training stability, this embodiment does not directly use all feature vectors but instead introduces an uncertainty filtering mechanism.

[0099] Specifically, this implementation comprehensively evaluates the feature vector at each pixel location based on its class activation map and prototype class activation map, and divides it into three parts: foreground, background, and uncertain region. Only features that show high confidence in both activation maps are identified as reliable foreground or background features, respectively. Features with activation scores in the middle range are classified into the uncertain region and ignored in this calculation. This mechanism effectively filters out unreliable supervision signals and improves the quality of samples participating in contrastive learning. At this time, the expression for the prototype contrastive loss is as follows:

[0100]

[0101] In the above formula, It is the set of all representative features carrying foreground region type labels obtained based on feature map F'; for The number of representative features; It is the set of features at each pixel location in the feature map F' that belongs to the candidate foreground region; express Features in; express Representative features; Indicates the temperature coefficient; It is the set of features at each pixel location in the feature map F' that belongs to the candidate background region; express Features in; It is the set of all representative features carrying background region type labels obtained based on feature map F'; express Representative features; The dot product operator is represented; the candidate foreground region is the region where the activation value in both the class activation map and the prototype class activation map corresponding to the feature map F' is greater than a preset threshold; the candidate background region is the region where the activation value in both the class activation map and the prototype class activation map corresponding to the feature map F' is 0; the class activation map corresponding to the feature map F' is obtained during the calculation process of inputting the fused feature map F' into the class prototype generation module; the prototype class activation map corresponding to the feature map F' is obtained by splicing the probability maps of the foreground and background region types obtained after inputting the fused feature map F'' into the probability map generation module in the channel dimension.

[0102] Finally, in this embodiment, the loss function for training the classification network can be expressed as follows:

[0103]

[0104] in, Indicates the total loss. Represents classification loss. Indicates the prototype contrast loss. This indicates a loss of consistency.

[0105] like Figure 3 The diagram shows the training process of a stroke lesion detection system provided under an implementation that combines consistency loss and the aforementioned prototype contrast loss. Figure 3 The multi-scale classifier in the system includes a feature extraction module and a classifier. Figure 4 This is a schematic diagram of all relevant output results during the training process provided in this embodiment.

[0106] After training, the fused feature map is extracted from the trained feature extraction module, and the visualization result is generated using prototype class activation map technology, which can accurately locate the stroke lesion region in the input brain image. Because this embodiment designs a global class feature distribution estimation mechanism, the model can establish fine-grained foreground and background prototypes during training. Its training objectives include minimizing the distance between foreground features and their corresponding class prototypes, maximizing the distance with background class prototypes, and minimizing the difference between the relative class activation map and the prototype class activation map. Therefore, without complex post-processing steps, the complete stroke region can be accurately identified, significantly improving segmentation accuracy.

[0107] Building upon this, and considering the sensitivity of brain medical images to spatial transformations, this embodiment also introduces a consistency constraint mechanism. This forces the system to learn spatially invariant feature representations, ensuring the stability of segmentation results under different shooting angles, thereby comprehensively improving the system's reliability in clinical practice. Based on this, this embodiment achieves accurate detection of the entire stroke region using only slice-level classification labels.

[0108] Example 3

[0109] This embodiment provides a method for detecting stroke, including:

[0110] The brain image to be detected is input into the stroke lesion detection system provided in Embodiment 1 of the present invention to obtain the stroke detection result;

[0111] Stroke detection results include: classification results of whether the brain image is a stroke image, and detection results of the stroke lesion area when the brain image is a stroke image.

[0112] The related technical solutions are the same as those provided in Embodiment 1 of this invention for detecting stroke lesions, and are not limited here.

[0113] It should be noted that the brain images in the above embodiments are all based on brain CT images, but are not limited to brain CT images.

[0114] Example 4

[0115] This embodiment provides an electronic device, including: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the method provided in Embodiment 2 or Embodiment 3 of the present invention.

[0116] The related technical solutions are the same as those provided in Embodiments 2 and 3 of this invention, and are not limited here.

[0117] Example 5

[0118] This embodiment also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when run by a processor, controls the device where the storage medium is located to execute the method provided in Embodiment 2 or Embodiment 3 of the present invention.

[0119] The related technical solutions are the same as those provided in Embodiments 2 and 3 of this invention, and are not limited here.

[0120] Example 6

[0121] This embodiment also provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the method provided in Embodiment 2 or Embodiment 3 of the present invention.

[0122] The related technical solutions are the same as those provided in Embodiments 2 and 3 of this invention, and are not limited here.

[0123] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A cerebral stroke lesion detection system, characterized by, The system comprises: a feature extraction module configured to extract feature maps of multiple scales of an input brain image, scale the feature maps to a same preset size respectively, and then concatenate the feature maps in a channel dimension to obtain a fused feature map F; The region detection module is configured to input the fusion feature map F into a probability map generation module to obtain a probability map corresponding to a foreground region type and a background region type when the brain image is a stroke image; for each pixel position p in the feature map F, the probability values at the corresponding pixel positions in the probability maps corresponding to the two region types are compared, and the region type corresponding to the larger pixel value is taken as the region type to which the position p belongs, so as to obtain a pseudo-label map corresponding to the feature map F, and further obtain a detection result of a stroke lesion region in the brain image; the probability map generation module is configured to obtain, for each region type, a representative feature carrying a label of the corresponding region type in a class prototype set and a feature of each pixel position p' in the input fusion feature map T, and calculate a cosine similarity between the representative feature and the feature of the pixel position p' by using a cosine similarity calculation formula, so as to obtain a probability that the position p' belongs to the corresponding region type, and further construct a probability map corresponding to the region type. The representative feature carrying the label of the corresponding region type with the highest similarity The cosine similarity between the representative feature and the feature of the pixel position p' is processed by using a ReLU function to obtain a probability that the position p' belongs to the corresponding region type, and further construct a probability map corresponding to the region type. The cosine similarity between the representative feature and the feature of the pixel position p' is processed by using a ReLU function to obtain a probability that the position p' belongs to the corresponding region type, and further construct a probability map corresponding to the region type. ​ a classifier configured to map the fused feature map F to a logical prediction score map, and then obtain a classification result of whether the brain image is a stroke image; wherein the region types include a foreground region and a background region; the class prototype set is obtained in a training process of the system; in the training process of the system, for each input brain image sample, a fused feature map obtained by the feature extraction module from the brain image sample is input into a class prototype generation module to obtain representative features carrying region type labels, and the representative features are added to the class prototype set; 2. The training method of the cerebral stroke lesion detection system according to claim 1, characterized by, the class prototype generation module is configured to generate a corresponding class activation map based on the input fused feature map F'; a region with an activation value greater than a preset threshold in the class activation map is regarded as the foreground region, and a region with an activation value of 0 in the class activation map is regarded as the background region; features at each pixel position belonging to the foreground region and features at each pixel position belonging to the background region are obtained from the feature map F', and are saved in a memory bank; feature distributions of different region types in the memory bank are calculated by a Gaussian mixture model; for each region type, a plurality of representative features are obtained by sampling based on the feature distribution, and each representative feature carries a corresponding region type label. The system comprises: obtaining a training set; the training set comprises: a plurality of brain image samples; each image sample carries a classification label indicating whether the image sample is a stroke image; inputting each image sample T in the training set into a feature extraction module of the system to obtain a corresponding fused feature map F'; inputting the fused feature map F' into a classifier of the system to obtain a corresponding logical prediction score map, and a classification result of whether the image sample T is a stroke image, and then calculating a difference loss between the classification result and a corresponding classification label as a first classification loss; inputting the fused feature map F' into a class prototype generation module to obtain representative features carrying region type labels, and adding the representative features to a class prototype set, and recording features belonging to the foreground region and features belonging to the background region in the feature map F'; constructing a training target, and training the feature extraction module, the classifier and the class prototype generation module based on the training target; 3. The training method of claim 2, wherein, wherein the training target comprises: minimizing the first classification loss, and minimizing a difference loss between features at pixel positions belonging to the foreground region and features at pixel positions belonging to the background region in the feature map F' and representative features of the same region type, and maximizing a difference loss between the features and representative features of different region types. Further comprising: inputting the fused feature map F' into the probability map generation module to obtain probability maps under foreground and background region types corresponding to the feature map F', and concatenating the probability maps in a channel dimension to obtain a prototype class activation map corresponding to the feature map F'; obtaining an image of the image sample T after spatial transformation, denoted as a transformed image; inputting the transformed image into the feature extraction module to obtain a fused feature map F''; inputting the fused feature map F'' into the classifier to obtain a classification result of whether the transformed image is a stroke image, and further calculating a difference loss between the classification result and a corresponding classification label as a second classification loss; inputting the fused feature map F'' into the probability map generation module to obtain a probability map under a corresponding foreground and background region type, and splicing in a channel dimension to obtain a prototype class activation map corresponding to the feature map F''; after performing inverse spatial transformation on the prototype class activation map corresponding to the feature map F'', a target class activation map is obtained; calculating a difference loss between the target class activation map and the prototype class activation map corresponding to the feature map F' as a consistency loss; the training target further includes: minimizing the second classification loss, and minimizing the consistency loss.

4. The training method according to claim 2 or 3, characterized in that, the respective features at the pixel point positions belonging to the foreground region and the pixel point positions belonging to the background region in the feature map F' are minimized in difference loss with the representative features of the same region type, and maximized in difference loss with the representative features of different region types, which is realized by minimizing the prototype contrast loss; the expression of the prototype contrast loss is as follows: in, It is the set of all representative features carrying foreground region type labels obtained based on feature map F'; for The number of representative features; It is the set of features at each pixel location in the feature map F' that belongs to the candidate foreground region; express Features in; express Representative features; Indicates the temperature coefficient; It is the set of features at each pixel location in the feature map F' that belongs to the candidate background region; express Features in; It is the set of all representative features carrying background region type labels obtained based on feature map F'; express Representative features; The dot product operator is represented; the candidate foreground region is the region where the activation value in both the class activation map and the prototype class activation map corresponding to the feature map F' is greater than a preset threshold; the candidate background region is the region where the activation value in both the class activation map and the prototype class activation map corresponding to the feature map F' is 0; the class activation map corresponding to the feature map F' is obtained during the calculation process of inputting the fused feature map F' into the class prototype generation module; the prototype class activation map corresponding to the feature map F' is obtained by splicing the probability maps of the foreground and background region types obtained after inputting the fused feature map F'' into the probability map generation module in the channel dimension.

5. A cerebral stroke detection method characterized by, including: inputting a brain image to be detected into the stroke lesion detection system of claim 1 to obtain a stroke detection result; the stroke detection result includes: a classification result of whether the brain image is a stroke image, and a detection result of a stroke lesion region when the brain image is a stroke image.

6. An electronic device, comprising: including: a memory and a processor, the memory stores a computer program, and the processor executes the computer program to execute the method of any one of claims 2-5.

7. A computer readable storage medium characterized by The computer readable storage medium includes a stored computer program, wherein the computer program is run by a processor to control the device where the storage medium is located to execute the method of any one of claims 2-5.

8. A computer program product, characterised in that, including a computer program / instruction, which is executed by a processor to realize the method of any one of claims 2-5.

Citation Information

Patent Citations

  • Liver CT image segmentation system and algorithm based on hybrid supervised learning

    WO2023060944A1

  • Pancreatic tumor image segmentation method and system based on reinforcement learning and attention

    WO2023221954A1