Abstract
-
Objective
Maintaining the occipito-axial (O–C2) angle following occipitocervical fusion is crucial to prevent postoperative complications. Although automated O–C2 measurement has been reported, practical methods that provide rapid results for routine practice remain limited. This study aimed to develop a deep learning model using the YOLO (You Only Look Once) object detection algorithm to automatically identify anatomical landmarks and rapidly calculate the O–C2 angle.
-
Methods
A retrospective analysis was conducted using cervical spine radiographs from 2 independent facilities. The internal dataset comprised 574 lateral cervical radiographs from 271 patients for model development, while the external validation dataset included 100 radiographs from 100 patients. Model performance was evaluated against manual measurements by 3 expert raters.
-
Results
The model demonstrated excellent detection performance, achieving perfect metrics for the hard palate (F1 score: 1.00) and high performance for the occipital bone (F1 score: 0.97), anteroinferior corner of C2 (F1 score: 0.99), and posteroinferior corner of C2 (F1 score: 0.99). For O–C2 angle estimation, the mean absolute error was 2.35° and root mean squared error was 2.98°, with an accuracy of 94.7% for determining the presence or absence of the O–C2 angle (i.e., whether all 4 anatomical landmarks were simultaneously detected). Bland-Altman analysis revealed minimal bias (0.57°; 95% confidence interval, -0.06° to 1.12°) with limits of agreement from -5.19° to 6.33°. Inference time was approximately 0.14 s per image.
-
Conclusion
Our deep learning model enables rapid and accurate O–C2 angle measurement on lateral cervical radiographs, demonstrating performance comparable to expert raters and potential clinical utility.
-
Keywords: Radiography, Cervical vertebrae, Deep learning, Algorithms
INTRODUCTION
Instability of the craniocervical junction can result from various pathologies, leading to severe neurological and physiological complications [
1]. Occipitocervical fusion (OCF) has become a widely accepted surgical treatment for stabilizing the junction between the occipital bone and cervical spine [
1-
3]. However, OCF may lead to serious postoperative complications, such as respiratory problems and swallowing difficulties. Therefore, ensuring proper alignment during OCF is essential to prevent these complications. Several studies have reported that a significant postoperative decrease in the occipito-axial angle (O–C2 angle) is associated with dyspnea and dysphagia [
4-
6]. Thus, preventing a reduction in the O–C2 angle postoperatively is crucial to avoid severe complications.
The O–C2 angle is defined as the angle between McGregor line and a line parallel to the inferior endplate of C2 [
5]. Specifically, the measurement of the O–C2 angle involves identifying the hard palate and the inferior edge of the occipital bone, as well as the anteroinferior and posteroinferior corners of C2, to draw the necessary lines. The O–C2 angle has been shown to exhibit minimal inter-observer variability [
7,
8]. Nevertheless, manual assessments by surgeons are time-consuming and can cause potential measurement errors that may lead to significant clinical complications. Therefore, given the importance of the O–C2 angle in predicting complications, an automated system capable of rapidly and accurately measuring this parameter from cervical radiographs using artificial intelligence (AI) is essential. Although these automated approaches have been reported, many use multistep pipelines and can be sensitive to radiograph variability or incomplete visualization of key structures [
9].
Recent advancements in computer vision and deep learning algorithms for automating surgical index measurements from radiographic images have been remarkable [
10]. For example, the Cobb angle, a representative spinal alignment index used for scoliosis assessment, has been measured using deep learning models with improved accuracy [
11-
20]. Advanced deep learning architectures, such as region-based convolutional neural networks (CNNs), have further enhanced the accuracy of automated measurements [
17-
20]. These technologies generally rely on segmentation or multistage landmark localization, which may increase implementation complexity and annotation demands. Object detection offers a complementary strategy by localizing predefined, clinically meaningful parts of anatomical structures, enabling intuitive visual verification and efficient inference. However, object-detection-based O–C2 angle measurement has not been evaluated.
In this study, we applied a You Only Look Once (YOLO)-based object detection technique and tested its utility for calculating the O–C2 angle as a proof-of-concept study. We assessed agreement with expert measurements and processing time to determine feasibility. Given the anatomical complexity and variability of the craniocervical region, we hypothesized that an object detection-based model for the automated measurement could provide an alternative approach for automated O–C2 angle measurement.
MATERIALS AND METHODS
1. Dataset and Annotation Description
1) Internal dataset
Patients who underwent cervical spinal surgery at the Department of Neurosurgery, Sakura General Hospital, between January 2018 and December 2023 were included in the internal dataset. The dataset included preoperative lateral radiographs of the cervical spine in the neutral, flexion, and extension positions. Overall, 574 images from 271 cases were retrospectively collected.
In addition to the imaging data, patient age, sex, and surgical information were retrospectively obtained. Images were initially in the Digital Imaging and Communications in Medicine (DICOM) format and were converted to JPEG using the Pydicom library (
https://pydicom.github.io) in Python (ver. 3.11). The annotation method using LabelImg software (
https://github.com/HumanSignal/LabelImg) was determined through a consensus among neurosurgeons (YF, YNagashima, and KM). A single neurosurgeon (SY, with >6 years of clinical experience and interpretation of radiograms) performed the annotation using bounding boxes to mark the hard palate, the inferior edge of the occipital bone, and the anteroinferior and posteroinferior corners of the C2–7 vertebral bodies. Of note, the corners of the vertebra were annotated as the anterior (A) and posterior (P) labels only, not being distinguished from each of the vertebrae. This was because the model was designed to detect all the corners, with the most superior among them regarded as the C2 vertebral corners. It was thought that this annotation approach could serve as data augmentation. The annotation process is illustrated in
Supplementary Fig. 1. The bounding box coordinates were saved as text files, with one file generated per radiograph. These annotated images were used as the training datasets.
2) External dataset
The external validation dataset was retrospectively obtained and consisted of 102 patients who underwent cervical spine surgery at the Department of Neurosurgery, Nagoya University Hospital, between January 2020 and March 2023. Two patients were excluded because of a lack of cervical spine images. Patient age, sex, and surgical information were retrospectively collected. Cervical spine radiographs in the neutral position were acquired as JPEG images with a predefined window width using the DICOM viewer (RapideyeCore SVIW-DVR01 ver.1.97, Canon Medical Systems, USA). Three neurosurgeon raters with different levels of experience in spine surgery [TA (>3 years of experience in spine surgery), MM (Certified Spine Surgeon of the Neurospinal Society of Japan) and YNagashima (Certified Spine Surgery Instructor of the Neurospinal Society of Japan)] performed annotations. They manually plotted a line between the hard palate and the inferior edge of the occipital bone (McGregor line) and a line between the anteroinferior and the posteroinferior corners of the C2 vertebral body (C2 line) using the Labelme tool (
https://github.com/labelmeai/labelme). The O–C2 angle was calculated as the angle between these lines. If the rater determined that any landmark (one or more) of the 4 anatomical features required to calculate the O–C2 angle was absent on the radiograph, the O–C2 angle was not measured, and the result of the annotation was recorded as the absence of the O–C2 angle. The annotation process is illustrated in
Supplementary Fig. 2.
2. Description of the Automated Measurement of O–C2 Angle
1) Training of the YOLO-based object detection model
We used the YOLO-v7 object detection model (available at the YOLO-v7 GitHub repository:
https://github.com/pHidayatullah/yolov7) to automatically detect 4 anatomical features: the hard palate, the inferior edge of the occipital bone, the anteroinferior corner of the C2 vertebral body, and the posteroinferior corner of the C2 vertebral body. Data augmentation, including inversion and contrast adjustment, was performed using the TorchVision library in PyTorch (
https://pytorch.org/vision), resulting in an eight-fold increase in dataset image size. The dataset was then split into training, internal validation, and testing sets in an 8:1:1 ratio, yielding 4,592 augmented images, which were divided into 3,673, 459, and 460 for training, internal validation, and testing, respectively (
Fig. 1). To avoid data leakage, the data split was conducted carefully and manually, to not include augmented images from one patient in both the train and test dataset. The training was conducted on a system with the following specifications: 13th Gen Intel Core i7-13700H (20 cores), NVIDIA GeForce RTX 4060 Laptop GPU, CUDA Version 12.3. The YOLO-v7 architecture was trained using the following parameters: image size of 640×640, learning rate of 0.01, and batch sizes of 4 and 300 epochs.
2) Object detection and O–C2 angle measurement based on bounding box coordinates
Object detection was performed on an external dataset using the trained model. In YOLO-based object detection, the results are received as bounding box coordinates and confidence score the model estimates. At inference, a confidence threshold of 0.25 was applied to filter out low-confidence predictions, and a nonmaximum suppression intersection over union (IoU) threshold of 0.45 was used to eliminate redundant overlapping bounding boxes. The detection time per radiograph (in seconds) was measured by calculating the total object detection time for 100 radiographs from the internal dataset and dividing it by 100. This process was performed using the same computer specifications as those used for training. The bounding boxes for the hard palate, inferior edge of the occipital bone, anteroinferior corner of the C2 vertebral body, and posteroinferior corner of the C2 vertebral body detected using the object detection model are displayed on the images (
Fig. 2A and
B).
Furthermore, we used the 4 bounding box coordinates to measure the O–C2 angle. Specifically, a line was drawn connecting the centers of the bounding boxes of the hard palate and inferior edge of occipital bone, creating the McGregor line. Another line was drawn by connecting the centers of the bounding boxes of the anteroinferior and posteroinferior corners of the C2 vertebral body, forming the C2 line (
Fig. 2C). The angle between these 2 lines was measured as the O–C2 angle. Similar to the process of creating the validation dataset, if our model failed to detect one or more of these features, the outcome was recorded as the absence of the O–C2 angle. The McGregor line, C2 line, and automatically measured O–C2 angle were displayed and visualized on the cervical spine radiographs using the OpenCV library (
https://github.com/opencv) (
Fig. 2C).
To objectively evaluate detection accuracy, we computed the Euclidean distance between each detected landmark coordinate and the mean coordinate of 3 independent human annotators, and further decomposed the error into x-axis and y-axis components. For the hard palate, error decomposition revealed a systematic x-axis offset due to the bounding box encompassing the entire hard palate structure, whereas the y-axis error remained small. Given that the slope of McGregor line is determined by Δy/Δx, and the horizontal distance between the hard palate and the inferior edge of the occipital bone is sufficiently large, the x-axis offset has a negligible effect on the calculated angle. Accordingly, the y-axis error was used as the localization metric for the hard palate. Successful detection was determined through agreement between SY (first author) and YNagashima (penultimate author) by reviewing the radiographs with bounding boxes. Note that the second evaluator was not involved in the validation dataset annotation. In addition to this visual confirmation, objective localization criteria were applied based on the Euclidean distance and its x-axis and y-axis components described above. For the hard palate, given that only the y-axis error reflects clinically meaningful localization accuracy, successful detection was defined as a y-axis error of less than 10 mm. For the remaining 3 landmarks, successful detection was defined as a Euclidean distance of less than 10 mm from the expert mean coordinate.
To facilitate practical deployment, we developed an end-toend pipeline that integrates image input, YOLO-based object detection, and automated O–C2 angle calculation. During inference, predictions with confidence scores below 0.25 were automatically discarded, while detections with confidence scores between 0.25 and 0.5 were flagged to alert users that manual verification is recommended. A pilot web application was implemented using Gradio (
https://www.gradio.app) as a practical demonstration. The source code is publicly available on GitHub (
https://github.com/shunxneuro/OC2_object-detection).
3. Statistical Analysis and Internal Dataset Validation
The data were presented using percentages (%), means, and standard deviations. Comparisons between the internal and external datasets were performed using univariate analysis. The Wilcoxon rank-sum test was applied to compare continuous variables, while Pearson chi-square and Fisher exact tests were used to compare proportions. Statistical significance was set at p<0.05 for all tests.
To evaluate the agreement of the 3 raters’ annotation results and interrater reliability, the detection results for the 4 anatomical features by each rater were expressed as follows. Detection of all 4 features (the hard palate, the inferior edge of the occipital bone, the anteroinferior corner of the C2 vertebral body, and the posteroinferior corner of the C2 vertebral body) was categorized as the presence of the O–C2 angle, whereas failure to detect any landmark (one or more) of these features was categorized as the absence of the O–C2 angle. This binary classification was applied to the annotation results and visualized as a heatmap. Based on these annotations, the authors discussed and determined the ground truth for the automatic measurement of the O–C2 angle. For interrater reliability analysis, the kappa coefficient for the presence of the O–C2 angle among the 3 raters was calculated using Light’s kappa model [
21]. The O–C2 angle was calculated for the images in which the O–C2 angle was present in the ground truth, and the mean O–C2 angle was calculated for each rater. The intraclass correlation coefficient (ICC) for the measured O–C2 angle was calculated among the 3 raters using a 2-way mixed model to assess consistency [
22].
4. Performance Metrics
To evaluate the performance of our model in object detection, the detection rates of the 4 anatomical features were calculated as percentages relative to the ground truth. In addition, the localization accuracy for each landmark was assessed by computing the Euclidean distance between the detected and expert mean coordinates, expressed in both pixels and millimeters, along with the decomposed x-axis and y-axis error components. Moreover, precision, recall, and F1 score were visualized as bar plots for each class against ground truth. Along with these metrics, the model’s performance in detecting O–C2 angles (i.e., accordance with human rater’s judgment of simultaneous detection of 4 objects or absence of one or more required landmarks in each radiograph) was further assessed by generating a confusion matrix, and the accuracy of O–C2 angle detection was calculated. Precision, recall, F1 score, and accuracy were calculated using the following equations.
Subsequently, to assess the error of the O–C2 angle, mean absolute error (MAE) and root mean squared error (RMSE) were calculated for cases where the model successfully detected all 4 landmarks and output an angle. ICC between the model’s estimation and the mean of 3 raters was calculated using a 2-way mixed model with absolute agreement. The proportion of errors within less than 3° and less than 5° in absolute value was calculated and visualized along with the distribution of errors. These proportions were computed among evaluable cases in which the model successfully output an angle. To assess the end-to-end automation rate, the proportions within ±3° and ±5° were additionally calculated using the total number of ground truth “present” cases as the denominator. Bland-Altman analysis was used to assess systematic bias with upper and lower limits of agreement, and the results were visualized through plotting. Ground truth was the mean value of the 3 raters for both assessment of coordinates and the O–C2 angle. To assess the robustness of the results against the ground truth definition, a sensitivity analysis was performed using 2 criteria: (1) the primary criterion requiring unanimous agreement among all 3 raters for the presence of the O–C2 angle (n=91), and (2) a liberal criterion in which the O–C2 angle was considered present if at least one rater judged all 4 landmarks to be detectable (n=95). The model’s detection rate and the proportion of errors within ±3° and ±5° were compared between the 2 criteria. Statistical analysis was performed using R ver. 4.3.2 (R Foundation for Statistical Computing, Austria) and RStudio 2023.12.0+369 (RStudio, Inc., USA).
5. Ethical Statement
This retrospective study was approved by the Ethics Review Committee of Nagoya University Graduate School of Medicine (2023-0003). As this research involved noninvasive observational methods, the Ethics Review Committee of the University waived the requirement for written informed consent. An opt-out method was instead employed following the Japanese ethical guidelines. This study adhered to the principles outlined in the Declaration of Helsinki, as revised in 2013. Clinical trial number: not applicable.
RESULTS
1. The Characteristics of the Internal and External Datasets
The dataset included demographic and clinical variables, such as age, sex, and type of surgery performed. The characteristics of the training dataset consisting of 271 patients and the validation dataset comprising 100 patients are summarized in
Table 1. Age was compared with a Wilcoxon rank‑sum test (n
1=271, n
2=100, p=2.4×10
-4). Sex was analyzed using a Pearson χ
2 test (df=1, n=371, p=0.14). The distribution of surgical procedures was evaluated with a Fisher exact test (n=371, p=9.8×10
-32). The prevalence of surgical implants on radiographs was 5.2% (30 of 574) in the internal dataset and 7.0% (7 of 100) in the external dataset, with no significant difference between the 2 groups (p=0.49). The 2 groups showed statistically significant differences in age and surgery, whereas there were no significant differences in sex (p=0.14) or the prevalence of surgical implants (p=0.49).
2. The Analysis of Interrater Reliability for Detecting All 4 Anatomical Features
The annotation results from the 3 raters in the external dataset regarding the presence of the O–C2 angle are visualized as a heatmap in
Fig. 3.
The kappa coefficient for this binary result between the 3 raters was 0.79, indicating substantial agreement [
21]. Ninety-six radiographs, where the detection results from the 3 raters were consistent (91 radiographs with agreement on the detection of all 4 features and 5 radiographs with agreement on the nondetection of at least one of the 4 features), were used as the ground truth for subsequent analyses. Consequently, the No. 13, 16, 35, and 72 radiographs, where the detection results varied among the raters, were excluded from the ground truth.
The mean O–C2 angle measurements obtained by the 3 raters for the 91 radiographs in the external dataset were 20.4°±8.6°, 21.3°±8.8°, and 22.5°±9.2°, respectively. The raters’ measurements were visualized as scatter plots in
Supplementary Fig. 3. The ICC for the measurement values among the 3 raters was 0.97 (95% confidence interval [CI], 0.96–0.98), indicating excellent consistency among the raters (an ICC >0.90 is considered excellent agreement) [
22]. Based on these results, the average of the 3 raters’ measurements was used as the ground truth for the O–C2 angle.
3. The Result of Object Detection
We performed object detection on all 100 radiographs using the same specifications as the training process. The time required for object detection using the YOLO algorithm was 14 seconds for 100 images, corresponding to approximately 0.14 seconds per image. In the ground truth dataset, the detection rates for each of the 4 anatomical features were as follows: 100% for the hard palate (92 of 92), 94.8% for the inferior edge of the occipital bone (91 of 96), 98.9% for the anteroinferior corner of the C2 vertebral body (94 of 95), and 97.9% for the posteroinferior corner of the C2 vertebral body (93 of 95). The localization accuracy, assessed by Euclidean distance and its
x-axis and
y-axis components in both millimeters and pixels, is presented alongside the detection rates in
Table 2. For the hard palate, the Euclidean distance was 11.08±4.30 mm, reflecting the systematic
x-axis offset, whereas the
y-axis error was 2.06±1.65 mm. The remaining 3 landmarks demonstrated high localization accuracy, with Euclidean distances of 2.81±2.10 mm for the inferior edge of the occipital bone, 0.81±0.54 mm for the anteroinferior corner of C2, and 0.72±0.65 mm for the posteroinferior corner of C2.
The model achieved perfect performance for the hard palate with precision, recall, and F1 score all equal to 1.00. For the inferior edge of the occipital bone, precision was 1.00, recall was 0.95, and the F1 score was 0.97. For the anteroinferior corner of C2, precision was 1.00, recall was 0.99, and the F1 score was 0.99. For the posteroinferior corner of C2, precision was 1.00, recall was 0.98, and the F1 score was 0.99. These results are summarized in
Fig. 4.
We then evaluated the agreement between the ground truth and our model’s detection for all 4 anatomical features. Among the 91 radiographs in which the ground truth indicated the presence of the O–C2 angle, our model detected it in 86 cases. Conversely, for the 5 radiographs where the ground truth indicated the absence of the O–C2 angle, our model correctly predicted nondetection in all cases. These results are summarized in a confusion matrix in
Fig. 5. The overall accuracy of all 4 anatomical features for measuring O–C2 angle detection was calculated to be 94.7%.
4. The Assessment of O–C2 Angle Calculation
The mean O–C2 angle measured by our model was 21.1°±8.7°. For the O–C2 angle, the MAE was 2.35° and RMSE was 2.98°. The ICC calculated using a 2-way mixed model with absolute agreement and the mean of 3 raters was 0.97 (95% CI, 0.95–0.98). The proportion of agreements within ±3° was 68.6% and within ±5° was 91.9% among the 86 evaluable cases in which the model successfully detected all 4 landmarks and output an angle. We then evaluated the metric using the total eligible cohort (n=91) as the denominator, with 64.8% (59 of 91; 95% CI, 54.6%–73.9%) yielding an angle within ±3° and 86.8% (79 of 91; 95% CI, 78.4%–92.3%) within ±5° of the expert mean. Bland- Altman analysis revealed an error of 0.57° (95% CI, -0.06° to 1.12°) with the upper limit of agreement was 6.33° (95% CI, 5.25°–7.41°) and the lower limit of agreement was -5.19° (95% CI, -6.27° to -4.11°). The distribution of errors with 3° and 5° auxiliary lines and result of the Bland-Altman analysis are presented in
Fig. 6. To assess the robustness of these results against the ground truth definition, a sensitivity analysis was performed using a liberal criterion in which the O–C2 angle was considered present if at least one rater judged all 4 landmarks to be detectable (n=95). This analysis yielded comparable results: 88 of 95 cases received an output, with MAE of 2.29° and 69.3% within ±3° and 92.0% within ±5°.
DISCUSSION
In this study, we developed and externally validated an object detection model that automatically detects anatomical structures that are necessary to calculate the O–C2 angle. Vertebral corners, the hard palate, and the inferior edge of the occipital bone, for which segmentation or landmark localization techniques have been dominant in this field, were successfully detected with high sensitivity and specificity, and their center coordinates were easily utilized to calculate the O–C2 angle with a MAE of 2.35°. Inference was completed in approximately 0.14 seconds per image, supporting rapid measurement in routine workflows. In particular, for the inferior edge of the occipital bone, segmentation may struggle to define a specific area to segment due to the vague superior boundary and bone variability may cause difficulty in deciding a single point with heatmap-based landmark localization technique; our results demonstrated that object detection may be sufficient when the edge itself is the object to detect. Furthermore, robust validation was conducted on an independent external dataset with annotations provided by 3 specialized neurosurgeon raters to ensure a robust ground truth.
The O–C2 angle is a critical indicator of cervical spine alignment and a crucial parameter in craniocervical junction surgeries [
23,
24]. Postoperative complications associated with O–C2 fixation, such as dyspnea and dysphagia, are primarily due to mechanical narrowing of the oropharyngeal cavity. These complications are strongly associated with the O–C2 alignment [
5]. Notably, several studies have documented cases with a postoperative reduction in the O–C2 angle of ≥10° at an increased risk of experiencing these complications [
4-
6,
24]. Furthermore, once fixation is performed, revision surgery to correct the angle poses a significant burden to the patients [
6]. This indicates that it is crucial to achieve accurate alignment during the initial fixation. Consequently, the development of an accurate and efficient automated O–C2 angle measurement system has substantial clinical relevance.
Recent studies have introduced several AI-assisted systems for measuring spinal alignment, where segmentation techniques have played a primary role. In addition, convolutional neural network (CNN)-backbone-based landmark localization has also been considered an effective approach. Nakarai et al. [
9] reported that they utilized a landmark localization approach and successfully detected key corners including the occipital bone edge and the posterior edge of the hard palate. Other applications in the spine field have also been reported, including deep learning-based measurements of interspinous motion on dynamic cervical radiographs. In contrast to these studies, which often require complex model architecture and loss function designs, YOLO-based object detection offers an easier approach that can achieve comparable detection accuracy. Many prior studies involve segmentation or multistage landmark localization, which can increase implementation complexity and annotation burden. In contrast, the present approach uses single-stage object detection to localize predefined parts of clinically relevant structures, producing outputs that are readily visualized for quality checking. The YOLO-based object detection system can estimate and detect multiple objects simultaneously with remarkable speed. Wang et al. [
25] achieved inference times of approximately 0.07 seconds per image using a YOLO-UNet ensemble model in segmentation of cervical vertebra, compared to several minutes required for manual annotation by human experts. This substantial reduction in processing time makes YOLO-based approaches particularly suitable for clinical applications requiring rapid assessment, especially in intraoperative settings where real-time angle measurement and adjustment are critical for surgical decision-making.
An interesting finding of our study is that by using object detection, we successfully detected the inferior edge of the occipital bone as a distinct “object,” rather than relying on spatial relationships with surrounding structures or recognition of anatomical boundaries, as typically captured by landmark localization or segmentation approaches. Notably, despite numerous candidate bone edges present in the images, our model was able to detect the target structure with high specificity, suggesting the utility of simply applying object detection in this context. However, we must also acknowledge the factors that lowered sensitivity. In our study, some anatomical structures were not detectable by our model. The 5 images in which the ground truth indicated the presence of the anatomical landmarks required to calculate the O–C2 angle but the model failed to detect them are presented in
Fig. 7. These failure cases can be categorized into 3 distinct patterns. The first and most common pattern was isolated failure to detect the inferior edge of the occipital bone, observed in 4 of the 5 cases (
Fig. 7A–
D). The causes included overlap between the occipital bone and an occipital fixation implant (
Fig. 7A), severe overlap of bony structures (
Fig. 7B), severe ossification at the craniocervical junction (
Fig. 7C), and overlap of bony structures (
Fig. 7D). The second pattern involved simultaneous failure of multiple landmarks due to basilar invagination (
Fig. 7B). This was the only case of wrong-level C2 corner selection observed in the entire external validation dataset, suggesting that basilar invagination represents a specific condition under which the “most superior corners” strategy may be vulnerable. The third pattern was misidentification of a C2 corner due to left-right inversion of the image (
Fig. 7E), indicating that standardization of image orientation prior to inference is important for reliable detection.
This study has several limitations. First, most cervical spine radiographs used in our study did not include surgical implants, which substantially limit clinical applicability. Although this study was a proof-of-concept study for applying object detection in this field, we tested our methods using only refined lateral cervical radiographs without surgical implants or fluoroscopic images. In clinical practice, occipital fixation constructs with rods and screws placed directly on the occipital bone are likely to obscure the inferior edge of the occipital bone, as suggested by the detection failure in
Fig. 7A. Further, to test the feasibility under postoperative settings, we conducted a pilot evaluation using 18 instrumented postoperative radiographs in which the O–C2 angle could be measured. The overall success rate across all instrumented cases was 72.2% (13 of 18), with representative failure cases presented in
Supplementary Fig. 4. We stratified results according to whether the instrumentation interfered with any landmark required for O–C2 angle measurement. In cases where instrumentation did not obscure the relevant landmarks, the model achieved a success rate of 92.3% (12 of 13). In contrast, the success rate was 20.0% (1 of 5) in cases involving upper cervical or occipitocervical fixation. These findings indicate that occipital bone detection in the presence of upper cervical or occipitocervical instrumentation remains a major limitation of the current system and represents an important target for future improvement. Furthermore, future studies should address the variability in lateral cervical radiographs, including variations in
x-ray intensity, projection angle, and image noise. Deep learning-based image reconstruction would solve this problem. Regarding the variability of the validation dataset, it consisted of cervical spine radiographs obtained only in the neutral position. Notably, actual clinical situations requiring O–C2 angle measurement occur during OCF surgery, where the neck is fixed in a neutral position. The second major limitation was the use of center coordinates of bounding boxes. Given that landmark localization was utilized to define a specific point to calculate the angle, there may be alternative methods to select more optimal coordinates through the application of other computer vision approaches. These updates and refinements to deep learning models may potentially yield even higher accuracy; however, the methodology used in this study achieved very small errors for each coordinate and clinically acceptable performance in calculating the O–C2 angle compared with the robust ground truth. Third, our study did not demonstrate the model’s ability to automatically identify unsuccessful detections using metrics such as mean average precision. This is mainly because successful detection was not determined by objective metrics such as the IoU of bounding boxes. In particular, the inferior edge of the occipital bone represents only a portion of the larger bone structure, and the precise boundary of where the “inferior edge” begins may vary among raters. As a result, it was not possible to establish a consistent ground truth label for this landmark.
CONCLUSION
In this study, we developed and validated a YOLO-based object detection model that automatically measures the O–C2 angle on lateral cervical radiographs with clinically acceptable accuracy. Our findings demonstrate that object detection can effectively identify anatomical landmarks, including the inferior edge of the occipital bone, as distinct objects without requiring segmentation or landmark localization techniques. This approach offers a rapid and straightforward method for automated spinal alignment assessment, with potential applications in intraoperative settings during OCF surgery. In order to bring this approach to clinical application, future studies are warranted to address image variability, including the presence of surgical implants and fluoroscopic imaging.
Supplementary Materials
Supplementary Fig. 1.
Description of the annotation for training dataset using LabelImg. Using LabelImg software, a neurosurgeon, SY, performed the annotations for 4 labels: hard palate, occipital bone, the anteroinferior corner (A), and the posteroinferior corner (P) of the cervical vertebral bodies. For labels A and P, annotations were performed from C2 to the most inferior vertebra visible in the image.
ns-2551878-939-Supplementary-Fig-1.pdf
Supplementary Fig. 2.
Description of the annotation for the external dataset to calculate the O–C2 angle using Labelme. Three neurosurgeons specializing in spinal surgery (TA, MM, and YNagashima) used Labelme software to measure the O–C2 angle. For each x-ray image, the McGregor line was drawn as a straight line connecting the hard palate and the lower edges of occipital bone, while the C2 line was drawn as a straight line connecting the anteroinferior corner and the posteroinferior corner of the C2 vertebra.
ns-2551878-939-Supplementary-Fig-2.pdf
Supplementary Fig. 3.
Scatter plots to visualize the raters’ measurements for each pair of raters in the external validation dataset of 100 radiographs.
ns-2551878-939-Supplementary-Fig-3.pdf
Supplementary Fig. 4.
Pilot evaluation of the automated landmark detection system for O–C2 angle measurement in postoperative instrumented cases with 3 representative failure cases. As a pilot test, 18 postoperative cases in which the O–C2 angle could be measured were retrospectively collected and stratified according to whether the instrumentation interfered with the 4 landmarks required for O–C2 angle measurement. In noninterfering cases (n=13), procedures involved subaxial instrumentation (anterior fixation cages, artificial disc implants, posterior fixation screws, or laminoplasty implants at any C3–7 level) that did not obscure the landmarks; the model successfully detected all 4 landmarks in 12 of 13 cases (success rate: 92.3%). In interfering cases (n=5), procedures involved upper cervical fixation (C1–2 fixation, C2–4 fixation, or occipitocervical fixation); the model succeeded in detecting all 4 landmarks in only 1 of 5 cases (success rate: 20.0%). Overall, the automated system achieved a success rate of 72.2% (13 of 18) across all instrumented cases. Representative cases are shown: a C1–2 fusion case (A) and an occipitoaxial fusion case (B); in both cases, the model failed to detect the inferior edge of the occipital bone, resulting in incomplete landmark detection for O–C2 angle measurement. Pane C shows a case of upper cervical fixation in which the model successfully detected all 4 landmarks. However, even in this case—the only case with successful detection among the 5 craniovertebral junction instrumentation cases—the bounding box for the occipital bone appeared to be displaced from its correct position.
ns-2551878-939-Supplementary-Fig-4.pdf
NOTES
-
Conflict of Interest
The authors have nothing to disclose.
-
Funding/Support
This research was supported by the Industry-University Collaborative Project for Human Resource Development to Accelerate AI R&D in Health and Medical Fields (Ministry of Education, Culture, Sports, Science, and Technology, Japan) and Aichi Health Promotion Foundation. This work was supported by JST BOOST, Japan Grant Number JPMJBS2422.
-
Acknowledgments
The author SY would like to take this opportunity to thank the “THERS Nagoya University, Program for Fostering Next Generation AI Professionals.”
-
Data Availability
Individual participant data (deidentified) that underlie the results reported in this article will be available after publication to researchers who provide a methodologically sound proposal. The source code is publicly available on GitHub (https://github.com/shunxneuro/OC2_object-detection).
-
Author Contribution
Conceptualization: YF, YNagashima, YNishimura; Data curation: SY, YF, YNagashima, TA, MM, TG; Formal analysis: SY, YF, YNagashima, KM; Funding acquisition: SY, YF; Methodology: SY, YF, YNagashima, KM; Project administration: KM, NH, RS; Visualization: YNagashima, TA, MM, TG; Writing – original draft: SY, YF; Writing – review & editing: SY, YF, YNagashima, KM, TA, NH, YNishimura, RS.
Fig. 1.The description of the training of our model in the internal dataset and object detection and O–C2 angle measurement in the external dataset.
Fig. 2.An example of the description of object detection and visualization of the O–C2 angle. (A) An example of input image. (B) Object detection was performed to identify the hard palate, inferior edge of the occipital bone, and the anteroinferior and posteroinferior corners of the C2 vertebral body, with the results visualized as bounding boxes overlaid on the original image. (C) McGregor line and the C2 line were drawn, and the automatically measured O–C2 angle was visualized on the image using the OpenCV library.
Fig. 3.The heatmap illustrates whether each rater detected all 4 anatomical features across 100 radiographs. Blue indicates that a rater successfully detected all 4 features in an image, while white (no color) signifies that the rater could not detect at least one structure. Each column represents a radiograph, and each row corresponds to a rater.
Fig. 4.Bar plots illustrating the model’s precision, recall, and F1 score for the detection of hard palate, inferior edge of occipital bone, anteroinferior of C2 and posteroinferior corner of C2.
Fig. 5.Confusion matrix analysis of AI-based detection in radiographs. The confusion matrix shows whether our model’s detection of all 4 anatomical structures matched the ground truth across 96 radiographs. A value of 0 indicates the absence of the O–C2 angle, while a value of 1 indicates its presence. The results are visualized using blue shades, with darker blue representing a higher number of cases and lighter blue indicating a lower number of cases.
Fig. 6.Evaluation of errors in O–C2 angle detection. (A) Distribution of errors with auxiliary reference lines indicating thresholds of 3° and 5° for agreement. (B) Bland-Altman plot demonstrating the distribution of errors and systematic bias, with upper and lower limits of agreement. In this chart, the mean values of the average measurements of the 3 raters and AI measurements, divided by 2, are plotted on the x-axis as “Means,” while the corresponding errors are represented on the y-axis as “Differences.” The chart also illustrates the mean of errors, upper limit of agreement, and lower limit of agreement, along with their respective 95% confidence intervals.
Fig. 7.Five radiographs in which the ground truth indicated the presence of the O–C2 angle but the model failed to detect at least one landmark required for its measurement. (A) No. 33: The inferior edge of the occipital bone was not detected due to overlap between the occipital bone and an occipital fixation implant (1 landmark missing). (B) No. 45: This patient had basilar invagination, resulting in severe overlap of bony structures at the craniocervical junction. The inferior edge of the occipital bone was not detected, and the anteroinferior and posteroinferior corners of C2 were misidentified at the C3 level (3 landmarks missing). (C) No. 48: The inferior edge of the occipital bone was not detected due to severe ossification at the craniocervical junction (1 landmark missing). (D) No. 69: The inferior edge of the occipital bone was not detected due to overlap of bony structures with poor overall image quality (1 landmark missing). (E) No. 74: The posteroinferior corner of C2 was misidentification, likely due to left-right inversion of the image (1 landmark missing).
Table 1.Characteristics of the internal and external datasets
Table 1.
|
Characteristic |
Internal dataset (n = 271) |
External dataset (n = 100) |
p-value |
|
Age (yr) |
67 ± 14 |
60 ± 15 |
< 0.001 |
|
Sex |
|
|
0.14 |
|
Female |
85 (31) |
40 (40) |
|
|
Male |
186 (69) |
60 (60) |
|
|
Surgery |
|
|
< 0.001 |
|
ACF |
161 (59) |
59 (59) |
|
|
Laminoplasty |
89 (33) |
0 (0) |
|
|
OCF |
0 (0) |
6 (6) |
|
|
PCF |
18 (6.6) |
0 (0) |
|
|
Other |
3 (1.1) |
35 (35) |
|
|
Surgical implant |
30/574 (5.2) |
7/100 (7.0) |
0.49 |
Table 2.Detection rate and localization error for each landmark
Table 2.
|
Landmark |
Detection rate |
Euclidean distance
|
|dx|
|
|dy|
|
|
mm |
pixel |
mm |
pixel |
mm |
pixel |
|
Hard palate |
100% (92/92) |
11.08 ± 4.30 |
35.5 ± 13.7 |
10.78 ± 4.26 |
34.5 ± 13.6 |
2.06 ± 1.65 |
6.6 ± 5.3 |
|
Occipital bone |
94.8% (91/96) |
2.81 ± 2.10 |
9.0 ± 6.7 |
2.40 ± 2.24 |
7.7 ± 7.2 |
1.09 ± 0.62 |
3.5 ± 2.0 |
|
C2 (anteroinferior) |
98.9% (94/95) |
0.81 ± 0.54 |
2.6 ± 1.7 |
0.42 ± 0.46 |
1.3 ± 1.5 |
0.63 ± 0.42 |
2.0 ± 1.3 |
|
C2 (posteroinferior) |
97.9% (93/95) |
0.72 ± 0.65 |
2.3 ± 2.1 |
0.38 ± 0.45 |
1.2 ± 1.4 |
0.56 ± 0.54 |
1.8 ± 1.7 |
REFERENCES
- 1. Tatter C, El-Hajj VG, Fletcher-Sandersjöö A, et al. Radiographic measurements for the prediction of dysphagia after occipitocervical fusion: a systematic review. Acta Neurochir (Wien) 2023;165:1161-70.
- 2. Pan J, Huang D, Hao D, et al. Occipitocervical fusion: fix to C2 or C3? Clin Neurol Neurosurg 2014;127:134-9.
- 3. Ding X, Abumi K, Ito M, et al. A retrospective study of congenital osseous anomalies at the craniocervical junction treated by occipitocervical plate-rod systems. Eur Spine J 2012;21:1580-9.
- 4. Miyata M, Neo M, Fujibayashi S, et al. O–C2 angle as a predictor of dyspnea and/or dysphagia after occipitocervical fusion. Spine (Phila Pa 1976) 2009;34:184-8.
- 5. Izeki M, Neo M, Takemoto M, et al. The O–C2 angle established at occipito-cervical fusion dictates the patient’s destiny in terms of postoperative dyspnea and/or dysphagia. Eur Spine J 2014;23:328-36.
- 6. Wang X, Chou D, Jian F. Influence of postoperative O–C2 angle on the development of dysphagia after occipitocervical fusion surgery: results from a retrospective analysis and prospective validation. World Neurosurg 2018;116:e595-601.
- 7. Nagashima S, Nagae M, Arai Y, et al. A new method of measuring the occipitocervical angle that could be applied as an intraoperative indicator during occipitocervical fusion. Clin Spine Surg 2017;30:E981-7.
- 8. Shoda N, Takeshita K, Seichi A, et al. Measurement of occipitocervical angle. Spine (Phila Pa 1976) 2004;29:E204-8.
- 9. Nakarai H, Cina A, Jutzeler C, et al. Automatic calculation of cervical spine parameters using deep learning: development and validation on an external dataset. Global Spine J 2025;15:710-21.
- 10. Haselhuhn JJ, Soriano PB, Grover P, et al. Spine surgeon versus AI algorithm full-length radiographic measurements: a validation study of complex adult spinal deformity patients. Spine Deform 2024;12:755-61.
- 11. Zhang J, Li H, Lv L, et al. Computer-aided Cobb measurement based on automatic detection of vertebral slopes using deep neural network. Int J Biomed Imaging 2017;2017:9083916.
- 12. Tu Y, Wang N, Tong F, et al. Automatic measurement algorithm of scoliosis Cobb angle based on deep learning. J Phys Conf Ser 2019;1187:042100.
- 13. van der Graaf JW, van Hooff ML, van Ginneken B, et al. Development and validation of AI-based automatic measurement of coronal Cobb angles in degenerative scoliosis using sagittal lumbar MRI. Eur Radiol 2024;34:5748-57.
- 14. Ishikawa Y, Kokabu T, Yamada K, et al. Prediction of Cobb angle using deep learning algorithm with three-dimensional depth sensor considering the influence of garment in idiopathic scoliosis. J Clin Med 2023;12:499.
- 15. Maeda Y, Nagura T, Nakamura M, et al. Automatic measurement of the Cobb angle for adolescent idiopathic scoliosis using convolutional neural network. Sci Rep 2023;13:14576.
- 16. Sun Y, Xing Y, Zhao Z, et al. Comparison of manual versus automated measurement of Cobb angle in idiopathic scoliosis based on a deep learning keypoint detection technology. Eur Spine J 2022;31:1969-78.
- 17. Pan Y, Chen Q, Chen T, et al. Evaluation of a computer-aided method for measuring the Cobb angle on chest X-rays. Eur Spine J 2019;28:3035-43.
- 18. Berlin C, Adomeit S, Grover P, et al. Novel AI-based algorithm for the automated computation of coronal parameters in adolescent idiopathic scoliosis patients: a validation study on 100 preoperative full spine x-rays. Global Spine J 2024;14:1728-37.
- 19. Ha AY, Do BH, Bartret AL, et al. Automating scoliosis measurements in radiographic studies with machine learning: comparing artificial intelligence and clinical reports. J Digit Imaging 2022;35:524-33.
- 20. Xie L, Zhang Q, He D, et al. Automatically measuring the Cobb angle and screening for scoliosis on chest radiograph with a novel artificial intelligence method. Am J Transl Res 2022;14:7880-8.
- 21. Kundel HL, Polansky M. Measurement of observer agreement. Radiology 2003;228:303-8.
- 22. Koo TK, Li MY. A guideline of selecting and reporting intraclass correlation coefficients for reliability research. J Chiropr Med 2016;15:155-63.
- 23. Tang C, Li GZ, Liao YH, et al. Importance of the occipitoaxial angle and posterior occipitocervical angle in occipitocervical fusion. Orthop Surg 2019;11:1054-63.
- 24. Nagashima Y, Nishimura Y, Awaya T, et al. Radiographic prediction of the occipito–C2 angle variation with changes in distance between the mandible and cervical vertebrae: a preliminary study. Neurol Med Chir (Tokyo) 2023;63:200-5.
- 25. Wang H, Lu J, Yang S, et al. Cervical vertebral body segmentation in X-ray and magnetic resonance imaging based on YOLO-UNet: automatic segmentation approach and available tool. Digit Health 2025;11:20552076251347695.