A pneumoconiosis chest radiograph intelligent identification method and system

By combining the ViT initial screening model and the medical visual language large model, and employing lung area perception attention bias and cross-layer feature fusion, the problems of early lesion identification and multi-task adaptability in chest X-ray diagnosis of pneumoconiosis are solved, improving the reliability and efficiency of diagnosis and adapting to large-scale batch screening scenarios.

CN123161827APending Publication Date: 2026-11-24WEST CHINA FOURTH HOSPITAL OF SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611206266.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies for diagnosing pneumoconiosis via chest X-rays suffer from several problems, including insufficient early lesion identification, poor adaptability of feature extraction and multi-task output, lack of interpretable diagnostic reasoning ability, lack of effective modeling of diagnostic uncertainty, difficulty in reconciling the contradiction between reasoning efficiency and diagnostic depth, and insufficient data privacy and continuous evolution capabilities.

Method used

A dual-track hierarchical architecture combining the ViT screening model with the Transformer encoder and the medical visual language model is adopted. Through the lung area perception attention bias mechanism and the task perception cross-layer feature fusion module, a three-level triage process is achieved. Combined with structured clinical data, diagnosis is performed, and an interpretable structured diagnostic report is output.

Benefits of technology

It improves the ability to identify early lesions, enhances the overall performance of multi-task classification, strengthens the credibility and efficiency of diagnostic results, ensures data privacy, and is suitable for large-scale batch screening scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123161827A_ABST
    Figure CN123161827A_ABST
Patent Text Reader

Abstract

This application discloses an intelligent method and system for chest X-ray identification of pneumoconiosis. The method employs a dual-track diagnostic architecture consisting of a ViT initial screening model and a large-scale medical visual language model. The ViT model incorporates a lung region perception attention bias mechanism and a task-perception cross-layer feature fusion module, simultaneously outputting dual-head classification results for disease determination and staging. Based on joint confidence, a three-level triage is performed, triggering secondary diagnosis by the large-scale model only for borderline suspected cases, outputting a structured report containing the diagnostic process and its basis. This invention balances screening efficiency and diagnostic accuracy, improves early lesion identification capabilities and model generalization, possesses good clinical interpretability, supports localized deployment to ensure medical data privacy and security, and is suitable for batch screening scenarios of occupational health for pneumoconiosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of imaging diagnostic technology for pneumoconiosis, and in particular to an intelligent method and system for recognizing chest X-rays of pneumoconiosis. Background Technology

[0002] Pneumoconiosis is a prevalent occupational respiratory disease in my country, and clinical diagnosis relies heavily on the interpretation of chest X-ray images. Currently, the diagnosis of pneumoconiosis via chest X-rays heavily depends on radiologists' manual interpretation, which suffers from significant problems such as low interpretation efficiency, large subjective differences, and insufficient medical resources at the grassroots level. With the development of deep learning technology, some auxiliary diagnostic systems use a single deep learning model (such as ResNet, DenseNet, or ViT) to classify chest X-rays, training them on a large amount of labeled data and outputting a probability prediction of whether it is pneumoconiosis and its severity. Some studies have also attempted to use general vision-language models (such as GPT-4V) to describe and diagnose medical images, or to use multi-model ensemble methods for simple voting or averaging fusion.

[0003] However, the aforementioned existing technical solutions all have the following objective defects: First, the ability to identify early lesions is insufficient. Early lesions of pneumoconiosis appear as tiny, sparse shadows on chest X-rays, highly similar to normal lung texture and background noise. Single deep learning models struggle to capture these subtle pathological features, easily leading to missed diagnoses or misdiagnoses. Existing ViT models do not adequately utilize prior knowledge of lung structure in chest X-rays. The self-attention mechanism treats all image patches equally globally, causing features from background areas such as bones and mediastinum to interfere with feature learning in lesion areas, further weakening the ability to perceive early, subtle lesions.

[0004] Second, the adaptability of feature extraction to multi-task output is poor. Clinical diagnosis of pneumoconiosis naturally involves two dimensions: "presence of disease" and "disease severity." These two dimensions differ in their emphasis on image features: presence / absence relies more on global semantic information, while staging relies more on local lesion details. Most existing methods only output a single classification result, failing to simultaneously address the diagnostic needs of both dimensions. While some methods use multiple output heads, they only use the features from the last layer of the Transformer for classification, ignoring the differentiated contributions of shallow texture features and deep semantic features to different diagnostic tasks. Furthermore, there is a lack of effective feature decoupling mechanisms between the output heads, resulting in poor overall performance in multi-task classification.

[0005] Third, there is a lack of interpretable diagnostic reasoning ability. Traditional deep learning models are essentially black-box classifiers, only outputting probability values ​​and failing to present the basis for diagnosis, the order of observation, and the logic of reasoning. Clinicians find it difficult to verify the rationality of diagnostic conclusions, resulting in low credibility and acceptance of auxiliary diagnostic results in clinical practice. Some studies have attempted to use general vision-language models to describe medical images, but these general models have not undergone sufficient fine-tuning and reinforcement learning in the medical field. The generated diagnostic process may not conform to clinical diagnostic standards, the logical chain may be chaotic, and it may even produce "illusionary" lesion features that do not exist in the original images, thereby increasing the risk of clinical misjudgment.

[0006] Fourth, there is a lack of effective modeling for diagnostic uncertainty. Existing methods generally lack mechanisms for quantitative assessment and grading of model output uncertainty. For difficult samples with ambiguous boundaries and atypical features, diagnostic results are still output with the same confidence level, failing to provide differentiated credibility hints in clinical practice. When the model predicts incorrectly, clinicians find it difficult to identify and avoid errors, severely limiting the practical clinical application value of auxiliary diagnostic systems.

[0007] Fifth, the contradiction between inference efficiency and diagnostic depth is difficult to reconcile. While large models possess inference capabilities, their inference time is long and computational consumption is high. If all screening samples are called one by one, it is difficult to meet the high-throughput and low-latency requirements of batch screening scenarios. Existing solutions lack an effective triage mechanism to balance efficiency and accuracy, resulting in the system facing the dual pressures of computational bottlenecks and clinical response speed during large-scale deployment.

[0008] Sixth, insufficient data privacy and continuous evolution capabilities. Screening for pneumoconiosis involves sensitive patient medical information. Existing solutions generally rely on cloud computing power for inference, requiring data to be uploaded to external servers, posing a risk of privacy leaks. Furthermore, most models become static after deployment, unable to continuously learn and evolve from clinical review, resulting in a waste of valuable clinical feedback resources. Summary of the Invention

[0009] To solve the above problems, the technical solution of this invention is as follows: In a first aspect, embodiments of the present invention provide a method for intelligent identification of chest X-rays of pneumoconiosis, comprising: acquiring chest X-ray images of a patient to be detected and corresponding structured clinical data; Chest X-ray images are input into the ViT initial screening model, and image features are extracted by the Transformer encoder. The classification head outputs binary and tri-class probability distributions. The binary probability distribution corresponds to the judgment result of whether the patient has pneumoconiosis, and the tri-class probability distribution corresponds to the stage judgment result of pneumoconiosis in stages one, two, and three. The joint confidence score is calculated based on the binary and tri-class probability distributions, and a three-level triage process is performed based on the joint confidence score: If the joint confidence score is higher than the first threshold, the diagnostic results of the ViT screening model are directly output. If the joint confidence level is lower than the second threshold, a manual review prompt will be output. If the joint confidence level is between the first and second thresholds, it is determined to be a suspected case, and the chest X-ray image and structured clinical data are input into the pre-trained medical visual language model for secondary diagnosis. The medical visual language big data model combines chest X-ray images with structured clinical data to perform reasoning and output a structured diagnostic report that includes the diagnostic process, diagnostic basis and final diagnostic conclusion. Among them, the Transformer encoder has a built-in lung region perception attention bias mechanism, which introduces inter-regional attention bias in self-attention calculation based on the prior of chest radiograph anatomical partitions, guiding the model to increase the attention weight of lung lesion regions. The ViT initial screening model is also equipped with a task-aware cross-layer feature fusion module, which extracts category label features from different depth layers of the Transformer encoder, adaptively generates fusion weights for each layer of features according to the current classification task, and inputs the weighted fusion into the classification head.

[0010] Among the possible implementations, the lung region perception attention bias mechanism can be implemented in the following ways: The input image is divided into six lung regions (upper left, upper right, middle left, middle right, lower left, and lower right) and one background region according to the standard chest X-ray anatomical structure. Each image block is assigned a corresponding region label. Construct a learnable region bias matrix of size 7×7, where each element in the matrix represents the intensity of attention preference between two regions; The full-image bias matrix generated by mapping the region bias matrix is ​​superimposed on the self-attention score calculation term, and the final attention weight is obtained after softmax normalization and value weighting calculation is completed. The region bias matrix is ​​shared across all layers of the Transformer encoder, and the overall strength of the bias is adjusted by a learnable bias strength coefficient.

[0011] In some possible implementations, the execution steps of the task-aware cross-layer feature fusion module are as follows: Extract the category label features from the outputs of layers 3, 6, 9, and 12 of the Transformer encoder, which correspond to shallow texture features, mid-layer structural features, and deep semantic features, respectively. Using the task vector corresponding to the current classification task as input, a lightweight fully connected sub-network generates fusion weights corresponding to the features of each layer. After softmax normalization, the fusion weights satisfy the constraint that the sum of the weights is 1. The category label features of each layer are weighted and summed according to the fusion weights to obtain the fusion features used for classification.

[0012] In some possible implementations, the ViT screening model is obtained by multi-task hybrid pre-training, and the pre-training task set includes one pneumoconiosis classification task and multiple common chest disease classification tasks. Each classification task corresponds to an independent fixed task vector, which is generated by random sampling from a standard normal distribution and then L2 normalized. During training, the task vector parameters are not updated. For input images belonging to the target task, the task vector corresponding to that task is superimposed on all tokens to avoid feature interference between different disease classification tasks, while sharing the underlying feature extractor.

[0013] In some possible implementations, the ViT initial screening model adopts a dual-head shared encoder architecture, where the binary and ternary classification heads share the same Transformer encoder features. The total loss function for model training is the sum of the binary cross-entropy loss and the tri-class cross-entropy loss, with the two classifiers being optimized simultaneously and jointly.

[0014] In some possible implementations, the joint confidence score is calculated based on the binary and ternary probability distributions, including taking the minimum of the maximum probability values ​​of the binary and ternary probability distributions as the joint confidence score.

[0015] In some possible implementations, the large medical visual language model is obtained through two-stage fine-tuning training, consisting of a supervised fine-tuning stage and a reinforcement learning optimization stage; the supervised fine-tuning stage includes: For each chest X-ray training sample labeled with structured clinical data, multiple diagnostic texts with different expression styles are generated using a general large language model. The diversity of the diagnostic texts is enhanced by changing sentence structure, replacing synonyms, adjusting the order of lung areas, and changing the reasoning style. Using chest X-ray images and structured clinical data as input, and corresponding style diagnostic text as training target, a large-scale medical visual language model is trained using the LoRA parameter efficient fine-tuning method.

[0016] In some possible implementations, the reinforcement learning optimization phase employs the GRPO group relative policy optimization algorithm, configuring a multi-dimensional combined reward function to guide the model in optimizing the diagnostic inference logic. The combined reward function includes: Classification accuracy reward: Corresponding reward points are set for the accuracy of the binary classification judgment and staging judgment in the final diagnosis conclusion; Reasoning Step Reasoning Reward: Positive rewards are given if the diagnostic process is described in accordance with the standard lung area observation order, and negative penalties are given if there are obvious errors in the description order; Sufficient Evidence Bonus: Bonus points will be awarded when the diagnostic text covers preset key fields such as years of dust exposure, type of work, and lesion morphology, with a maximum bonus set; Hallucination penalty: A penalty is imposed when generating lesion features that do not exist in the original labeled data.

[0017] In some possible implementations, both the ViT initial screening model and the medical visual language large model are deployed on a local end-side hardware platform. All chest X-ray data and clinical data are processed locally, supporting high-speed interconnection of multiple devices to form a cluster to adapt to batch screening scenarios.

[0018] Secondly, embodiments of the present invention provide an intelligent chest X-ray recognition system for pneumoconiosis, comprising: The data acquisition module is used to acquire chest X-ray images of the patient to be tested and the corresponding structured clinical data; The ViT initial screening module incorporates a Transformer encoder and a classification head to extract chest X-ray image features and output binary and tri-class probability distributions. The Transformer encoder includes a lung region-aware attention bias unit, which introduces inter-regional attention bias in self-attention calculation based on the prior knowledge of chest X-ray anatomical partitions, guiding the model to increase the attention weight of lung lesion regions. The ViT initial screening module is also equipped with a task-aware cross-layer feature fusion unit, which extracts class label features from different depth layers of the Transformer encoder, adaptively generates fusion weights for each layer's features according to the current classification task, and inputs the weighted fusion into the classification head. The traffic splitting decision module is used to calculate the joint confidence score based on the binary classification probability distribution and the tri-class classification probability distribution, and to perform three-level traffic splitting processing based on the joint confidence score. The large model reasoning module has a built-in fine-tuned medical visual language large model, which is used to perform multimodal reasoning on samples identified as suspected medical records and output a structured diagnostic report that includes the diagnostic process, diagnostic basis and final diagnostic conclusion. The results output module is used to output the corresponding diagnostic results, manual review prompts, or structured diagnostic reports.

[0019] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: In this embodiment of the invention, a dual-track hierarchical architecture of "ViT initial screening + large model secondary screening" is adopted, and a three-level triage process is performed based on joint confidence: high-deterministic samples are directly output by the lightweight ViT model, and only borderline suspected samples trigger the large model for in-depth diagnosis. This scheme not only ensures the rapid screening efficiency of all chest X-rays, but also enhances the diagnostic capability of difficult samples through the large model. It obtains complete interpretable diagnostic capabilities with a slight increase in overall inference time, avoiding the high computational cost and inference latency caused by calling the large model for all samples, and is suitable for large-scale batch screening scenarios.

[0020] A lung region-aware attention bias mechanism is built into the Transformer encoder. Based on the prior knowledge of chest X-ray anatomical partitions, the attention weights between different regions are adjusted to guide the model to focus on lung lesion areas and reduce feature interference from background areas. This design effectively enhances the model's ability to perceive lung lesions with minimal parameter increments, especially improving the recognition of early, minor lesions, thereby improving the overall accuracy of image classification. Simultaneously, a task-aware cross-layer feature fusion module is configured, which can adaptively integrate features from different depth layers of the Transformer according to the characteristics of the diagnostic task, taking into account both shallow texture details and deep semantic information. Compared with the traditional approach of using only the last layer of features, this better supports two different dimensions of diagnostic tasks simultaneously: "discrimination of pneumoconiosis presence" and "discrimination of pneumoconiosis staging," improving the comprehensive performance of multi-task classification.

[0021] Furthermore, the dual-head output structure using a shared encoder can simultaneously output binary disease classification and tri-category staging results, aligning with the conventional output habits of clinical diagnostic reports. The joint confidence score calculated based on the dual-head output can accurately identify boundary samples with high diagnostic uncertainty, ensuring the rationality of the triage mechanism. Simultaneously, the diagnostic results from the two dimensions can mutually verify each other, enhancing the inherent reliability of the output results. For suspected cases, a large-scale medical visual language model performs secondary diagnosis, outputting a structured diagnostic report that includes the diagnostic process, diagnostic basis, and final conclusion. This fully presents the diagnostic reasoning logic and core evidence, breaking the black-box nature of traditional deep learning models, facilitating clinicians to verify the rationality of the diagnosis, and significantly improving the clinical credibility and acceptability of the auxiliary diagnostic results. Attached Figure Description

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

[0023] Figure 1A schematic flowchart of an embodiment of a method for intelligent identification of chest X-rays of pneumoconiosis provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of lung area perception attention bias in an embodiment of the present invention; Figure 3 This is a structural diagram of the task-aware cross-layer feature fusion module in an embodiment of the present invention; Figure 4 This is a schematic diagram of the DGX Spark deployment architecture in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a pneumoconiosis chest X-ray intelligent recognition system according to an embodiment of the present invention. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0025] In the relevant descriptions of this embodiment, the terms "including," "containing," and "possessing" are all open terms and are generally understood to include but not be limited to; the term "at least one" is generally understood to mean one or more, where "multiple" refers to two or more; the term "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items, for example, "at least one of a, b, or c", or "at least one of a, b, and c", which can all mean: a, b, c, ab (i.e., a and b), ac, bc, or abc, where a, b, and c can be single or multiple; the symbol "A / B" is used to describe the selection relationship of associated objects, generally indicating an "or" relationship.

[0026] In the following description of the embodiments, the terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms "a" and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0027] Those skilled in the art should understand that, in the following description of the embodiments of this application, the sequence of numbers does not imply the order of execution. Some or all steps may be executed in parallel or sequentially. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0028] Those skilled in the art will understand that the numerical ranges in the embodiments of this application should be understood to specifically disclose each intermediate value between the upper and lower limits of the range. Any stated value or intermediate value within a stated range, as well as any other stated value or each smaller range between intermediate values ​​within a range, are also included within this invention. The upper and lower limits of these smaller ranges may be independently included or excluded from the range.

[0029] Unless otherwise stated, the technical / scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. While this application describes only preferred methods and materials, any methods and materials similar or equivalent to those described herein may be used in the implementation or testing of this application. All references to this specification are incorporated by way of citation to disclose and describe the methods and / or materials associated with those references. In the event of any conflict with any incorporated reference, the content of this specification shall prevail.

[0030] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0031] Figure 1 This is a schematic flowchart of an embodiment of an intelligent chest X-ray identification method for pneumoconiosis provided by the present invention. (See attached diagram.) Figure 1 As shown, the above method may include: S101, acquire chest X-ray images of the patient to be tested and the corresponding structured clinical data; Specifically, the patient's chest X-ray image is a plain chest X-ray that conforms to the diagnostic imaging standards for pneumoconiosis. It can be retrieved through the hospital's image archiving and communication system, physical examination image database, etc. After acquisition, the original chest X-ray is preprocessed with basic format unification, grayscale calibration and size normalization to output image data that meets the model's input dimension requirements, ensuring the consistency and stability of subsequent feature extraction.

[0032] Structured clinical data is a collection of patient clinical information that corresponds one-to-one with the chest X-ray, specifically covering the patient's basic information, including gender, type of pneumoconiosis, dust, occupation, history of dust exposure, morphology and density grade of lesions in each lung region, years of dust exposure, age, and lung function.

[0033] In real-world occupational health examinations, structured clinical data often suffers from missing or non-standardized records for fields such as years of dust exposure, occupation type, and lung function indicators. Directly discarding missing samples leads to data waste, while simple zero-filling introduces bias. To address this, this invention designs a missing value-aware encoder that simultaneously inputs a numerical value and a missing value mask for each clinical field. It then utilizes learnable missing value embeddings to model the uncertainty of missing values, which in turn affects the final joint confidence score.

[0034] Specifically, for the first Clinical fields Define missing mask ( (Indicates missing). Its encoding vector is: ; in For field encoders, This is a learnable global missing representation. All Aggregated into clinical embedding vectors The data is then concatenated with image features and input into the subsequent network. Simultaneously, the confidence decay factor for data quality perception is calculated. ; in For tolerance threshold, This represents the total number of clinical fields. The final joint confidence score is calculated by subtracting... ( The maximum penalty item is corrected. When the proportion of missing fields is too high, even if the model outputs a high probability, it is forcibly diverted to manual review to ensure the integrity of the diagnostic basis from the source.

[0035] S102, input the chest X-ray image into the ViT screening model, extract the image features through the Transformer encoder, and output the binary and tri-class probability distributions through the classification head; the binary probability distribution corresponds to the judgment result of whether or not the patient has pneumoconiosis, and the tri-class probability distribution corresponds to the stage judgment result of pneumoconiosis stage I, II, and III; Among them, the Transformer encoder has a built-in lung region perception attention bias mechanism, which introduces inter-regional attention bias in self-attention calculation based on the prior of chest radiograph anatomical partitions, guiding the model to increase the attention weight of lung lesion regions. The ViT initial screening model is also equipped with a task-aware cross-layer feature fusion module, which extracts category label features from different depth layers of the Transformer encoder, adaptively generates fusion weights for each layer of features according to the current classification task, and inputs the weighted fusion into the classification head.

[0036] It should be noted that the ViT screening model completes multi-task pre-training and task adaptation training based on a pre-built chest X-ray dataset. The specific composition of the dataset is as follows: Data on pneumoconiosis: Includes multiple chest X-ray films, for example, 1900 chest films, evenly distributed into four categories: no pneumoconiosis, stage I pneumoconiosis, stage II pneumoconiosis, and stage III pneumoconiosis, with approximately 475 films in each category. Among them, "no pneumoconiosis" corresponds to "none" in the classification and "none" in the second category; the other three stages correspond to "present" in the second category.

[0037] Additional pre-training data: 4,000 other chest X-ray images covering 10 common diseases (such as pneumonia, tuberculosis, lung cancer, pneumothorax, atelectasis, pleural effusion, sarcoidosis, pulmonary fibrosis, pulmonary edema, aortic sclerosis, etc.), with approximately 400 images for each category.

[0038] All images are accompanied by corresponding structured annotations, including disease categories, lung lesion morphology and density, etc., to provide supervision signals for model training.

[0039] After completing the dataset construction, multi-task hybrid pre-training was performed on the ViT initial screening model, and corresponding task-specific vectors were configured for each classification task.

[0040] In this embodiment of the invention, the ViT small model serves as the initial screening model, responsible for rapidly screening all chest X-rays. Its task is to quickly classify most of the clearly negative and clearly positive medical records and screen out "suspected medical records" (i.e., boundary samples) for further processing by the large model.

[0041] Specifically, image embedding preprocessing is first performed: In this embodiment of the invention, VisionTransformerSmall (ViT-S) is used as the basic architecture. After adjusting the input chest X-ray image to a preset size, it is evenly divided into multiple image blocks of fixed size; for example, the input image , Representing the image space, divided into indivual The image patches. Each image patch is linearly projected to obtain a corresponding patchbedding vector. , For the first i Each patch embedding, dimension The value is 384. A learnable class token is concatenated at the beginning of the embedded sequence, and a learnable positional encoding is superimposed. To preserve the spatial location information of image patches, an initial input sequence is constructed. Simultaneously, the task vector corresponding to the pneumoconiosis diagnosis task is superimposed onto the embedding vectors of all labeled vectors, adapting the model to the feature extraction logic of the current task, thus forming the final input sequence of the Transformer encoder. The initial input sequence can be represented as: ; Subsequently, the initial input sequence is fed into a stacked multi-layer Transformer encoder for layer-by-layer feature extraction.

[0042] In some embodiments, the ViT screening model is obtained by multi-task hybrid pre-training, and the pre-training task set includes one pneumoconiosis classification task and multiple common chest disease classification tasks. Each classification task corresponds to an independent fixed task vector, which is generated by random sampling from a standard normal distribution and then L2 normalized. During training, the task vector parameters are not updated. For input images belonging to the target task, the task vector corresponding to that task is superimposed on all tokens to avoid feature interference between different disease classification tasks, while sharing the underlying feature extractor.

[0043] For example, this invention trains a classification system for pneumoconiosis (one task) in combination with classification systems for 10 other chest X-ray diseases (a total of 10 tasks), resulting in a total of 11 classification tasks. For each task... Generate a fixed task vector Generation method: from standard normal distribution Random sampling is performed, followed by L2 normalization, as shown below: ; in, A random sample from a standard normal distribution dimensional vector, for The identity matrix.

[0044] The vector for each task is fixed once generated and does not participate in training. For tasks... The input image, with the task vector superimposed on all its tokens (including the class token), is represented as: ; in, For the first in the input sequence The initial embedding vector of each token It is a universal quantifier, indicating that it applies to all. All possible values ​​are valid.

[0045] The above mechanism enables the model to distinguish the task to which the current sample belongs, avoid feature interference between different disease classification tasks, and share the underlying feature extractor.

[0046] In some embodiments, Figure 2 This is a schematic diagram of lung region perception attention bias in an embodiment of the present invention, where six lung regions and the bias matrix are labeled. See [link / reference]. Figure 2 As shown, the mechanisms by which lung region perception attention bias is implemented include: The input image is divided into six lung regions (upper left, upper right, middle left, middle right, lower left, and lower right) and one background region according to the standard chest X-ray anatomical structure. Each image block is assigned a corresponding region label. Construct a learnable region bias matrix of size 7×7, where each element in the matrix represents the intensity of attention preference between two regions; The full-image bias matrix generated by mapping the region bias matrix is ​​superimposed on the self-attention score calculation term, and the final attention weight is obtained after softmax normalization and value weighting calculation is completed. The region bias matrix is ​​shared across all layers of the Transformer encoder, and the overall strength of the bias is adjusted by a learnable bias strength coefficient.

[0047] For example, the self-attention calculation in traditional ViT is as follows: ; in, For query vector, The query vector key , The vector being queried.

[0048] This invention introduces a priori lung anatomy. First, based on the standard anatomical structure of a chest radiograph, the image is divided into six lung regions (upper left, upper right, middle left, middle right, lower left, and lower right) plus one background region. Each patch is assigned a region label based on its coordinates. , For the first i Each patch belongs to a specific lung region label. A learnable region attention bias matrix is ​​defined. , Indicates the region For the region Attention preferences. The modified attention calculation is as follows: ; in The bias matrix has the following elements. , This is an adjustable bias strength coefficient (e.g., initially set to 0.5, learnable). This bias matrix is ​​shared across each Transformer layer, introducing only 49 additional parameters. Through training, the model automatically learns that patches within the same lung region should be given higher attention weights, while attention across lung regions should be appropriately reduced.

[0049] In chest X-rays, high-density anatomical structures such as ribs, clavicles, and mediastinum create strong edge features. The self-attention mechanism of ViT is easily attracted by the high contrast of these non-lesion areas, interfering with the feature learning of lung parenchyma. To address this, this invention introduces a structural inhibition branch, using a lightweight U-Net to generate rib / skeletal masks. An adversarial gradient reversal layer (GRL) forces the features extracted by the ViT backbone to be independent of the skeletal mask features.

[0050] Let the output of the skeleton mask prediction branch be ,in This is the feature map of the intermediate layer of the Transformer. The skeletal classification loss is... During backpropagation, gradient reversal is applied to this branch: ; in This is the inversion coefficient. Simultaneously, an orthogonal feature loss is added to explicitly penalize the model's dependence on skeletal features: ; in This module performs element-wise multiplication. It forces the backbone network to focus its limited model capacity on small shadows (such as r-type and q-type small shadows) within the lung fields, significantly improving the detection sensitivity of early small nodules.

[0051] To enable lung region perception attention bias matrix This invention not only adjusts attention weights but also explicitly increases the distance between the lung region and the background in the feature space. Furthermore, it introduces a region contrast constraint loss. Let the... The image patch belongs to the lung area. Its corresponding characteristics are Define the region prototype. For the region The mean of features across all image patches within the region. Region contrast loss. The aim is to bring image patch features within the same lung region closer to their prototypes, while increasing the prototype distance between different lung regions or backgrounds. ; in The total number of image patches, For cosine similarity, The temperature coefficient is used. At this point, the total loss function of the ViT initial screening model is updated as follows: ; in To balance the coefficients, this design forces the model to not only "focus" on the lung region at the attention level, but also to form discriminative clusters of the lung region at the feature representation level, thereby enhancing the uniqueness of lesion representation.

[0052] In some embodiments, Figure 3 This is a structural diagram of the task-aware cross-layer feature fusion module in an embodiment of the present invention. See [link / reference]. Figure 3 As shown, the execution steps of the task-aware cross-layer feature fusion module are as follows: Extract the category label features from the outputs of layers 3, 6, 9, and 12 of the Transformer encoder, which correspond to shallow texture features, mid-layer structural features, and deep semantic features, respectively. Using the task vector corresponding to the current classification task as input, a lightweight fully connected sub-network is used to generate fusion weights corresponding to the features of each layer. The fusion weights are normalized by softmax and satisfy the constraint that the sum of the weights is 1. The category label features of each layer are weighted and summed according to the fusion weights to obtain the fusion features used for classification.

[0053] Because there is a strong logical connection between the binary classification (presence or absence of pneumoconiosis) and the triadic classification (stage I / II / III) (i.e., the presence of pneumoconiosis is a major prerequisite for staging), the fusion features are directly shared. This can lead to gradient conflicts between different classification heads. To address this, this invention adds a task interaction masking mechanism after cross-layer fusion, generating a dynamic feature mask based on the task vector to selectively filter feature channels that interfere with the current task.

[0054] For the current task ( Generate mask vector : ; in For the Sigmoid function, , For learnable parameters, the output range is The fused features are then subjected to task-adaptive modulation. ; in This is an element-wise product. The final binary classification head uses... Three-part sorting head used This ensures that different classification heads can extract the most relevant dimensions from shared features, effectively mitigating feature interference between multiple tasks.

[0055] Specifically, ViT includes Layer Transformer encoder. In the first layer... layer( Extract the feature vector of classtoken For each task Learn a set of fusion weights ,satisfy: ; The weights are generated through a small subnetwork, with the task vector as input. : ; in, Net output, With a weight of 2, With a weight of 1, It is a partial value; , The final fusion feature is represented as: .

[0056] in, For the first Layer classtoken features, For the task For the Layer fusion weights.

[0057] In some embodiments, the ViT primary screening model adopts a dual-head shared encoder architecture, where the binary classification head and the tertiary classification head share the same Transformer encoder features. The total loss function for model training is the sum of the binary cross-entropy loss and the tri-class cross-entropy loss, with the two classifiers being optimized simultaneously and jointly.

[0058] For example, fusion features Two sorting heads are sent separately: Head 1 (Disease Differentiation Head): Binary Classification Output (Pollution Conservation Disease / No Pollution Conservation Disease) ; Head 2 (Severity Discriminant Head): Three-classification output (Phase 1, Phase 2, Phase 3) ; The total loss function is: .

[0059] in, Output probability for binary classification. For the three-class classification output probabilities, the summation index in the loss function and Iterate through the category indices for binary and ternary classification respectively (e.g., binary classification). Three categories ).

[0060] and The true label for the corresponding category (one-hot encoded). and This represents the probability value predicted by the model.

[0061] This is the weight matrix of the binary classification head (disease discriminant head), with dimension [missing information]. This is used to map fused features to a binary classification output (with / without pneumoconiosis).

[0062] The fused feature vector output by the task-aware cross-layer feature fusion module has a dimension of ( (For feature dimensions).

[0063] Let be the bias vector of the binary classification head, with dimension . .

[0064] This is the weight matrix of the three-class classification head (degree discriminant head), with dimension 1. It is used to map fused features to three-class outputs (phase one / phase two / phase three).

[0065] The bias vector for the three-class classification head has dimension . .

[0066] For the other 10 disease tasks, the corresponding loss (usually binary cross-entropy) is used according to the task definition, and the pneumoconiosis task optimizes both heads simultaneously.

[0067] S103, Calculate the joint confidence score based on the binary and tri-class probability distributions, and perform a three-level triage process based on the joint confidence score: If the joint confidence score is higher than the first threshold, the diagnostic results of the ViT screening model are directly output. If the joint confidence level is lower than the second threshold, a manual review prompt will be output. If the joint confidence level is between the first and second thresholds, it is determined to be a suspected case, and the chest X-ray image and structured clinical data are input into the pre-trained medical visual language model for secondary diagnosis. In some embodiments, calculating the joint confidence score includes taking the minimum of the maximum probability value of the binary probability distribution and the maximum probability value of the ternary probability distribution as the joint confidence score.

[0068] The above formula for calculating joint confidence ignores the logical consistency between the two-headed outputs. For example, the probability of "yes" in binary classification is extremely high, but the probability of "yes" in each period of triclass classification is very low, indicating significant internal divergence within the model. In this case, directly using the minimum probability value may still overestimate the confidence. Therefore, this invention adds a divergence penalty term to the joint confidence.

[0069] Three-class probability The summation is mapped to binary classification probabilities. (Combined into the probability of "existence") ; Calculate the difference in probability distributions between the two head outputs (KL divergence): ; Corrected joint confidence for: ; in This is an adjustment coefficient. When both heads are at the same height, When the confidence level approaches 0, the confidence level remains unchanged; when there is a contradiction, the confidence level decreases, and the samples are more likely to be diverted to larger models or manually reviewed, significantly improving the robustness of the diversion logic.

[0070] For example, for each chest X-ray, the joint confidence score is defined as the minimum of the two head confidence scores, expressed as: .

[0071] Understandably, the first threshold is a high-confidence triage threshold, with the core principle being to ensure the diagnostic accuracy of the direct output results. A grid search can be used to traverse candidate thresholds on the model's independent validation set, statistically analyzing the classification accuracy of directly triaged samples at different thresholds. While meeting the clinical diagnostic accuracy criteria, the threshold that maximizes the proportion of directly triaged samples can be selected as the first threshold. This maximizes initial screening efficiency while ensuring diagnostic reliability, and reasonably controls the frequency of large model calls and computational load.

[0072] Fixing a fixed global threshold (e.g., a first threshold of 0.85 and a second threshold of 0.5) can lead to suboptimal triage efficiency due to the drift in confidence distribution among different population groups (e.g., different dust-exposed occupations, different imaging equipment). This invention introduces a batch statistical calibration mechanism to dynamically fine-tune the triage threshold based on the overall confidence distribution of the current batch of screened samples.

[0073] Suppose that the current batch contains The samples have a joint confidence level of _ samples. Calculate the mean confidence level for this batch. with standard deviation The first threshold after dynamic adjustment Second threshold for: ; ; in , As the baseline threshold, and For reference statistics on the validation set, To adjust the step size, when the overall confidence level of the batch of samples is too high, the high confidence threshold is appropriately increased to more aggressively divert the data to the ViT output; conversely, convergence is achieved, thus dynamically optimizing the inference efficiency.

[0074] The second threshold serves as a low-confidence fallback threshold, set with the core principle of mitigating the risk of low-reliability diagnoses. Statistical validation examines the classification performance of samples across different confidence levels in the validation set. When a sample's confidence level falls below this threshold, the model's classification accuracy significantly decreases, making it difficult to guarantee the reliability of the diagnostic conclusion even with secondary inference from a large model. Therefore, this threshold is set as the second threshold; samples below this threshold are directly transferred to manual review, using manual diagnosis as a fallback to ensure the safety of clinical diagnosis.

[0075] For example, the traffic splitting rule can be: like : Directly output ViT results (no pneumoconiosis or a certain stage of pneumoconiosis), without triggering large models.

[0076] like The result was determined to be "requires manual review" and the large model was not triggered.

[0077] like Defined as a suspected medical record, triggering a secondary screening by the large model.

[0078] S104, a large-scale medical visual language model, combines chest X-ray images with structured clinical data to perform reasoning and output a structured diagnostic report that includes the diagnostic process, diagnostic basis, and final diagnostic conclusion.

[0079] When large models generate text freely, they may produce inconsistent output formats, contradictory staged conclusions and descriptions, or, while there may be no "illusion," there may be issues of "omitted key conclusions." To address this, this invention introduces context-free grammar (CFG) constraint decoding during the large model's reasoning stage. This forces the model to complete a pre-defined "observation-evidence-conclusion" syntax tree when outputting diagnostic conclusions, ensuring that the final conclusion always includes atomic judgments of "present / absent" and "stage one / stage two / stage three / absent."

[0080] Define output syntax rules for: At each step of LLM token generation, based on the current parsing stack state... Dynamically mask out all candidate tokens that do not conform to the syntax rules, thus restoring the original probability distribution. Revised to: ; in, For indicator functions, This is the set of the next allowed words in the current grammatical state. This mechanism ensures that the output strictly conforms to the clinical structured report paradigm, eliminating formatting errors and logical omissions.

[0081] In this embodiment of the invention, the medical visual language large model can simultaneously process chest X-ray images and text input. It is obtained through a two-stage fine-tuning training process, which includes a supervised fine-tuning stage and a reinforcement learning optimization stage; wherein, the supervised fine-tuning stage includes: For each chest X-ray training sample labeled with structured clinical data, multiple diagnostic texts with different expression styles are generated using a general large language model. The diversity of the diagnostic texts is enhanced by changing sentence structure, replacing synonyms, adjusting the order of lung areas, and changing the reasoning style. Using chest X-ray images and structured clinical data as input, and corresponding style diagnostic text as training target, a large-scale medical visual language model is trained using the LoRA parameter efficient fine-tuning method.

[0082] Specifically, an existing large-scale NLP model (such as GPT-4) is used to automatically generate multiple text descriptions for each piece of structured clinical data. A different expression is required each time. Change the sentence structure: Describe the lesion first and then give the conclusion vs. Give the conclusion first and then describe the evidence; Replace synonyms: "dust exposure years" vs. "dust exposure duration"; Adjust the lung region order: upper left → upper right vs. upper right → upper left; Change your reasoning style: deductive vs. inductive.

[0083] Each structured sample generates The SFT training set consists of texts with diverse styles. ,in For chest X-ray, For structured data, For the first A text description.

[0084] Training objective: The language modeling loss is represented as: .

[0085] LoRA is used for efficient parameter fine-tuning.

[0086] In some embodiments, the reinforcement learning optimization phase employs the GRPO (Group Relative Policy Optimization) algorithm, configuring a multi-dimensional combined reward function to guide the model's optimization of diagnostic inference logic. The combined reward function includes: Classification accuracy reward: Corresponding reward points are set for the accuracy of the binary classification judgment and staging judgment in the final diagnosis conclusion; Reasoning Step Reasoning Reward: Positive rewards are given if the diagnostic process is described in accordance with the standard lung area observation order, and negative penalties are given if there are obvious errors in the description order; Sufficient Evidence Bonus: Bonus points will be awarded when the diagnostic text covers preset key fields such as years of dust exposure, type of work, and lesion morphology, with a maximum bonus set; Hallucination penalty: A penalty is imposed when generating lesion features that do not exist in the original labeled data.

[0087] In addition to the four types of rewards mentioned above, this invention also adds a clinical pathway alignment reward. The diagnosis of pneumoconiosis has a clear GBZ70-2015 standard, which requires first considering the overall density, then the distribution range, and finally a comprehensive determination of the stage. This reward item forces the model's reasoning logic chain to strictly follow this standard path.

[0088] Let the standard clinical pathway node sequence be (e.g., determining the shape of small shadows → determining density → determining distribution range → comprehensive staging). Model-generated diagnostic process text. Transformed into semantic action sequences Define path alignment rewards. Normalized length of the longest common subsequence (LCS): ; The final GRPO reward function is expanded as follows: ; in As the weighting coefficient, this operation ensures that the reasoning process of the large model not only "speaks like a doctor" but also strictly "thinks according to national standard procedures".

[0089] For example, using the GRPO algorithm, for each state (chest X-ray + structured data + ViT intermediate features), the model generates a complete diagnostic inference text. Define the reward function: ; in, Rewards will be given for correct classification. Rewards are given for the reasonableness of the reasoning steps. As a reward for sufficiency of evidence, Punishment for hallucinations.

[0090] The reward for correct classification is represented as follows: ; in: The model predicts a three-category (stage) result, meaning the output is one of the categories: "Stage 1", "Stage 2", or "Stage 3".

[0091] For the true pneumoconiosis staging label (groundtruth stage), and They belong to the same three-category space.

[0092] The model predicts a binary classification result (presence or absence of pneumoconiosis), i.e., "presence" or "absence".

[0093] The ground truth binary label indicates whether the sample actually has pneumoconiosis.

[0094] Reasoning Steps Reasonableness Reward: Check if the lung regions are divided according to the standard order (upper left → upper right → middle left → middle right → lower left → lower right). Description: ; Sufficient Evidence Bonus: Check whether the generated text covers key fields (dust exposure years, job type, lesion morphology, etc.), and for each matched field. upper limit ; Hallucination penalty: Generating lesion morphologies that do not exist (e.g., generating small p-shaped shadows that do not exist in the original data). every time In this embodiment of the invention, the optimization objective of GRPO (maximizing expected reward) is achieved through intra-group relative comparisons, without relying on an independent critic model, and the training is stable.

[0095] In some embodiments, the output of the large model is in the format of structured text, which includes the following parts: Diagnostic process: Describe the observation sequence and reasoning logic step by step; Diagnostic criteria: List key evidence; Final conclusion: Binary determination + three-category staging.

[0096] For example, the diagnostic process is as follows: First, observe the upper right lung area, and observe 2 / 3 of the density. r The first step is to observe the small shadow; the second step is to observe the left upper lung area, where 2 / 1 density is observed. r The third step involves comparing the left and right middle lung regions; the right middle lung region shows a density of 1 / 2. qThe fourth step involves considering the patient's 13 years of exposure to dust, coal mining work experience, and abnormal lung function.

[0097] Diagnostic criteria: Small opacities in both upper lung areas with a density exceeding 2 / 1 and a distribution range exceeding two intercostal spaces, meeting the stage II criteria in GBZ70-2015.

[0098] Final conclusion: Stage II pneumoconiosis.

[0099] In some embodiments of the present invention, the ViT initial screening model and the medical visual language large model are both deployed on a local end-side hardware platform. All chest X-ray data and clinical data are processed locally, supporting high-speed interconnection of multiple devices to form a cluster to adapt to batch screening scenarios.

[0100] To fully utilize the correction results from clinicians on "manually reviewed" samples, this invention designs a lightweight online incremental learning mechanism. For samples diverted to manual review, the "correction report" modified or confirmed by the doctor is regarded as a high-quality pseudo-label and is periodically (e.g., weekly) fed back to the local ViT model for parameter fine-tuning. Only the task-aware fusion module and the classification head are updated (the backbone encoder is frozen), ensuring that the model continuously drifts and adapts in specific physical examination populations.

[0101] Establish a review sample buffer The loss function for incremental updates is the sum of the original task loss and the regularization term, and Elastic Weight Consolidation (EWC) is used to prevent catastrophic forgetting. ; in The diagonal terms of the Fisher information matrix measure the importance of older parameters. To update the model parameters, These are the current model parameters. In actual execution, only the classification header parameters are processed. The system is updated and the backbone network is frozen. This mechanism transforms the professional judgment of clinicians into fuel for model evolution, enabling low-cost human-machine collaborative continuous learning.

[0102] Considering the deployment of multiple interconnected devices forming a cluster, and the increasingly stringent data privacy regulations (such as the "right to be forgotten"), this invention also features a localized federated forgetting mechanism. When it is necessary to remove the influence of a specific patient's data on the model, it is not necessary to retrain the entire dataset. Instead, several rounds of gradient ascent are performed on the local device to eliminate the contribution of that sample, and the Fisher information matrix is ​​used to limit the impact of the forgetting process on the performance of the retained set.

[0103] The forgetting process is specific to a particular sample set. In local model parameters Perform gradient ascent: ; Simultaneously, EWC constraints are incorporated to prevent the forgetting process from corrupting the model in the retention set. This mechanism improves system performance. It provides compliant deletion capabilities without requiring global retraining, significantly reducing operational costs.

[0104] For example, the deployment platform: NVIDIA DGXSpark; such as Figure 4 As shown, Figure 4 This is a schematic diagram of the DGXSpark deployment architecture in an embodiment of the present invention.

[0105] The hardware uses NVIDIA DGXSpark (formerly "Project DIGITS"), with the following configuration: GB10 Grace Blackwell super chip, 20-core Arm CPU + Blackwell GPU (6144 CUDA cores). 128GB LPDDR5x unified memory, 1 PFLOPS FP4 performance; The overall dimensions are 150mm × 150mm × 51mm, and it weighs approximately 1.25kg. Deployment architecture: The ViT mini-model runs locally in DGXSpark to achieve initial screening; The large model also performs inference locally, only processing suspected medical records; All data remains within the hospital, meeting privacy compliance requirements; Supports cluster expansion of 2 to 4 units (200Gb / s interconnection) to meet batch screening needs.

[0106] In this embodiment of the invention, at the ViT architecture level, the present invention incorporates a lung region perception attention bias mechanism within the Transformer encoder. Based on the prior knowledge of chest X-ray anatomical partitioning, an inter-regional attention bias is introduced in the self-attention calculation, guiding the model to focus attention weights on lung lesion areas, reducing feature interference from non-lesion areas such as the bone background, and significantly improving the sensitivity of early small lesion identification. Simultaneously, a task-aware cross-layer feature fusion module is configured. According to the different requirements of two types of tasks, namely presence / absence discrimination and staging discrimination, the module adaptively integrates the shallow texture features and deep semantic features of Transformer, and introduces a task interaction mask to dynamically filter the feature channels of different classification heads, effectively alleviating multi-task gradient conflicts and achieving optimal comprehensive performance of dual-head classification.

[0107] At the system architecture level, this invention adopts a dual-track hierarchical architecture of ViT initial screening and a large-scale medical visual language model for secondary diagnosis. Based on binary and trigonometric classification, it calculates joint confidence and introduces a divergence penalty term to accurately identify boundary samples with high diagnostic uncertainty. A three-level triage is then implemented: high-certainty samples are directly output by the lightweight ViT model; borderline suspected samples trigger in-depth diagnosis by the large-scale model; and extremely low-confidence samples prompt manual review. This architecture balances the rapid screening efficiency of all chest X-rays with the accurate diagnostic capability of difficult samples, and further optimizes inference efficiency through a dynamic adaptive triage threshold mechanism, effectively controlling overall computational overhead and inference latency.

[0108] At the large-scale model inference level, this invention employs a two-stage training process involving supervised fine-tuning and GRPO reinforcement learning, and introduces clinical pathway alignment rewards into the reward function. This ensures that the large-scale model's diagnostic inference strictly adheres to the logical chain of the National Diagnostic Standard for Pneumoconiosis (GBZ70-2015). During the inference process, structured constraint decoding forces the output of a standardized report containing the diagnostic process, diagnostic basis, and final conclusion, breaking the black-box nature of traditional deep learning models and providing complete clinical interpretability. Furthermore, the large-scale model inference is performed only on borderline suspected samples, avoiding the risk of hallucination accumulation that can easily occur with general-purpose large-scale models across the entire sample set.

[0109] In terms of deployment and continuous evolution, this invention deploys both the ViT initial screening model and the large-scale medical visual language model on a local edge hardware platform. All chest X-ray and clinical data are calculated locally, ensuring the privacy and security of medical data. At the same time, it designs an incremental feedback loop based on review samples, using correction reports confirmed by clinicians as high-quality pseudo-labels to periodically feed back to the local ViT model for lightweight incremental fine-tuning, enabling the model to continuously drift and adapt in specific physical examination populations. It also has a localized federated forgetting mechanism, which supports the compliant deletion of the impact of specific patient data on the model without global retraining, significantly reducing operation and maintenance costs.

[0110] In summary, this invention is significantly different from existing technical solutions in terms of lesion perception capability, multi-task output adaptability, interpretable reasoning, uncertainty quantification, reasoning efficiency, data privacy, and continuous evolution. It effectively solves the long-standing technical bottlenecks in the field of imaging-assisted diagnosis of pneumoconiosis and is suitable for batch screening of occupational health conditions for pneumoconiosis.

[0111] Based on the same inventive concept, this application also provides an intelligent chest X-ray recognition system for pneumoconiosis. Figure 5 This is a schematic diagram of a chest X-ray intelligent recognition system for pneumoconiosis according to an embodiment of the present invention. See also: Figure 5 As shown, the intelligent chest X-ray recognition system 500 for pneumoconiosis may include: The data acquisition module 501 is used to acquire the chest X-ray images of the patient to be tested and the corresponding structured clinical data; The ViT screening module 502 incorporates a Transformer encoder and a classification head to extract chest X-ray image features and output binary and tri-class probability distributions. The Transformer encoder includes a lung region-aware attention bias unit, which introduces inter-regional attention bias in self-attention calculation based on the prior knowledge of chest X-ray anatomical partitions, guiding the model to increase the attention weight of lung lesion regions. The ViT screening module is also equipped with a task-aware cross-layer feature fusion unit, which extracts class label features from different depth layers of the Transformer encoder, adaptively generates fusion weights for each layer's features according to the current classification task, and inputs the weighted fusion into the classification head. The traffic splitting decision module 503 is used to calculate the joint confidence level based on the binary classification probability distribution and the tri-class classification probability distribution, and to perform three-level traffic splitting processing based on the joint confidence level. The large model reasoning module 504 has a built-in fine-tuned medical visual language large model, which is used to perform multimodal reasoning on samples identified as suspected medical records and output a structured diagnostic report containing the diagnostic process, diagnostic basis and final diagnostic conclusion. The result output module 505 is used to output the corresponding diagnostic results, manual review prompts, or structured diagnostic reports.

[0112] The various embodiments in this specification are described in a progressive manner. For the same or similar parts between the various embodiments, please refer to each other. Each embodiment focuses on describing the differences from other embodiments.

[0113] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of this application.

Claims

1. A method for intelligent identification of chest X-rays for pneumoconiosis, characterized in that, include: Obtain chest X-ray images and corresponding structured clinical data of the patient to be tested; The chest X-ray image is input into the ViT screening model, and the image features are extracted by the Transformer encoder. The binary probability distribution and the tri-class probability distribution are output by the classification head. The binary probability distribution corresponds to the judgment result of whether the patient has pneumoconiosis, and the tri-class probability distribution corresponds to the stage judgment result of pneumoconiosis stage I, II and III. The joint confidence score is calculated based on the binary and tri-class probability distributions, and a three-level triage process is performed based on the joint confidence score: If the joint confidence score is higher than the first threshold, the diagnostic results of the ViT screening model are directly output. If the joint confidence level is lower than the second threshold, a manual review prompt will be output. If the joint confidence level is between the first threshold and the second threshold, it is determined to be a suspected case, and the chest X-ray image and structured clinical data are input into a pre-trained medical visual language model for secondary diagnosis. The medical visual language big model combines chest X-ray images with structured clinical data to perform reasoning and output a structured diagnostic report that includes the diagnostic process, diagnostic basis, and final diagnostic conclusion. The Transformer encoder incorporates a lung region perception attention bias mechanism, which introduces inter-regional attention bias in self-attention calculation based on the prior knowledge of chest radiograph anatomical partitions, guiding the model to increase the attention weight of lung lesion regions. The ViT initial screening model is also equipped with a task-aware cross-layer feature fusion module, which extracts category label features from different depth layers of the Transformer encoder, adaptively generates fusion weights for each layer of features according to the current classification task, and inputs the weighted fusion into the classification head.

2. The method according to claim 1, characterized in that, The implementation methods of the lung region perception attention bias mechanism include: The input image is divided into six lung regions (upper left, upper right, middle left, middle right, lower left, and lower right) and one background region according to the standard chest X-ray anatomical structure. Each image block is assigned a corresponding region label. Construct a learnable region bias matrix of size 7×7, where each element in the matrix represents the intensity of attention preference between two regions; The full-image bias matrix generated by mapping the region bias matrix is ​​superimposed on the self-attention score calculation term, and the final attention weight is obtained after softmax normalization and value weighting calculation is completed. The region bias matrix is ​​shared across all layers of the Transformer encoder, and the overall strength of the bias is adjusted by a learnable bias strength coefficient.

3. The method according to claim 1, characterized in that, The execution steps of the task-aware cross-layer feature fusion module are as follows: Extract the category label features from the outputs of layers 3, 6, 9, and 12 of the Transformer encoder, which correspond to shallow texture features, mid-layer structural features, and deep semantic features, respectively. Using the task vector corresponding to the current classification task as input, a lightweight fully connected sub-network is used to generate fusion weights corresponding to the features of each layer. The fusion weights are normalized by softmax and satisfy the constraint that the sum of the weights is 1. The category label features of each layer are weighted and summed according to the fusion weights to obtain the fusion features used for classification.

4. The method according to claim 3, characterized in that, The ViT screening model was obtained by multi-task hybrid pre-training. The pre-training task set included one pneumoconiosis classification task and several common chest disease classification tasks. Each classification task corresponds to an independent fixed task vector, which is generated by random sampling from a standard normal distribution and then L2 normalized. During training, the task vector parameters are not updated. For input images belonging to the target task, the task vector corresponding to that task is superimposed on all tokens to avoid feature interference between different disease classification tasks, while sharing the underlying feature extractor.

5. The method according to claim 1, characterized in that, The ViT initial screening model adopts a dual-head shared encoder architecture, with the two-classification head and the three-classification head sharing the same Transformer encoder features. The total loss function for model training is the sum of the binary cross-entropy loss and the tri-class cross-entropy loss, with the two classifiers being optimized simultaneously and jointly.

6. The method according to claim 1, characterized in that, The calculation of the joint confidence score based on the binary and ternary probability distributions includes: taking the minimum of the maximum probability values ​​of the binary and ternary probability distributions as the joint confidence score.

7. The method according to claim 1, characterized in that, The medical visual language large model was obtained through two-stage fine-tuning training, which includes a supervised fine-tuning stage and a reinforcement learning optimization stage; wherein, the supervised fine-tuning stage includes: For each chest X-ray training sample labeled with structured clinical data, multiple diagnostic texts with different expression styles are generated using a general large language model. The diversity of these diagnostic texts is enhanced by changing sentence structure, replacing synonyms, adjusting the order of lung regions, and changing reasoning style. Using chest X-ray images and structured clinical data as input, and corresponding style diagnostic text as training target, a large-scale medical visual language model is trained using the LoRA parameter efficient fine-tuning method.

8. The method according to claim 7, characterized in that, The reinforcement learning optimization phase employs the GRPO group relative policy optimization algorithm, configuring a multi-dimensional combined reward function to guide the model in optimizing diagnostic inference logic. The combined reward function includes: Classification accuracy reward: Corresponding reward points are set for the accuracy of the binary classification judgment and staging judgment in the final diagnosis conclusion; Reasoning Step Reasoning Reward: Positive rewards are given if the diagnostic process is described in accordance with the standard lung area observation order, and negative penalties are given if there are obvious errors in the description order; Sufficient Evidence Bonus: Bonus points will be awarded when the diagnostic text covers preset key fields such as years of dust exposure, type of work, and lesion morphology, with a maximum bonus set; Hallucination penalty: A penalty is imposed when generating lesion features that do not exist in the original labeled data.

9. The method according to claim 1, characterized in that, Both the ViT initial screening model and the medical visual language big data model are deployed on a local end-side hardware platform. All chest X-ray data and clinical data are processed locally, and multiple devices can be interconnected at high speed to form a cluster to adapt to batch screening scenarios.

10. A smart chest X-ray recognition system for pneumoconiosis, characterized in that, include: The data acquisition module is used to acquire chest X-ray images of the patient to be tested and the corresponding structured clinical data; The ViT initial screening module incorporates a Transformer encoder and a classification head to extract chest X-ray image features and output binary and tri-class probability distributions. The Transformer encoder includes a lung region-aware attention bias unit, which introduces inter-regional attention bias in self-attention calculation based on chest X-ray anatomical partitioning priors, guiding the model to increase the attention weight of lung lesion regions. The ViT initial screening module also features a task-aware cross-layer feature fusion unit, which extracts category label features from different depth layers of the Transformer encoder, adaptively generates fusion weights for each layer based on the current classification task, and inputs the weighted fusion into the classification head. The traffic splitting decision module is used to calculate the joint confidence score based on the binary classification probability distribution and the tri-class classification probability distribution, and to perform three-level traffic splitting processing based on the joint confidence score. The large model reasoning module has a built-in fine-tuned medical visual language large model, which is used to perform multimodal reasoning on samples identified as suspected medical records and output a structured diagnostic report that includes the diagnostic process, diagnostic basis and final diagnostic conclusion. The results output module is used to output the corresponding diagnostic results, manual review prompts, or structured diagnostic reports.