Automatic osteoporosis diagnosis method and system based on position-specific attention
By employing a location-specific attention mechanism and dual-channel image enhancement, combined with anatomical prior knowledge, this method addresses the uneven diagnostic accuracy of existing osteoporosis diagnostic methods across different lumbar spine segments. It achieves highly sensitive and interpretable automated osteoporosis diagnosis, applicable to multi-center CT equipment.
Patent Information
- Application Number
- CN202510921420.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-11-18
AI Technical Summary
Existing methods for diagnosing osteoporosis ignore the differences in anatomical structure and pathology among different segments of the lumbar spine, resulting in uneven diagnostic accuracy. In particular, they are prone to missed diagnoses in the L3 and L4 vertebrae. Furthermore, they lack effective utilization of prior knowledge of vertebral anatomical location, and the models have poor interpretability, which limits their application in clinical practice.
An automatic osteoporosis diagnosis method based on location-specific attention is adopted. By combining dual-channel image enhancement preprocessing with the DenseNet121 network, anatomical location index information is preserved. A dedicated attention submodule is dynamically selected for feature weighting and fused with the location encoding vector to construct a comprehensive diagnostic feature that includes anatomical prior knowledge.
It significantly improves the consistency of diagnostic accuracy among different vertebral bodies, reduces the risk of missed diagnoses, enhances the sensitivity of early lesions, and strengthens the interpretability and clinical credibility of the model. It is suitable for multi-center CT equipment and has good robustness.
Smart Images

Figure CN120976616A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image processing and artificial intelligence assisted diagnosis, in particular to an automatic osteoporosis diagnosis method and system based on position-specific attention. BACKGROUND
[0002] Osteoporosis is a systemic bone disease characterized by bone mass loss and microstructure damage, leading to increased bone fragility and increased risk of fracture. With the acceleration of population aging, osteoporosis has become a major public health problem that seriously threatens the health of the middle-aged and elderly. According to statistics, the osteoporosis prevalence rate of people over 60 years old in China is as high as 36%, and more than 1 million cases of hip fractures caused by osteoporosis occur every year, with a high rate of disability and mortality. Early and accurate diagnosis of osteoporosis is of great clinical significance for timely intervention and prevention of fractures.
[0003] In recent years, deep learning technology has made breakthrough progress in medical image analysis, providing a new technical approach for automatic diagnosis of osteoporosis. Existing research mainly uses convolutional neural networks (CNN) to automatically extract features from CT images and make classification diagnosis. For example, some studies use classic network architectures such as ResNet and DenseNet, combined with transfer learning strategies, to achieve automatic classification of osteoporosis on spine CT images. Some studies introduce attention mechanisms to enhance the model's ability to focus on key areas, such as using channel attention modules (Channel Attention Module) or spatial attention modules (Spatial Attention Module) to improve diagnostic performance. Some studies attempt to combine multi-modal information, integrating CT image features with clinical information for comprehensive diagnosis.
[0004] However, existing deep learning-based osteoporosis diagnosis methods still have obvious technical defects. First, these methods generally use general network architectures and attention mechanisms, treating all vertebral bodies as homogeneous diagnostic objects, ignoring the essential differences in anatomical structure and function between different segments of the lumbar spine. From an anatomical perspective, L1 vertebrae are close to thoracic vertebrae, with a relatively small shape, high mobility but less load bearing; L4 vertebrae are close to sacral vertebrae, with a larger shape and bearing the largest axial load. These structural and functional differences result in significant differences in the pathological manifestations of osteoporosis in different vertebral bodies: osteoporosis in upper vertebrae (L1, L2) mainly manifests as sparse and broken central trabeculae, while osteoporosis in lower vertebrae (L3, L4) mainly manifests as thinning of the cortical bone and micro-fracture of the endplate. Using a unified feature extraction and attention pattern cannot adapt to this heterogeneity, resulting in large fluctuations in the diagnostic accuracy of the model on different vertebral bodies, especially in L3 and L4, which bear more load and are more clinically important, leading to missed diagnoses.
[0005] Existing image preprocessing methods are relatively single, either focusing only on gray scale enhancement of bone density or emphasizing only edge detection of bone structure, failing to fully exploit the multi-dimensional diagnostic information in CT images. The pathological changes of osteoporosis not only manifest in the reduction of bone mass (manifested as a decrease in CT value), but more importantly, the destruction of bone microstructure (manifested as thinning, breaking and reduced connectivity of bone trabeculae). A single image enhancement strategy is difficult to capture both types of key features, resulting in the subtle changes of early osteoporosis being ignored, affecting the sensitivity of diagnosis.
[0006] Existing methods lack effective modeling and utilization of prior knowledge of the anatomical position of the vertebral body. Although doctors will fully consider the anatomical characteristics and diagnostic value differences of different vertebral bodies when making clinical diagnoses, existing deep learning models only regard the position of the vertebral body as a simple class label, failing to effectively integrate this important medical prior knowledge into the feature learning and diagnostic decision-making process. This not only limits the diagnostic performance of the model, but also reduces the interpretability of the model.
[0007] Most existing methods use "black box" end-to-end learning, and doctors have difficulty understanding the diagnostic basis of the model, which seriously hinders the popularization and application of deep learning technology in clinical practice. Although some studies attempt to use visualization techniques such as class activation maps (CAM), due to the use of general network structures, the generated attention maps are often not accurate enough to accurately reflect the key diagnostic areas of different vertebral bodies. SUMMARY
[0008] To overcome the shortcomings of the prior art, the present application proposes an automatic osteoporosis diagnosis method and system based on position-specific attention. Existing deep learning-based osteoporosis diagnosis methods generally use general feature extraction and attention mechanisms, ignoring the significant differences in anatomical structure, biomechanical properties and pathological manifestations of different segments L1 to L4 of the lumbar spine, resulting in uneven diagnostic accuracy of the model on different vertebral bodies, especially in the heavily loaded L3 and L4 vertebral bodies, where misdiagnosis is likely to occur. At the same time, traditional image enhancement methods focus only on bone density or bone structure features, failing to consider both bone density information and bone trabecular microstructure information, resulting in insufficient extraction of key diagnostic features. In addition, existing methods lack effective utilization of prior knowledge of the anatomical position of the vertebral body, and the model has poor interpretability, limiting its popularization and application in clinical practice.
[0009] To achieve the above purpose, the present application proposes an automatic osteoporosis diagnosis method based on position-specific attention, comprising the following steps:
[0010] Step S1: Perform dual-channel enhancement preprocessing on the lumbar spine CT image, and generate an enhanced image that takes into account both bone density and bone trabecular structure features by weighted fusion of the contrast enhancement channel and the structure enhancement channel;
[0011] Step S2: input the enhanced image into a deep convolutional neural network for multi-scale feature extraction, and retain the anatomical position index information of each vertebral body during the extraction process to obtain a feature map containing spatial semantic information;
[0012] Step S3: based on the anatomical position index information, dynamically select a dedicated attention sub-module corresponding to the current vertebral body position, and perform position-specific weighting on the feature map to generate an attention weighted feature highlighting the key diagnostic area of the vertebral body;
[0013] Step S4: after global pooling of the attention weighted feature, perform feature level fusion with the position encoding vector of the vertebral body to construct a comprehensive diagnostic feature containing anatomical prior knowledge;
[0014] Step S5: input the comprehensive diagnostic feature into a classifier to output the osteoporosis probability distribution of the vertebral body, and realize precise diagnosis at the vertebral body level.
[0015] Further, the dual-channel enhancement preprocessing in step S1 specifically includes:
[0016] S1.1: use the CLAHE algorithm to perform contrast enhancement on the original CT image, set the limited contrast parameter to 2.0-4.0, and set the grid size to 8x8 to obtain a first enhanced image;
[0017] S1.2: use the Frangi filter to enhance the trabecular structure of the original CT image, detect the tubular structure through multi-scale Hessian matrix analysis, set the scale range to 1-3, and set the scale step to 0.5 to obtain a second enhanced image;
[0018] S1.3: pixel-level weighted fusion is performed on the first enhanced image and the second enhanced image according to a weight ratio of 0.6-0.8:0.2-0.4, and normalization processing is performed.
[0019] Further, the deep convolutional neural network in step S2 uses DenseNet121 as the backbone network, specifically including:
[0020] Remove the classification layer of the original DenseNet121, and retain all convolutional layers, batch normalization layers and dense connection structures from the input layer to the last dense block;
[0021] Load the ImageNet pre-training weights as initialization parameters, and perform transfer learning fine-tuning on the medical image dataset;
[0022] The output feature map has a dimension of [batch size ,1024,H,W], where H and W are spatial dimensions.
[0023] Further, the position-specific attention mechanism in the step S3 is specifically implemented as:
[0024] S3.1: A module pool containing 4 independent attention sub-modules is pre-constructed, corresponding to L1, L2, L3, and L4 respectively;
[0025] S3.2: Each attention sub-module contains two 1x1 convolution layers, the first convolution layer reduces the channel number from 1024 to 256 and uses ReLU activation, and the second convolution layer reduces the channel number from 256 to 1 and uses Sigmoid activation, outputting an attention weight map with a value range of [0, 1];
[0026] S3.3: According to the position index of the current input vertebra, select the corresponding attention sub-module from the module pool, and perform pixel-wise multiplication operation between the output attention weight map and the original feature map.
[0027] Further, each attention sub-module is updated by independent backpropagation, so that different position attention modules can learn the anatomical structure pattern and pathological feature distribution specific to the vertebra.
[0028] Further, the position encoding and feature fusion in the step S4 specifically includes:
[0029] S4.1: Map the discrete vertebra position index {0, 1, 2, 3} to a 64-dimensional continuous position encoding vector through a learnable embedding layer;
[0030] S4.2: Perform global average pooling on the attention-weighted features to obtain a 1024-dimensional global visual feature vector;
[0031] S4.3: Concatenate the position encoding vector and the global visual feature vector in the feature dimension to obtain a 1088-dimensional combined feature;
[0032] S4.4: Pass the combined feature through a fusion network containing linear transformation, ReLU activation, batch normalization, and Dropout to output a 512-dimensional comprehensive diagnostic feature.
[0033] Further, the position encoding vector automatically learns the optimal representation of each vertebra position through gradient descent during training, encoding the structural differences and diagnostic weights of different vertebrae in osteoporosis diagnosis.
[0034] Further, the classifier in step S5 adopts a two-layer fully connected network, the first layer maps 512-dimensional features to 128-dimensional features using ReLU activation and 0.5 Dropout, and the second layer outputs a 2-dimensional vector using Softmax activation, representing the probabilities of normal and osteoporosis respectively.
[0035] Further, a patient-level comprehensive diagnosis step is further included:
[0036] Steps S1-S5 are performed on the L1-L4 four vertebral bodies of the same patient respectively to obtain four vertebral body-level diagnosis results.
[0037] A weighted voting strategy is adopted, wherein the weights of L2 and L3 are set to 0.3, and the weights of L1 and L4 are set to 0.2, and when the weighted average probability is greater than 0.5, osteoporosis is determined.
[0038] An osteoporosis automatic diagnosis system based on position-specific attention, suitable for the osteoporosis automatic diagnosis method based on position-specific attention, comprising:
[0039] An image preprocessing module for performing step S1 in claim 1;
[0040] A feature extraction module for performing step S2 in claim 1;
[0041] A position-specific attention module for performing step S3 in claim 1;
[0042] A position encoding and feature fusion module for performing step S4 in claim 1;
[0043] A classification and diagnosis module for performing step S5 in claim 1;
[0044] Wherein, each module is trained end-to-end through a deep learning framework to optimize the accuracy of osteoporosis diagnosis.
[0045] Compared with the prior art, the beneficial effects of the present application are:
[0046] 1. The present application provides an osteoporosis automatic diagnosis method and system based on position-specific attention, which significantly improves the balance of diagnosis accuracy among different vertebral bodies, and the standard deviation of the diagnosis accuracy of the four vertebral bodies L1 to L4 is greatly reduced from 5.3% of the traditional method to 2.1%, which means that the model can maintain stable and reliable diagnosis performance on each vertebral body, effectively solving the problem of large difference in diagnosis accuracy of different vertebral bodies in existing methods. Especially in L3 and L4 vertebral bodies which have the most diagnostic value in clinical practice, the diagnosis accuracy is 92.3% and 91.8% respectively, significantly reducing the risk of missed diagnosis of these key parts.
[0047] 2.The application provides an automatic osteoporosis diagnosis method and system based on position-specific attention, which has high sensitivity to early lesions and is of great significance to the clinic. It can help doctors identify high-risk patients earlier and intervene in time, thereby preventing the occurrence of osteoporotic fractures. At the same time, the dual-channel image enhancement technology significantly improves the visibility of trabecular bone and cortical bone structure, making the subtle structural changes that are difficult to identify in conventional CT images clear and visible, providing a better image basis for accurate diagnosis.
[0048] 3.The application provides an automatic osteoporosis diagnosis method and system based on position-specific attention. The system can be seamlessly integrated into existing PACS systems without additional hardware investment or special imaging equipment. The method shows good robustness to CT devices of different manufacturers and different scan parameters. In multi-center verification, the images of mainstream CT devices such as GE, Siemens, and Philips maintain stable diagnostic performance, with AUC values above 0.89. BRIEF DESCRIPTION OF DRAWINGS
[0049] In order to more clearly illustrate the specific embodiments of the application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the description of the specific embodiments or the prior art. Obviously, the drawings described below are some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0050] Figure 1 is a schematic diagram of the system architecture of the application
[0051] Figure 2 is a system transmission layer protocol conversion and secure transmission architecture
[0052] Figure 3 is a schematic diagram of the image preprocessing flow
[0053] Figure 4 is a schematic diagram of the feature extraction module flow
[0054] Figure 5 is a schematic diagram of the position-specific attention module
[0055] Figure 6 is a schematic diagram of the position encoding and feature fusion module
[0056] Figure 7 is a schematic diagram of the classification and diagnosis module
[0057] Figure 8 is a schematic diagram of the classification result
[0058] Figure 9 is a schematic diagram of the technical efficiency improvement
[0059] Figure 10 For the visualization effect of the image after CLAHE DETAILED DESCRIPTION
[0060] The technical solutions of the present application will be described more clearly and completely in combination with the drawings and through the description of the preferred embodiments of the present application.
[0061] As Figure 1 shown, the present application is:
[0062] Step S1: dual-channel enhancement preprocessing is performed on the lumbar CT image, an enhanced image considering bone density and bone trabecular structure features is generated through weighted fusion of a contrast enhancement channel and a structure enhancement channel;
[0063] Step S2: the enhanced image is input into a deep convolutional neural network for multi-scale feature extraction, anatomical position index information of each vertebral body is retained in the extraction process, and a feature map containing spatial semantic information is obtained;
[0064] Step S3: based on the anatomical position index information, a dedicated attention sub-module corresponding to the current vertebral body position is dynamically selected, the feature map is subjected to position-specific weighting, and an attention weighted feature highlighting the key diagnostic area of the vertebral body is generated;
[0065] Step S4: after global pooling of the attention weighted feature, feature-level fusion is performed with the position encoding vector of the vertebral body, and a comprehensive diagnostic feature containing anatomical prior knowledge is constructed;
[0066] Step S5: the comprehensive diagnostic feature is input into a classifier, and the osteoporosis probability distribution of the vertebral body is output, realizing precise diagnosis at the vertebral body level.
[0067] The overall architecture of the osteoporosis automatic diagnosis system of the present application is shown in Figure 2 , mainly including an image preprocessing module, a feature extraction module, a position-specific attention module, a position encoding and feature fusion module, and a classification diagnosis module.
[0068] The image preprocessing module process is shown in Figure 3 , first, a preprocessing function preprocessvertebra image is defined, which receives an original vertebral body image and a vertebral body position index as input.
[0069] A CLAHE object is created, and the limit contrast parameter clipLimit is set to 3.0 and the grid size tileGridSize is set to (8, 8).
[0070] Apply CLAHE object to the original image to get the CLAHE enhanced image clahe_enhanced.
[0071] Call Frangi filter function to process the original image, with the parameters set as: scale_range=(1, 3) representing the scale range, scale step = 0.5 representing the scale step, beta1=0.5 and beta2=15 as control parameters, black ridges =False representing detecting bright color structures.
[0072] Standardize the Frangi filter result to the range of 0-255 to get the frangi enhanced image.
[0073] Use the weighted fusion function to fuse the CLAHE enhanced image and the Frangi filter enhanced image in the ratio of 0.7:0.3 to get the fused image image.
[0074] Normalize the fused image, with the calculation method as: (fused_image-mean) / std, where mean and std are the mean and standard deviation of the image respectively.
[0075] Return the normalized image.
[0076] The feature extraction module is as shown in Figure 4 Fig. 5, and the FeatureExtractor class is defined, which inherits from the neural network module base class. The module is based on DenseNet121, and uses the front part as the feature extraction backbone network, which has good multi-scale feature extraction capability and is suitable for the recognition needs of microstructures in medical images.
[0077] Load the ImageNet pre-trained weights to improve the initial feature extraction effect, and perform transfer learning fine-tuning on the medical image dataset.
[0078] Remove the last classification layer (classifier) of DenseNet121, and only keep the convolutional layer, batch normalization, ReLU activation and dense connection structure for output spatial feature map.
[0079] To adapt to the size of medical images, the input image size is set to 128x128, and the step and padding parameters of the maximum pooling layer in the network are dynamically adjusted according to the input size.
[0080] The modules of conv1, norm1, relu, pool1, denseblock1~4, and transition are reserved, and the last layer feature map is output, with a shape of [batch size , 1024, 4, 4].
[0081] Forward propagation method: receive input image x (size [batch size , 1, 128, 128]). sequentially input into DenseNet backbone network to extract deep semantic features, output feature map features, dimension [batch size , 1024, H, W], where H and W are spatial dimensions (usually 4 or 7, depending on actual adjustment).
[0082] The feature map is passed to the position-specific attention module.
[0083] The position-specific attention module is defined as shown in Figure 5 , and the PositionSpecificAttention class is defined, which inherits from the neural network module base class.
[0084] In the initialization method, set the input channel number in channels to 1024 by default, and the number of vertebral positions positions to 4 (corresponding to L1-L4) by default.
[0085] Create a module list position attention , which contains 4 independent attention sub-modules, each corresponding to a vertebral position.
[0086] Each attention sub-module is composed of the following components in order:
[0087] The first convolutional layer: the input channel number is in channels , the output channel number is 256, and the convolution kernel size is 1×1
[0088] ReLU activation function, set inplace=True to improve memory efficiency
[0089] The second convolutional layer: the input channel number is 256, the output channel number is 1, and the convolution kernel size is 1×1
[0090] Sigmoid activation function, compressing the output to the range of 0-1 as the attention weight
[0091] In the forward propagation method, select the corresponding attention sub-module for each sample according to the input position index position idx .
[0092] Apply the corresponding attention module to each sample to generate the attention map attention map .
[0093] Concatenate the attention maps of all samples into a batch attention map attention.
[0094] Multiply the original feature map with the attention map to achieve feature weighting and get the weighted feature attended features .
[0095] Return the weighted feature and attention map for subsequent processing and visualization.
[0096] The position encoding and feature fusion module is defined as shown in Figure 6 PositionEncodingFusion class, which inherits from the neural network module base class.
[0097] In the initialization method, set the feature dimension feature dim default 1024, position encoding dimension position dim default 64.
[0098] Create an embedding layer position embedding , which maps the 4 vertebral position indices (0-3) to a position dim dimension position encoding vector.
[0099] Create a feature fusion sequence fusion, which contains the following components:
[0100] Linear layer: input dimension feature dim +position dim , output dimension 512
[0101] ReLU activation function, set inplace=True
[0102] Batch normalization layer BatchNorm1d, dimension 512
[0103] Dropout layer, dropout rate 0.3, to prevent overfitting
[0104] In the forward propagation method, first get the position encoding vector position_features through the embedding layer.
[0105] Concatenate the global visual feature visual_features and the position encoding vector position_features in the feature dimension to get combined_features.
[0106] The concatenated features are sent to the fusion sequence for processing, and the final fused features fused_features are obtained.
[0107] The fused features are returned as the input of the subsequent classification module.
[0108] The classification and diagnosis module defines the DiagnosisClassifier class, which inherits from the neural network module base class, as shown in the following code: Figure 7
[0109] In the initialization method, the input feature dimension input_dim is set to 512 by default.
[0110] The classifier sequence classifier is created, which includes the following components:
[0111] The first linear layer has an input dimension of input_dim and an output dimension of 128
[0112] The ReLU activation function is set with inplace=True
[0113] The Dropout layer has a dropout rate of 0.5 to prevent overfitting
[0114] The second linear layer has an input dimension of 128 and an output dimension of 2 (normal and osteoporosis)
[0115] The Softmax activation function calculates the probability distribution along dimension 1
[0116] In the forward propagation method, the input feature x is directly sent to the classifier sequence for processing.
[0117] The classification result is returned, which contains the probability values of the two categories.
[0118] In practical applications, the second value (the probability of osteoporosis) is compared with the threshold value (default 0.5), and if it is greater than the threshold value, it is diagnosed as osteoporosis.
[0119] The OsteoporosisNet class is defined, which inherits from the neural network module base class.
[0120] In the initialization method, the following components are created:
[0121] backbone: a feature extractor based on the DenseNet121 pre-trained model, with the last layer modified to adapt to medical images
[0122] position_attention: a position-specific attention module with an input channel number equal to the output channel number of backbone
[0123] global_pooling: global average pooling layer to convert feature map to feature vector
[0124] position_fusion: position encoding and feature fusion module
[0125] classifier: classification diagnosis module
[0126] In the forward propagation method, the following steps are sequentially executed:
[0127] The input image x is sent to the backbone to extract features
[0128] The extracted features and position index position_idx are sent to the position_attention module to obtain weighted features and attention map
[0129] The weighted features are pooled using global_pooling to obtain global feature vectors
[0130] The global feature vectors and position index are sent to the position_fusion module to obtain fused features
[0131] The fused features are sent to the classifier to obtain the final classification result
[0132] The classification result and attention map (for visualization analysis) are returned, as shown in Figure 8
[0133] As a specific embodiment, the method first performs dual-channel enhancement preprocessing on the lumbar CT image. The specific implementation process is as follows: a CLAHE object is created and the limit contrast parameter clipLimit is set to 3.0 and the grid size tileGridSize is set to 8x8. The CLAHE object is applied to the original vertebral body image to generate a contrast-enhanced image. This process enhances the gray scale distribution difference of bone density through local histogram equalization. At the same time, a Frangi filter is applied to the original image, with the scale range scale_range set to 1 to 3, the scale step scale_step set to 0.5, the control parameter beta1 set to 0.5, and the control parameter beta2 set to 15. The Hessian matrix eigenvalues at multiple scales are calculated to detect tubular structures, thereby highlighting the fine structure features of the trabecular bone. The CLAHE enhanced image and the Frangi filter enhanced image are weighted and fused pixel by pixel according to a weight ratio of 0.7 to 0.3. This fusion ratio is optimized through a large number of experiments and can maintain bone density information while fully displaying the trabecular bone microstructure. The fused image is normalized, and the calculation formula is (fused_image-mean) / std, to ensure the standardization of the input data.
[0134] The enhanced image is input into a feature extraction network constructed based on DenseNet121. This network retains all the convolutional layers, batch normalization layers, ReLU activation layers and dense connection structures of DenseNet121 from the input layer to the last dense block, but removes the original classification layer. The network loads the ImageNet pre-trained weights as initialization and performs transfer learning fine-tuning on the medical image dataset. During feature extraction, it is crucial to retain the anatomical position index information of each vertebral body image, i.e., whether the image comes from L1, L2, L3 or L4 vertebral body. After processing by DenseNet121, the output is a deep feature map with dimensions of [batch_size, 1024, H, W], where 1024 is the number of feature channels, H and W are spatial dimensions, usually 4x4 or 7x7, depending on the input image size.
[0135] The core innovation of the present application lies in the design and implementation of position-specific attention mechanism. The system pre-constructs a module pool containing 4 completely independent attention sub-modules, each corresponding to a vertebral body position. Each attention sub-module has the same structure but independent parameters, containing two 1x1 convolutional layers: the first convolutional layer compresses the input 1024-dimensional feature channels to 256-dimensional, followed by a ReLU activation function to introduce nonlinearity; the second convolutional layer further compresses the 256-dimensional features to a single channel, followed by a Sigmoid activation function to normalize the output value to the [0, 1] interval as the attention weight. During forward propagation, the system dynamically selects the corresponding module from the 4 attention sub-modules according to the position index of the current input vertebral body. For example, if the current processing is an L3 vertebral body image, the 3rd attention sub-module is automatically selected. The selected attention module processes the input feature map to generate a single-channel attention weight map with the same spatial dimensions as the feature map. This attention weight map is broadcasted with the original 1024-channel feature map for pixel-wise multiplication operation, achieving feature weighting in spatial dimensions. This mechanism allows each vertebral body position to have a dedicated attention mode, enabling adaptive learning and focusing on the key diagnostic regions specific to that vertebral body.
[0136] The position-specific weighted features need to be deeply fused with the anatomical position information of the vertebral body. First, a global average pooling operation is performed on the weighted feature map to convert the [batch_size, 1024, H, W] feature map into a [batch_size, 1024] global feature vector. At the same time, a learnable embedding layer is used to map the discrete vertebral body position indexes 0, 1, 2, and 3 to 64-dimensional continuous vector representations, respectively. This embedding layer automatically learns the optimal representation of each position during the training process, implicitly encoding the importance differences of different vertebral bodies in osteoporosis diagnosis. The 1024-dimensional visual feature vector and the 64-dimensional position encoding vector are concatenated in the feature dimension to obtain a 1088-dimensional combined feature. The combined feature is processed by a carefully designed fusion network, which includes a linear layer to map 1088 dimensions to 512 dimensions, a ReLU activation function to introduce nonlinearity, a batch normalization layer to stabilize the training process, and a Dropout layer with a probability of 0.3 to prevent overfitting.
[0137] The fused 512-dimensional feature is input into the final classification and diagnosis module. The classifier uses a two-layer fully connected network structure: the first layer maps the 512-dimensional feature to 128 dimensions, using ReLU activation and a Dropout of 0.5; the second layer maps the 128-dimensional feature to 2 dimensions, corresponding to the normal and osteoporosis classes, respectively, and uses a Softmax activation to output a probability distribution. In actual diagnosis, the probability value of the osteoporosis class is taken, and when it is greater than 0.5, it is determined as osteoporosis.
[0138] To achieve comprehensive diagnosis at the patient level, the system performs the above complete process on the L1 to L4 vertebral bodies of the same patient to obtain 4 independent vertebral body level diagnosis results. Considering the reliability differences of different vertebral bodies in clinical diagnosis, a weighted voting strategy is used for comprehensive judgment: the L2 and L3 vertebral bodies are given a weight of 0.3 due to their load-bearing characteristics and typical pathological manifestations; the L1 and L4 vertebral bodies are given a weight of 0.2. The weighted average value of the osteoporosis probabilities of the 4 vertebral bodies is calculated, and when the value is greater than 0.5, the patient is determined as osteoporosis.
[0139] As shown in Figure 9 the comparative experiments on the self-developed data set show that the method has an average accuracy of 91.2% in vertebral body level diagnosis; the classification accuracy of L1-L4 different vertebral bodies is significantly improved, and the stability of the model in the structure difference area is significantly improved. At the same time, the method reduces the missed diagnosis rate in the identification of early osteopenia patients, improves the detection ability of the low bone mass to osteoporosis transition period, and has important clinical screening value.
[0140] Through the technical scheme, the present application realizes a plurality of significant technical progress. In the experimental verification of the self-research data set, the average diagnostic accuracy of the vertebral body level reaches 91.2%, which is improved by 8.5 percentage points compared with the baseline method using a general attention mechanism. More importantly, the balance of diagnostic accuracy among the vertebrae is significantly improved, and the standard deviation of the diagnostic accuracy of L1 to L4 is reduced from 5.3% to 2.1%. Through Grad-CAM visualization analysis, it is found that the position-specific attention successfully learns differentiated attention patterns for different vertebrae: L1 and L2 pay more attention to the central trabecular region, while L3 and L4 pay more attention to the cortical edge and endplate region, which is highly consistent with the diagnostic experience of clinicians. In the early detection of osteoporosis, for boundary cases with T values in the range of-2.5±0.3, the detection sensitivity is improved from 68% of the traditional method to 83%, significantly reducing the missed diagnosis rate.
[0141] As shown in Figure 10 , through the double-channel image enhancement preprocessing combined with CLAHE and Frangi filtering, the visibility of trabeculae and cortical bone in the vertebral body image is significantly improved, and the problems of uneven original image contrast and weak structural details are improved, providing better input data for subsequent feature extraction.
[0142] Through the core innovation of the position-specific attention mechanism, combined with double-channel image enhancement and anatomical prior knowledge fusion, the present application not only improves the diagnostic accuracy of osteoporosis, but more importantly, enhances the model's explainability and clinical credibility, providing a new technical path for the application of artificial intelligence technology in the field of medical image diagnosis.
[0143] The above specific embodiments only describe the preferred embodiments of the present application, and do not limit the protection scope of the present application. Without departing from the design concept and spirit of the present application, various modifications, substitutions and improvements of the technical solutions of the present application made by those skilled in the art according to the description and drawings of the present application should belong to the protection scope of the present application. The protection scope of the present application is determined by the claims.
Claims
1. An automated method for diagnosing osteoporosis based on location-specific attention, characterized in that, Includes the following steps: Step S1: Perform dual-channel enhancement preprocessing on the lumbar spine CT images. By weighted fusion of the contrast enhancement channel and the structural enhancement channel, an enhanced image that takes into account both bone density and trabecular bone structure features is generated. Step S2: Input the enhanced image into a deep convolutional neural network for multi-scale feature extraction. During the extraction process, retain the anatomical location index information of each vertebra to obtain a feature map containing spatial semantic information. Step S3: Based on the anatomical location index information, dynamically select a dedicated attention submodule corresponding to the current vertebral body position, perform location-specific weighting on the feature map, and generate attention-weighted features that highlight the key diagnostic areas of the vertebral body; Step S4: After global pooling of the attention-weighted features, feature-level fusion is performed with the position encoding vector of the vertebral body to construct a comprehensive diagnostic feature that includes anatomical prior knowledge; Step S5: Input the comprehensive diagnostic features into the classifier and output the osteoporosis probability distribution of the vertebral body to achieve accurate diagnosis at the vertebral body level.
2. The automatic diagnosis method for osteoporosis based on location-specific attention according to claim 1, characterized in that, The dual-channel enhancement preprocessing in step S1 specifically includes: S1.1: The contrast of the original CT image is enhanced using the contrast-limited adaptive histogram equalization (CLAHE) algorithm. The contrast limit parameter is set to 2.0-4.0 and the grid size is 8×8 to obtain the first enhanced image. S1.2: The original CT image is enhanced with a Frangi filter to enhance the trabecular structure. Tubular structures are detected by multi-scale Hessian matrix analysis. The scale range is set to 1-3 and the scale step size is 0.5 to obtain the second enhanced image. S1.3: The first enhanced image and the second enhanced image are pixel-level weighted fusion according to a weight ratio of 0.6-0.8:0.2-0.4, and then normalized.
3. The automatic diagnosis method for osteoporosis based on location-specific attention according to claim 1, characterized in that, The deep convolutional neural network in step S2 uses DenseNet121 as the backbone network, specifically including: Remove the original DenseNet121 classification layer, and retain all convolutional layers, batch normalization layers, and dense connection structures from the input layer to the last dense block; Load ImageNet pre-trained weights as initialization parameters and perform transfer learning fine-tuning on a medical image dataset; The output dimension is [batch] size The feature map is defined as [1024, H, W], where H and W are the spatial dimensions.
4. The automatic diagnosis method for osteoporosis based on location-specific attention according to claim 1, characterized in that, The location-specific attention mechanism in step S3 is specifically implemented as follows: S3.1: Pre-build a module pool containing 4 independent attention sub-modules, corresponding to the four lumbar vertebrae L1, L2, L3 and L4 respectively; S3.2: Each attention submodule contains two 1×1 convolutional layers. The first convolutional layer reduces the number of channels from 1024 to 256 and uses ReLU activation. The second convolutional layer reduces the number of channels from 256 to 1 and uses Sigmoid activation. The output is an attention weight map with a value range of [0,1]. S3.3: Based on the current input cone position index, select the corresponding attention sub-module from the module pool, and perform pixel-by-pixel multiplication between its output attention weight map and the original feature map.
5. The automatic diagnosis method for osteoporosis based on location-specific attention according to claim 4, characterized in that, Each attention submodule updates its parameters through independent backpropagation, enabling attention modules at different locations to learn the unique anatomical structure patterns and pathological feature distributions of that vertebra.
6. The method according to claim 1, characterized in that, The location encoding and feature fusion in step S4 specifically include: S4.1: The discrete vertebral position indices {0,1,2,3} are mapped to a 64-dimensional continuous position encoding vector through a learnable embedding layer; S4.2: Perform global average pooling on the attention-weighted features to obtain a 1024-dimensional global visual feature vector; S4.3: Concatenate the position encoding vector with the global visual feature vector in the feature dimension to obtain a 1088-dimensional combined feature; S4.4: The combined features are passed through a fusion network that includes linear transformation, ReLU activation, batch normalization and Dropout to output a comprehensive diagnostic feature of 512 dimensions.
7. The automatic diagnosis method for osteoporosis based on location-specific attention according to claim 6, characterized in that, The location encoding vector automatically learns the optimal representation of each vertebral body position through gradient descent during training, encoding the structural differences and diagnostic weights of different vertebral bodies in osteoporosis diagnosis.
8. The automatic diagnosis method for osteoporosis based on location-specific attention according to claim 1, characterized in that, The classifier in step S5 uses a two-layer fully connected network. The first layer maps 512-dimensional features to 128-dimensional features and uses ReLU activation and Dropout of 0.
5. The second layer outputs a 2-dimensional vector and uses Softmax activation, representing the probabilities of normal and osteoporosis, respectively.
9. The automatic diagnosis method for osteoporosis based on location-specific attention according to any one of claims 1-8, characterized in that, It also includes comprehensive diagnostic steps at the patient level: Steps S1-S5 were performed on the four vertebrae L1-L4 of the same patient to obtain diagnostic results at the four vertebral body levels. A weighted voting strategy was adopted, with L2 and L3 having a weight of 0.3 and L1 and L4 having a weight of 0.
2. When the weighted average probability was greater than 0.5, it was determined to be osteoporosis.
10. An automated osteoporosis diagnosis system based on position-specific attention, applicable to the automated osteoporosis diagnosis method based on position-specific attention as described in any one of claims 1-9, characterized in that, include: The image preprocessing module is used to perform step S1 in claim 1; The feature extraction module is used to perform step S2 in claim 1; A location-specific attention module for performing step S3 of claim 1; The location encoding and feature fusion module is used to perform step S4 in claim 1; The classification and diagnosis module is used to perform step S5 in claim 1; Each module is trained end-to-end using a deep learning framework to jointly optimize the accuracy of osteoporosis diagnosis.
Citation Information
Cited By
Cervical vertebra MRI image automatic segmentation method and system based on attention mechanism
CN122199581A
An Automatic Segmentation Method and System for Cervical Spine MRI Images Based on Attention Mechanism
CN122199581B
Osteoporosis assessment method and system based on spine CT image and application method of system
CN122200080A