Chest CT pathogen explaination for predictive model construction

By separating noise from pathological features using a noise-invariant encoder and a counterfactual causal intervention module, and combining this with a knowledge compensation module, the problem of noise interference in low-dose CT images was solved, achieving highly accurate and interpretable pathogen prediction.

CN122337557APending Publication Date: 2026-07-03THE FIRST AFFILIATED HOSPITAL OF BENGBU MEDICAL COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
THE FIRST AFFILIATED HOSPITAL OF BENGBU MEDICAL COLLEGE
Filing Date
2026-04-10
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively distinguish between real lesions and noise artifacts in low-dose CT images, resulting in poor model robustness and interpretability, which hinders clinical application.

Method used

A noise-invariant encoder is used to separate anatomical and pathological features from noise quality features. Combined with a counterfactual causal intervention module and a knowledge-guided feature compensation module, the causal confidence coefficient and attention map feedback mechanism are used to improve the causality and interpretability of the model.

Benefits of technology

It significantly enhances the accuracy and robustness of pathogen type prediction on low-dose CT images, provides an interpretable decision process, and improves the model's generalization ability under different devices and scanning parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122337557A_ABST
    Figure CN122337557A_ABST
Patent Text Reader

Abstract

This invention discloses a method for constructing an interpretable predictive model of pathogenic bacteria in chest CT scans, belonging to the field of artificial intelligence technology. The method includes: Step S1: acquiring a chest CT image dataset and pathogenic bacteria type labels, and constructing a pathogenic bacteria imaging knowledge graph using a medical knowledge base; Step S2: constructing an initial model, which includes: a noise-invariant encoder, a counterfactual causal intervention module, a knowledge-guided feature compensation module, an interpretability analysis module, and a classifier; Step S3: feeding the spatial attention weight map back to the noise-invariant encoder to update and iterate the anatomical pathological features. Based on the final features obtained after internal iterative optimization, the initial model is trained according to preset training rules until overall convergence. This invention effectively distinguishes between real lesions and noise artifacts in low-dose CT images through causal intervention and attention map difference-driven feature updates, improving the model's recognition accuracy and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, specifically a method for constructing an interpretable predictive model of pathogenic bacteria in chest CT scans. Background Technology

[0002] In the diagnosis of chest infections, low-dose CT (LDCT) is increasingly becoming an important tool for screening and diagnosis due to its lower radiation risk. Utilizing artificial intelligence models to automatically identify and predict pathogen types in LDCT images can assist clinical decision-making and achieve early, precise treatment, thus possessing significant clinical value.

[0003] For images with limited imaging conditions or low signal-to-noise ratios (e.g., low-light images, high-compression-ratio images, low-dose imaging images), robustly and interpretably extracting and utilizing key features relevant to specific semantic tasks is a common technical challenge. Traditional image analysis methods, including many deep learning-based models, typically learn an end-to-end mapping from raw pixels to high-level semantics (such as object categories). These methods may perform well when processing high-quality, uniformly distributed training data.

[0004] However, existing technologies have limitations that severely restrict their reliable application and widespread adoption in real-world clinical scenarios. Current methods typically treat low-dose CT images as a whole for feature learning, failing to effectively decouple and explicitly address the causal relationships between inherent, complex noise interference and true anatomical and pathological features. This leads to models easily learning "spurious correlations" introduced by noise rather than essential pathological features. In the process of reducing radiation dose, low-dose CT images inevitably introduce more significant quantum noise and electronic noise than standard-dose CT. These noise patterns are highly intertwined with specific anatomical structures or pathological manifestations (such as ground-glass opacities and consolidation) in the image domain. During end-to-end learning, the model is highly susceptible to misclassifying certain fixed noise patterns (e.g., streak artifacts generated by specific equipment or scanning protocols) as typical imaging features of a pathogen, thus establishing incorrect associations. Such models based on "spurious correlations" not only lack credible interpretability in their decision-making process but, more importantly, have fragile generalization capabilities. When the model is applied to low-dose CT images obtained from different hospitals, different CT equipment, or different scanning parameters, the "pseudo-features" built by the model based on the original noise patterns become invalid due to the change in the distribution of noise patterns, resulting in a sharp decline in predictive performance and low clinical reliability.

[0005] Therefore, how to eliminate the dependence on noise interference during model training and improve the robustness, interpretability, and clinical applicability of low-dose CT pathogen prediction models is a core issue that urgently needs to be addressed. Summary of the Invention

[0006] To address the problem that existing technologies cannot effectively distinguish between real lesions and noise artifacts and perform causal reasoning, this invention provides a method for constructing an interpretable predictive model of pathogenic bacteria in chest CT scans.

[0007] To achieve the above objectives, the technical solution of the present invention is as follows:

[0008] Firstly, this application discloses a method for constructing an interpretable predictive model for pathogenic bacteria in chest CT scans, including:

[0009] Step S1: Obtain the training dataset, which includes paired standard-dose CT images and low-dose CT images, as well as corresponding pathogen type labels and imaging feature text descriptions;

[0010] Step S2: Construct an initial model, which includes:

[0011] A noise-invariant encoder is used to separate and output anatomical and pathological features and noise quality features from input low-dose CT images;

[0012] The counterfactual causal intervention module performs counterfactual causal intervention on the anatomical and pathological features based on the noise quality characteristics, calculates the causal confidence coefficient, and weights the anatomical and pathological features based on the coefficient to obtain causal enhancement features.

[0013] The knowledge-guided feature compensation module retrieves the corresponding text description from the pre-constructed pathogenic bacteria imaging knowledge graph based on the causal enhancement features, generates a virtual ideal feature vector, and then performs a weighted fusion of the virtual ideal feature vector with the causal enhancement features to obtain the compensated enhancement features.

[0014] The interpretability analysis module is used to generate attention maps based on the compensated enhanced features, causal confidence coefficients, and fusion weights based on the virtual ideal feature vectors, calculate the spatial difference maps between pairs of features, and fuse them as a spatial attention weight map.

[0015] A classifier is used to output the predicted probability of pathogen type based on the compensated enhanced features;

[0016] Step S3: Feed the spatial attention weight map back to the noise-invariant encoder to update and iterate the anatomical pathological features until the preset internal iteration termination condition is reached. Based on the final features obtained after internal iteration optimization, train the initial model according to the preset training rules until the whole convergence, and obtain the final chest CT pathogenic bacteria interpretable prediction model.

[0017] Secondly, this application discloses an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described above.

[0018] Thirdly, this application discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned method for constructing an interpretable predictive model of pathogenic bacteria in chest CT.

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0020] 1. Causal modeling capability: By introducing a counterfactual causal intervention module, the model calculates the causal confidence coefficient of each feature channel by simulating the counterfactual intervention operation of "artificially removing noise". This enables the model to distinguish between real lesions and noise artifacts, and improves the model from correlation learning to causal learning, which significantly enhances the robustness and generalization ability of the model.

[0021] 2. Noise-Leg Decoupling: By designing a noise-invariant encoder, anatomical and pathological features are separated from noise quality features, providing clear intervention variables for counterfactual interventions. Joint optimization of alignment loss, contrast loss, and reconstruction loss ensures the robustness of anatomical and pathological features to noise and the sensitivity of noise quality features to the degree of degradation.

[0022] 3. Knowledge-guided dynamic compensation: To address the potential loss of true lesion features in low-dose CT images, a pathogenic bacteria imaging knowledge graph was constructed. A text-feature generator then transformed textual knowledge into fusionable virtual ideal feature vectors. An adaptive fusion network dynamically adjusts the compensation intensity based on image quality, achieving an intelligent "on-demand compensation" mechanism.

[0023] 4. Breakthrough in Interpretability: This invention not only generates traditional attention maps (first attention map), but also innovatively generates noise artifact maps (second attention map) and knowledge compensation maps (third attention map). The three attention maps reveal the model's decision-making process from different dimensions: the actual observation area, the suppressed noise area, and the knowledge compensation area, enabling doctors to fully understand the model's reasoning logic.

[0024] 5. Attention Map Difference-Driven Update: By calculating the difference map between the three attention maps, spatial attention weights are generated and fed back to the encoder's feature extraction process, forming a closed-loop mechanism of "interpretable output → model self-optimization". This design enables the model to dynamically adjust the attention focus of feature extraction based on its own interpretability feedback. High-difference regions (regions of model uncertainty) are given enhanced attention, while high-noise regions are suppressed, realizing the model's self-correction capability.

[0025] 6. Controllable Inference Efficiency: The quality-aware triggering mechanism enables the model to dynamically select inference paths based on image quality, ensuring both accuracy and efficiency. Inference speed is significantly improved on images of acceptable quality; on images of unacceptable quality, the entire process guarantees recognition accuracy. This mechanism enhances the model's practicality in real-world clinical deployments. Attached Figure Description

[0026] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. In the drawings, the same reference numerals are used to refer to the same parts. Wherein:

[0027] Figure 1 This is an overall framework diagram of the present invention;

[0028] Figure 2 This is a schematic diagram of the overall workflow of the present invention;

[0029] Figure 3 This is a schematic diagram of the counterfactual causal intervention steps of the present invention. Detailed Implementation

[0030] It is readily understood that, based on the technical solution of this invention, those skilled in the art can propose various interchangeable structural methods and implementations without altering the essential spirit of the invention. Therefore, the following detailed embodiments and accompanying drawings are merely illustrative examples of the technical solution of this invention and should not be considered as the entirety of the invention or as limitations or restrictions on the technical solution of this invention.

[0031] In existing technologies, traditional methods for constructing interpretable predictive models for pathogenic bacteria in chest CT scans can enhance low-quality images using image denoising algorithms or image domain transformation models, and then input the enhanced images into classification models for identification. However, these methods have limitations: the denoising or transformation process may irreversibly lose weak signal features that are crucial for identifying pathogenic bacteria while filtering out noise; while multimodal information can be fused through cross-modal attention mechanisms, existing fusion methods are mostly static fusions, meaning that the same fusion strategy and fusion weights are used regardless of image quality, failing to dynamically adjust the intensity of knowledge introduction based on image quality; class activation mapping is widely used in interpretability analysis of medical image AI models to generate heatmaps to highlight areas of interest to the model. However, when the input image quality is poor and key features are blurred, the model enters a guessing state of "insufficient evidence," and its output attention map becomes scattered, unstable, or unreliable.

[0032] To address the aforementioned issues, this application proposes an iterative optimization and knowledge-enhanced interpretable prediction model construction method. Its core concept is to achieve accurate, robust, and interpretable predictions through a deep, learnable model: First, a noise-invariant encoder decouples low-dose CT images into anatomical and pathological features and noise quality features. Then, a counterfactual causal intervention module infers based on noise features, calculating causal confidence to enhance noise-independent causal pathological features. Next, a knowledge-guided feature compensation module retrieves and generates virtual ideal features from a pathogenic imaging knowledge graph to compensate for information loss in low-dose images. Then, an interpretability analysis module integrates multi-source attention to generate a spatial attention weight map, feeding it back to the encoder to update pathological features, forming an internal iterative optimization that gradually focuses the model on key pathological regions. Finally, after internal iterative convergence, the optimized features are used for pathogen classification, and end-to-end training ensures overall model convergence. This method effectively improves the accuracy, robustness, and interpretability of pathogen type prediction on low-dose CT images through a closed-loop design of feature decoupling, causal intervention, knowledge compensation, and attention feedback.

[0033] After introducing the basic concept of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0034] like Figure 1 and Figure 2 As shown in the figure, this embodiment provides a method for constructing an interpretable predictive model for pathogenic bacteria in chest CT images, which mainly includes three stages: data preparation, model construction, and model training. This method addresses the problem that noise artifacts in low-dose CT images severely affect pathogenic bacteria identification by proposing an interpretable predictive framework based on noise decoupling, causal intervention, and knowledge compensation.

[0035] Step S1: Obtain the training dataset, which includes paired standard-dose CT images and low-dose CT images, as well as corresponding pathogen type labels and radiographic feature text descriptions.

[0036] This step utilizes publicly available medical image databases and knowledge bases to ensure the objectivity, repeatability, and scalability of data acquisition.

[0037] 1.1 Acquisition of Paired CT Image Data

[0038] Paired standard-dose CT (conventional dose) and low-dose CT images of the same patient were obtained from publicly available chest CT image databases. Low-dose CT images could be obtained in two ways: (1) by directly obtaining paired data containing both conventional-dose and low-dose scans from publicly available datasets; (2) for datasets containing only conventional-dose CT, by using publicly available physical simulation models or noise injection methods to generate simulated low-dose CT images from conventional-dose CT images, thereby constructing paired training data.

[0039] Optional data sources include:

[0040] The Cancer Imaging Archive (TCIA) contains multiple chest CT datasets, such as the NSCLC Radiogenomics dataset and the RIDER Lung CT dataset, providing detailed clinical information and paired scan data for some cases.

[0041] The LIDC-IDRI dataset (Lung Image Database Consortium) is primarily used for lung nodule detection. It allows users to filter scans at different dose levels using scan parameter information from its DICOM metadata, or generate simulated low-dose images based on its standard dose scans using a noise injection method. Note that this dataset itself does not contain pathogen labels; pathogen type information must be supplemented by combining it with clinical reports or other data sources.

[0042] COVID-19 CT Scan Dataset (publicly released by the University of California, San Diego School of Medicine): This dataset contains chest CT scans from at least 2,482 COVID-19 patients, covering images from different scanning protocols, and provides detailed clinical reports and microbial culture results. Pathogen type information was extracted from the "Microbiology" field of the clinical reports.

[0043] Mayo Clinic Low-Dose CT Dataset: A dataset specifically designed for low-dose CT imaging research, containing paired conventional and low-dose scans.

[0044] The above data sources are examples of optional sources. In practical applications, they can be flexibly combined according to availability. Alternatively, hospitals can use their own desensitized retrospective datasets, or low-dose images can be generated from standard-dose CT scans using physical simulation models, expanding to 2000-3000 cases.

[0045] In this embodiment, the integration of the above-mentioned data sources is preferred to construct a paired image dataset containing no fewer than 2000 patients, with each patient having one set of conventional dose CT images and one set of low dose CT images. Image preprocessing includes: window width and window level adjustment (lung window: window width 1500HU, window level -600HU; mediastinal window: window width 400HU, window level 40HU), pixel value normalization to the [0,1] interval, resampling to a uniform resolution of 512×512 pixels, and uniform slice thickness of 1.0-1.5mm. During the training phase, data augmentation strategies are adopted: random rotation (±10°), random translation (±10 pixels), random horizontal flip (probability 0.5), and random brightness and contrast adjustment (brightness factor 0.9-1.1, contrast factor 0.9-1.1) to enhance the model's generalization ability.

[0046] 1.2 Obtaining Pathogenic Bacterial Type Labels

[0047] Natural language processing techniques were used to automatically extract pathogen type labels from the structured clinical reports accompanying the dataset.

[0048] Locating the data source: Obtaining structured or semi-structured clinical documents (such as microbiology test reports, pathology results, and diagnostic records) that accompany the CT images from public databases;

[0049] Information extraction and standardization: Using natural language processing tools (such as the rule-based and dictionary-based MicrobEx system) to identify pathogen names from free text and map them to standard medical terms (such as SNOMED-CT), thus realizing the transformation of unstructured text into unified labels;

[0050] Association mapping: The standardized pathogenic bacteria labels are matched with the corresponding CT image files using the desensitized patient unique identifiers (such as case number, examination ID) to form the "image-label" data pairs required for training.

[0051] This embodiment constructs a dataset containing eight pathogenic bacteria types: Streptococcus pneumoniae, Staphylococcus aureus, Mycobacterium tuberculosis, Klebsiella pneumoniae, novel coronavirus, influenza virus, Legionella pneumophila, and Mycoplasma pneumoniae, as well as normal control samples, totaling nine categories. The sample size is balanced across categories, with a total sample size of no less than 2000 cases (including paired criteria and low-dose images).

[0052] 1.3 Acquisition of Textual Descriptions of Imaging Features

[0053] The textual description of imaging features comes from two aspects:

[0054] (1) Public medical knowledge base: Extract the association descriptions between pathogenic bacteria and imaging features from knowledge bases such as RadLex (Radiology Glossary), UMLS (Unified Medical Language System), and SNOMED CT (Systematic Medical Nomenclature - Clinical Terminology). For example, query the associated concepts of "Streptococcus pneumoniae" from UMLS, filter the concepts related to imaging features, and extract the triplet (pathogenic bacteria, features, imaging features), such as "Streptococcus pneumoniae - features - lobar consolidation", "Streptococcus pneumoniae - features - air bronchus sign", "Mycobacterium tuberculosis - features - tree bud sign", "Mycobacterium tuberculosis - features - thick-walled cavity", etc.

[0055] (2) Public medical image-report datasets: Chest images and their corresponding radiological report texts were obtained from public datasets such as DeepLesion and OpenI. Natural language processing techniques (such as medical text processing tools such as cTAKES and CLAMP) were used to perform entity recognition and relation extraction on the reports, and sentences containing clear descriptions of imaging features were selected, such as "tree-bud sign visible in the upper lobe of the right lung" and "leaning consolidation shadow with halo sign in the lower lobe of the left lung", to form a correspondence between imaging features and text descriptions.

[0056] The final knowledge base contains no fewer than 50 imaging features, each of which corresponds to multiple natural language description variants, providing rich corpus for subsequent text-feature generator pre-training.

[0057] Step S2: Construct the initial model. The construction process includes the following sub-steps:

[0058] Sub-step 2.1: Noise-invariant encoder, used to separate and output anatomical and pathological features and noise quality features from the input low-dose CT images.

[0059] The noise-invariant encoder is the foundation of the entire model's feature extraction. Its core design idea is to decouple features, breaking down the information contained in the input image into two independent parts: anatomical and pathological features related to lesions, and noise quality features related to image quality. The encoder consists of four parts: a shared feature extraction backbone network, an anatomical and pathological feature branch, a noise quality feature branch, and a reconstruction decoder.

[0060] (1) Shared feature extraction backbone network

[0061] A convolutional neural network is used as the backbone feature extractor. This embodiment uses the ResNet-50 architecture, removing the final global average pooling layer and fully connected layers, retaining all convolutional layers from conv1 to conv5_x. The input image size is 512×512×1 (single-channel CT image), and the output feature map size is 16×16×2048. Let the backbone network be φ, then for the input image x, the expression is as follows:

[0062] ;

[0063] in This represents the feature map output by the backbone network. This indicates a shared feature extraction backbone network. It is the set of real numbers, indicating that the elements of the tensor belong to real numbers. This feature map preserves the spatial structure information and deep semantic information of the input image and is the feature basis for subsequent branches.

[0064] (2) Branches of Anatomical and Pathological Features

[0065] The goal of the anatomical pathology feature branch is to extract information related to lung anatomy and pathogenic morphology from feature maps. This information should be insensitive to image noise, i.e., consistent across different dose levels. Specifically, this is achieved as follows:

[0066] For feature maps Global Average Pooling (GAP) is performed to obtain a 2048-dimensional global feature vector, which is then mapped to a 1024-dimensional anatomical and pathological feature space through a fully connected layer.

[0067] , ;

[0068] in This represents the global feature vector after global average pooling. , represents the weight matrix of the fully connected layer in the anatomical pathology branch. is a learnable parameter, representing the bias vector of the fully connected layer of the anatomical pathology branch. This is the anatomical and pathological feature vector, which will be used for pathogen type classification later.

[0069] (3) Noise quality characteristics branch

[0070] The goal of the noise quality feature branch is to extract image quality-related information from the feature map, including noise level, artifact type, and resolution degradation. This information should be independent of anatomical and pathological features; that is, changes in image quality should not affect the extraction of anatomical and pathological features, and vice versa. Specifically, this is implemented as follows:

[0071] Similarly to Global average pooling is performed to obtain a 2048-dimensional vector, which is then mapped to a 256-dimensional noise quality feature space through another independent fully connected layer. The expression formula is as follows:

[0072] ;

[0073] in , represents the weight matrix of the fully connected layer in the noise quality branch. Here, represents the learnable parameters, indicating the bias vector of the fully connected layer in the noise quality branch. This represents the noise quality feature vector, which is subsequently used for causal intervention and image quality assessment.

[0074] (4) Reconstructing the decoder

[0075] To ensure the effectiveness of feature decoupling, i.e., to ensure and It does contain enough information from the input image to allow setting up the reconstruction decoder. ,from and The original image is reconstructed from the joint representation of the two layers. The decoder consists of a series of transposed convolutional layers, expressed as follows:

[0076] ;

[0077] in This represents the reconstructed image. This represents a vector concatenation operation, enforced by the presence of a decoder. and It retains the information needed to reconstruct the original image, while ensuring the orthogonality and independence of the information in the two feature branches through the constraint loss of subsequent training.

[0078] In this application, the main purpose of the reconstruction decoder is as a regularization method during the training phase, constraining the two feature branches to retain sufficient and complementary image information through reconstruction loss. During the model inference phase, the reconstruction decoder does not participate in forward propagation and does not affect inference efficiency.

[0079] Sub-step 2.2: Counterfactual causal intervention module, based on the noise quality characteristics, performs counterfactual causal intervention on the anatomical pathological features, calculates the causal confidence coefficient, and weights the anatomical pathological features based on the coefficient to obtain causal enhancement features.

[0080] like Figure 3As shown, the counterfactual causal intervention module aims to distinguish between true lesion features and noise artifact features by drawing on the idea of ​​causal inference. Its core idea is inspired by the "do-operator" operation in structural causal models. By simulating the intervention operation of "gradually removing noise contributions" in the feature space, it approximates the causal contribution of each feature channel to the prediction result, thereby distinguishing between causally related features and spuriously related features.

[0081] (1) Noise contribution projection

[0082] First, a projection network is constructed to incorporate noise quality features. Projecting onto the anatomical pathology feature space to quantify the contribution of noise features to each channel of the anatomical pathology features, the formula is as follows:

[0083] ;

[0084] in , represents the weight matrix of the projection network. , representing the bias vector of the projection network. This is the noise contribution vector, where each dimension represents the degree to which the corresponding anatomical pathological feature channel is affected by noise.

[0085] (2) Multi-intensity counterfactual intervention

[0086] The counterfactual intervention operation is defined to simulate the subtraction of noise contributions of varying intensities from anatomical and pathological features. The formula is as follows:

[0087] ;

[0088] in Indicates the intensity of intervention Post-treatment anatomical and pathological features, This represents the intervention intensity coefficient. =0 indicates no intervention (preserving the original features). =1 indicates that noise contribution is completely removed (simulating the ideal situation of no noise), and intermediate values ​​indicate different levels of intervention.

[0089] This embodiment pre-sets a set of intervention intensity values: For each intervention intensity, the post-intervention characteristics were calculated separately. The result is then fed into a classifier (containing fully connected layers and a softmax activation function, which can share weights with subsequent classification layers) to obtain the corresponding probability distribution. ,in This represents the intensity coefficient of the e-th intervention. Indicates an intervention intensity of At that time, the anatomical and pathological feature vector after counterfactual intervention, where e represents the index variable.

[0090] It should be noted that the classifier used in the above counterfactual intervention operation only defines its structure during the model building phase. In the third phase of training (end-to-end joint fine-tuning phase), it shares weights with the final classification layer and is updated synchronously with the training process. During the first and second phases of pre-training, the counterfactual causal intervention module does not participate in the training.

[0091] Prediction results under the above multiple intervention intensities Used to validate the effectiveness and stability of causal interventions during the training phase. During the inference phase, the causal confidence coefficient is calculated based solely on gradient information at the time of no intervention.

[0092] (3) Calculation of causal confidence

[0093] For the current prediction category ,in The preset number of intervention intensities (E=5 in this embodiment) is used. This represents the probability distribution without intervention. In the baseline probability distribution without intervention, the nth... The probability value of the class. Indicates the intensity of the e-th intervention Below, the probability distribution obtained after the counterfactual intervention feature is activated by a fully connected layer and Softmax is the th... The probability value of the class.

[0094] The causal confidence coefficient for each feature channel j is calculated using the following formula:

[0095] ;

[0096] in Indicates the feature channel index. To prevent division by zero constant, Indicates the preliminary forecast category The probability, The first anatomical pathological feature vector represents the... One portion, The first vector representing the noise contribution projection vector One portion, This can be calculated through backpropagation. The physical meaning of this formula lies in: molecular measurement of characteristic channels. For prediction categories The ratio represents the degree of contribution of the channel, i.e., the importance of the channel. The denominator measures the degree to which the channel is affected by noise, i.e., noise sensitivity. The larger the ratio, the more likely the channel is to be a causal feature driven by real lesions; the smaller the ratio, the more likely the channel is to be a spurious correlation feature driven by noise artifacts.

[0097] (4) Feature weighting

[0098] Based on the causal confidence coefficient, the original anatomical and pathological features are weighted channel by channel to obtain causal enhancement features, expressed by the following formula:

[0099] ;

[0100] in This represents a causal enhancement feature vector with a dimension of 1024. This represents element-wise multiplication. Through weighted operations, the true lesion features are preserved or even enhanced, while noise artifacts are suppressed, thus achieving an improvement from correlation-based learning to causal learning.

[0101] Sub-step 2.3: The knowledge-guided feature compensation module retrieves the corresponding text description from the pre-constructed pathogenic bacteria imaging knowledge graph based on the causal enhancement features, generates a virtual ideal feature vector, and performs weighted fusion of the virtual ideal feature vector with the causal enhancement features to obtain the compensated enhancement features;

[0102] Constructing a knowledge graph of pathogenic bacteria in imaging: Extracting concepts and relationships related to lung pathogens from the UMLS database. Specific steps:

[0103] Use the REST API provided by UMLS to query the CUI (Conceptual Unique Identifier) ​​of each pathogen.

[0104] Retrieve all concepts related to this CUI and filter for concepts with semantic types of "imaging findings" (T060) or "pathological findings" (T046).

[0105] Extract the relation triples (pathogenic bacteria CUI, "characteristic", imaging findings CUI) and obtain the text description and definition for each imaging finding.

[0106] Add standardized imaging terms and their synonyms to the RadLex glossary.

[0107] The knowledge-guided feature compensation module aims to retrieve relevant knowledge from an external knowledge base to perform feature compensation when poor image quality leads to the loss or blurring of real lesion features, thereby realizing an intelligent enhancement mechanism of "on-demand completion".

[0108] (1) Preliminary classification and knowledge retrieval

[0109] Enhance causal features Input the initial classification header (a single fully connected layer) to obtain the preliminary pathogen probability distribution. :

[0110] ;

[0111] in , represents the weight matrix of the initial classification layer. , represents the bias vector of the preliminary classification layer, C is the number of pathogenic bacteria categories (C=9 in this embodiment), Softmax represents the activation function, converts logits into probabilities, and the preliminary classification head ( , This is an auxiliary classification component independent of the final classification layer. During the first and second pre-training phases, the initial classification head does not participate in training. During the third phase of end-to-end joint fine-tuning, the initial classification head is unfrozen along with other modules, and its gradient is backpropagated through the knowledge retrieval path for co-optimization with the overall loss function. The purpose of this auxiliary classification head is to provide preliminary pathogen candidate judgments for knowledge retrieval; its accuracy does not need to be consistent with the final classifier.

[0112] according to The top K candidate pathogens with the highest probability (K=3 in this example) are selected, and their corresponding key imaging feature text descriptions are retrieved from a pre-constructed pathogen imaging knowledge graph. Let the candidate pathogen index set be:

[0113] ;

[0114] in This indicates that the first option with the highest probability is returned. Operations on each index. Indicates the first Preliminary probability of class This represents the category index for each candidate pathogen. The text descriptions of all associated imaging features are retrieved, merged, and deduplicated to obtain a set of text descriptions. , where M is the total number of text descriptions retrieved.

[0115] (2) Text-feature generator

[0116] The text-feature generator G is a key component in converting natural language descriptions into visual feature vectors. This generator employs a pre-trained visual-language model architecture, pre-trained using the publicly available medical image-report dataset obtained in step S1, to learn the mapping relationship between text descriptions and visual features.

[0117] Specifically, for a given text description The generator outputs a virtual ideal feature vector:

[0118] ;

[0119] This virtual ideal feature vector represents the visual feature that the imaging feature should correspond to under ideal imaging conditions. Through pre-training on large-scale image-text pairs, the generator learns to map semantic descriptions (such as "tree bud sign" and "halo sign") to corresponding feature space representations.

[0120] During the reasoning phase, each retrieved text description Input generator G to obtain the corresponding virtual ideal feature vector , constitute a virtual feature set , Indicates the first A text description.

[0121] (3) Generation of dynamic compensation strength coefficient

[0122] Based on noise quality characteristics The modulus is used to calculate the image quality decision signal. : ;

[0123] A larger Q value indicates a worse image quality (stronger noise), requiring stronger knowledge compensation; a smaller Q value indicates a better image quality, requiring less knowledge compensation to avoid introducing irrelevant information.

[0124] based on The value is used to generate dynamic compensation strength coefficients through the gating unit. : ,in This is a multilayer perceptron with the following structure: input layer (1D) → hidden layer (64D, ReLU activation) → output layer (1D); σ is the sigmoid activation function, which maps the output to... The range. The strength of α dynamic control knowledge compensation: when the image quality is poor, α is close to 1, and the compensation is strong; when the image quality is good, α is close to 0, and the compensation is weak.

[0125] (4) Feature-level attention fusion

[0126] Employing a scaled dot product attention mechanism to enhance features causally. For querying, a set of virtual ideal feature vectors is used. Calculate the compensation vector for the key and value:

[0127] First, calculate the attention score between the query and each key:

[0128] ,in A key matrix composed of stacked virtual ideal eigenvectors. Representation matrix The transpose of the expression, d=1024, represents the feature dimension. The Softmax function is applied to obtain the feature-level attention weights:

[0129] ;

[0130] This attention weight This indicates the degree of matching between each virtual feature and the current actual feature, i.e., which radiographic features are most relevant to the current image.

[0131] Calculate the compensation vector: ;

[0132] in To be A stacked matrix of values It is a compensation vector based on the attention mechanism fusion.

[0133] (5) Feature fusion

[0134] Multiplying the compensation vector by the compensation strength coefficient and then adding it to the causal enhancement feature yields the compensated enhanced feature:

[0135] ;

[0136] This fusion method achieves adaptive knowledge compensation: when the image quality is poor (α is large) and the matching degree between actual features and virtual features is high (A weight is concentrated), the compensation effect is significant; when the image quality is good (α is small), the compensation effect is weak, and the actual features are dominant.

[0137] Sub-step 2.4: Interpretability analysis module, used to generate attention maps based on the compensated enhanced features, causal confidence coefficients and fusion weights based on the virtual ideal feature vectors, calculate the spatial difference maps between pairs and fuse them as spatial attention weight maps.

[0138] This module is not only used to generate visualization results, but more importantly, it identifies uncertain areas of the model through differential analysis of multi-angle attention maps and generates spatial attention weight maps to provide feedback and guide the feature extraction process.

[0139] (1) Generation of the first attention map (actual observation map)

[0140] Classifier based on compensated enhanced features The output prediction result is the target, and the convolutional feature map output by the backbone network is used. The first attention map is generated using Grad-CAM technology. Highlighting the spatial regions that the model actually observes and that significantly contribute to the final prediction. Due to the classifier... to There exists a complete differentiable computational graph, and backpropagation can yield the different gradient weights for each channel. By combining the spatial activation patterns retained by each channel, a weighted summation can still generate an attention map with spatial positioning capabilities.

[0141] Specifically, calculate the final predicted category of For feature maps gradient:

[0142] ;

[0143] in, Indicates the first in Grad-CAM Each feature channel corresponds to a category The weight, Indicates the final prediction category The logit (unnormalized score). Representation of feature map In spatial location ( , ) No. The channel value, where Z is the spatial size of the feature map (16×16). For feature channel index, and For spatial location indexing, generate a weighted activation map and upsample it to the original image size:

[0144] , ;

[0145] in, This reflects the main image region that the model focuses on when making predictions. This represents the first attention map before upsampling. This represents a linear rectifier unit, taking a positive value. Indicates the first Grad-CAM weights of the channels Representation of feature map The One channel, This indicates an upsampling operation, which enlarges the 16×16 image to the original image size. To prevent the removal of the zero constant.

[0146] (2) Generation of the second attention map (noise artifact map)

[0147] Based on causal confidence coefficient Identify the feature channels identified as noise artifacts and generate a second attention map. This is used to display the noise region suppressed by the model.

[0148] First, calculate the difference between the original features and the causal enhancement features:

[0149] ;

[0150] in, This represents the difference vector between the original anatomical and pathological features and the causal enhancement features. Channels with larger median values ​​represent features significantly suppressed by causal intervention, i.e., channels identified as noise artifacts. Define the back projection matrix. ,Will Mapping back to the channel space of the backbone network feature map: ,in To select a learnable projection matrix The absolute value is greater than the threshold. channel set (θ is set to 0.5), these channels are plotted in the feature map. Spatial activation weighted summation:

[0151] , ;

[0152] in, This represents the unsampled second attention map. The difference vector after back projection is represented as the first... The absolute value of each component, Representation of feature map The One channel, The index range is 1 to 2048, and The number of channels is the same.

[0153] (3) Generation of the third attention map (knowledge compensation map)

[0154] Based on the feature-level attention weight A (the attention weight calculated in sub-step 2.3), the spatial region corresponding to the feature enhanced by knowledge compensation is identified, and a third attention map is generated. .

[0155] Select the set of virtual feature indices in attention weight A that are greater than the threshold μ·max(A). (Where μ is a preset scaling factor, and in this embodiment μ is 0.5), these virtual ideal feature vectors are mapped back to the feature map space through back projection:

[0156] , ;

[0157] in, This represents a linear transformation that maps virtual ideal feature vectors back to the feature map space (which can be approximated by a transpose of the last convolutional kernel of the encoder). This reflects the regions that the model retrieves and compensates for enhancements from the knowledge graph. This represents the unsampled third attention map. This represents the set of selected virtual feature indices. Indicates the first A virtual ideal feature vector, Indicates the first Attention weights corresponding to virtual features This indicates that the virtual ideal feature vector A linear transformation mapping back to feature map space (approximate transpose convolution) defines a spatial mapping network. It consists of fully connected layers and transposed convolutions: First, the 1024-dimensional vector is mapped to 4×4×16=256 dimensions through the FC layer and reshaped into a 4×4×16 feature map. Then, it is upsampled to 16×16 through two transposed convolutions (4×4×16→8×8×4→16×16×1). , ,in, This indicates a refactoring; FC stands for fully connected layer. This represents the first layer of transposed convolution. This indicates the second layer of transposed convolution.

[0158] (4) Calculation of difference plot

[0159] Calculate the pairwise differences between the three attention maps to obtain three difference maps:

[0160] First Difference Diagram This quantifies the spatial difference between the actual observation area and the knowledge compensation area. A large difference indicates that the model's actual area of ​​focus is inconsistent with the area expected to be focused on by the knowledge, which may indicate missing information or blurred features.

[0161] Second Difference Diagram This quantifies the spatial difference between the actual observed area and the noise artifact area. A large difference indicates that the model focused on areas that may contain noise, or that the noise area was not effectively suppressed.

[0162] Third Difference Diagram This quantifies the spatial difference between the knowledge compensation region and the noise artifact region. A large difference indicates that the knowledge compensation region and the noise suppression region are inconsistent, which may indicate a problem.

[0163] (5) Spatial attention weight map generation

[0164] The three difference maps above are weighted and combined, and then non-linearly activated using the Sigmoid function to generate a spatial attention weight map, expressed by the following formula:

[0165] ;

[0166] in For the Sigmoid function, , , The preset weighting coefficients are used; (in this embodiment, the weighting coefficients are taken as follows) =1.0, =1.0, =0.5). The physical meaning of this weighted graph is: when there is a large difference between actual observation and knowledge compensation ( Large difference between actual observations and noise artifacts (large) Large), and the difference between knowledge compensation and noise artifacts is small ( Regions with high uncertainty in the model (i.e., areas with significant uncertainty) are given high weights to guide the model to focus on these regions and re-extract features.

[0167] Sub-step 2.5: Classifier, used to output the predicted probability of pathogen type based on the compensated enhanced features.

[0168] The enhanced features after compensation Input the final classification layer to obtain the final predicted probability distribution:

[0169] ;

[0170] in , represents the weight matrix of the final classification layer. , representing the bias vector of the final classification layer, predicting the category as:

[0171] , This indicates that the category index with the highest probability is selected. For the first The final predicted probability of the class.

[0172] Step S3: Feed the spatial attention weight map back to the noise-invariant encoder to update and iterate the anatomical pathological features until the preset internal iteration termination condition is reached. Based on the final features obtained after internal iteration optimization, train the initial model according to the preset training rules until the whole convergence, and obtain the final chest CT pathogenic bacteria interpretable prediction model.

[0173] 3.1 Spatial Attention Weight Map Feedback and Update

[0174] The spatial attention weight map generated in sub-step 2.4 Downsampling to encoder feature map Same space dimensions (16×16), and Element-wise multiplication is expressed by the following formula:

[0175] ;

[0176] in This represents the weighted feature map, to which global average pooling is performed. This indicates downsampling, resulting in updated anatomical and pathological features:

[0177] , ,in, This indicates the updated anatomical and pathological features. This represents the global feature vector obtained after GAP of the weighted feature map, where , The fully connected layer parameters are shared with the anatomical and pathological feature branches in sub-step 2.1;

[0178] This module uses spatial attention weighting to make subsequent feature aggregation focus more on the uncertain regions indicated by the difference map, thereby obtaining more discriminative feature representations.

[0179] 3.2 Iterative Update

[0180] The above update process can be iterated multiple times, forming a loop optimization:

[0181] The updated anatomical and pathological features are obtained in the t-th iteration. The input to subsequent modules (counterfactual causal intervention module, knowledge-guided feature compensation module, and interpretability analysis module) generates the corresponding attention map. , , ;

[0182] The interpretability analysis module calculates a new spatial attention weight map based on the newly generated attention map. ;

[0183] Will The data is fed back to the encoder to obtain the updated anatomical and pathological features for the (t+1)th iteration. ;

[0184] Repeat the above process until the preset stopping condition is met.

[0185] It should be noted that in subsequent iterations (t≥2), Keeping the same, always using the category determined in the first iteration, in the causal confidence calculation... It should also remain fixed.

[0186] 3.3 Preset Termination Conditions

[0187] The iteration stopping condition is one of the following:

[0188] Condition 1: Reach the preset maximum number of iterations. (This embodiment) =5), to prevent infinite loops and ensure reasoning efficiency;

[0189] Condition 2: The spatial overlap between the first attention maps obtained in two adjacent iterations is greater than the first preset threshold. ;

[0190] The spatial overlap is quantified using the intersection-union ratio (IU / U), which measures the similarity between the first attention maps generated in two adjacent iterations. The specific calculation process is as follows: First, the first attention maps generated in the t-th and t+1-th iterations are compared... and Binarization is performed separately, and a binary mask is generated by using 50% of the maximum value of each attention map as a threshold. and Then calculate the ratio of the intersection area to the union area of ​​the two masks:

[0191] When the IoU value is greater than the first preset threshold When the value is 0.9, it indicates that the region of interest of the model has stabilized and the iteration terminates.

[0192] Condition 3: The KL divergence of the causal confidence coefficient distribution obtained in two consecutive iterations is less than the second preset threshold;

[0193] Causal confidence coefficient It is the core indicator output by the counterfactual causal intervention module, and each dimension of it... This represents the causal contribution of the j-th anatomical pathology feature channel to the current predicted category. A larger coefficient indicates that the image region corresponding to that channel is more likely to be a causal feature driven by a real lesion; conversely, a smaller coefficient indicates that it is more likely to be a spurious correlation feature driven by noise artifacts. Therefore... The distribution directly characterizes the model's ability to distinguish between "lesions" and "noise";

[0194] First, the causal confidence coefficient vector is normalized to a probability distribution form. Let the causal confidence coefficient obtained after the t-th iteration be... Normalize its components to obtain the distribution :

[0195] ,in, , It is a very small constant. The dimension of anatomical pathological features (in this embodiment) =1024), after normalization satisfy It can be regarded as a discrete probability distribution, reflecting the relative importance of each feature channel in causal judgment;

[0196] The Kullback-Leibler divergence (KL divergence) is used to measure the distribution obtained between two adjacent iterations. and The difference between them. The formula for calculating the KL divergence is:

[0197] ,in, and The first Second and third Causal confidence distribution after iteration normalization It is the natural logarithm. Similarly, a very small constant is added to avoid the logarithmic parameter being zero;

[0198] when When the causal judgment is considered to have reached a stable state, the internal iteration can be stopped. The second preset threshold, The value of is determined through validation set data-driven optimization: A complete iterative optimization process is run on the validation set, collecting the final KL divergence values ​​of all samples at convergence (e.g., when the maximum number of iterations is reached or the attention map is stable), and the 90th percentile of these values ​​is taken as . In this embodiment, =0.05.

[0199] 3.4 Model Construction

[0200] Construct the initial model according to step S2, with the parameters of each module set as follows:

[0201] Noise-invariant encoder:

[0202] Shared backbone network: ResNet-50, with the last global average pooling layer and fully connected layer removed, output feature map size 16×16×2048;

[0203] Anatomical and pathological feature branch: global average pooling + fully connected layer (2048→1024), output dimension 1024;

[0204] Noise quality feature branch: Global average pooling + fully connected layer (2048→256), output dimension 256;

[0205] The decoder consists of 6 transposed convolutional layers, upsampled layer by layer to 512×512×1. The parameters of each layer are as follows:

[0206] Fully connected layer: 1280 dimensions → 32768 dimensions (i.e. 8×8×512), after ReLU activation, it is reconstructed into an 8×8×512 three-dimensional feature map, which is used as the input of the transposed convolution sequence;

[0207] Transposed convolution 1: 4×4, stride 2, output 16×16×256, BN+ReLU;

[0208] Transposed convolution 2: 4×4, stride 2, output 32×32×128, BN+ReLU;

[0209] Transposed convolution 3: 4×4, stride 2, output 64×64×64, BN+ReLU;

[0210] Transposed convolution 4: 4×4, stride 2, output 128×128×32, BN+ReLU;

[0211] Transposed convolution 5: 4×4, stride 2, output 256×256×16, BN+ReLU;

[0212] Transposed convolution 6: 4×4, stride 2, output 512×512×1, Tanh, where ReLU and Tanh are activation functions.

[0213] Counterfactual causality intervention module:

[0214] Noise contribution projection network: fully connected layers (256→1024), no activation function.

[0215] Intervention intensity set: δ∈{0.1, 0.3, 0.5, 0.7, 0.9};

[0216] Classifier: Shares weights with the final classification layer, single fully connected layer (1024→9);

[0217] ε: 1e-8 (excluding zero constant).

[0218] Knowledge-guided feature compensation module:

[0219] Preliminary classification header: Single-layer fully connected (1024→9);

[0220] Top-K in knowledge retrieval: 3;

[0221] Text-feature generator: CLIP-based text encoder (12-layer Transformer, 512 hidden layer dimensions, 8 attention heads), fine-tuned on the DeepLesion dataset, with the output feature dimension mapped to 1024 through a projection layer;

[0222] MLP (Main Level Gate) gating unit: 1-dimensional input → 64-dimensional hidden layer (ReLU) → 1-dimensional output (Sigmoid).

[0223] Attention mechanism: Scaling dot product attention, scaling factor ;

[0224] Interpretability Analysis Module:

[0225] Difference plot weights: =1.0, =1.0, =0.5;

[0226] Threshold parameters: θ=0.5 (noise channel selection threshold), μ=0.5 (knowledge channel selection threshold);

[0227] Maximum number of iterations: =5;

[0228] Attention map overlap threshold: =0.9; Back projection matrix: Fully connected layer (1024→2048), no activation function.

[0229] Space Mapping Network : FC (1024→256) + transposed convolution 1 (4×4, 16→4 channels, stride 2) + transposed convolution 2 (4×4, 4→1 channel, stride 2), BN + ReLU, where BN is batch normalization;

[0230] Classification layer: Fully connected layer (1024→9), followed by Softmax activation function.

[0231] 3.5 Preset Training Rules

[0232] The training process employs a phased training strategy to ensure stable convergence and collaborative optimization of each module.

[0233] Phase 1: Pre-training of the noise-invariant encoder

[0234] Training targets: Only the noise-invariant encoder is trained, including the shared backbone network, the anatomical pathology branch, the noise quality branch, and the decoder.

[0235] Training objective: Optimize the following three constraint losses to enable the encoder to effectively decouple anatomical pathological features and noise quality features.

[0236] (1) Alignment loss To ensure consistency in the anatomical and pathological features of low-dose and standard-dose images of the same patient, the following formula is used: This is because the anatomical and pathological features should be independent of the imaging dose and only reflect the lesion itself.

[0237] ;

[0238] in For batch size, and These represent the anatomical and pathological features corresponding to the low-dose and standard-dose images of the i-th sample, respectively.

[0239] (2) Comparative loss This constrains the differentiation of noise quality characteristics between low-dose and standard-dose images of the same patient. Because noise quality characteristics should reflect differences in image quality, the noise characteristics of images from different doses should be clearly distinguishable.

[0240] Margin contrast loss is used to distinguish the noise features of paired standard and low-dose images in the feature space, expressed by the following formula:

[0241] ;

[0242] in Indicates the anchor sample index. Indicates the first Noise quality characteristics of low-dose images of individual samples, Indicates the first Noise quality characteristics of standard dose images of a sample, among which The interval parameter (in this embodiment, it is taken as...) =0.3), this loss encourages the cosine similarity of noise quality features of low-dose and standard-dose images of the same patient to be lower than 0.3. When the cosine similarity is lower than When the cosine similarity is zero, no further optimization is needed; when the cosine similarity is higher than... When the loss is positive, the model further widens the distance between the two in the feature space.

[0243] (3) Reconstruction losses The constraint ensures that the original image can be reconstructed from the anatomical and pathological features and the noise quality features, and that both feature branches retain sufficient information. The formula is as follows:

[0244] ;

[0245] in To determine the perceived loss, the specific formula is as follows: Specifically, it calculates the differences in the feature space based on the pre-trained VGG network, where... It is the first The weights of the layer loss, This represents the network layer index, and the distance metric is usually the L2 norm. , This represents the balance coefficient, in this embodiment =1.0, in this embodiment =0.1, Indicates the pre-trained network's... Layer to input Extracted feature map, Indicates the pre-trained network's... Layer-to-layer reconstructed image Extracted feature map.

[0246] Total losses in Phase One:

[0247] ;

[0248] , , These represent the weighting coefficients for each loss; in this embodiment, we take... =1.0, =0.5, =0.1, =1.0, =0.1. Training for 50 epochs, with the Adam optimizer, a learning rate of 0.0001, and a batch size of 32.

[0249] Phase 2: Text-Feature Generator Pre-training

[0250] Text-feature generator pre-training data: Pre-training was performed using a publicly available chest CT image-report dataset, primarily including:

[0251] The DeepLesion dataset contains 32,735 annotated lesions on CT images, each lesion corresponding to a descriptive fragment in the radiology report, totaling approximately 30,000 image-text pairs;

[0252] The CT dataset with reports in TCIA includes NSCLC Radiogenomics (262 cases, including clinical reports) and LIDC-IDRI (1,010 cases, including radiologist annotations), etc. After screening, approximately 20,000 image-text pairs were obtained.

[0253] Additional data sources: Cases with report text were selected from the RSNA pneumonia detection challenge dataset, the COVID-19-CT-Seg dataset, as well as CT-RATE, RadGenome-ChestCT, etc.;

[0254] The above data is preprocessed as follows:

[0255] Use cTAKES 4.0 tool for medical concept recognition to filter sentences containing descriptions of imaging features;

[0256] Extract the symptom terms appearing in the sentence and align them with the imaging features in the knowledge graph;

[0257] For each CT image-report pair, retain sentences containing at least one description of a radiological feature and filter out irrelevant sentences;

[0258] Standardize the description of symptoms by mapping different expressions of the same symptom to standard terminology;

[0259] Preprocessing of CT images: window width and window level adjustment (lung window: window width 1500HU, window level -600HU; mediastinal window: window width 400HU, window level 40HU), resampling to 512×512 pixels.

[0260] Approximately 50,000 high-quality image-text pairs were ultimately obtained and used to pre-train the text-feature generator. The dataset was then divided into training, validation, and test sets in an 8:1:1 ratio.

[0261] Training objects: Freeze the noise-invariant encoder trained in the first stage, and train the text-feature generator G.

[0262] Training data: Utilize the publicly available medical image-report dataset obtained in step S1.

[0263] Training objective: Optimize the generation loss so that the text-feature generator can map text descriptions to a vector space aligned with the visual feature space.

[0264] For each image-report pair, features are extracted from the image via the encoder's anatomical and pathological branch. The text features are extracted by the text encoder of the generator G. Optimizing the InfoNCE loss results in high feature similarity for paired features and low feature similarity for unpaired features. The formula is as follows:

[0265] ;

[0266] in Let be the cosine similarity, and τ be the temperature coefficient (set to 0.1). Training is performed for 30 epochs using the Adam optimizer with a learning rate of 0.0001 and a batch size of 128. This represents the feature vector extracted from the image through the encoder's anatomical pathology branch. The text description paired with the image is represented by a feature vector obtained through a generator text encoder. This represents unpaired textual description features (negative samples). This represents the set of negative samples.

[0267] Phase 3: End-to-end joint fine-tuning

[0268] Training targets: All modules (noise-invariant encoder, counterfactual causal intervention module, knowledge-guided feature compensation module, interpretability analysis module, and classification layer) were unfrozen and jointly optimized end-to-end. Modules not trained in the first and second stages (counterfactual causal intervention module, preliminary classification head, back projection matrix and spatial mapping network in the interpretability analysis module) were initialized using Xavier uniform initialization or Kaiming normal initialization before unfreezing, and were warmed up with a linear learning rate (linearly increasing from 10% of the target learning rate to the target value) in the first two epochs of the third stage to ensure gradient stability in the early stages of training.

[0269] Training objective: Primarily using classification loss, combined with the aforementioned alignment loss, contrastive loss, generation loss, reconstruction loss, and attention loss. Figure 1 To mitigate losses, collaborative optimization is needed.

[0270] (1) Classification loss: Cross-entropy loss, which measures the difference between the predicted probability and the true label, and is expressed by the following formula.

[0271] ;

[0272] in, The one-hot encoding of the real label, if the sample belongs to the first... Class =1, otherwise 0 Indicates the total number of categories. The first digit representing the final predicted probability Class probability.

[0273] (2) Alignment loss and contrast loss: The loss function of the first stage is used to maintain the feature decoupling ability.

[0274] (3) Attention Figure 1 Consistency loss: Constrains the stability of the attention map during the iteration process to prevent drastic fluctuations.

[0275] Where N is the number of iterations (taken as the final stopping number), this loss encourages the attention maps of adjacent iterations to remain consistent, making the iterative process converge and stabilize. Indicates the first The first attention map is generated in the next iteration.

[0276] Total losses in Phase Three:

[0277]

[0278] , , , , These are the weighting coefficients for each loss; in this embodiment, we take... =0.1, =0.05, =0.01, =0.1, =0.05, where The reconstruction loss function from the first stage is retained with a smaller weight in the third stage to prevent the encoder's feature decoupling capability from degrading during end-to-end fine-tuning. The computational data comes from the publicly available medical image-report dataset used in the second phase. In the third phase of training, paired CT image datasets are used alternately within each epoch (computation). , , , , ) and image-report datasets (computation) Update the parameters.

[0279] Training strategy: A hierarchical learning rate is used, with the encoder part having a learning rate of 0.00001, the generator part having a learning rate of 0.000001, and other modules having a learning rate of 0.0001. An early stopping strategy is employed: training stops if the validation set loss does not decrease for 5 consecutive epochs. The maximum number of training epochs is 20.

[0280] After the above-mentioned phased training, the various modules of the model converged collaboratively, resulting in the final interpretable predictive model of pathogenic bacteria in chest CT scans.

[0281] Furthermore, this embodiment also includes a quality-aware triggering step during the model inference phase:

[0282] In practical applications, to improve inference efficiency, a quality-aware triggering mechanism can be set up to dynamically determine whether to execute the complete iterative optimization process based on the quality of the input image.

[0283] Calculate the magnitude of the noise quality features of the input image. As a signal for image quality decision. Third preset threshold (Determined through a validation set, such as taking the 85th percentile of Q values ​​for all low-dose images in the validation set).

[0284] like If the image quality is deemed acceptable, the counterfactual causal intervention module, the knowledge-guided feature compensation module, and the interpretability analysis module are skipped, and anatomical and pathological features are used directly. Input the classification layer for prediction, and output a single attention map. This mode is fast and suitable for scenarios with high real-time requirements.

[0285] like If the image quality is deemed unacceptable, a complete counterfactual causal intervention, knowledge-guided feature compensation, and iterative update process are executed sequentially, outputting three attention maps and the final prediction result. This model has high accuracy and is suitable for difficult cases with poor image quality.

[0286] Experimental verification: This embodiment verifies the technical effect of the present invention through comparative experiments.

[0287] 1. Experimental setup

[0288] Dataset: 2000 paired CT images, 8 pathogens + normal controls, divided into training set (1200 cases), validation set (400 cases) and test set (400 cases) in a 6:2:2 ratio.

[0289] Low-dose images can be generated from conventional-dose CT scans using physical simulation models, expanding to 2000-3000 cases. For data sources with only conventional-dose CT scans, publicly available physical simulation models (such as those based on Poisson noise injection and system response modeling) are used to generate simulated low-dose CT images. This method has been widely applied in research on low-dose CT reconstruction algorithms, realistically simulating noise characteristics at different dose levels. By controlling simulation parameters, images highly similar to real low-dose CT scans can be generated to expand paired training data.

[0290] Comparison method:

[0291] Baseline 1: ResNet-50 direct classification (without any enhancements);

[0292] Baseline 2: LDCT→SDCT GAN conversion + ResNet-50 classification;

[0293] Baseline 3: Multimodal static fusion (image features + pre-trained text features, without causal intervention);

[0294] Baseline 4: Counterfactual causal intervention only (without knowledge compensation and iterative updates);

[0295] This invention: Complete solution;

[0296] Evaluation metrics: Accuracy, Precision, Recall, F1 score, AUC (Macro Average).

[0297] 2. Experimental Results

[0298] method Accuracy (%) Accuracy (%) Recall rate (%) F1 score AUC Baseline 1 72.3 71.8 70.5 0.71 0.81 Baseline 2 78.6 78.2 77.9 0.78 0.86 Baseline 3 81.2 80.8 80.5 0.81 0.88 Baseline 4 83.5 83.1 82.8 0.83 0.90 This invention 86.5 86.2 85.9 0.86 0.92

[0299] 3. Ablation test

[0300] To verify the contribution of each module, an ablation experiment was conducted:

[0301] Configuration Accuracy (%) Decline illustrate Complete model 86.5 - - Remove Counterfactual Causal Intervention Module 83.2 -3.3 Only the knowledge-guided feature compensation module and iteration are retained. Remove the knowledge-guided feature compensation module 82.8 -3.7 Only retain the counterfactual causal intervention module and iteration. Remove iterative updates 84.1 -2.4 Only the counterfactual causal intervention module and the knowledge-guided feature compensation module are retained. Noise-invariant encoder 78.9 -7.6 No counterfactual causal intervention module and knowledge-guided feature compensation module, no iteration

[0302] It should be noted that, in the above ablation experiments, although both the "noise-invariant encoder" configuration (accuracy 78.9%) and baseline 1 (ResNet-50 direct classification, accuracy 72.3%) used ResNet-50 as the backbone network, there is a key difference between the two: the former trained the feature decoupling ability by pairing the alignment loss, contrast loss, and reconstruction loss of standard dose and low dose images, and used the decoupled anatomical and pathological features. The former performs classification directly using the raw global features of ResNet-50, without utilizing paired data for feature decoupling training.

[0303] Ablation experiments show that each module makes a significant contribution to the final performance, with counterfactual causal intervention and knowledge-guided compensation making the largest contributions. Iterative updates further improve performance.

[0304] The technical solution of this application will be explained below using a specific scenario.

[0305] Scene setting:

[0306] A 65-year-old male patient presented to a community hospital with a 3-day history of fever, cough, and chest pain. Given his history of mild COPD and the need for short-term follow-up, the doctor ordered a low-dose chest CT scan. After the scan, the images were uploaded to an image-assisted diagnostic system deployed with the predictive model of this invention.

[0307] Step 1: Image Quality Perception and Path Selection

[0308] The model first extracts features from the input low-dose CT images. Using a noise-invariant encoder, the model separates the anatomical and pathological features. and noise quality characteristics .

[0309] Calculating the quality signal: The model calculates the magnitude of the noise quality characteristics. Calculations show that the image... The value is 6.8.

[0310] Decision: The system's preset third threshold is 5.2. Because... =6.8>5.2, the model determines that the image quality is unqualified (high noise, blurred lesions), and automatically triggers the complete inference path, that is, all subsequent modules will be activated to ensure the diagnostic accuracy under low quality images.

[0311] Step Two: Counterfactual Causal Intervention—Separating Falsehood from Truth

[0312] The image shows a blurred ground-glass opacity in the upper lobe of the patient's right lung, along with noticeable striped noise artifacts. The model needs to distinguish between the actual lesion and the noise.

[0313] Noise Projection: The counterfactual causal intervention module first identifies noise quality characteristics. Projecting onto the anatomical pathology feature space generates a noise contribution vector, quantifying the degree of noise interference to each pathological feature channel.

[0314] Causal confidence calculation: The model simulates the counterfactual operation of "noise removal". Results show:

[0315] Some characteristic channels in the blurred ground-glass shadow region maintain stable activation intensity after noise subtraction and contribute significantly to the prediction results. These channels have high causal confidence coefficients (e.g., 0.85).

[0316] The feature channels corresponding to the stripe artifact regions show a sharp drop in activation intensity after noise subtraction, contributing little to the prediction results. These channels also have very low causal confidence coefficients (e.g., 0.15).

[0317] Feature enhancement: The model weights the features based on the causal confidence coefficient, resulting in causal enhanced features. True lesion features are amplified, while noise artifacts are suppressed, achieving a preliminary "removal of artifacts and preservation of truth".

[0318] Step 3: Knowledge-guided feature compensation—"filling in the gaps" in ambiguous areas

[0319] Despite noise suppression, the problem of blurred lesion margins caused by low-dose scanning persists, particularly making it difficult to discern fine structures within ground-glass opacities (such as vascular perforation). At this point, the knowledge-guided feature compensation module comes into play:

[0320] Preliminary guess and retrieval: Based on the current characteristics, the model initially judges that the pathogen may be Streptococcus pneumoniae or the novel coronavirus. Based on these two candidates, the model retrieves key feature descriptions from the pre-constructed pathogen imaging knowledge graph: "lobular consolidation", "air bronchus sign", and "ground-glass opacity with vascular perforation sign".

[0321] Generating Virtual Ideal Features: Using a pre-trained text-feature generator, the above text description (such as "air bronchial sign") is converted into a corresponding virtual ideal feature vector. This vector represents "the perfect feature appearance of the air bronchial sign in an ideal noise-free high-definition image".

[0322] Dynamic compensation fusion:

[0323] Determine the compensation strength: due to image quality signals The value is high, and the gating unit generates a high compensation intensity coefficient α close to 0.8, indicating that "strong compensation is required".

[0324] Calculate attention weights: Using the current blurred lesion features as the "query," perform attention matching with multiple virtual ideal features. The model found that the current lesion features best match the virtual feature of "ground-glass opacity with vascular perforation" (attention weight as high as 0.7).

[0325] Feature fusion: The matched virtual features are multiplied by the compensation intensity coefficient and then added to the current features to obtain the compensated enhanced features. At this point, the model features are supplemented with detailed information on "vascular passage," making the lesion morphology more closely resemble the typical imaging manifestations of pneumonia caused by novel coronavirus infection.

[0326] Step 4: Interpretability Analysis and Iterative Self-Optimization—A Decision-Making Process That Doctors Can Understand

[0327] While generating the diagnostic report, the model also generated three key attention maps, clearly demonstrating its thought process:

[0328] First Attention Map The model ultimately focuses on the area highlighted, which is mainly concentrated in the ground-glass opacity region of the upper lobe of the right lung, indicating that the model makes its judgment based on the location of the lesion.

[0329] Second attention map The image shows the area suppressed by causal intervention, with the highlighted portion precisely corresponding to the strip-shaped noise artifact in the lower left corner. The doctor immediately recognized it: "Oh, the model knows it's noise and isn't bothered by it."

[0330] Third Attention Map The image shows the area enhanced by knowledge compensation, with the highlighted portion focusing on the blurred blood vessels within the ground-glass opacity. This tells the doctor, "The model believes this should be a vascular traversal sign, but because the image is too blurry, it makes an inference based on the knowledge base."

[0331] Closed-loop optimization: The interpretability analysis module calculates the differences between the three graphs and finds... and There is a slight difference in the vascular region (the model is unsure whether this is a real variation or a blood vessel). This difference is transformed into a spatial attention weight map and fed back to the encoder. In subsequent iterations, through spatial attention weighting, the model strengthens its feature aggregation of this difference region. After 2-3 iterations, the model features tend to stabilize, and the final prediction confidence is also higher.

[0332] Final result:

[0333] Prediction output: The model outputs the prediction result for the novel coronavirus (high confidence 0.89), while the prediction probabilities for other bacterial pathogens are all low.

[0334] This invention is no longer a "black box" prediction. In complex scenarios with low doses and high noise, it distinguishes lesions from noise through causal intervention, completes ambiguous key details through knowledge graphs, and finally presents the diagnostic basis to doctors in a complete manner with three interpretable heatmaps, greatly enhancing clinical trust and the value of auxiliary diagnosis.

[0335] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above embodiments.

[0336] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps described above.

[0337] The technical scope of this invention is not limited to the content described above. Those skilled in the art can make various modifications and variations to the above embodiments without departing from the technical concept of this invention, and all such modifications and variations should fall within the protection scope of this invention.

Claims

1. A method for constructing a predictive model of chest CT pathogen, characterized by, Includes the following steps: Step S1: Obtain the training dataset, which includes paired standard-dose CT images and low-dose CT images, as well as corresponding pathogen type labels and imaging feature text descriptions; Step S2: Construct an initial model, which includes: A noise-invariant encoder is used to separate and output anatomical and pathological features and noise quality features from input low-dose CT images; The counterfactual causal intervention module performs counterfactual causal intervention on the anatomical and pathological features based on the noise quality characteristics, calculates the causal confidence coefficient, and weights the anatomical and pathological features based on the coefficient to obtain causal enhancement features. The knowledge-guided feature compensation module retrieves the corresponding text description from the pre-constructed pathogenic bacteria imaging knowledge graph based on the causal enhancement features, generates a virtual ideal feature vector, and then performs a weighted fusion of the virtual ideal feature vector with the causal enhancement features to obtain the compensated enhancement features. The interpretability analysis module is used to generate attention maps based on the compensated enhanced features, causal confidence coefficients, and fusion weights based on the virtual ideal feature vectors, calculate the spatial difference maps between pairs of features, and fuse them as a spatial attention weight map. A classifier is used to output the predicted probability of pathogen type based on the compensated enhanced features; Step S3: Feed the spatial attention weight map back to the noise-invariant encoder to update and iterate the anatomical pathological features until the preset internal iteration termination condition is reached. Based on the final features obtained after internal iteration optimization, train the initial model according to the preset training rules until the whole convergence, and obtain the final chest CT pathogenic bacteria interpretable prediction model.

2. The method of claim 1, wherein, The counterfactual causal intervention module specifically includes: The noise quality features are mapped to the space containing the anatomical and pathological features to obtain the noise contribution vector; The simulation subtracts noise contribution vectors of different intensities from the anatomical pathological features to obtain counterfactual intervention features of different intensities. Each counterfactual intervention feature is then activated by a fully connected layer and Softmax to obtain the corresponding intervention probability distribution. The baseline probability distribution is obtained by applying the fully connected layer and Softmax activation to the anatomical and pathological features. The baseline probability distribution is then fused with each intervention probability distribution, and the category with the highest probability is selected as the target category. The ratio of the absolute value of the partial derivative of the probability value of the target category in the baseline probability distribution with respect to each channel of the anatomical pathological feature to the absolute value of the corresponding component of the noise contribution vector is used as the causal confidence coefficient. The causal enhancement features are obtained by weighting the anatomical pathological features channel by channel using the causal confidence coefficient.

3. The method of claim 1, wherein, The knowledge-guided feature compensation module specifically includes: Based on the causal enhancement features, retrieve the corresponding text description from the pre-constructed pathogenic bacteria imaging knowledge graph; Using a pre-trained text-feature generator, each of the text descriptions is converted into a virtual ideal feature vector; Based on the modulus of the noise quality characteristics, a dynamic compensation intensity coefficient is generated; An attention mechanism is used to calculate a compensation vector, with the causal enhancement feature as the query and the virtual ideal feature vector as the key and value. The compensation vector is multiplied by the compensation intensity coefficient and then added to the causal enhancement feature to obtain the compensated enhancement feature.

4. The method of claim 1, wherein, The process of feeding the spatial attention weight map back to the noise-invariant encoder specifically includes: A first attention map is generated based on the compensated enhanced features, a second attention map is generated based on the causal confidence coefficient, and a third attention map is generated based on the feature-level attention weights. Calculate the first difference map between the first attention map and the third attention map; Calculate a second difference map between the first attention map and the second attention map; Calculate the third difference map between the third attention map and the second attention map; The three difference maps are weighted and combined, and then passed through a non-linear activation function to generate a spatial attention weight map. The spatial attention weight map is downsampled to the same size as the feature map output by the noise-invariant encoder, and then multiplied element by element. The multiplied feature maps are subjected to global average pooling and then mapped through a fully connected layer to obtain the updated anatomical and pathological features.

5. The method of claim 4, wherein, The preset termination condition for the internal iteration is to satisfy any of the following conditions: Condition 1: Reach the preset maximum number of iterations; Condition 2: The spatial overlap between the first attention maps obtained in two adjacent iterations is greater than the first preset threshold; Condition 3: The KL divergence of the causal confidence coefficient distribution obtained in two consecutive iterations is less than the second preset threshold.

6. The method of claim 1, wherein, The noise-invariant encoder is subject to the following constraints during training: Alignment loss that constrains consistency of anatomical and pathological features between low-dose and standard-dose images of the same patient; Contrast loss that constrains the distinguishing of noise quality features between low-dose and standard-dose images of the same patient; The constraints are designed to reconstruct the original image from anatomical and pathological features and noise quality features, thus minimizing the reconstruction loss.

7. The method of claim 6, wherein, The training rules preset in step S3 adopt a phased training strategy, including: In the first stage, only the noise-invariant encoder is trained, and its network parameters are updated based on the alignment loss, contrast loss, and reconstruction loss. In the second stage, the noise-invariant encoder is frozen, the text-feature generator is trained, and its network parameters are updated based on the generation loss. The generation loss function is used to constrain the similarity between the virtual ideal feature vector output by the text-feature generator and the pathological features of the standard dose CT image in the feature space. In the third stage, all modules are unfrozen, and end-to-end joint fine-tuning is performed, mainly based on classification loss, combined with alignment loss, contrast loss, generation loss, reconstruction loss and attention map consistency loss. The classification loss is used to measure the difference between the predicted probability of pathogenic bacteria type output by the classifier and the corresponding real pathogenic bacteria type label in the training data. The attention map consistency loss is used to constrain the stability of the attention map during the iteration process.

8. The method of claim 1, wherein, After obtaining the final interpretable predictive model of pathogenic bacteria from chest CT scans, the method also includes quality-aware triggering during inference using this model. The specific steps are as follows: The input image to be inferred is input into the noise-invariant encoder to obtain the corresponding anatomical pathological features and noise quality features; The magnitude of the noise quality feature is calculated as the image quality decision signal; Determine whether the image quality decision signal is less than a third preset threshold: If so, the image quality is deemed acceptable, and the counterfactual causal intervention module, knowledge-guided feature compensation module, interpretability analysis module, and internal iterative optimization process are skipped. The anatomical and pathological features are directly input into the classifier for classification. If not, the image quality is deemed unqualified. After sequentially executing the counterfactual causal intervention module, the knowledge-guided feature compensation module, the interpretability analysis module, and the internal iterative optimization process, the classifier outputs the predicted probability of the pathogenic bacteria type.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the method for constructing an interpretable predictive model of pathogenic bacteria in chest CT as described in any one of claims 1 to 8.