A stroke ct image prototype confidence calibration classification method and system
By combining the Swin-Transformer backbone network with learnable category prototypes, the problems of ambiguous category feature boundaries and unreliable softmax confidence in brain CT classification are solved, improving the accuracy and robustness of stroke CT image classification and reducing the risk of high-confidence misclassification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 同济大学浙江学院
- Filing Date
- 2026-06-08
- Publication Date
- 2026-07-07
AI Technical Summary
Existing brain CT classification methods suffer from problems such as blurred category feature boundaries, difficulty in recognizing subtle image features of ischemic stroke, unreliable softmax confidence, and unstable model output under slight image perturbations.
We use the Swin-Transformer backbone network to extract global image features, construct learnable category prototypes, and enhance feature separability through prototype contrast constraints and prototype enhancement mechanisms. We also optimize the classification model by combining prototype distance confidence calibration and uncertainty perception consistency constraints.
It improves the accuracy and robustness of stroke CT image classification, reduces the risk of misclassification at high confidence levels, and enhances the stability of the model under conditions of slight noise and image perturbation.
Smart Images

Figure CN122347714A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of intelligent medical image analysis, computer-aided diagnosis, and artificial intelligence image recognition, and in particular to a prototype confidence calibration classification method and system for stroke CT images. Background Technology
[0002] Stroke is one of the most common acute and critical illnesses in clinical practice, characterized by rapid onset, rapid progression, and high rates of disability and mortality. For suspected stroke patients, completing imaging examinations and determining the type of lesion as early as possible is crucial for selecting subsequent thrombolysis, hemostasis, surgical intervention, or conservative treatment options. Head CT scans, with their advantages of rapid examination, widespread availability, and high sensitivity to acute hemorrhage, have become an important imaging tool for emergency stroke screening and preliminary classification.
[0003] With the development of deep learning technology, existing methods have attempted to use convolutional neural networks, Transformer networks, or a combination of both to classify brain CT images into normal, ischemic, and hemorrhagic strokes. While these methods can improve image analysis efficiency to some extent, they still suffer from problems in real-world clinical settings, such as unclear category feature boundaries, unreliable model prediction confidence, and insufficient generalization ability across devices and scanning conditions.
[0004] Specifically, early CT manifestations of ischemic stroke are often subtle, possibly only showing localized low-density changes, shallowing of sulci, or blurred gray-white matter boundaries, easily confused with normal brain tissue, scanning noise, or minor artifacts. While hemorrhagic stroke is more pronounced in typical cases, it can also be affected by slice thickness, window width and level, skull artifacts, and image quality. Existing models often directly utilize classification layers or softmax probability outputs, lacking explicit judgment on whether the current sample closely approximates the typical imaging features of a certain category, easily leading to unstable category boundaries and high-confidence misclassifications.
[0005] Therefore, there is an urgent need to propose a new intelligent classification technology for stroke CT images, which enables the model to establish category reference centers for normal, ischemic, and hemorrhagic strokes in the feature space, and to complete classification judgment, confidence calibration, and stability training by utilizing the similarity and distance relationship between sample features and category reference centers, thereby improving the accuracy, reliability, and robustness of stroke CT image classification results. Summary of the Invention
[0006] The purpose of this application is to provide a prototype confidence calibration classification method and system for stroke CT images, which can solve the problems of blurred category feature boundaries, difficulty in recognizing subtle image features of ischemic stroke, unreliable ordinary softmax confidence, and unstable model output under slight image perturbation in existing brain CT classification methods.
[0007] To achieve the above objectives, this application provides the following solution: In a first aspect, this application provides a prototype confidence calibration classification method for stroke CT images, the method comprising: Brain CT images were acquired and preprocessed to obtain preprocessed images.
[0008] The preprocessed image is input into the Swin-Transformer backbone network to extract global image features.
[0009] During the training phase, based on the global image features corresponding to the training samples, learnable category prototypes corresponding to the classification categories are constructed, and the learnable category prototypes are dynamically optimized to obtain each optimized category prototype.
[0010] Calculate the cosine similarity between the global image features and the optimized class prototypes, and establish prototype contrast constraints; the prototype contrast constraints are used to make samples closer to their corresponding class prototypes and farther away from non-corresponding class prototypes, thereby enhancing the feature separation between samples of different classes.
[0011] Based on the cosine similarity, the global image features are enhanced to obtain the prototype enhanced features.
[0012] The prototype enhancement features are subjected to multi-scale refinement processing to obtain refined features.
[0013] Calculate the distance between the refined features and each optimized category prototype, and obtain the initial classification probability and initial confidence based on the distance; the initial confidence is the maximum value of the initial classification probability; the initial classification probability constitutes the original predicted probability distribution.
[0014] The initial confidence level is calibrated based on the nearest distance between the refined features and each optimized category prototype to obtain the calibrated confidence level.
[0015] Based on the global image features, a perturbation sample is constructed, and based on the perturbation sample, a perturbed prediction probability distribution is obtained. The difference between the original prediction probability distribution and the perturbed prediction probability distribution is calculated. Based on the difference and the calibration confidence, an uncertainty-aware consistency constraint is constructed. A total loss function is constructed based on the classification loss, the prototype comparison loss corresponding to the prototype comparison constraint, and the uncertainty perception consistency loss corresponding to the uncertainty perception consistency constraint. The trainable parameters of the classification network are optimized based on the total loss function, and a classification model is obtained by combining the optimized category prototypes. The brain CT image to be identified is input into the classification model, and the final predicted category is output. At the same time, the calibration confidence and verification prompts are output.
[0016] Secondly, this application provides a prototype confidence calibration classification system for stroke CT images, the system being used to implement the aforementioned prototype confidence calibration classification method for stroke CT images, the system comprising: The image acquisition and preprocessing module is used to acquire brain CT images and perform preprocessing to obtain preprocessed images.
[0017] The feature extraction module is used to input the preprocessed image into the Swin-Transformer backbone network to extract global image features.
[0018] The category prototype construction module is used to construct learnable category prototypes corresponding to the classification categories based on the global image features corresponding to the training samples during the training phase, and dynamically optimize the learnable category prototypes to obtain each optimized category prototype.
[0019] The prototype comparison constraint establishment module is used to calculate the cosine similarity between the global image features and the optimized category prototypes, and to establish prototype comparison constraints. The prototype comparison constraints are used to make samples closer to their corresponding category prototypes and farther away from non-corresponding category prototypes, thereby enhancing the feature separation between samples of different categories.
[0020] The prototype enhancement module is used to enhance the global image features based on the cosine similarity to obtain prototype enhanced features.
[0021] The multi-scale refinement processing module is used to perform multi-scale refinement processing on the prototype enhancement features to obtain refined features.
[0022] The prototype distance classification module is used to calculate the distance between the refined features and each optimized category prototype, and to obtain the initial classification probability and initial confidence based on the distance; the initial confidence is the maximum value of the initial classification probability; the initial classification probability constitutes the original prediction probability distribution.
[0023] The confidence calibration module is used to calibrate the initial confidence based on the nearest distance between the refined features and each optimized category prototype to obtain the calibrated confidence.
[0024] An uncertainty-aware consistency constraint construction module is used to construct perturbation samples based on the global image features, obtain the perturbed prediction probability distribution based on the perturbation samples, and calculate the difference between the original prediction probability distribution and the perturbed prediction probability distribution; based on the difference and the calibration confidence, an uncertainty-aware consistency constraint is constructed.
[0025] The model training and result output module constructs a total loss function based on the classification loss, the prototype comparison loss corresponding to the prototype comparison constraint, and the uncertainty perception consistency loss corresponding to the uncertainty perception consistency constraint; it optimizes the trainable parameters of the classification network based on the total loss function, and obtains a classification model by combining the optimized category prototypes; it inputs the brain CT image to be identified into the classification model and outputs the final predicted category; it also outputs the calibration confidence and verification prompts.
[0026] According to the specific embodiments provided in this application, this application has the following technical effects: This application constructs learnable category prototypes and combines prototype contrast constraints and prototype enhancement mechanisms to form clearer category reference centers in the feature space for different categories of brain CT images, thereby improving the feature separability between normal, ischemic stroke, and hemorrhagic stroke categories. This application employs a confidence calibration mechanism based on the nearest prototype distance to further determine whether a sample is close to the typical feature distribution of its corresponding category while obtaining the classification probability; when a sample is far from all category prototypes, its calibration confidence can be reduced, thus helping to reduce the risk of misclassification at high confidence levels. This application uses uncertainty-aware consistency constraints to ensure that high-confidence samples maintain relatively stable predictions before and after slight perturbations, while reducing the consistency constraint strength for low-confidence samples, thereby helping to improve the robustness of the model under conditions of slight noise, grayscale changes, window width and window level differences, and feature perturbations. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A flowchart illustrating a prototype confidence calibration classification method for stroke CT images provided in an embodiment of this application; Figure 2 A flowchart of category prototype construction and dynamic optimization provided for an embodiment of this application; Figure 3 A flowchart of prototype enhancement and prototype distance confidence calibration provided for an embodiment of this application; Figure 4 A flowchart illustrating uncertainty-aware consistency constraints is provided for one embodiment of this application. Figure 5 A schematic diagram of the functional modules of a prototype confidence calibration classification system for stroke CT images provided in an embodiment of this application; Figure 6This is a schematic diagram of the structure of a computer device provided in one embodiment of this application; Figure 7 This is an application environment diagram of a prototype confidence calibration classification method for stroke CT images according to an embodiment of this application. Detailed Implementation
[0029] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0030] This application relates to a method and system for automatically identifying brain CT image categories such as normal stroke, ischemic stroke, and hemorrhagic stroke by combining learnable category prototypes, prototype enhancement, prototype distance confidence calibration, and uncertainty perception consistency constraints.
[0031] This application introduces learnable category prototypes on the basis of the Swin-Transformer backbone network, enabling the model to explicitly establish feature reference centers for categories such as normal, ischemic stroke, and hemorrhagic stroke; improves the separability of different categories of brain CT images in the feature space through prototype contrast constraints and prototype enhancement mechanisms; reduces the risk of high-confidence misclassification of samples far from category prototypes through a confidence calibration mechanism based on the nearest prototype distance; and improves the stability of the model under conditions of slight noise, gray-level perturbation, and feature perturbation through uncertainty-perceived consistency constraints.
[0032] It should be noted that this application differs from existing brain CT classification techniques based on counterfactual consistency. Existing solutions focus on reducing the model's dependence on non-lesion regions, artifacts, or background information through counterfactual branching or consistency mechanisms. This application, however, does not focus on counterfactual image generation, counterfactual feature suppression, or content domain feature decomposition. Instead, it constructs a complete technical solution around "category prototype representation—prototype enhancement—prototype distance discrimination—prototype confidence calibration—uncertainty perception consistency training." Its core lies in establishing a category reference system and determining whether the classification result is close to the known category prototype, thereby outputting a more reliable calibration confidence level.
[0033] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] The prototype confidence calibration classification method for stroke CT images provided in this application can be applied to, for example... Figure 7In the application environment shown, terminal 102 communicates with server 104 via a network, and the data storage system can store the data that server 104 needs to process. Terminal 102 can send brain CT images to server 104. After receiving the brain CT images, server 104 can call the trained classification model to preprocess the brain CT images, extract features, perform prototype enhancement, calculate prototype distance, and calibrate confidence, obtaining the final predicted category, calibration confidence, and verification prompts, and then feeding the results back to terminal 102. In addition, in some embodiments, the prototype confidence calibration classification method for stroke CT images can also be implemented by server 104 or terminal 102 alone. Alternatively, server 104 can obtain brain CT images from the data storage system and perform stroke CT image prototype confidence calibration classification on the brain CT images.
[0035] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster composed of multiple servers, or it can be a cloud server.
[0036] In one exemplary embodiment, such as Figure 1 As shown, a prototype confidence calibration classification method for stroke CT images is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 7 Taking server 104 as an example, the explanation includes the following steps S1 to S10.
[0037] S1: Acquire brain CT images and perform preprocessing to obtain preprocessed images.
[0038] S2: Input the preprocessed image into the Swin-Transformer backbone network to extract global image features.
[0039] S3: During the training phase, based on the global image features corresponding to the training samples, a learnable category prototype corresponding to the classification category is constructed, and the learnable category prototype is dynamically optimized to obtain each optimized category prototype.
[0040] S4: Calculate the cosine similarity between the global image features and the optimized category prototypes, and establish prototype comparison constraints; the prototype comparison constraints are used to make samples closer to their corresponding category prototypes and farther away from non-corresponding category prototypes, thereby enhancing the feature separation between samples of different categories.
[0041] S5: Based on the cosine similarity, the global image features are enhanced to obtain the prototype enhanced features.
[0042] S6: Perform multi-scale refinement processing on the prototype enhancement features to obtain refined features.
[0043] S7: Calculate the distance between the refined feature and each optimized category prototype, and obtain the initial classification probability and initial confidence based on the distance; the initial confidence is the maximum value of the initial classification probability; the initial classification probability constitutes the original predicted probability distribution.
[0044] S8: Based on the nearest distance between the refined features and each optimized category prototype, the initial confidence level is calibrated to obtain the calibrated confidence level.
[0045] S9: Construct perturbation samples based on the global image features, obtain the perturbation-adjusted prediction probability distribution based on the perturbation samples, and calculate the difference between the original prediction probability distribution and the perturbation-adjusted prediction probability distribution; construct uncertainty-aware consistency constraints based on the difference and the calibration confidence.
[0046] S10: Construct a total loss function based on the classification loss, the prototype comparison loss corresponding to the prototype comparison constraint, and the uncertainty perception consistency loss corresponding to the uncertainty perception consistency constraint; optimize the trainable parameters of the classification network based on the total loss function, and combine the optimized category prototypes to obtain a classification model; input the brain CT image to be identified into the classification model, and output the final predicted category; simultaneously output the calibration confidence and verification prompt.
[0047] By implementing steps S1 to S10 above, this method can improve the separability of category features in stroke CT image classification, reduce the risk of high-confidence misjudgment, and enhance the robustness of the model under image perturbation and data distribution changes.
[0048] As an optional implementation, in step S1, brain CT images are acquired and preprocessed to obtain preprocessed images, specifically including: First, several brain CT image samples are acquired, and each sample is assigned a corresponding category label. These category labels can be set to normal, ischemic stroke, and hemorrhagic stroke in a three-class classification task, or normal and stroke in a two-class classification task, depending on the application requirements. The training dataset is represented as follows: (1); in, This represents the training dataset; Indicates the first A sample of brain CT images, This indicates the category label corresponding to the sample. This represents the total number of samples.
[0049] The category set is represented as: (2); in, Represents a set of categories. Indicates the total number of categories. When These correspond to normal stroke, ischemic stroke, and hemorrhagic stroke, respectively.
[0050] To reduce the impact of different CT equipment, scanning conditions, and image formats on model training, standardized preprocessing was performed on the original brain CT images to obtain input images in a uniform format: (3); in, Indicates the first CT images of a sample after preprocessing; This indicates preprocessing operations. These preprocessing operations include image resizing, grayscale normalization, window width and level adjustment, channel adaptation, and necessary noise suppression. Preferably, the training set, validation set, and test set are divided at the patient level, ensuring that CT images of the same patient appear in only one set.
[0051] The above preprocessing can reduce the differences in size, grayscale range, window width and window level, and channel format of CT images from different sources, so that the input data can meet the unified requirements of subsequent feature extraction and category prototype comparison.
[0052] As an optional implementation, in step S2, the preprocessed image is input into the Swin-Transformer backbone network to extract global image features, specifically including: After image preprocessing, the standardized CT images are input into the Swin-Transformer backbone network to extract image features that characterize brain tissue structure, lesion morphology, local density changes, and global contextual relationships. Subsequently, global average pooling is performed on the high-level feature maps output by the backbone network to obtain global image feature vectors. (4); in, Indicates the first Global image features of a CT image sample; This represents the Swin-Transformer backbone network; This represents a global average pooling operation. If the feature dimension is... ,but .
[0053] These global image features serve as the foundational input for subsequent category prototype learning, prototype enhancement, distance discrimination, confidence calibration, and consistency constraints.
[0054] This step maps the preprocessed CT images into high-dimensional feature representations that can be used for subsequent class prototype comparison, distance calculation, and confidence calibration.
[0055] As an optional implementation, in step S3, during the training phase, based on the global image features corresponding to the training samples, a learnable category prototype corresponding to the classification category is constructed, and the learnable category prototype is dynamically optimized to obtain each optimized category prototype, specifically including: S31: Get the first [item] in the current training batch The set of sample features for a class of samples.
[0056] S32: Calculate the first... The average feature of the class of samples in the current training batch.
[0057] S33: Based on the average features, the corresponding category prototype is updated using an exponential moving average method to obtain the optimized category prototype.
[0058] Specifically, such as Figure 2 As shown, in order to enable the model to explicitly represent the typical distribution characteristics of different categories of brain CT images, after obtaining the global image features, a set of learnable category prototypes corresponding one-to-one with each category is constructed: (5); in, Represents the set of category prototypes; Indicates the first The prototype vectors corresponding to each category. In a three-class classification task, that is... hour, , and These can correspond to the normal category prototype, the ischemic stroke category prototype, and the hemorrhagic stroke category prototype, respectively.
[0059] Considering that the category prototypes are unstable in the early stages of training, and that the distribution of samples from each category in the feature space will continue to change as the feature extraction network parameters are updated, the category prototypes are dynamically optimized by incorporating features of similar samples in the current batch during training. Let the i-th sample in the current training batch... The feature set of the class samples is Then the average feature of this category in the current batch is represented as: (6); in, Indicates the first in the current training batch The average features of the class of samples; Indicates that the current batch belongs to the first... The number of samples in a class.
[0060] Based on this, the category prototype is updated using an exponential moving average method: (7); in, Indicates the first The prototype vectors corresponding to each category, and ; Denotes the momentum coefficient, and Through this dynamic update method, the category prototype can gradually approach the global feature center of the corresponding category during the training process, and provide a stable reference for subsequent prototype comparison constraints and prototype enhancement.
[0061] In this step, the category prototype is used to represent the typical distribution center of the corresponding category in the feature space. By performing exponential sliding updates incorporating the average features of similar samples in the current training batch, the category prototype can gradually stabilize as the classification network parameters are updated, and provide a category reference for subsequent prototype comparison constraints and prototype enhancement.
[0062] As an optional implementation, in step S4, the cosine similarity between the global image features and the optimized category prototypes is calculated, and prototype comparison constraints are established, specifically including: After establishing and progressively optimizing the category prototypes, the cosine similarity between the global image features of the samples and the prototypes of each category is calculated: (8); in, Representing sample features With the Each category prototype Cosine similarity between them; Represents the dot product of vectors; express Norm.
[0063] To guide samples to cluster towards the class prototype corresponding to their true class and away from non-corresponding class prototypes, prototype contrast constraints are constructed: (9); in, Indicates the first Prototype contrast loss for each sample; Indicates the true category of the sample The corresponding category prototype; This represents the prototype-to-contrast temperature coefficient. By minimizing this loss, the model can enhance the compactness of similar samples in the feature space and improve the separability between samples of different categories.
[0064] This step guides sample features to cluster toward the class prototype corresponding to the true class through prototype contrast constraints, while maintaining a gap with non-corresponding class prototypes, thereby enhancing the separability of samples of different classes in the feature space.
[0065] As an optional implementation, in step S5, the global image features are enhanced based on the cosine similarity to obtain prototype enhanced features, specifically including: S51: Based on the cosine similarity, attention weights for each category of prototypes are generated after softmax normalization.
[0066] S52: The prototypes of each category are weighted according to their corresponding attention weights and incorporated into the global image features to obtain prototype enhancement features.
[0067] Specifically, after the category prototypes have discriminative capabilities, prototype attention weights are further generated based on the similarity between sample features and each category prototype: (10); in, Indicates the first The nth sample pair Attention weights for each category prototype; Indicates the prototype fusion temperature coefficient; Represents the category index; the attention weights, after softmax normalization, satisfy... .
[0068] Subsequently, the prototypes of each category are weighted according to attention weights and incorporated into the original global image features of the samples to obtain prototype enhancement features: (11); in, Indicates the first Prototype enhancement features for each sample; This represents the scaling factor, used to control the strength of how much category prototype information is incorporated into the original features. Preferably, It can be initialized to 0, so that the model mainly relies on the original image features in the early stage of training, and gradually introduces prototype information as the category prototypes gradually stabilize.
[0069] This step generates prototype attention weights based on the similarity between sample features and prototypes of each category, and incorporates the weighted category prototype information into the sample features, so that the feature representation includes category reference information.
[0070] As an optional implementation, in step S6, the prototype enhancement features are subjected to multi-scale refinement processing to obtain refined features, specifically including: Considering that lesions in stroke CT images may have different sizes, shapes, and boundary clarity, this step performs multi-scale refinement processing on the prototype enhancement features to obtain refined feature representations suitable for classification and distance calculation: (12); in, Indicates the first Refined features of each sample; The multi-scale feature processing function is represented; the multi-scale feature processing function can be implemented by a multi-branch convolutional structure, a multilayer perceptron structure, an attention structure, or a combination thereof; the feature processing branch includes at least one of a 1×1 convolutional branch, a 3×3 convolutional branch, a 5×5 convolutional branch, a multilayer perceptron branch, or an attention branch.
[0071] This step is used to integrate the prototype enhancement features at multiple scales, so that the refined features simultaneously include local density changes, lesion boundaries and information on a larger scale of brain tissue structure.
[0072] As an optional implementation, in step S7, the distance between the refined features and each optimized category prototype is calculated, and the initial classification probability and initial confidence level are obtained based on the distance, specifically including: After obtaining the refined features, calculate the Euclidean distance between them and the prototypes of each category: (13); in, Representing refined features of the sample With the The distance between the prototypes of each category.
[0073] Based on the distance calculation results, the negative distance is input into the softmax function to obtain the initial classification probability: (14); in, Indicates the first The sample belongs to the first The initial classification probabilities of each category; Indicates the first The prototype vectors corresponding to each category. The smaller the distance, the more... The larger the value, the higher the initial classification probability of that category.
[0074] The initial confidence level is further defined as: (15); in, Indicates the first The initial confidence level of each sample.
[0075] The initial classification probabilities constitute the original predicted probability distribution, denoted as... .
[0076] This step generates initial classification probabilities based on the Euclidean distance between refined features and prototypes of each category, and uses the maximum initial classification probability as the initial confidence level for subsequent confidence level calibration.
[0077] As an optional implementation, in step S8, the initial confidence level is calibrated based on the nearest distance between the refined features and each optimized category prototype to obtain a calibrated confidence level, specifically including: S81: Generate a prototype calibration signal based on the nearest distance between the refined features and each optimized category prototype.
[0078] S82: Input the initial confidence level and the prototype calibration signal into the gating function to obtain the confidence gating parameters.
[0079] S83: Obtain the calibration confidence level based on the confidence gating parameters.
[0080] Specifically, since the initial classification probability only reflects the relative distance between the sample and the prototypes of each class, it cannot fully reflect whether the sample is truly close to the typical distribution of a certain class. Therefore, a prototype calibration signal is further generated based on the distance of the sample to the nearest class prototype: (16); in, This represents the prototype calibration signal; Indicates the distance scaling factor; It represents the distance from the refined features of a sample to the nearest class prototype.
[0081] Initial confidence level and prototype calibration signal By inputting the common gating function, we obtain the confidence gating parameters: (17); in, Indicates the first Confidence gating parameters for each sample; This represents the sigmoid activation function. Indicates the gating weight parameter; Indicates the gating bias parameter. This indicates that the initial confidence level and the prototype calibration signal are spliced together.
[0082] The calibrated confidence level is obtained based on the confidence gating parameters: (18); in, Indicates the confidence level after calibration; Indicates the first The initial confidence level of each sample. Through this calibration method, when a sample is relatively closer to a certain category prototype but far away from all category prototypes as a whole, its final confidence level is reduced, thereby reducing the risk of misjudgment with high confidence.
[0083] This step combines the nearest class prototype distance to calibrate the initial confidence level, so that the calibrated confidence level not only reflects the relative probability between classes, but also reflects whether the sample is close to the typical feature distribution of the corresponding class.
[0084] Prototype enhancement and prototype distance confidence calibration process as follows Figure 3 As shown.
[0085] As an optional implementation, in step S9, a perturbation sample is constructed based on the global image features; a perturbation-adjusted prediction probability distribution is obtained based on the perturbation sample; and the difference between the original prediction probability distribution and the perturbation-adjusted prediction probability distribution is calculated. Based on the difference and the calibration confidence level, an uncertainty-aware consistency constraint is constructed, specifically including: S91: Add a perturbation term to the global image features to obtain the perturbated features.
[0086] S92: Calculate the perturbation cosine similarity between the perturbed features and the optimized category prototypes.
[0087] S93: Based on the perturbation cosine similarity, the perturbation features are enhanced to obtain perturbation-enhanced features.
[0088] S94: Perform multi-scale refinement processing on the perturbation enhancement features to obtain refined perturbation features.
[0089] S95: Calculate the perturbation distance between the perturbation refinement feature and each optimized category prototype, and obtain the initial perturbation classification probability and the initial perturbation confidence based on the perturbation distance; the initial perturbation confidence is the maximum value of the initial perturbation classification probability.
[0090] S96: Based on the nearest distance between the refined perturbation features and each optimized category prototype, the initial perturbation confidence is calibrated to obtain the perturbation calibration confidence; and based on the initial perturbation classification probability or perturbation branch classification output, the predicted probability distribution after perturbation is obtained.
[0091] S97: Calculate the KL divergence between the original predicted probability distribution and the perturbed predicted probability distribution.
[0092] S98: Based on the KL divergence and the calibration confidence, construct uncertainty-aware consistency constraints.
[0093] Specifically, such as Figure 4 As shown, to improve the model's robustness to slight noise, grayscale variations, window width and level differences, and feature perturbations, perturbed samples are constructed during the training phase. Taking feature perturbation as an example, the perturbed feature representation is as follows: (19); in, Indicates the characteristics after the disturbance; This represents the perturbation term. The perturbation term can be Gaussian noise, random deactivation, feature masking, or channel perturbation, etc.
[0094] The perturbed features are input into the same prototype enhancement, refinement, and prototype distance calculation process as the original features to obtain the perturbed predicted probability distribution. Simultaneously, based on the nearest distance between the perturbed refined features and each optimized category prototype, the initial perturbed confidence is calibrated to obtain the perturbed calibrated confidence. Let the original predicted probability distribution be denoted as , then the KL divergence between the two is expressed as: (20); in, This represents the difference between the original predicted probability distribution and the perturbed predicted probability distribution; In the probability distribution of disturbance prediction, the th The probability values of each category; Indicates that the sample belongs to the first The final predicted probability of the class.
[0095] Construct the uncertainty-perceived consistency loss corresponding to the uncertainty-perceived consistency constraint by combining the calibration confidence: (twenty one); in, Indicates the first The uncertainty-perceived consistency loss for each sample. Through this loss, samples with high calibration confidence are subject to stronger consistency constraints, while samples with low calibration confidence are subject to weaker consistency constraints.
[0096] This step compares the difference between the original predicted probability distribution and the predicted probability distribution after perturbation, and adjusts the consistency constraint strength in conjunction with the calibration confidence level. This ensures that high-confidence samples maintain relatively stable predictions before and after slight perturbations, while reducing the consistency constraint strength of low-confidence samples.
[0097] As an optional implementation, in step S10, a total loss function is constructed based on the classification loss, the prototype comparison loss corresponding to the prototype comparison constraint, and the uncertainty perception consistency loss corresponding to the uncertainty perception consistency constraint; the trainable parameters of the classification network are optimized based on the total loss function, and a classification model is obtained by combining the optimized category prototypes; the brain CT image to be identified is input into the classification model, and the final predicted category is output; simultaneously, calibration confidence and verification prompts are output, specifically including: During the training phase, the classification loss, prototype contrast loss, and uncertainty-perceived consistency loss are combined to form the total loss function: (twenty two); in, Represents the total loss function; Indicates classification loss; Indicates prototype contrast loss; This represents the loss of perceived consistency due to uncertainty. and These represent the weighting coefficients of the prototype contrast loss and the uncertainty perception consistency loss, respectively. The classification loss uses cross-entropy loss: (twenty three); in, Indicates the first Classification loss for each sample; This indicates the indicator function, which is used when the sample represents the true class. equal The value is 1 if the condition is met, and 0 otherwise.
[0098] After the model training is complete, input the brain CT image to be identified into the trained model, and output the final predicted category: (twenty four); in, Indicates the first The final predicted category for each sample.
[0099] Simultaneously output calibration confidence level According to the preset reliability threshold, when When the value exceeds the threshold, a message indicating high reliability of the classification result is output; when... When the output is below the threshold, the model has high uncertainty and a doctor is advised to review it.
[0100] This step combines classification loss, prototype contrast loss, and uncertainty-aware consistency loss to optimize the classification network parameters, and outputs the final predicted class, calibration confidence, and verification prompts after the model training is completed.
[0101] The calculation process of this application will be explained below using a three-category stroke CT image recognition task as an example. This task includes three categories: normal stroke, ischemic stroke, and hemorrhagic stroke. To facilitate the demonstration of the calculation process, the feature dimension is simplified to two dimensions in the following embodiments; in practical applications, the feature dimension can be 256, 512, 768, or other higher-dimensional values.
[0102] Example 1: Identification process of typical ischemic stroke samples.
[0103] Suppose that after model training, three class prototypes are obtained: ; in, Represents the normal category prototype; This represents the prototype of the ischemic stroke category; This represents the prototype of the hemorrhagic stroke category.
[0104] We input a brain CT image to be analyzed. After preprocessing and extraction using the Swin-Transformer backbone network, we obtain the global image features: ; Calculate the cosine similarity between the sample features and the three class prototypes to obtain: ; Therefore, this sample is consistent with the prototype of ischemic stroke. The similarity is the highest.
[0105] Assume the prototype fusion temperature coefficient Based on similarity, the prototype attention weight is calculated, resulting in: ; The weighted sum of the class prototypes is: ; Set the scaling factor Thus, the prototype enhancement feature is obtained: ; After performing multi-scale refinement on the prototype enhanced features, we assume that the refined features are obtained: ; Calculating the Euclidean distance between the refined features and the three class prototypes yields: ; Softmax normalization is performed based on the negative distance to obtain the initial classification probability: ; Therefore, the initial predicted category for this sample is ischemic stroke, with an initial confidence level of: ; Furthermore, since the distance from this sample to the nearest class prototype is 0.141, let... Then the prototype calibration signal is: ; Let the gate function be , Then the confidence gating parameters are: ; The calibrated confidence level is: ; Therefore, the system outputs a predicted category of ischemic stroke for this CT image, with a calibration confidence level of 0.711. If the preset confidence threshold is 0.70, the system can output the message "Ischemic stroke, classification result has high confidence".
[0106] During the training phase, if a slight perturbation is applied to the sample, the perturbation prediction distribution is obtained: ; The original predicted distribution is: ; The KL divergence between the original prediction distribution and the perturbation prediction distribution is: ; The uncertainty perception consistency loss is: ; The results indicate that the predicted distribution of the sample differs little before and after slight perturbations, and the model has good predictive stability for the sample.
[0107] Example 2: Confidence calibration process for fuzzy samples.
[0108] To illustrate the confidence level calibration effect of this application on low-confidence samples, assume that another CT image, after feature extraction and refinement, is obtained as follows: ; Its distance to the prototypes of the three categories is: ; The initial classification probability is obtained based on the negative distance: ; This sample is relatively closer to the prototype of ischemic stroke, but its maximum probability is only: ; Meanwhile, the distance from this sample to the nearest class prototype is 1.500. Let... Then the prototype calibration signal is: ; Still set , Then the confidence gating parameters are: ; The calibrated confidence level is: ; Therefore, the system outputs that the CT image is relatively closer to the ischemic stroke category, but the calibration confidence level is low. If the preset confidence threshold is 0.70, the system outputs a message: "High uncertainty, doctor's review recommended."
[0109] This embodiment illustrates that the present application can identify fuzzy samples that are relatively close to a certain category but far away from the prototypes of all categories as a whole, and reduce their final confidence by using a prototype distance calibration mechanism, thereby reducing the risk of misjudgment with high confidence.
[0110] In summary, compared with the prior art, this application has at least the following beneficial effects: First, this application constructs learnable category prototypes and combines prototype contrast constraints and prototype enhancement mechanisms to enable different categories of brain CT images to form clearer category reference centers in the feature space, thereby helping to improve the feature separability between categories such as normal, ischemic stroke and hemorrhagic stroke.
[0111] Second, this application employs a confidence calibration mechanism based on the nearest prototype distance to determine whether a sample is close to the typical feature distribution of its corresponding category while obtaining the classification probability. When a sample is far from all category prototypes, its calibration confidence can be reduced, thereby helping to reduce the risk of misclassification with high confidence.
[0112] Third, this application uses uncertainty-aware consistency constraints to ensure that high-confidence samples maintain relatively stable predictions before and after slight perturbations, while reducing the consistency constraint strength of low-confidence samples. This helps to improve the robustness of the model under conditions of slight noise, gray-level changes, window width and window level differences, and feature perturbations.
[0113] Based on the same inventive concept, this application also provides a stroke CT image prototype confidence calibration classification system for implementing the aforementioned stroke CT image prototype confidence calibration classification method. The solution provided by this system is similar to the implementation described in the above method. Therefore, the specific limitations of one or more stroke CT image prototype confidence calibration classification system embodiments provided below can be found in the limitations of the stroke CT image prototype confidence calibration classification method described above, and will not be repeated here.
[0114] In one exemplary embodiment, such as Figure 5 As shown, a prototype confidence calibration classification system for stroke CT images is provided, the system comprising: The image acquisition and preprocessing module is used to acquire brain CT images and perform preprocessing to obtain preprocessed images.
[0115] The feature extraction module is used to input the preprocessed image into the Swin-Transformer backbone network to extract global image features.
[0116] The category prototype construction module is used to construct learnable category prototypes corresponding to the classification categories based on the global image features corresponding to the training samples during the training phase, and dynamically optimize the learnable category prototypes to obtain each optimized category prototype.
[0117] The prototype comparison constraint establishment module is used to calculate the cosine similarity between the global image features and the optimized category prototypes, and to establish prototype comparison constraints. The prototype comparison constraints are used to make samples closer to their corresponding category prototypes and farther away from non-corresponding category prototypes, thereby enhancing the feature separation between samples of different categories.
[0118] The prototype enhancement module is used to enhance the global image features based on the cosine similarity to obtain prototype enhanced features.
[0119] The multi-scale refinement processing module is used to perform multi-scale refinement processing on the prototype enhancement features to obtain refined features.
[0120] The prototype distance classification module is used to calculate the distance between the refined features and each optimized category prototype, and to obtain the initial classification probability and initial confidence based on the distance; the initial confidence is the maximum value of the initial classification probability; the initial classification probability constitutes the original prediction probability distribution.
[0121] The confidence calibration module is used to calibrate the initial confidence based on the nearest distance between the refined features and each optimized category prototype to obtain the calibrated confidence.
[0122] An uncertainty-aware consistency constraint construction module is used to construct perturbation samples based on the global image features, obtain the perturbed prediction probability distribution based on the perturbation samples, and calculate the difference between the original prediction probability distribution and the perturbed prediction probability distribution; based on the difference and the calibration confidence, an uncertainty-aware consistency constraint is constructed.
[0123] The model training and result output module constructs a total loss function based on the classification loss, the prototype comparison loss corresponding to the prototype comparison constraint, and the uncertainty perception consistency loss corresponding to the uncertainty perception consistency constraint; it optimizes the trainable parameters of the classification network based on the total loss function, and obtains a classification model by combining the optimized category prototypes; it inputs the brain CT image to be identified into the classification model and outputs the final predicted category; it also outputs the calibration confidence and verification prompts.
[0124] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores brain CT images. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a prototype confidence calibration classification method for stroke CT images.
[0125] Figure 6 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0126] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0127] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0128] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with relevant regulations and be authorized by the owner of the corresponding device.
[0129] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0130] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0131] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A prototype confidence calibration classification method for CT images of stroke, characterized in that, The method includes: Brain CT images were acquired and preprocessed to obtain preprocessed images; The preprocessed image is input into the Swin-Transformer backbone network to extract global image features; During the training phase, based on the global image features corresponding to the training samples, learnable category prototypes corresponding to the classification categories are constructed, and the learnable category prototypes are dynamically optimized to obtain each optimized category prototype. Calculate the cosine similarity between the global image features and the optimized category prototypes, and establish prototype comparison constraints; Based on the cosine similarity, the global image features are enhanced to obtain the prototype enhanced features; The prototype enhancement features are subjected to multi-scale refinement processing to obtain refined features; Calculate the distance between the refined features and each optimized category prototype, and obtain the initial classification probability and initial confidence based on the distance; the initial confidence is the maximum value of the initial classification probability; the initial classification probability constitutes the original predicted probability distribution; Based on the nearest distance between the refined features and each optimized category prototype, the initial confidence is calibrated to obtain the calibrated confidence. Based on the global image features, a perturbation sample is constructed, and based on the perturbation sample, a perturbed prediction probability distribution is obtained. The difference between the original prediction probability distribution and the perturbed prediction probability distribution is calculated. Based on the difference and the calibration confidence, an uncertainty-aware consistency constraint is constructed. A total loss function is constructed based on the classification loss, the prototype comparison loss corresponding to the prototype comparison constraint, and the uncertainty perception consistency loss corresponding to the uncertainty perception consistency constraint. The trainable parameters of the classification network are optimized based on the total loss function, and a classification model is obtained by combining the optimized category prototypes. The brain CT image to be identified is input into the classification model, and the final predicted category is output. At the same time, the calibration confidence and verification prompts are output.
2. The method for prototype confidence calibration classification of stroke CT images according to claim 1, characterized in that, Dynamically optimize the learnable category prototypes to obtain optimized category prototypes, specifically including: Get the first in the current training batch The set of sample features for a class of samples; Calculate the first The average feature of class samples in the current training batch; the formula for calculating the average feature is: ; in, Indicates the first in the current training batch The average features of the class of samples; Indicates that the current batch belongs to the first... The number of samples in each class; Indicates the first in the current training batch Class sample feature set; Indicates the first Global image features of a CT image sample; Based on the aforementioned average characteristics, an exponential moving average method is used to calculate the first... k The class prototype is updated to obtain the optimized class prototype; the expression for the exponential moving average method is: ; in, Indicates the first The prototype vectors corresponding to each category; Denotes the momentum coefficient, and .
3. The method for prototype confidence calibration classification of stroke CT images according to claim 1, characterized in that, The expression for the cosine similarity is: ; in, Representing sample features With the Each category prototype Cosine similarity between them; Indicates the first Global image features of a CT image sample; Indicates the first The prototype vectors corresponding to each category; Represents the dot product of vectors; express Norm; The expression for the prototype contrast loss corresponding to the prototype contrast constraint is: ; in, Indicates the first Prototype contrast loss for each sample; Indicates the true category of the sample The corresponding category prototype; Indicates the temperature coefficient of the prototype comparison; This indicates the total number of categories.
4. The method for prototype confidence calibration classification of stroke CT images according to claim 1, characterized in that, Based on the cosine similarity, the global image features are enhanced to obtain prototype enhanced features, specifically including: Based on the cosine similarity, attention weights for each category prototype are generated after softmax normalization; the expression for the attention weights of the category prototypes is: ; in, Indicates the first The nth sample pair Attention weights for each category prototype; Indicates the prototype fusion temperature coefficient; Indicates a category index; Indicates the total number of categories; Indicates the first Global image features of a CT image sample; Indicates the first The prototype vectors corresponding to each category; Indicates the first The prototype vectors corresponding to each category; the attention weights, after softmax normalization, satisfy... ; The prototypes of each category are weighted according to their corresponding attention weights and incorporated into the global image features to obtain prototype enhancement features; the expression of the prototype enhancement features is: ; in, Indicates the first Prototype enhancement features for each sample; This represents the scaling factor, used to control the strength of how well the category prototype information is incorporated into the original features.
5. The method for prototype confidence calibration classification of stroke CT images according to claim 1, characterized in that, The expression for the multi-scale refinement process is: ; in, Indicates the first Refined features of each sample; Indicates the first Prototype enhancement features for each sample; The multi-scale feature processing function is represented; the multi-scale feature processing function includes feature processing branches with at least two different receptive fields; the feature processing branches include at least one of a 1×1 convolution branch, a 3×3 convolution branch, a 5×5 convolution branch, a multilayer perceptron branch, or an attention branch.
6. The method for prototype confidence calibration classification of stroke CT images according to claim 1, characterized in that, The distance is the Euclidean distance, and the distance calculation formula is: ; in, Representing refined features of the sample With the The distance between prototypes of each category; Indicates the first Refined features for each sample; Indicates the first The prototype vectors corresponding to each category; express Norm; The formula for calculating the initial classification probability is: ; in, Indicates the first The sample belongs to the first The initial classification probabilities of each category; Indicates a category index; Indicates the total number of categories; Indicates the first The prototype vectors corresponding to each category; The formula for calculating the initial confidence level is: ; in, Indicates the first The initial confidence level of each sample; The initial classification probabilities constitute the original predicted probability distribution, denoted as... .
7. The method for prototype confidence calibration classification of stroke CT images according to claim 1, characterized in that, Based on the nearest distance between the refined features and each optimized category prototype, the initial confidence level is calibrated to obtain the calibrated confidence level, specifically including: Based on the nearest distance between the refined features and each optimized category prototype, a prototype calibration signal is generated; the expression of the prototype calibration signal is: ; in, Indicates the prototype calibration signal; Indicates the distance scaling factor; It represents the distance from the refined features of a sample to the nearest class prototype; The initial confidence level and the prototype calibration signal are input together into a gating function to obtain the confidence gating parameter; the expression for the confidence gating parameter is: ; in, Indicates the first Confidence gating parameters for each sample; This represents the sigmoid activation function. Indicates the gating weight parameter; Indicates the gating bias parameter. This indicates that the initial confidence level and the prototype calibration signal are spliced together; The calibration confidence level is obtained based on the confidence gating parameters; the expression for the calibration confidence level is: ; in, Indicates the confidence level after calibration; Indicates the first The initial confidence level of each sample.
8. The method for prototype confidence calibration classification of stroke CT images according to claim 1, characterized in that, Based on the global image features, a perturbation sample is constructed, and based on the perturbation sample, a perturbed prediction probability distribution is obtained. The difference between the original prediction probability distribution and the perturbed prediction probability distribution is then calculated. Based on the aforementioned differences and the calibration confidence level, an uncertainty-aware consistency constraint is constructed, specifically including: A perturbation term is added to the global image features to obtain the perturbed features: ; in, Indicates the characteristics after the disturbance; Indicates the disturbance term; Indicates the first Global image features of a CT image sample; Calculate the perturbation cosine similarity between the perturbed features and the optimized category prototypes; Based on the perturbation cosine similarity, the perturbation features are enhanced to obtain perturbation-enhanced features; The perturbation enhancement features are refined using multi-scale processing to obtain refined perturbation features; Calculate the perturbation distance between the refined perturbation features and each optimized category prototype, and obtain the initial perturbation classification probability and initial perturbation confidence based on the perturbation distance; Based on the nearest distance between the refined perturbation features and each optimized category prototype, the initial perturbation confidence is calibrated to obtain the perturbation calibration confidence; and based on the initial perturbation classification probability or the perturbation branch classification output, the predicted probability distribution after perturbation is obtained. Calculate the KL divergence between the original predicted probability distribution and the perturbated predicted probability distribution; the expression for the KL divergence between the original predicted probability distribution and the perturbated predicted probability distribution is: ; in, This represents the difference between the original predicted probability distribution and the perturbed predicted probability distribution; In the probability distribution of disturbance prediction, the th The probability values of each category; Indicates that the sample belongs to the first The final predicted probability of the class; Indicates the total number of categories; Based on the KL divergence and the calibration confidence, an uncertainty-aware consistency constraint is constructed; the expression for the uncertainty-aware consistency loss corresponding to the uncertainty-aware consistency constraint is: ; in, Indicates the first Consistency loss in perceived uncertainty for each sample; This indicates the confidence level after calibration.
9. The method for prototype confidence calibration classification of stroke CT images according to claim 1, characterized in that, The total loss function is constructed based on the classification loss, the prototype comparison loss corresponding to the prototype comparison constraint, and the uncertainty-perceived consistency loss corresponding to the uncertainty-perceived consistency constraint; the expression of the total loss function is: ; in, Represents the total loss function; Indicates classification loss; Indicates prototype contrast loss; This represents the loss of perceived consistency in uncertainty; and These represent the weighting coefficients of the prototype contrast loss and the uncertainty perception consistency loss, respectively. The classification loss uses cross-entropy loss, and the expression for the classification loss is: ; in, Indicates the first Classification loss for each sample; Indicates an indicator function; Indicates that the sample belongs to the first The final predicted probability of the class; Indicates the total number of categories; The expression for the final predicted category is: ; in, Indicates the first The final predicted category for each sample.
10. A prototype confidence calibration classification system for CT images of stroke, characterized in that, The system is used to implement the prototype confidence calibration classification method for stroke CT images according to any one of claims 1-9, and the system comprises: The image acquisition and preprocessing module is used to acquire brain CT images and perform preprocessing to obtain preprocessed images; The feature extraction module is used to input the preprocessed image into the Swin-Transformer backbone network to extract global image features; The category prototype construction module is used to construct learnable category prototypes corresponding to the classification categories based on the global image features corresponding to the training samples during the training phase, and dynamically optimize the learnable category prototypes to obtain each optimized category prototype. The prototype comparison constraint establishment module is used to calculate the cosine similarity between the global image features and the optimized category prototypes, and to establish prototype comparison constraints. The prototype enhancement module is used to enhance the global image features based on the cosine similarity to obtain prototype enhanced features; A multi-scale refinement processing module is used to perform multi-scale refinement processing on the prototype enhanced features to obtain refined features; The prototype distance classification module is used to calculate the distance between the refined features and each optimized category prototype, and to obtain the initial classification probability and initial confidence based on the distance; the initial confidence is the maximum value of the initial classification probability; the initial classification probability constitutes the original predicted probability distribution. The confidence calibration module is used to calibrate the initial confidence based on the nearest distance between the refined features and each optimized category prototype to obtain the calibrated confidence. An uncertainty-aware consistency constraint construction module is used to construct perturbation samples based on the global image features, obtain the perturbed prediction probability distribution based on the perturbation samples, and calculate the difference between the original prediction probability distribution and the perturbed prediction probability distribution; and construct uncertainty-aware consistency constraints based on the difference and the calibration confidence. The model training and result output module constructs a total loss function based on the classification loss, the prototype comparison loss corresponding to the prototype comparison constraint, and the uncertainty perception consistency loss corresponding to the uncertainty perception consistency constraint; it optimizes the trainable parameters of the classification network based on the total loss function, and obtains a classification model by combining the optimized category prototypes; it inputs the brain CT image to be identified into the classification model and outputs the final predicted category; it also outputs the calibration confidence and verification prompts.