Skip to main content
BMC Medical Imaging logoLink to BMC Medical Imaging
. 2025 Dec 8;26:24. doi: 10.1186/s12880-025-02070-9

CerviHFENet: hybrid feature extraction-based deep learning for multi-label classification of upper cervical spine abnormalities in X-ray imaging

Zixuan Wang 1,#, Cheng Zhang 4,5,6,#, Xuemei Zhu 3, Kai Niu 1,2, Shanshan Liu 4,5,6, Shenglin Wang 4,5,6, Xingyu Zhou 7, Dingben Wang 7, Nanfang Xu 4,5,6,✉, Zhiqiang He 1,2,✉
PMCID: PMC12798049  PMID: 41361372

Abstract

Accurate diagnosis of upper cervical spine abnormalities is crucial for effective treatment and prognosis. However, the diversity of anatomical structures and pathological abnormalities poses significant challenges to the diagnostic process. These challenges highlight the need for deep learning models, which are capable of identifying multiple abnormalities to assist in diagnosis. Traditional deep learning approaches have exhibited limitations in extracting sequential features from multi-positional X-ray images and in performing joint diagnosis of multiple coexisting abnormalities. Therefore, a CerviHFENet-based framework is proposed to perform multi-label classification of six upper cervical spine abnormalities using three-view radiographs (extension, neutral, and flexion) obtained from individual patients. The system first incorporates an adaptive region of interest (ROI) detection module to minimize irrelevant information by precisely localizing the upper cervical spine. Following this, the CerviHFENet model integrates a hybrid feature extraction (HFE) mechanism that extracts both the anatomical features of the upper cervical vertebrae and the dynamic variations in bone structure across different neck positions, thereby fully representing the comprehensive characteristics of the upper cervical spine. Furthermore, a modified focal loss function is employed to enable the model to learn the mutual exclusivity or conditionally dependent relationships among the six abnormalities. A total of 249 patients participated in the study, contributing 747 X-ray images. The model achieved a mean AUC of 96.22% and a mean mAP of 94.6% on the test set, indicating promising diagnostic performance and validating the feasibility and effectiveness of the proposed model.

Keywords: Deep learning, X-ray images, Upper cervical spine abnormalities, Multi-label classification, Hybrid feature extraction, AI-Assisted diagnosis

Introduction

The upper cervical spine, particularly the atlantoaxial joint, plays a critical role in head mobility and structural stability. Anomalies in this region can lead to localized biomechanical alterations, resulting in abnormal stress distribution at the C1–C2 articular surfaces and increasing the risk of atlantoaxial dislocation (AAD) [1, 2]. AAD may cause posterior compression of the upper cervical spinal cord, potentially leading to cervical spondylotic myelopathy. Patients often exhibit symptoms such as cranial nerve palsies, pronounced gait disturbances, and respiratory dysfunction, which in severe cases may progress to life-threatening conditions and significantly impair daily functioning. However, due to the inherent characteristics of X-ray imaging techniques, such as potential image overlap in multiple anatomical regions, compromising the resolution of anatomical structures, and hindering accurate diagnosis. Given the low incidence rate of this condition in primary health care, along with limited experience in diagnosing and treating it among doctors, leading to substantial heterogeneity in diagnosing, which contributes to a high rate of missed diagnoses or misdiagnoses, significantly impacts early detection and treatment, as well as disease prognosis [3].

X-rays are indispensable in medical imaging, extensively utilized in various fields such as orthopedics, pulmonology, and cardiology, significantly contributing to the enhancement of diagnostic capabilities in clinical practice [4]. However, X-ray images are limited by their provision of only planar information. The potential overlap of structures in 2D images presents challenges for automatic recognition, thereby increasing the difficulty of distinguishing different anatomical elements. Meanwhile, many advanced deep learning technologies aim to provide auxiliary scientific methods for screening, diagnosis, treatment planning, guidance, and efficacy evaluation of various significant diseases in clinical medicine [5, 6]. Therefore, in recent years, studies have increasingly applied deep learning methods to X-ray diagnostics to assist physicians, aiming to minimize the risks of missed and inaccurate diagnoses. Shen et al. [7] developed YOLO-XRAY, a modified YOLOv5 architecture featuring dual decoders for simultaneous vertebral body detection and segmentation in OVF diagnosis, achieving 96.85% accuracy. Lee et al. [8] used a convolutional neural network that achieved 87.1% accuracy in detecting cervical spondylotic myelopathy by analyzing vertebral alignment patterns in lateral cervical radiographs. Similarly, Xie et al. [9] implemented a ResNet-34-based model with non-local attention modules for cervical spondylosis identification, achieving 89.7% accuracy through vertebral joint localization. Hong et al. [10] introduced an EfficientNet-based framework for simultaneous vertebral fracture detection and osteoporosis assessment, demonstrating radiologist-level performance on lateral spine radiographs. These studies demonstrate the suitability of deep learning backbones, such as YOLOv5, ResNet, and EfficientNet, for interpreting the complex anatomical features presented in cervical spinal X-ray images.

Current applications of X-rays in the automatic diagnosis of Spinal diseases primarily focus on specific abnormalities, such as scoliosis, osteoporosis, and lumbar spondylosis [11]. Ruchi et al. [12] developed an enhanced convolutional neural network (CNN) model for lumbar spine disease detection, achieving a classification accuracy of 94.2%, with a sensitivity of 92.3% and specificity of 95.1%. Similarly, Amin et al. [13] applied transfer learning techniques for the automatic detection and classification of scoliosis from spine X-rays, reporting an accuracy of 89.5%. Amiya et al. [14] used deep learning methods to identify low bone mass in osteoporotic X-ray images, achieving an accuracy of 91.6% and a sensitivity of 89.2%. Although these studies have demonstrated the diagnostic potential of deep learning, most focus on isolated diseases and static image features. There is a lack of modeling for sequential dependencies across multi-positional X-ray images and the capability to simultaneously diagnose multiple coexisting abnormalities. These limitations are particularly pronounced in upper cervical spine diagnostics, where the relative positioning of anatomical structures at different time points and neck postures also serves as an essential basis for diagnosis [15]. Meanwhile, the automated classification of multiple abnormalities in the upper cervical spine remains less explored [16]. The upper cervical spine, located at the base of the skull, presents additional challenges due to its complex anatomy, often leading to overlapping structures in lateral X-ray images, which complicates the diagnostic process [17]. This issue is particularly pronounced in the atlantoaxial region, where multiple abnormalities converge, making differentiation difficult even for experienced clinicians. Therefore, this study develops an automated classification model targeting multiple upper cervical spine abnormalities, with a particular focus on the atlantoaxial region, to explore the potential of aiding in the diagnosis of complex abnormalities. This area has received limited attention in existing research and holds substantial potential for clinical application [18].

This research explores the characteristics of upper cervical spine abnormalities, particularly focusing on atlantoaxial pathology. We have analyzed six abnormalities: Anterior atlantoaxial dislocation, Posterior atlantoaxial dislocation, basilar invagination, odontoid nonunion, atlas occipitalization, and C2–C3 nonsegmentation, all discernible through X-ray images. Through meticulous analysis and collaboration with medical experts, a comprehensive understanding of the unique attributes of each pathological abnormality has been gained. Figure 1 provides visual illustrations of the six abnormalities described below.

Fig. 1.

Fig. 1

Six abnormalities of upper cervical spine

A: Anterior atlantoaxial dislocation: The diagnosis of this abnormality on X-rays relies on the atlantodental interval (ADI), where a measurement exceeding 3 mm in adults or 5 mm in children indicates atlantoaxial instability. Example in Fig. 1A shows X-ray of a patient with Anterior atlantoaxial dislocation, highlighting the increased ADI measurement.

B: Posterior atlantoaxial dislocation: The anterior arch of the atlas moves backward. Refer to Fig. 1B for an X-ray depicting Posterior atlantoaxial dislocation, where the ADI is significantly reduced.

C: Basilar invagination: In this abnormality, the odontoid process of the axis (C2) ascends, surpassing the lower margin of the foramen magnum, known as McRae’s line. Figure 1C provides a clear X-ray of basilar invagination, with the odontoid process extending above McRae’s line.

D: Odontoid nonunion: This term refers to os odontoideum or an old fracture of the odontoid process, where imaging shows that the odontoid process is not a complete, unified structure, with a gap visible between the anterior arch of the atlas and the odontoid process of the axis (C2). Figure 1D illustrates the incomplete structure of the odontoid process, characteristic of odontoid nonunion, with a visible gap between the atlas and the odontoid process.

E: Atlas occipitalization: This involves fusion of the atlas, with the occipital bone, leading to an abnormal junction between the upper cervical spine and the skull. Example in Fig. 1E shows an X-ray of a patient with atlas occipitalization, demonstrating the fusion with the occipital bone.

F: C2–C3 nonsegmentation: a segmentation failure at the 2nd and 3rd upper cervical spine are depicted on imaging as abnormal connections. Refer to Fig. 1F for an X-ray of C2–C3 nonsegmentation, where abnormal connections between C2 and C3 are visible.

Figure 2 illustrates the interrelationships among upper cervical spine abnormalities analyzed in this study. These relationships were established based on medical knowledge and clinical observations.

Fig. 2.

Fig. 2

Medical prior knowledge: interrelationships among upper cervical spine abnormalities- basilar invagination (C), atlas occipitalization (E), and C2–C3 nonsegmentation (F) are independent of the three abnormalities shown in the figure and can coexist with them. Additionally, C, E, and F are independent of each other and can coexist

Conditional Dependency: Posterior atlantoaxial dislocation (B) occurs only when odontoid nonunion (D) is present. Mutual Exclusivity: Anterior atlantoaxial dislocation (A) and Posterior atlantoaxial dislocation (B) cannot occur simultaneously because they represent opposite dislocation directions. Independence and Coexistence: Basilar invagination (C), atlas occipitalization (E), and C2–C3 nonsegmentation (F) are mutually independent and can coexist with any other abnormality, including Anterior atlantoaxial dislocation (A), odontoid nonunion (D), and Posterior atlantoaxial dislocation (B). Anterior atlantoaxial dislocation (A) and odontoid nonunion (D) are likewise independent and can coexist.

This medical prior knowledge provides a foundational understanding of the interrelationships of upper cervical spine abnormalities, facilitating the development of more clinically relevant diagnostic models.

The main contributions of this paper are as follows:

  1. CerviHFENet Model: Static and Sequential Feature Extraction for Upper Cervical Spine X-Ray Diagnosis: The CerviHFENet model architecture is introduced, where ResNet50 is employed for static cervical spine anatomical feature extraction and LSTM for sequential feature extraction through cross-view spatial correlation analysis of cervical spine dynamics (extension/neutral/flexion) within individual patients.

  2. Dependency-Driven Decision Making Among Six Cervical Statuses to Improve Diagnostic Accuracy: A modified focal loss function is proposed that incorporates medical prior knowledge, including the mutually exclusive or conditionally dependent relationships among six abnormalities. Additionally, the final output results are further refined directly according to medical rules, enhancing the accuracy and clinical credibility of the diagnostic outcomes.

  3. Adaptive Adjustment of Region of Interest (ROI) for Improved Diagnostic Accuracy: An adaptive diagnostic system based on Faster R-CNN is introduced to automatically identify and localize regions of interest (ROIs) associated with abnormalities anatomical structures in the upper cervical spine, which enhances diagnostic accuracy and interpretability.

These contributions leverage existing deep learning techniques, integrate domain-specific knowledge and better emulate the decision-making processes of medical professionals.

Proposed method

Dataset description

Dataset construction

A retrospective study was conducted on all patients who underwent surgery for atlantoaxial dislocation in the Department of Orthopedics at Peking University Third Hospital from January 1, 2022 to December 31, 2022. The clinical data and extension, neutral, and flexion lateral view X-ray images of these patients were collected, while exclusion criteria included: (1) previous history of atlantoaxial internal fixation; (2) incomplete imaging data.

The dataset for model development was constructed using de-identified and annotated X-ray images.The annotation process of images consisted of two steps, with the first step being the diagnostic labeling. An independent investigator retrospectively extracted diagnoses from imaging reports and medical records; an orthopaedic surgeon with 5 years of experience independently interpreted all radiographs and made a diagnosis without access to medical records and surgical data. In cases where two independent imaging findings were inconsistent, another orthopaedic surgeon made the final decision. All the labels were reviewed by a senor expert. The second step was annotation of bounding box. As shown in Fig. 3, the criteria were defined to encompass specific anatomical landmarks: the upper boundary exceeding the foramen magnum, the lower boundary extending below the C3 vertebra, the posterior boundary encapsulating the C1–C3 spinous processes, and the anterior boundary surpassing the posterior edge of the hard palate. This demarcated region is identified as encompassing the key locations necessary for accurate disease diagnosis.

Fig. 3.

Fig. 3

Annotation of bounding boxes in different postures

Data summary

After applying exclusion criteria, the final cohort comprised 249 patients, including 124 males and 125 females, with ages ranging from 5 to 78 years. The mean age was 46 years, and the median age was 50 years. Each patient provided three lateral X-ray images, resulting in a total of 747 images.

Among the 747 images, 571 images(76.4%) exhibited anterior dislocation of the atlas, 40(5.4%) images exhibited posterior dislocation of the atlas, 249(33.3%) images exhibited basilar invagination, 264(35.3%) images exhibited a non-continuous odontoid process, 255(34.1%) images exhibited occipitalization of the atlas, and 159(21.3%) images exhibited incomplete segmentation of C2–C3. The distribution of cases in the dataset aligns with the real-world prevalence of upper cervical spine abnormalities, where certain conditions–such as posterior atlantoaxial dislocation–occur infrequently.

To ensure reliable model evaluation and avoid overfitting, particularly given the class imbalance in our dataset, we adopted a five-fold cross-validation strategy at the patient level. The entire dataset was evenly divided into five non-overlapping folds. In each iteration, one fold was designated as the test set, while the remaining four folds were used for model development. Importantly, all images from the same patient were kept within a single subset (training, validation, or testing) in each fold to prevent data leakage.

Training network model

To provide a clear understanding of the overall system design, this section begins with an overview of the proposed CerviHFENet framework, as illustrated in Fig. 4. The model is composed of three main modules: (1) Bounding Box Detection, which utilizes Faster R-CNN to extract clinically relevant regions of interest (ROIs) from input lateral X-ray images; (2) Hybrid Feature Extraction, which combines ResNet-based static feature extraction for extension, neutral, and flexion views, followed by an LSTM-based sequence modeling that captures sequential relationships across views; and (3) Classification, where hybrid features are transformed into multi-label predictions of six cervical abnormalities. Medical prior knowledge, including mutual exclusivity and conditional dependency among abnormalities, is integrated into the framework at two stages. During training, it is encoded into a modified focal loss function to guide the optimization process. During inference, it is applied through a medical rule refinement mechanism that adjusts the sigmoid outputs to ensure clinically consistent results.

Fig. 4.

Fig. 4

A schematic illustration of our proposed CerviHFENet framework

Bounding box detection

Initially, images are processed through a bounding box detection phase using the Faster R-CNN algorithm [19]. Faster R-CNN integrates a Region Proposal Network (RPN) that dynamically proposes candidate object boundaries and an ROI Head that refines these proposals into precise bounding boxes. To ensure that all six abnormalities are appropriately captured, we adaptively adjust the size and position of the bounding boxes to focus on small regions of interest (ROI) containing all the relevant pathological information. After the bounding boxes are detected and adjusted, the images are cropped to retain only the information within these ROI regions before proceeding to feature extraction. To ensure consistency across all samples, the cropped ROI images are uniformly resized to 224 Inline graphic 224 pixels before being fed into the feature extraction module. This phase aims to direct subsequent analytical models to critical pathological regions, minimizing distractions from non-essential areas.

Hybrid feature extraction

The images, cropped to include only the detected ROI regions, are processed for feature extraction. As shown in Fig. 5, the Extension, Neutral, and Flexion view X-ray images of these patients are individually passed through the ResNet50 network, which extracts the static features for each posture [20]. To address challenges such as gradient vanishing and explosion, commonly encountered in deep learning, ResNet50 employs a residual learning framework. This approach facilitates efficient optimization, reduces computational complexity, and mitigates performance degradation as the network depth increases. A four-layer residual block is used in our implementation. To ensure consistent feature size, a global average pooling (GAP) layer is appended after the convolutional backbone, yielding a fixed-length feature vector for each image in the sequence. Specifically, the output feature map of the ResNet50 backbone is a tensor Inline graphic, where 2048 is the number of channels and Inline graphic denotes the spatial resolution. The GAP operation computes the mean value over each feature map, defined as:

graphic file with name d33e506.gif 1
Fig. 5.

Fig. 5

Hybrid feature extraction of CerviHFENet

This operation reduces each spatial feature map to a single scalar value, resulting in a tensor of size Inline graphic. The output is then flattened to form a spatially pooled vector Inline graphic, which serves as the compact representation of the input image and is used as the input to the sequential modeling module.

After static feature extraction and dimensional standardization via adaptive average pooling, features from the three postures (Extension, Neutral, and Flexion) are sequentially input into a sequence modeling network. Clinically, evaluating atlantoaxial stability and cervical spine abnormalities requires comparative analysis across these dynamic views, which reflect the biomechanical behavior of the cervical spine under varying physiological loads. These views form a structured temporal sequence rather than independent snapshots. This temporal arrangement simulates the physiological motion of the cervical spine, enabling the model to learn how structural abnormalities evolve across postures. Sequential features in this context capture the positional, structural, and morphological changes of the upper cervical spine during these transitions. By modeling these posture-induced variations, the network learns dynamic pathological patterns for detecting motion-sensitive abnormalities.To model the dependencies and transitions among these postures, we employ a Long Short-Term Memory (LSTM) network [21]. LSTMs capability to retain contextual memory enables it to identify motion-consistent abnormalities by leveraging both short- and long-range dependencies within the postural feature sequence. By treating the three views as an integrated diagnostic sequence, the LSTM aligns with clinicians’ interpretive strategy of identifying motion-sensitive pathology through comparative analysis. As a recurrent neural network specialized for sequential data, the LSTM mimics clinical reasoning by capturing temporal relationships between features across views. Its architecture–comprising input, forget, and output gates along with memory cells–controls information flow, enabling effective long-term dependency capture and memory retention. This makes LSTM highly suitable for the classification task involving sequential postural image features. The LSTM network used in our model comprises a single layer with a hidden size of 128. It processes the sequence of 2048-dimensional feature vectors corresponding to the three postures. The final hidden state of the LSTM is then passed to a fully connected layer for the multi-label classification task.

By integrating the static feature extraction capabilities of ResNet50 with the sequential modeling strengths of LSTM, our CerviHFE model provides an effective framework specifically tailored for the joint diagnosis of diverse upper cervical spine abnormalities.

Loss function

The dataset used in this study exhibits class imbalance, such as the under-representation of posterior atlantoaxial dislocation, which may compromise the model’s robustness. To mitigate this issue, Focal Loss [22] was employed as the primary loss component. Focal Loss modifies the standard cross-entropy loss by introducing a scaling factor that down-weights well-classified examples and emphasizes hard or minority samples, thereby improving stability and performance under imbalanced data distributions. It is defined as:

graphic file with name d33e543.gif

where Inline graphic is the predicted probability for the positive class, Inline graphic is the ground truth label, and Inline graphic represents the model’s confidence in the true class. Inline graphic is a class-balancing factor, and Inline graphic is the focusing parameter that controls the rate at which easy examples are down-weighted. In this work, Inline graphic and Inline graphic were used and were empirically validated to achieve optimal performance.

To effectively incorporate interrelationships among the six upper cervical spine abnormalities (illustrated in Fig. 2 of the Introduction) into model training, we introduce penalty terms in the loss function. These terms enhance the model’s ability to better capture the relationships between the six upper cervical spine abnormalities. Furthermore, due to the imbalance between positive and negative samples, focal loss is selected as the foundational loss function to address this issue.

The modified loss function is formulated as follows:

graphic file with name d33e587.gif 2

where:

Inline graphic denotes the predicted probability for each class Inline graphic, where Inline graphic to Inline graphic correspond to the six cervical abnormalities, as described above, labeled as Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic, and Inline graphic. Here, Inline graphic represents the sigmoid function and Inline graphic represents the neural network output for class Inline graphic. The true label for each class Inline graphic is denoted as Inline graphic. The first term in the loss function corresponds to the focal loss (FL). The second term represents the exclusivity penalty, ensuring that Anterior atlantoaxial dislocation (Inline graphic) and Posterior atlantoaxial dislocation (Inline graphic) are not present simultaneously. This exclusivity term is regulated by the parameter Inline graphic, which is set to 0.7 in this study. The third term represents the conditionally dependent penalty, which enforces the conditional dependency that abnormality Posterior atlantoaxial dislocation (Inline graphic) can only be present if abnormality odontoid nonunion (Inline graphic) is also present. The conditionally dependent term is regulated by the parameter Inline graphic, which is set to 1.6 in this study.

The weighting coefficients of Inline graphic = 0.7 and Inline graphic = 1.6 were selected to achieve an optimal balance between overall classification performance and adherence to clinical constraints. Specifically, the conditional dependency (Inline graphic) represents a more abstract clinical relationship that is challenging to infer directly from data. A stronger Inline graphic was therefore applied to enforce this constraint. Empirical observations indicated that elevated Inline graphic values resulted in an overly conservative model, which disproportionately reduced recall for conditions Inline graphic and Inline graphic. In contrast, insufficient Inline graphic values frequently led to violations of the Inline graphic dependency.

By incorporating these penalty terms, the overall loss function seeks to improve model performance while respecting the medical relationships between abnormalities.

Experimental result

Implementation detail

In our experiments, we employed a 5-fold cross-validation strategy. For each fold, training was conducted using a batch size of 6, and the Adam optimizer was used with an initial learning rate of Inline graphic. The learning rate was decayed by a factor of 0.1 every 30 epochs. A classification threshold of 0.5 was applied. The model was trained for 200 epochs, utilizing a momentum of 0.9 and a weight decay of Inline graphic. For feature extraction, the model incorporated 4 attention heads with a hidden size of 128. All training and evaluation processes were implemented in Python 3.8.5 using PyTorch 1.12.1+cu116. The experiments were conducted on a workstation running Ubuntu 18.04.5 LTS, equipped with an RTX A6000 GPU with 48 GB of memory.

CerviHFENet network performance

Multi-label diagnostic classification results

A comprehensive evaluation of the CerviHFENet model’s performance in a multi-label classification task, which involved six types of upper cervical spine abnormalities, was performed, as summarized in Table 1. To effectively assess the model’s performance in this setting, a set of widely used metrics for multi-label classification was adopted, including recall, precision, F1-score, AUC (Area Under the ROC Curve), mAP (mean average precision), and the Jaccard Index. Recall and precision measure sensitivity and specificity, respectively, while the F1-score balances both. AUC and mAP evaluate the model’s discriminative ability and ranking accuracy across thresholds, and the Jaccard Index quantifies label set overlap between predictions and ground truth. All reported metrics are presented as the mean Inline graphic standard deviation across the five cross-validation folds, demonstrating the stability of the model’s performance.

Table 1.

Performance metrics of the CerviHFENet model in multi-label classification of six upper cervical spine abnormalities, reported as mean Inline graphic standard deviation over five cross-validation folds

Class Jaccard (%) mAP (%) Recall (%) Precision (%) AUC (%)
Anterior atlantoaxial dislocation Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
Posterior atlantoaxial dislocation Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
Basilar invagination Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
Odontoid nonunion Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
Atlas occipitalization Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
C2–C3 segmentation insufficiency Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
Overall (mean) Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic

The obtained metrics indicate a high level of performance across all classes.In particular, perfect precision and recall were achieved in the Posterior atlantoaxial dislocation class, and a high AUC of 98.07% was obtained in the C2–C3 nonsegmentation class. The Anterior atlantoaxial dislocation class exhibited the highest class-wise precision(96.55%), indicating a low false positive rate. Overall, CerviHFENet showed excellent performance in this task, with high AUC(96.22%) and mAP(94.6%) supporting its discriminative effectiveness and multi-label prediction capability.

Multi-label classification results visualization

Both the Precision-Recall Curve (PRC) and the Receiver Operating Characteristic (ROC) Curve were employed to evaluate the model. The PRC illustrates the trade-off between Precision and Recall, while the ROC Curve represents the balance between Sensitivity (True Positive Rate) and the False Positive Rate.

Figure 6 presents the Precision-Recall (PRC) and Receiver Operating Characteristic (ROC) curves for each class, along with the corresponding Average Precision (AP) and Area Under the ROC Curve (AUC-ROC) scores. The PRC curves are concentrated in the upper-right corner, reflecting high Precision and Recall values, with an average AP of 0.95 across all classes. Likewise, the ROC curves are clustered in the upper-left corner, illustrating high True Positive Rates and low False Positive Rates, with an average AUC-ROC of 0.96. These visualizations confirm the model’s strong discriminative capability and consistent performance across all target classes.

Fig. 6.

Fig. 6

Performance curves of CervHFENet: (a) precision-recall curve; (b) ROC curve

Comparative evaluation with other models

To evaluate the effectiveness of the proposed CerviHFENet model, a comparative analysis was conducted against several state-of-the-art architectures, including DenseNet169, MobileViTv2, ResNet50, ResNet101, and EfficientNetV2. All models were trained and tested on the identical set of cropped region-of-interest (ROI) images generated by the Faster R-CNN module, under the same experimental conditions on the multi-label classification task involving upper cervical spine abnormalities. Given the multi-label nature of the task, F1-score, AUC, and mAP were selected as primary evaluation metrics due to their sensitivity to class imbalance and their ability to reflect both classification quality and ranking performance.

As shown in Fig. 7, CerviHFENet consistently outperformed other models across all evaluation metrics, highlighting its comparative advantage in accurately and reliably identifying multiple structural abnormalities from lateral cervical spine radiographs. The performance advantage of CerviHFENet is particularly evident in terms of F1-score and Jaccard index, which reflect the model’s ability to detect the presence of each pathological condition with both high precision and recall. This suggests that CerviHFENet effectively captures and integrates discriminative anatomical features that are critical for distinguishing multiple co-occurring abnormalities. These results validate the architectural design and domain-specific enhancements of CerviHFENet for clinical tasks involving automated, multi-label diagnosis of upper cervical spine abnormalities.

Fig. 7.

Fig. 7

Model performance comparison. Statistical significance was assessed using paired t-tests between CerviHFENet and each model. The performance improvements of CerviHFENet over all models were statistically significant across all evaluated metrics (p Inline graphic 0.03)

Ablation experiments

Key components analysis

To evaluate the contribution of key modules in the CerviHFENet framework, an ablation study was conducted focusing on three major components: temporal feature extraction, ROI localization, and loss function design.

Table 2 summarizes the performance of different configurations by selectively disabling or altering these components.

Table 2.

Ablation study on key components of the CerviHFENet model, reported as mean Inline graphic standard deviation over five cross-validation folds

Component Choice
Temporal Feature Extraction ✓ Inline graphic ✓ ✓
ROI Localization ✓ ✓ Inline graphic ✓
Focal Loss ✓
Modified Loss ✓ ✓ ✓
AUC Inline graphic Inline graphic Inline graphic Inline graphic
mAP Inline graphic Inline graphic Inline graphic Inline graphic

The removal of the temporal feature extraction module resulted in a noticeable performance drop, suggesting that sequential modeling plays an important role in capturing contextual patterns across image slices. Similarly, eliminating ROI localization led to the lowest mAP score, reflecting the importance of spatially constraining the attention region to clinically relevant structures. With regard to loss function design, Focal Loss was employed as a comparative baseline due to its proven effectiveness in addressing class imbalance. The proposed Modified Loss function, which further incorporates domain-specific priors derived from clinical observations. Notably, our Modified Loss outperforms the traditional Focal Loss, making it better suited for the specific challenges of our task.

To further evaluate the model’s behavior under clinical constraints, the number of rule violations was analyzed across the five folds, focusing on the mutual exclusivity between anterior atlantoaxial dislocation and posterior atlantoaxial dislocation, as well as the conditional dependency requiring posterior atlantoaxial dislocation to occur only when odontoid nonunion was present. The model trained with the Focal Loss exhibited an average of 5.8 exclusivity and 6.2 dependency violations per fold, whereas the proposed Modified Loss reduced these numbers to 0.8 and 1.0, respectively. These results suggest that incorporating medical prior knowledge not only enhances classification performance but also enforces logical consistency consistent with clinical reasoning.

In addition, to verify the effectiveness of the LSTM module, it was replaced with a Transformer-based encoder for sequence analysis. The Transformer was configured with two layers, four attention heads, a hidden dimension of 128, and a dropout rate of 0.1. When combined with the ResNet50 backbone, the Transformer-based variant achieved a mean AUC of 93.05%, mAP of 82.89%, Jaccard index of 61.30%, recall of 73.15%, and precision of 83.96%. These results were consistently lower than those of the LSTM-based model, suggesting that although Transformer architectures are powerful, their advantages are not fully realized in this setting because of the dataset size and short sequence length. Therefore, the LSTM provides a more data-efficient and stable solution for modeling multi-positional X-ray images in upper cervical spine analysis.

ROI visualization

As demonstrated in Section 3.3.1, the incorporation of ROI localization using the Faster R-CNN framework significantly improved the model’s diagnostic performance. To further investigate and intuitively validate this improvement, we visualized the model’s attention regions using class activation heatmaps.

Reduction of Redundancy:

In the upper section of Fig. 8, we observe that the application of bounding box cropping effectively reduces the region of interest (ROI), marked in red, by focusing attention on the anatomical areas surrounding the atlantoaxial joints. This targeted reduction in ROI minimizes the model’s processing of irrelevant image regions, directing its analysis toward the most diagnostically significant structures.

Fig. 8.

Fig. 8

Comparison of model attention heatmaps before and after applying bonding detection. Reduction of redundancy and minimization of extreme errors achieved through bonding detection. Red indicates areas of highest attention, yellow denotes moderately high attention, green represents medium attention, and blue reflects the lowest attention

Minimization of Extreme Errors:

In the lower section of Fig. 8, the impact of bounding box cropping in minimizing extreme errors is clearly demonstrated. By restricting the model’s focus to the defined ROI, the likelihood of the model attending to erroneous or irrelevant regions is significantly reduced. This constraint ensures that the model concentrates on clinically relevant features, significantly improving the precision of the classification process.

Discussion

Despite increasing interest in spine imaging analysis, current research on cervical spine X-ray classification largely remains confined to single-label or multi-class classification tasks. For example, DeepSpine [23] utilizes deep convolutional neural networks for multi-class classification of spinal disorders. Vision Transformer-based cervical fracture classification models, focuses on single-abnormality classification [24]. These approaches do not capture the clinical reality where patients often present with multiple, concurrent spinal abnormalities. In contrast, multi-label classification has been extensively explored in chest X-ray imaging. For instance, Chen et al. [25] proposed a two-stream collaborative network with lung segmentation, achieving a mean AUC of 0.823 on the ChestX-ray14 dataset across 14 thoracic conditions. Jung et al. [26] developed a weakly supervised disease localization method based on disease masks, reporting a mean AUC of 0.830. These results demonstrate the viability of multi-label learning in radiology, particularly when diseases exhibit overlapping patterns. In this context, our proposed CerviHFENet achieves a mean AUC of 96.22% across six upper cervical spine abnormalities, outperforming the above models and indicating the potential of cervical spine X-ray images for multi-label classification.

The three key innovations of our model each make significant contributions to its overall performance: LSTM-based temporal modeling, ROI localization, and our modified loss function. Both the LSTM module and the loss function incorporate prior medical knowledge–respectively modeling inter-postural feature dependencies and clinical co-occurrence or exclusion patterns among labels, thereby enhancing the model’s interpretability. Their inclusion each led to an approximate 2% increase in AUC, suggesting their contribution to improved diagnostic accuracy. Additionally, ROI localization, by directing attention to anatomically relevant regions, significantly boosted mAP by over 14%, emphasizing its critical role in spatial precision and clinical focus. It should be emphasized that the proposed CerviHFENet is intended for diagnostic assistance. The system is designed to support clinicians after patients have been referred for radiographic examination due to clinical symptoms. In this setting, overall diagnostic accuracy and mAP are more clinically meaningful than recall or precision alone, as they reflect the model’s ability to distinguish among multiple, coexisting upper cervical abnormalities. This clarification aligns the reported metrics with the system’s intended use and practical deployment scenario. Nevertheless, future work will aim to further enhance both sensitivity and precision to develop a more comprehensive and clinically robust framework.

However, this study also has certain limitations. The dataset was collected from a single center and includes a limited number of patients, with class imbalance for some abnormalities. Such limitations partly stem from the fact that existing datasets for cervical spine analysis typically focus on single or multiple independent abnormalities, whereas the dataset in this study provides joint annotations for multiple interrelated upper cervical spine abnormalities, which remain rare and challenging to construct. While the reliability was supported by five-fold cross-validation, its generalizability requires further confirmation through large-scale, multi-center studies. Future work will therefore focus on multi-center collaboration to externally validate and refine the model, facilitating its broader clinical translation.

Furthermore, this work opens up several other promising avenues for future research. Integrating multi-modal imaging data, such as combining CT for detailed 3D bone structures and MRI for soft tissue assessment, could provide a more comprehensive representation of cervical anatomy and pathology. Extending this framework to incorporate 3D convolutional neural networks (3D CNNs) for CT/MRI data [27] could enable the modeling of the complex three-dimensional anatomy of the atlantoaxial joint, facilitating the automated quantification of critical spatial parameters and the detection of subtle abnormalities not discernible in two-dimensional projections. The development of such multi-modal and 3D-aware systems would represent a significant advancement toward a more precise and comprehensive AI-assisted diagnostic framework.

Conclusion

In this study, we proposed CerviHFENet, a deep learning framework for multi-label classification of upper cervical spine abnormalities in X-ray images, particularly targeting the atlantoaxial region. The model simultaneously identifies six categories of abnormalities and achieved favorable performance compared to several representative methods, including EfficientNetV2, MoCo, DenseNet169, MobileViTv2, ResNet50, and ResNet101. CerviHFENet incorporates three key components–ROI localization, static feature extraction, and sequential modeling–that work collaboratively to enhance classification performance. The experimental results demonstrate the effectiveness of our approach on the collected dataset, indicating its potential in supporting diagnostic tasks involving multiple upper cervical spine abnormalities.

Acknowledgements

Not applicable.

Author contributions

Zixuan Wang: Writing – review and editing, Writing - original draft, Visualization, Validation, Software, Methodology, Investigation, Formal analysis, Conceptualization. Cheng Zhang: Writing – review and editing, Writing - original draft, Validation, Methodology, Investigation, Formal analysis, Data curation, Conceptualization. Xuemei Zhu: Writing - review and editing, Supervision, Project administration, Niu Kai: Writing - review and editing, Supervision, Resources, Project administration, Funding acquisition, Conceptualization. Shanshan Liu: Supervision, Project administration, Conceptualization. Shenglin Wang: Supervision, Resources, Project administration, Conceptualization. Xingyu Zhou: Investigation, Formal analysis. Dingben Wang:Investigation, Formal analysis. Nanfang Xu: Writing - review and editing, Supervision, Resources, Project administration, Funding acquisition, Conceptualization. Zhiqiang He: Writing - review and editing, Supervision, Resources, Project administration, Funding acquisition, Conceptualization.

Funding

This work was supported by the National Key Research and Development Program of China [grant number 2021YFE0205300]; and the National Natural Science Foundation of China [grant number 82272577].

Data availability

The datasets used and analyzed during the current study are not publicly available due to institutional policies of Peking University Third Hospital but are available from the corresponding author on reasonable request and with institutional approval.

Declarations

Ethics approval and consent to participate

This retrospective study utilized fully anonymized X-ray images from Peking University Third Hospital with no identifiable patient information. The study was conducted in accordance with the ethical standards of the Declaration of Helsinki. The Ethics Committee of Peking University Third Hospital confirmed that Ethics approval and consent to participate was waived for this study.

Consent for publication

The need for individual consent for publication was waived by the Ethics Committee of Peking University Third Hospital due to the retrospective nature of the study and the complete anonymization of all data.

Competing interests

The authors declare that they have no conflict of interest.

Footnotes

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Zixuan Wang and Cheng Zhang contributed equally to this work.

Contributor Information

Nanfang Xu, Email: xunanfang@foxmail.com.

Zhiqiang He, Email: hezq@bupt.edu.cn.

References

  • 1.Duan S, Ye F, Kang J. Three-dimensional ct study on normal anatomical features of atlanto-axial joints. Surg And Radiologic Anat. 2007;29(2):83–88. 10.1007/s00276-006-0166-0. [DOI] [PubMed] [Google Scholar]
  • 2.Babić-Naglić DJ, Potočki K, Ćurković B. Clinical and radiological features of atlantoaxial joints in rheumatoid arthritis. Z für Rheumatologie. 1999;58:196–200. 10.1007/s003930050170. [DOI] [PubMed] [Google Scholar]
  • 3.Yang SY, Boniello AJ, Poorman CE, Chang AL, Wang S, Passias PG. A review of the diagnosis and treatment of atlantoaxial dislocations. Global Spine J. 2014;4(3):197–210. 10.1055/s-0034-1376371. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Akhter Y, Singh R, Vatsa M. AI-based radiodiagnosis using chest X-rays: a review, frontiers in big data 6. 2023. p. 1120989. 10.3389/fdata.2023.1120989. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Li Y, Liang W, Zhang Y, An H, Tan J. Automatic lumbar vertebrae detection based on feature fusion deep learning for partial occluded c-arm x-ray images. 2016 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC). 2016, pp. 647–50. 10.1109/EMBC.2016.7590785. [DOI] [PubMed]
  • 6.Spampinato C, Palazzo S, Giordano D, Aldinucci M, Leonardi R. Deep learning for automated skeletal bone age assessment in x-ray images. Med Image Anal. 2017;36:41–51. 10.1016/j.media.2016.10.010. [DOI] [PubMed] [Google Scholar]
  • 7.Shen L, Gao C, Hu S, Kang D, Zhang Z, Xia D, et al. Using artificial intelligence to diagnose osteoporotic vertebral fractures on plain radiographs. J Bone And Mineral Res. 2023;38(9):1278–87. 10.1002/jbmr.4879. [DOI] [PubMed] [Google Scholar]
  • 8.Lee G, Shin H, Chang M. Deep learning algorithm to evaluate cervical spondylotic myelopathy using lateral cervical spine radiograph. BMC Neurol. 2022;22:147. 10.1186/s12883-022-02670-w. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Xie Y, Nie Y, Lundgren J, Yang M, Zhang Y, Chen Z. Cervical spondylosis diagnosis based on convolutional neural network with x-ray images. Sensors. 2024;24(11):3428. 10.3390/s24113428. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Hong N, Cho SW, Lee YH, Kim CO, Kim HC, Rhee Y, et al. Deep learning-based identification of vertebral fracture and osteoporosis in lateral spine radiographs and dxa vertebral fracture assessment to predict incident fracture. J Bone Mineral Res. 2025;40(5):628–38. 10.1093/jbmr/zjaf050. [DOI] [PubMed]
  • 11.Litjens G, Kooi T, Bejnordi BE, Setio AAA, Ciompi F, Ghafoorian M, et al. A survey on deep learning in medical image analysis. Med Image Anal. 2017;42:60–88. 10.1016/j.media.2017.07.005. [DOI] [PubMed] [Google Scholar]
  • 12.Ruchi DS, Singla J, Rahmani MKI, Ahmad S, Rehman MU, Jha S, et al. Lumbar spine disease detection: enhanced cnn model with improved classification accuracy. IEEE Access. 2023;11:141889–901. 10.1109/ACCESS.2023.3342064. [Google Scholar]
  • 13.Amin A, Abbas M, Salam AA. Automatic detection and classification of scoliosis from spine x-rays using transfer learning. 2022 2nd International Conference on Digital Futures and Transformative Technologies (ICoDT2). 2022, pp. 1–6. 10.1109/ICoDT255437.2022.9787480.
  • 14.Amiya G, Ramaraj K, Murugan PR, Govindaraj V, Vasudevan M, Thiyagarajan A. Assertion of low bone mass in osteoporotic x-ray images using deep learning technique. 2022 4th International Conference on Advances in Computing, Communication Control and Networking (ICAC3N). 2022, pp. 830–35. 10.1109/ICAC3N56670.2022.10074388.
  • 15.Xu N, Tian Y, Zhao H, Chu H, Li F, Wang B, et al. Revisiting the treatment algorithm for atlantoaxial dislocation after 10 years: a multi-center study with mid-to-long-term follow-up. SpineEpub ahead of print (February 2025). 10.1097/BRS.0000000000005318. [DOI] [PubMed]
  • 16.Ham D-W, Seon Choi Y, Yoo Y, Park S-M, Song K-S. Measurement of interspinous motion in dynamic cervical radiographs using a deep learning ased segmentation model. J Neurosurg: Spine. 2023;39(3):329–34. 10.3171/2023.5.SPINE23293. [DOI] [PubMed] [Google Scholar]
  • 17.Vandemark RM. Radiology of the cervical spine in trauma patients: practice pitfalls and recommendations for improving efficiency and communication. Am J Roentgenol. 1990;155(3):465–72. 10.2214/ajr.155.3.2117342. [DOI] [PubMed] [Google Scholar]
  • 18.Li S, Yang B, Dou Y, Wang Y, Ma J, Huang C, et al. Aided diagnosis of cervical spondylotic myelopathy using deep learning methods based on electroencephalography. Med Eng Phys. 2023;121:104069. 10.1016/j.medengphy.2023.104069. [DOI] [PubMed] [Google Scholar]
  • 19.Ren S, He K, Girshick R, Sun J. Faster R-CNN: towards real-time object detection with region proposal networks. IEEE Trans On Pattern Anal And Mach Intel. 2017;39(6):1137–49. 10.1109/TPAMI.2016.2577031. [DOI] [PubMed] [Google Scholar]
  • 20.He K, Zhang X, Ren S, Sun J. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2016, pp. 770–78. 10.1109/CVPR.2016.90.
  • 21.Hochreiter S, Schmidhuber J. Long short-term memory, neural computation. 1997;9(8):1735–80. 10.1162/neco.1997.9.8.1735. [DOI] [PubMed]
  • 22.Lin T-Y, Goyal P, Girshick R, He K, Dollár P. Focal loss for dense object detection. IEEE Trans Pattern Anal Mach Intel. 2020;42(2):318–27. 10.1109/TPAMI.2018.2858826. [DOI] [PubMed] [Google Scholar]
  • 23.Degadwala S, Krishnamurthy VND, Vyas D. Deepspine: multi-class spine x-ray conditions classification using deep learning. 2024 3rd International Conference on Sentiment Analysis and Deep Learning (ICSADL). 2024, pp. 8–13. 10.1109/ICSADL61749.2024.00008.
  • 24.Chład P, Ogiela MR. Deep learning and cloud-based computation for cervical spine fracture detection system. 2023;12(9). 10.3390/electronics12092056.
  • 25.Chen B, Zhang Z, Lin J, Chen Y, Lu G. Two-stream collaborative network for multi-label chest x-ray image classification with lung segmentation. Pattern Recognit Lett. 2020;135:221–27. 10.1016/j.patrec.2020.04.016. [Google Scholar]
  • 26.Jung H-G, Nam W-J, Kim H-W, Lee S-W. Weakly supervised thoracic disease localization via disease masks. Neurocomputing. 2023;517:34–43. 10.1016/j.neucom.2022.10.019. [Google Scholar]
  • 27.Shen W, Zhou M, Yang F, Yang C, Tian J. Multi-scale convolutional neural networks for lung nodule classification. In: Information processing in medical imaging. Cham: Springer International Publishing; 2015. p. 588–99. 10.1007/978-3-319-19992-4_46. [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The datasets used and analyzed during the current study are not publicly available due to institutional policies of Peking University Third Hospital but are available from the corresponding author on reasonable request and with institutional approval.


Articles from BMC Medical Imaging are provided here courtesy of BMC

RESOURCES