Classifying femur fractures usingvision transformers
2023 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesis
Abstract [en]
Atypical femur fractures (AFFs) are a rare complication associated with long-term usageof bisphosphonates. AFFs have certain radiographic features that allow them to bedistinguished from normal femur fractures (NFFs). However, these features can be verysubtle and thus easily overlooked.
The objective of this thesis is to implement two-dimensional convolutions neural networks(2D CNNs) and vision transformers (ViTs) for classification of AFFs and NFFsfrom radiographs, and determine whether ViTs perform significantly better at classificationthan 2D CNNs. Eight architectures pre-trained on ImageNet are implemented, includingResNet50 and VGG19 belonging to the CNN family, and ViT-B/16, ViT-L/16, DeiTB/16, Swin-B/4, CaiT-S/24 and PVT v2 belonging to the ViT family. To better understandthe decision-making process, Gradient-weighted Class Activation Mapping (Grad-CAM)Is used to highlight the areas of the radiographs that contribute most to the networks’ predictions.
The used dataset consists of 1,161 radiographs from 72 hospitals in Sweden. 20.03% ofthe radiographs show AFFs, and the remaining 79.97% of the radiographs show NFFs. Thedata is partitioned into training and test sets using an 80/20 ratio. The training set it furtherdivided into five folds and k-fold cross validation is performed. For the vast majority ofpatients present in the dataset, there are more than one radiograph available. To avoid data leakage, the dataset is therefore partitioned on patient-level. Class weights are usedto manage the imbalanced class distribution.
Accuracy, precision, sensitivity, specificity, F1-score, ROC-AUC, PRC-AUC andMatthew’s correlation coefficient (MCC) are used to evaluate the performances of eachmodel on both image and patient-level. To determine whether there are significant differencesin performances, McNemar’s test is used. Furthermore, Monte Carlo dropout is usedto estimate the uncertainties in the networks’ predictions. The estimated uncertainties arealso used as weights when computing patient-level predictions.
In terms of MCC, CaiT-S/24 performs best on image-level (0.759 ± 0.049), ViT-B/16performs best on patient-level (0.925 ± 0.015) and ViT-L/16 performs best on patient-levelwhen weighing the individual radiographs by their corresponding uncertainties. All architecturesperform better on patient-level than on image-level. Weighing the individualradiographs by their corresponding uncertainties negatively impact MCC for all architectureswith the exception of ViT-L/16. The results are variable across the different architectures,and it is not possible to conclude that ViTs perform significantly better than 2DCNNs in classifying AFFs based on the obtained results.
Place, publisher, year, edition, pages
2023. , p. 59
Keywords [en]
machine learning, statistics, transformers, vision transformers
National Category
Probability Theory and Statistics
Identifiers
URN: urn:nbn:se:liu:diva-207772ISRN: LIU-IDA/STAT-A--23/018--SEOAI: oai:DiVA.org:liu-207772DiVA, id: diva2:1900038
Supervisors
Examiners
2024-09-302024-09-222024-09-30Bibliographically approved