Fine-grained pneumonia classification method and system based on sample anchoring and positive excitation noise learning

By introducing positively motivated noise learning and sample anchoring adaptation mechanisms into the deep learning model, the feature distribution and decision-making process are optimized, solving the problems of overlapping category features and blurred discrimination boundaries in fine-grained pneumonia classification, and achieving higher classification accuracy and stability.

CN122493091APending Publication Date: 2026-07-31BEIJING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING JIAOTONG UNIV
Filing Date
2026-03-18
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing deep learning methods struggle to accurately capture the fine-grained semantic features of pneumonia in fine-grained classification, leading to blurred category boundaries and severe overlap of feature spaces, which affects the stability and reliability of diagnosis.

Method used

A positively motivated noise learning module and a sample anchoring adaptation module are introduced. Learnable active noise is introduced into the visual and text feature spaces through image noise generators and text noise generators to optimize feature distribution. A category-aware memory matrix is ​​constructed through the sample anchoring adaptation module to achieve refined classification decisions.

Benefits of technology

This improved the model's robustness and discriminative performance in fine-grained pneumonia classification, reduced the risk of misclassification, and enhanced the accuracy and stability of assisted diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122493091A_ABST
    Figure CN122493091A_ABST
Patent Text Reader

Abstract

This invention provides a fine-grained pneumonia classification method and system based on sample anchoring and positively motivated noise learning, belonging to the field of deep learning-based image processing technology. It acquires scanned images of pneumonia patients after scanning; processes the acquired scanned images using a pre-trained fine-grained pneumonia classification model to obtain pneumonia classification results. This invention enhances disease-specific expression capabilities by constructing continuous semantic neighborhoods to actively reshape the feature distribution structure, without relying on a specific backbone model structure, and can be easily embedded into existing mainstream vision-language model frameworks. It achieves category-aware decision optimization based on prototype matching, a mechanism that can be effectively integrated with existing methods and has good compatibility. It avoids large-scale parameter updates to the backbone network, resulting in low training and inference computational overhead, and can improve classification performance while maintaining stable efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of deep learning-based image processing technology, specifically to a fine-grained pneumonia classification method and system based on sample anchoring and positive excitation noise learning. Background Technology

[0002] In current medical image-assisted diagnosis, deep learning methods have been widely applied to the automatic identification of lung diseases such as pneumonia. Especially with the continuous upgrading of imaging equipment and the expanding scale of data, single-modal models based on convolutional neural networks (CNNs) or visual transformers (ViTs) have achieved good results in routine pathological classification tasks. However, in fine-grained pneumonia classification scenarios, due to the extremely subtle differences between different categories, small inter-class differences, and large intra-class differences, traditional visual models struggle to accurately capture the fine-grained semantic features of the disease. This leads to blurred category boundaries and severe overlap of feature spaces, thus affecting the stability and reliability of the diagnosis.

[0003] In recent years, visual-language models have demonstrated strong generalization capabilities in cross-modal alignment by incorporating textual semantic information. However, existing CLIP-based methods primarily rely on deterministic cross-modal alignment mechanisms, which still struggle to effectively characterize subtle visual-semantic differences between diseases when faced with fine-grained pneumonia images. Furthermore, traditional adaptation methods typically fine-tune by adding extra modules or splicing additional tokens, but without altering the backbone network, their ability to express fine-grained features remains limited, hindering sophisticated decision-making.

[0004] Researchers have conducted extensive studies on the problem of fine-grained pneumonia image classification, which can be mainly divided into two categories: cross-modal alignment optimization methods and lightweight adaptation methods.

[0005] In cross-modal alignment optimization methods, within the vision-language model framework, the alignment quality between image and text features directly impacts classification performance. These methods focus on optimizing cross-modal alignment mechanisms by improving cue design, optimizing text encoding, or enhancing contrastive learning objectives to improve image-text semantic matching accuracy. For example, introducing learnable cue vectors allows for dynamic optimization of the text side, enabling the model to better adapt to specific medical tasks; or multi-template fusion or semantic enhancement strategies improve the expressive power of text features. The core idea of ​​these methods is to strengthen the consistency between image and text features, thereby improving classification performance.

[0006] In lightweight adaptation methods, researchers have proposed various approaches to improve model performance in downstream medical imaging tasks without requiring overall fine-tuning of the large-scale pre-trained backbone network. These methods add additional neural networks or task classifiers to the feature output of the visual-language model, achieving rapid adaptation to downstream tasks by remapping pre-trained features. For example, linear layers or nonlinear feedforward networks are concatenated after the image encoder output to transform and reconstruct high-dimensional features, thereby enhancing class separability; or an independent classification head is added after cross-modal fusion to improve classification performance by relearning the discrimination boundary. These methods have relatively small parameter sizes and controllable training overhead, achieving a certain degree of performance improvement while keeping the backbone model frozen.

[0007] Cross-modal alignment optimization methods primarily improve model performance by refining cue design or enhancing semantic consistency between text and images. However, their core still relies on deterministic alignment mechanisms, focusing on improving overall semantic matching capabilities. They fail to adequately address the feature aliasing problem caused by minimal inter-class differences and significant intra-class differences in fine-grained pneumonia classification. Lightweight adaptation methods often remap pre-trained features by adding structures such as feedforward neural networks, MLPs, or task classifiers, remaining largely at the structural level and struggling to proactively shape more discriminative disease-specific features from the feature generation mechanism. Summary of the Invention

[0008] The purpose of this invention is to provide a fine-grained pneumonia classification method and system based on sample anchoring and positive excitation noise learning, so as to solve at least one of the technical problems existing in the background art.

[0009] To achieve the above objectives, the present invention adopts the following technical solution:

[0010] In a first aspect, the present invention provides a fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning, comprising:

[0011] Acquire scan images of pneumonia patients after the scan is completed;

[0012] A pre-trained fine-grained pneumonia classification model is used to process acquired scanned images to obtain pneumonia classification results. The fine-grained pneumonia classification model includes a positively excited noise learning module and a sample anchoring adaptation module. The positively excited noise learning module introduces an image noise generator and a text noise generator to learn positive noise, introducing learnable active noise into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation. The sample anchoring adaptation module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions. It consists of a memory matrix composed of a small number of labeled samples, used to characterize the category discrimination structure, and participates in the final classification decision during forward propagation.

[0013] As a further limitation of the first aspect of the present invention, for the positively excited noise learning module, given a set of category labels, a template-based text prompt is first constructed and mapped to a token embedding representation through CLIP; to characterize the potential semantic uncertainty in medical text, a text noise generator is introduced to learn Gaussian distribution parameters in the token embedding space; and sampling is performed through reparameterization to obtain the noise-enhanced text embedding; the text embedding is input into the frozen CLIP text encoder to obtain the corresponding text feature representation.

[0014] As a further limitation of the first aspect of the present invention, for the input image, the frozen CLIP image encoder extracts its image feature representation; in order to generate semantically guided visual perturbations, an image noise generator is introduced and conditional modeling is performed in combination with cross-modal information; wherein, the image features are used as queries, and the corresponding category-level text features are simultaneously used as keys and values ​​input into the cross-attention mechanism.

[0015] As a further limitation of the first aspect of the present invention, by simultaneously injecting semantically constrained positive noise at both the text prompt level and the image feature level, and simulating real semantic changes and external perturbations under cross-modal semantic guidance, the diversity and robustness of feature representation are effectively enhanced, while avoiding the unstable effects caused by unconstrained random perturbations; given the noise-enhanced image features and text features, the two are then... Normalization is performed to ensure that the feature vectors are in a uniform scale space; then, classification prediction results are constructed according to CLIP's similarity calculation method.

[0016] As a further limitation of the first aspect of the present invention, in the sample anchoring adaptation, for each category, randomly selects... Zhang image samples were used, and features were extracted using a frozen CLIP image encoder. The resulting features were then processed... Normalization is performed to construct a category-aware memory library; all extracted features are aggregated to form a memory key matrix; simultaneously, each memory unit is assigned a corresponding category label and encoded using one-hot vectors to obtain a memory value matrix; through the above method, the memory module stores a set of visual prototype features anchored by categories and their corresponding explicit category identification information; for the input image features, the sample anchoring and adaptation module uses them as query vectors to match with the stored category prototypes to retrieve category information related to the current sample; to achieve prototype matching that surpasses fixed similarity measurement methods, a lightweight linear adapter is introduced to project the input features onto the memory-aware space and generate a prototype matching score, which measures the correlation between the input image features and each few-sample prototype; weighted aggregation of each prototype yields the category-level memory prediction result.

[0017] As a further limitation of the first aspect of the present invention, the final classification prediction result is obtained by weighted fusion of the prediction results of the positive excitation noise learning branch and the sample anchoring adaptation branch; after obtaining the fused prediction vector Then, given the true category label The cross-entropy loss function is used to optimize the entire framework.

[0018] Secondly, the present invention provides a fine-grained pneumonia classification system based on sample anchoring and positive excitation noise learning, comprising:

[0019] The acquisition module is used to acquire scan images of pneumonia patients after the scan is completed;

[0020] The processing module is used to process the acquired scanned images using a pre-trained fine-grained pneumonia classification model to obtain pneumonia classification results. The fine-grained pneumonia classification model includes a positively stimulated noise learning module and a sample anchoring adaptation module. The positively stimulated noise learning module introduces an image noise generator and a text noise generator to learn positive noise, introducing learnable active noise into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation. The sample anchoring adaptation module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions. It consists of a memory matrix composed of a small number of labeled samples, used to characterize the category discrimination structure, and participates in the final classification decision during forward propagation.

[0021] Thirdly, the present invention provides a non-transitory computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described in the first aspect.

[0022] Fourthly, the present invention provides a computer device including a memory and a processor, the processor and the memory communicating with each other, the memory storing program instructions executable by the processor, and the processor calling the program instructions to execute the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described in the first aspect.

[0023] Fifthly, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described in the first aspect.

[0024] The beneficial effects of this invention are as follows: This invention focuses on the problem of small differences between fine-grained disease categories, proposing a positively motivated noise learning mechanism. By constructing continuous semantic neighborhoods to actively reshape the feature distribution structure, it enhances disease-specific expression capabilities without relying on a specific backbone model structure, and can be easily embedded into existing mainstream visual-language model frameworks. The sample anchoring adaptation mechanism proposed in this invention constructs a category memory structure under limited sample supervision, achieving category-aware decision optimization based on prototype matching. This mechanism can be effectively integrated with existing methods and has good compatibility. This invention performs feature enhancement and decision optimization while freezing the main structures of the visual and text encoders, without large-scale parameter updates to the backbone network. This results in low training and inference computational overhead, improving classification performance while maintaining stable efficiency. This invention has strong theoretical interpretability, effectively alleviating the problem of ambiguous decision boundaries in fine-grained pneumonia classification, reducing the risk of misjudgment, and improving the accuracy of assisted diagnosis.

[0025] The advantages of additional aspects of the invention will be set forth more clearly in the following description or will be learned by practice of the invention. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a framework diagram of the fine-grained pneumonia classification model described in an embodiment of the present invention. Detailed Implementation

[0028] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0029] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0030] It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as here.

[0031] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or groups thereof.

[0032] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0033] To facilitate understanding of the present invention, the present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments. However, the specific embodiments do not constitute a limitation on the embodiments of the present invention.

[0034] Those skilled in the art should understand that the accompanying drawings are merely schematic diagrams of embodiments, and the components in the drawings are not necessarily essential for implementing the present invention.

[0035] To address the aforementioned problems, this invention proposes a fine-grained pneumonia classification method based on positive excitation noise learning and a sample anchoring mechanism, building upon a visual-language model. By introducing positive excitation noise during feature learning, the model gradually learns more discriminative disease-specific features, thereby enhancing the compactness of the feature distribution and inter-class separability. Simultaneously, a sample anchoring adaptation mechanism is introduced to constrain and correct category-related features under the guidance of a small number of labeled samples, achieving more refined category-aware decision-making. This method effectively alleviates the feature entanglement problem between fine-grained categories without fine-tuning the backbone network, improving the model's classification performance in complex pneumonia imaging scenarios. This invention aims to solve the problems of severe overlap of category features, blurred discriminative boundaries, and insufficient expression of disease specificity in fine-grained pneumonia classification by optimizing the feature distribution structure and category clustering morphology to improve intra-class compactness and inter-class separability in the feature space.

[0036] Example 1

[0037] In this embodiment 1, a fine-grained pneumonia classification system based on sample anchoring and positive stimulus noise learning is first provided. This system includes: an acquisition module for acquiring scanned images of pneumonia patients after scanning; and a processing module for processing the acquired scanned images using a pre-trained fine-grained pneumonia classification model to obtain pneumonia classification results. The fine-grained pneumonia classification model includes a positive stimulus noise learning module and a sample anchoring adaptation module. The positive stimulus noise learning module introduces an image noise generator and a text noise generator to learn positive noise, introducing learnable active noise into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation. The sample anchoring adaptation module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions. It consists of a memory matrix composed of a small number of labeled samples, used to characterize the category discrimination structure, and participates in the final classification decision during forward propagation.

[0038] In this embodiment, the above-described system is used to implement a fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning, including: acquiring scanned images of pneumonia patients after scanning using an acquisition module; and processing the acquired scanned images using a pre-trained fine-grained pneumonia classification model using a processing module to obtain pneumonia classification results.

[0039] like Figure 1 As shown in this embodiment, the fine-grained pneumonia classification model described above is obtained through a fine-grained pneumonia classification model training method based on positive excitation noise learning and sample anchoring mechanism. It can be used to identify and classify pneumonia images to obtain the pneumonia category in the image.

[0040] Specifically, the fine-grained pneumonia classification model includes a Positively Excited Noise Learning (PiNL) module and a Sample Anchoring Adaptation (EaA) module. The PiNL module incorporates an image noise generator and a text noise generator to learn positive noise. The EaA module enables efficient and stable prediction for downstream tasks.

[0041] In this embodiment, for the Positively Incentivized Noise Learning (PiNL) module, in order to adapt CLIP to the fine-grained pneumonia classification task, learnable active noise is introduced into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation.

[0042] Specifically, for the positively stimulated noise learning module, given a set of category labels, a template-based text prompt is first constructed and mapped to a token embedding representation using CLIP. To characterize the potential semantic uncertainty in medical texts, a text noise generator is introduced to learn Gaussian distribution parameters in the token embedding space. The text embedding is then sampled using a reparameterization method to obtain the noise-enhanced text embedding. Finally, the text embedding is input into the frozen CLIP text encoder to obtain the corresponding text feature representation.

[0043] Specifically, given a set of category labels First, build template-based text prompts (e.g., "a photo of a..."). "), and map it to a token embedding representation via CLIP. ,in Indicates the sequence length. This represents the embedding dimension. To characterize the potential semantic uncertainty in medical texts, a text noise generator (Prompt Noise Generator) is introduced, which... and Learning Gaussian distribution parameters in the token embedding space:

[0044] ;

[0045] in, and These represent the mean prediction network and the variance prediction network, respectively, used to embed features based on the input token. Calculate the mean parameter of the corresponding Gaussian distribution. and standard deviation parameter .

[0046] Then, sampling is performed using reparameterization to obtain the noise-enhanced text embedding:

[0047] ;

[0048] in, Let represent a random noise vector, where each element is a randomly sampled value, used to generate features with random perturbations. In this formula, and Element-wise multiplication is performed to introduce controllable random perturbations into the original features. This indicates that the mean is 0 and the covariance matrix is ​​the identity matrix. The Gaussian distribution.

[0049] Will The input is fed into the frozen CLIP text encoder to obtain the corresponding text feature representation. By employing the methods described above, a continuous semantic neighborhood is constructed around the original deterministic text prompt, thereby alleviating the expressive limitations caused by fixed text descriptions.

[0050] For the input image, the frozen CLIP image encoder extracts its image feature representation. To generate semantically guided visual perturbations, an image noise generator is introduced and conditionally modeled using cross-modal information. The image features serve as the query, while the corresponding category-level text features are simultaneously input as both key and value into the cross-attention mechanism. By simultaneously injecting semantically constrained positive noise at both the text prompt level and the image feature level, realistic semantic changes and external perturbations are simulated under cross-modal semantic guidance, effectively enhancing the diversity and robustness of feature representation while avoiding the unstable effects of unconstrained random perturbations. Given the noise-enhanced image features and text features, they are then processed... Normalization is performed to ensure that the feature vectors are in a uniform scale space; then, classification prediction results are constructed according to CLIP's similarity calculation method.

[0051] Specifically, for the input image The frozen CLIP image encoder extracts its image feature representation. To generate semantically guided visual perturbations, an image noise generator is introduced, and conditional modeling is performed using cross-modal information. Among these, image features... As a query, the corresponding category-level text features They are simultaneously input as both keys and values ​​into the cross-attention mechanism.

[0052] Image noise distribution parameters The prediction is as follows:

[0053] ;

[0054] The enhanced image features are obtained by sampling and summing:

[0055] ;

[0056] By simultaneously injecting semantically constrained positive noise at both the text prompt level and the image feature level, we can simulate real semantic changes and external perturbations under cross-modal semantic guidance, effectively enhancing the diversity and robustness of feature representation while avoiding the unstable effects of unconstrained random perturbations.

[0057] Given image features after noise enhancement Text features To conduct on both Normalization is performed to ensure that the feature vectors are in a uniform scale space. Then, the classification prediction results are constructed according to the CLIP similarity calculation method, the formula of which is as follows:

[0058] ;

[0059] In the formula, This represents the cosine similarity function, used to measure the degree of similarity between image features and text features; Temperature is a parameter used to adjust the smoothness of the similarity distribution and the class discrimination. This represents the feature vector of the image after noise enhancement. Indicates the first The text feature vectors with noise enhancement corresponding to each category.

[0060] In the sample anchoring adaptation process, for each category, random selection is performed. Zhang image samples were used, and features were extracted using a frozen CLIP image encoder. The resulting features were then processed... Normalization is performed to construct a category-aware memory library; all extracted features are aggregated to form a memory key matrix; simultaneously, each memory unit is assigned a corresponding category label and encoded using one-hot vectors to obtain a memory value matrix; through the above method, the memory module stores a set of visual prototype features anchored by categories and their corresponding explicit category identification information; for the input image features, the sample anchoring adaptation module uses them as query vectors to match with the stored category prototypes to retrieve category information related to the current sample; to achieve prototype matching beyond fixed similarity measurement methods, a lightweight linear adapter is introduced to project the input features onto the memory-aware space and generate a prototype matching score, which measures the correlation between the input image features and each few-sample prototype; weighted aggregation of each prototype yields the category-level memory prediction result. The final classification prediction result is obtained by weighted fusion of the prediction results of the positive excitation noise learning branch and the sample anchoring adaptation branch; after obtaining the fused prediction vector... Then, given the true category label The cross-entropy loss function is used to optimize the entire framework.

[0061] Specifically, in sample anchoring adaptation, to achieve accurate diagnosis of fine-grained pneumonia, a sample anchoring adaptation module is introduced in a few-sample supervised scenario. This module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions.

[0062] The sample anchoring and adaptation module consists of a memory matrix composed of a small number of labeled samples, which is used to characterize the category discrimination structure and participate in the final classification decision during the forward propagation process.

[0063] Let the few-sample training set be: ;

[0064] In the formula, The total number of samples, Indicates the number of categories. This represents the number of samples corresponding to each category. For each category... Random selection Zhang image samples were used, and features were extracted using a frozen CLIP image encoder. The resulting features were then processed... Normalization process, denoted as To construct a category-aware memory bank.

[0065] All extracted features are summarized to form a mnemonic key matrix:

[0066] ;

[0067] At the same time, each memory unit is assigned a corresponding category label and encoded using one-hot vector form to obtain the memory value matrix:

[0068] ;

[0069] In the formula, Indicate category The one-hot encoded vector.

[0070] In the manner described above, the memory module stores a set of visual prototype features anchored by categories and their corresponding explicit category identification information.

[0071] For the input image features The sample anchoring and adaptation module uses it as a query vector to match with the stored category prototypes in order to retrieve category information related to the current sample.

[0072] To achieve prototype matching that surpasses fixed similarity metrics, a lightweight linear adapter is introduced. Its parameters are Initialization is used to project the input features onto the memory-aware space and generate prototype matching scores: The matching score is used to measure the correlation between input image features and each few-sample prototype.

[0073] The prototypes are weighted and aggregated to obtain the category-level memory prediction results, which are calculated as follows:

[0074] ;

[0075] In the formula, the parameter Used to control the sharpness of the distribution and adjust the distinguishing strength between different prototype matching scores; This represents the memory value matrix.

[0076] By employing exponential reweighting and category aggregation mechanisms, prototype-level matching information is transformed into category-level prediction results, thereby enabling auxiliary discrimination based on sample anchoring structures and improving the stability and accuracy of fine-grained pneumonia classification.

[0077] The final classification prediction result is obtained by weighted fusion of the prediction results of the positive excitation noise learning branch and the sample anchoring adaptation branch, and the calculation formula is as follows:

[0078] In the formula, is a weighting coefficient used to adjust the contribution ratio of the memory-based adaptation branch in the final prediction.

[0079] Obtain the fused prediction vector Then, given the true category label The cross-entropy loss function is used to optimize the entire framework, and its expression is as follows:

[0080] In the formula, Represents the fused prediction vector The Middle The logit value corresponding to each category Represents the true category The corresponding logit value, This indicates the total number of categories.

[0081] The model described in this embodiment achieves synergistic optimization of two discriminative information types: positive excitation noise learning and sample anchoring adaptation, thereby improving the overall discriminative performance in fine-grained pneumonia classification tasks.

[0082] Example 2

[0083] This embodiment 2 provides a non-transitory computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, they implement the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described above. The method includes:

[0084] Acquire scan images of pneumonia patients after the scan is completed;

[0085] A pre-trained fine-grained pneumonia classification model is used to process acquired scanned images to obtain pneumonia classification results. The fine-grained pneumonia classification model includes a positively excited noise learning module and a sample anchoring adaptation module. The positively excited noise learning module introduces an image noise generator and a text noise generator to learn positive noise, introducing learnable active noise into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation. The sample anchoring adaptation module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions. It consists of a memory matrix composed of a small number of labeled samples, used to characterize the category discrimination structure, and participates in the final classification decision during forward propagation.

[0086] Example 3

[0087] This embodiment 3 provides a computer device, including a memory and a processor, wherein the processor and the memory communicate with each other, and the memory stores program instructions that can be executed by the processor. The processor calls the program instructions to execute the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described above, the method including:

[0088] Acquire scan images of pneumonia patients after the scan is completed;

[0089] A pre-trained fine-grained pneumonia classification model is used to process acquired scanned images to obtain pneumonia classification results. The fine-grained pneumonia classification model includes a positively excited noise learning module and a sample anchoring adaptation module. The positively excited noise learning module introduces an image noise generator and a text noise generator to learn positive noise, introducing learnable active noise into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation. The sample anchoring adaptation module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions. It consists of a memory matrix composed of a small number of labeled samples, used to characterize the category discrimination structure, and participates in the final classification decision during forward propagation.

[0090] Example 4

[0091] This embodiment 4 provides an electronic device, including: a processor, a memory, and a computer program; wherein, the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described above. The method includes:

[0092] Acquire scan images of pneumonia patients after the scan is completed;

[0093] A pre-trained fine-grained pneumonia classification model is used to process acquired scanned images to obtain pneumonia classification results. The fine-grained pneumonia classification model includes a positively excited noise learning module and a sample anchoring adaptation module. The positively excited noise learning module introduces an image noise generator and a text noise generator to learn positive noise, introducing learnable active noise into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation. The sample anchoring adaptation module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions. It consists of a memory matrix composed of a small number of labeled samples, used to characterize the category discrimination structure, and participates in the final classification decision during forward propagation.

[0094] In summary, the visual-language model adaptation method for fine-grained pneumonia classification described in this embodiment of the invention addresses the problems of small differences between fine-grained disease categories, highly overlapping feature spaces, and insufficient expressive power of traditional deterministic cross-modal alignment mechanisms. This method fully exploits the semantic drift and feature entanglement phenomena of pre-trained visual-language models in downstream medical scenarios and designs a collaborative modeling framework of positively motivated noise learning and sample anchoring adaptation mechanisms, thereby enhancing the model's ability to discriminate fine-grained disease features and its structural stability.

[0095] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0096] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0097] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0098] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0099] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solutions disclosed in the present invention, various modifications or variations that can be made by those skilled in the art without creative effort should be included within the scope of protection of the present invention.

Claims

1. A fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning, characterized by, include: Acquire scan images of pneumonia patients after the scan is completed; A pre-trained fine-grained pneumonia classification model is used to process acquired scanned images to obtain pneumonia classification results. The fine-grained pneumonia classification model includes a positively excited noise learning module and a sample anchoring adaptation module. The positively excited noise learning module introduces an image noise generator and a text noise generator to learn positive noise, introducing learnable active noise into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation. The sample anchoring adaptation module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions. It consists of a memory matrix composed of a small number of labeled samples, used to characterize the category discrimination structure, and participates in the final classification decision during forward propagation.

2. The method for fine-grained pneumonia classification based on sample anchoring and forward excitation noise learning according to claim 1, characterized in that, For the positively stimulated noise learning module, given a set of category labels, a template-based text prompt is first constructed and mapped to a token embedding representation using CLIP. To characterize the potential semantic uncertainty in medical text, a text noise generator is introduced to learn Gaussian distribution parameters in the token embedding space. The text embedding is then sampled using a reparameterization method to obtain the noise-enhanced text embedding. The text embedding is then input into the frozen CLIP text encoder to obtain the corresponding text feature representation.

3. The fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning according to claim 2, characterized in that, For the input image, the frozen CLIP image encoder extracts its image feature representation; in order to generate semantically guided visual perturbations, an image noise generator is introduced and conditional modeling is performed in conjunction with cross-modal information; wherein, the image features serve as the query, and the corresponding category-level text features are simultaneously input as keys and values ​​into the cross-attention mechanism.

4. The fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning according to claim 3, characterized in that, By simultaneously injecting semantically constrained positive noise at both the text prompt level and the image feature level, and simulating real semantic changes and external perturbations under cross-modal semantic guidance, the diversity and robustness of feature representation are effectively enhanced, while avoiding the unstable effects of unconstrained random perturbations. Given the noise-enhanced image features and text features, perform... Normalization is performed to ensure that the feature vectors are in a uniform scale space; then, classification prediction results are constructed according to the CLIP similarity calculation method.

5. The fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning according to claim 1, characterized in that, In sample anchoring adaptation, for each category, random selection is performed. Zhang image samples were used, and features were extracted using a frozen CLIP image encoder. The resulting features were then processed... Normalization is performed to construct a category-aware memory library; all extracted features are aggregated to form a memory key matrix; simultaneously, each memory unit is assigned a corresponding category label and encoded using one-hot vectors to obtain a memory value matrix; through the above method, the memory module stores a set of visual prototype features anchored by categories and their corresponding explicit category identification information; for the input image features, the sample anchoring and adaptation module uses them as query vectors to match with the stored category prototypes to retrieve category information related to the current sample; to achieve prototype matching that surpasses fixed similarity measurement methods, a lightweight linear adapter is introduced to project the input features onto the memory-aware space and generate a prototype matching score, which measures the correlation between the input image features and each few-sample prototype; weighted aggregation of each prototype yields the category-level memory prediction result.

6. The fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning according to claim 5, characterized in that, The final classification prediction result is obtained by weighted fusion of the prediction results from the positive excitation noise learning branch and the sample anchoring adaptation branch; the fused prediction vector is then obtained. Then, given the true category label The cross-entropy loss function is used to optimize the entire framework.

7. A fine-grained pneumonia classification system based on sample anchoring and positive excitation noise learning, characterized in that, include: The acquisition module is used to acquire scan images of pneumonia patients after the scan is completed; The processing module is used to process the acquired scanned images using a pre-trained fine-grained pneumonia classification model to obtain pneumonia classification results. The fine-grained pneumonia classification model includes a positively stimulated noise learning module and a sample anchoring adaptation module. The positively stimulated noise learning module introduces an image noise generator and a text noise generator to learn positive noise, introducing learnable active noise into the visual and text feature spaces to characterize potential semantic changes and guide feature distribution optimization, thereby improving the robustness and discriminative performance of the model representation. The sample anchoring adaptation module is used to refine the model's prediction results with category awareness, thereby improving the accuracy and stability of fine-grained classification decisions. It consists of a memory matrix composed of a small number of labeled samples, used to characterize the category discrimination structure, and participates in the final classification decision during forward propagation.

8. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described in any one of claims 1-6.

9. A computer device, characterized in that, The system includes a memory and a processor, which communicate with each other. The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described in any one of claims 1-6.

10. An electronic device, characterized in that, include: The electronic device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the fine-grained pneumonia classification method based on sample anchoring and positive excitation noise learning as described in any one of claims 1-6.