Machine Learning for Bone Fracture Detection
Machine Learning for Bone Fracture Detection
DOI: 10.1002/ima.22849
RESEARCH ARTICLE
KEYWORDS
bone fracture, classification, feature extraction, image processing, machine learning, X-ray
images
Int J Imaging Syst Technol. 2023;33:853–865. [Link]/journal/ima © 2023 Wiley Periodicals LLC. 853
10981098, 2023, 3, Downloaded from [Link] by Orta Dogu Teknik Universitesi, Wiley Online Library on [08/10/2025]. See the Terms and Conditions ([Link] on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
854 SAHIN
the field of medicine in recent years and many studies criterion. Basha et al. performed a fracture detection
have been presented in the literature.7–9 study on long bones using X-ray images.16 In their study,
In real life, radiologists and physicians usually transmit 60 of the 80 images containing fractures were reserved for
x-rays to determine if a fracture is present and what type training and 20 for testing. It has been reported that the
of fracture it is specifically. For the purpose of detecting NN (RBFNN) classifier using radial-based function has
fractures, manual inspection or a traditional X-ray system passed the performances of Hough transform-based frac-
should be used. The computer vision system can help scan ture detection (HTBFD) and kNN classifier with 88% per-
X-ray images for suspected cases and alert doctors. Accord- formance over the overall accuracy performance
ing to related studies, fractures in CT or X-ray images can criterion. Guan et al. tried to determine the location of
be classified with high precision using new algorithms that arm fractures from X-ray images.17 In their previous
have entered the literature.10–12 Depending on the type of work,18 they modified the CNN architecture and applied
bone, there are different studies in the literature. It is pos- it to X-ray images containing arm fractures. The perfor-
sible to divide these studies into two categories: studies mance of the proposed system was measured at 62.04%,
using machine learning and deep learning methods. Stud- based on the average precision performance criterion.
ies using machine learning methods are based on prepro- In this study, image preprocessing steps are applied
cessing and classification steps. In the preprocessing step, for fracture detection, and the images that have feature
various image processing techniques are used to remove extraction are classified with different classifiers. It is of
noise from images. In the classification step, features must great importance in terms of performing feature extrac-
be extracted from the images to support the classifier to be tion and doing this with a large number of machine
used. Support Vector Machine (SVM), Naïve Bayes (NB), learning algorithms. In this paper, 12 machine learning
artificial neural networks (ANN or NN), decision trees algorithms, which are logistic regression, linear discrimi-
(DT), and random forest (RF) are widely used classifiers nant analysis (LDA), multi-layer perceptron (MLP) classi-
for fracture detection and classification. fier, multinomial naive bayes, gaussian naive bayes,
Olczak et al. performed a study on fracture detection gradient boosting classifier, quadratic discriminant analy-
on radiographs of various body parts.4 The images sis, ada boost classifier, light gradient boosting machine
include ankle, wrist, and hand regions. According to classifier (LGBM), eXtreme gradient boosting (XGB) clas-
these experiments, the VGG-16 ready architecture sifier, RF classifier, and extra trees classifier, are used on
achieved 99%, 95% and 90% performance for the classifi- an experimental dataset. With the help of the grid search
cation and detection problems, respectively, over the method, hyperparameters are found for machine learning
overall accuracy performance criterion. Avinash et al. classifiers. In addition, the reliability of the results
performed a fracture-type determination study on X-ray obtained by performing the k-fold cross-validation pro-
images of the humerus, ulna, femur, tibia, and fibula.13 cess on the dataset is presented.
In the preprocessing phase, the Canny edge detection The following is an overview of the paper's structure.
and Harris corner detector algorithms are applied to the Section 2 briefly describes the algorithms and techniques
images. In the feature extraction stage, the bag of words commonly used in each, along with general steps such as
(BoW) model used in the text classification problem was image acquisition, data preprocessing, image segmenta-
chosen. SVM was used as a classifier in the study, and tion, extraction of images, and bone fracture classification
the performance of the system was calculated as 78% extraction of images, and bone fracture classification
according to the results of the 10-fold cross-validation (automated bone fracture detection and classification
method. Bayram and Çakıroglu performed a study to using machine learning). Section 3 includes experimental
classify diaphyseal femur fractures using X-ray images.14 work on machine learning classifiers, results, and evalua-
It identifies nine types of fractures in the classification tion metrics like accuracy, recall, precision, and F1-score.
process. The dataset includes 196 femoral images. It has Discussion is given in Section 4. Finally, conclusions and
been shown that the SVM classifier is superior to other suggestions for future investigation are presented in
classifiers with a score of 89.87% in the performance eval- Section 5. An overview of the study is given in Figure 1.
uations made on the general accuracy performance crite-
rion using 10-fold cross-validation tests. Tripathi et al.
performed a study for fracture detection on X-ray images 2 | MATERIAL A ND METHODS
of the femur.15 In the preprocessing stage, firstly, noise
removal was applied to the images with the mean filter In this study, the bone fracture detection system is imple-
and median filter methods. In the study in which the mented in four stages, which are image acquisition,
SVM classifier was used, the performance of the system image preprocessing, feature extraction, and classification
was measured at 87.5% over the general accuracy stages, respectively. Typical computer-aided diagnostic
10981098, 2023, 3, Downloaded from [Link] by Orta Dogu Teknik Universitesi, Wiley Online Library on [08/10/2025]. See the Terms and Conditions ([Link] on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
SAHIN 855
F I G U R E 2 X-ray images
(A) and (B) bone fractured
(C) Normal cases
systems based on medical images include image proces- The purpose of making these changes is to remove vari-
sing tools for noise removal, enhancement, and feature ous disturbances such as noise from the image or to make
extraction. X-ray images include normal and fractured the image better for the next stages such as segmentation
bone images. and feature extraction. In this article, image processing is
performed on Jupyter Notebook using python.
2.1 | Dataset
2.2.1 | Image acquisition
The data set used in this study was obtained as a dataset of
X-ray images from Al-huda Digital X-ray Laboratory. It The images in the data set are in .jpg format and the
contains 105 normal and 71 fractured long bone images. images are in three-channel form. Each image read is
There are different types of bone fractures: oblique, greeb- converted to grayscale image format using color space
stick, comminuted, spiral, and transverse. This variety of conversion. Since the X-ray images used are single-chan-
data is available in the literature.19 An example of X-ray nel, there is no loss of quality in the images.
images of bone is given in Figure 2. The data set includes
images that is be used 70% for training and 30% for testing.
2.2.2 | Thresholding
boundaries of the resulting binary image. Thresholding is 2.2.5 | Harris corner detector
probably the most commonly used technique in image
segmentation. Thresholding is applied to X-ray images in Harris corner detector algorithm is generally used to detect
grayscale. With this process, pixels with gray values in corner points on the output obtained after edge detection.26
certain ranges are changed to white (255 or 1) and all In this study, this method, which is used in the process of
other pixels become black (0). The lower and upper distinguishing bone fractures, is applied to the images
values determined for the operation performed in this obtained from the Sobel edge detection process. The steps
study are between 120 and 255. Here, pixels with values of the image pre-processing are shown in Figure 3.
between 120 and 255 are determined to be white and
other pixels to be black. The image formed after the
thresholding process is transmitted to other processing 2.3 | Feature extraction
steps at gray level.
Some features can be extracted from the digital images
obtained after the image preprocessing step. Having more
2.2.3 | Edge detection of these features means more features for classification,
which can increase the classification accuracy. The fea-
Edge detection is considered the most important opera- tures obtained in feature extraction can be derived from
tion in image processing. In most color images, edge each other. Some of the features used are divided by the
detection is done by converting the images to grayscale. number of vertical pixels, and a kind of normalization is
Edges in grayscale images can be defined as borders performed with the aim of making the features indepen-
where the brightness levels of two regions are clearly dif- dent of the resolution of the image from which they are
ferent from each other. Edges are the most important extracted. The properties obtained in this study to detect
information in the image.20 Edge regions are also defined bone fractures are given below. The steps of feature
as the places where sudden changes in pixel values occur extraction are shown in Figure 4.
in images.
The Canny edge detection algorithm is one of success-
ful the methods that finds changes in images and exam- 2.3.1 | Perimeter (perimeter)
ines whether they are edges.21 This method is a method
developed by John F. Canny to find sharply defined edges The perimeter feature is calculated as the number of
on the image.22 In the study, this method is used for white pixels, that is, determined edges, in the image
image processing in the Opencv platform. The phase of obtained from the Canny edge detection algorithm. The
highlighting the outer and inner edges of the bones in obtained values are normalized by dividing by the num-
the image is performed.23 The image obtained here is a ber of vertical pixels.
bitwise image. In addition, the output obtained from here
is used for finding the straight-line segment and the fea-
ture we call the perimeter in the next step. 2.3.2 | Area (area)
Sobel, which is mainly used for vertical or horizontal
edge detection, is used to detect edges with separate fil- The area property is the number of white pixels obtained
ters for both methods.24 The part that distinguishes the from the Sobel edge detection algorithm. As can be seen
Sobel method from the other edge detection method in the images obtained, it resembles the inner area of the
Canny for this study is that it can show an area closer to bone with thick drawings. The value obtained here is
the area covered by the bones in the image as output. proportional to the number of vertical pixels.
2.2.4 | Hough line detection 2.3.3 | Line, line length and average length
(nm_lnslngth_pxl and avg_length)
The Hough transform is a method used for both line and
circle detection.25 The Hough line segment transform is This feature is obtained with the help of the Hough Lines
used to detect straight lines in the given image. Since the algorithm. The Hough Lines algorithm gives the maxi-
algorithm can detect many lines, only 10 of the longest mum number of line segments that can be drawn. Within
lines are detected and stored in memory for this study. the scope of this study, 10 lengths that we keep in mem-
These lines are then used for properties such as length ory are used in length and angle operations in the next
and angle. steps.
10981098, 2023, 3, Downloaded from [Link] by Orta Dogu Teknik Universitesi, Wiley Online Library on [08/10/2025]. See the Terms and Conditions ([Link] on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
857
F I G U R E 4 The steps of
feature extraction
pre-processing
SAHIN
10981098, 2023, 3, Downloaded from [Link] by Orta Dogu Teknik Universitesi, Wiley Online Library on [08/10/2025]. See the Terms and Conditions ([Link] on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
858 SAHIN
TABLE 1 Parameters
Predicted
Negative Positive
Actual cases Negative True negatives (tn) True positives (tp)
Positive False negatives (fn) False positives (fp)
This feature, in which the maximum of the angles Different methods are used to measure the success of
between the detected long line segments is calculated, is machine learning methods. Evaluation criteria are used
essentially based on the slope calculation. Two endpoints to measure the accuracy, sensitivity, specificity, and
of the obtained line segment are used for the slope. Each F1-score of the system. Evaluation criteria are calculated
slope calculation is made for 10 line segments. Then, the over the confusion matrix, which includes correct and
difference between the largest and smallest values among incorrect predictions as a result of classification. The con-
these 10 slope values is added to our data set as our angle fusion matrix is shown in Table 1.
value. There is also an important detail to note: the acute Based on the results of Table 1, accuracy, sensitivity,
angle between two lines can be 90 degrees at most. If the specificity, precision, recall, and the F1-score are calcu-
value is greater than 90 degrees, the difference from lated and used in the evaluation of the results of this
180 degrees should be calculated. study.28
tn þ tp
Accuracy ¼ ð1Þ
2.3.5 | Corner and total corner (crnt and tn þ tp þ fn þ fp
nm_crnr)
tp
Recall ¼ ð2Þ
With the result obtained from the Harris corner finding tp þ fn
algorithm, the total number of corners is found. In addi-
tion, considering the ratio of the total number of vertices tp
Precision ¼ ð3Þ
to the number of vertical pixels, two different features tp þ fp
are obtained. A total of 8 features are obtained for the
images in the data set and used within the scope of the Precision Recall
F1_Score ¼ 2 ð4Þ
study. Precision þ Recall
knowledge of the variability or distribution of the data. A significance of this study. The active use of image proces-
boxplot is a graph that shows how the distribution of sing techniques in the extraction of features obtained
values in the data is distributed. Figure 10 shows the out- from the data used in machine learning algorithms adds
comes of this study's analysis of the classifiers using the a separate innovation to the study. In the study, 12 differ-
10-fold cross-validation method. ent machine learning classifiers are used and hyperpara-
When the training time is considered, Table 2 shows meter optimization is performed for the classifiers. In
that QDA is better than the other classifiers, while the order to ensure the distribution of the data set and the
MLP classifier has the best test time when the training accuracy of the classifiers, the results are obtained using
time is considered. The LDA classifier, however, has the the cross-validation method, and the training and testing
dataset's highest accuracy rate. In addition, the most used times of the classifiers are presented comparatively. By
feature of the algorithm with the highest accuracy rate in examining the results, it is found that the LDA classifier
the study and its graphic is given in Figure 11. When the performs the best among the 12 classifiers. Our study has
figure is examined, it is clear that the number 5 which is some limitations. The main problems include the lack of
called lngth_pxl is the most used feature for LDA images in the dataset and the lack of labeled data for
classifier. bone fractures. The use of CT images instead of radio-
graphs in future studies will allow the acquisition of a
more comprehensive dataset.
4 | DISCUSSION
GradientBoostingClassifier
0 26 3
0 23 6
precision recall f1-score support
precision recall f1-score support
0 0.87 0.90 0.88 29
0 0.85 0.79 0.82 29
Actual
Actual
1 4 20 1 0.81 0.80 0.81 24
1 4 20 1 0.77 0.83 0.80 24
Accuracy 0.87 53
Accuracy 0.81 53
Macro avg 0.87 0.86 0.87 53
0 1 Macro avg 0.81 0.81 0.81 53
Weighted avg 0.87 0.87 0.87 53 0 1
Weighted avg 0.81 0.81 0.81 53
Predicted
Predicted
Logistic regression
LightGBM
0 25 4
0 24 5
precision recall f1-score support
precision recall f1-score support
0 0.81 0.86 0.83 29
0 0.86 0.83 0.884 29
Actual
Actual
1 6 18 1 0.82 0.75 0.78 24
1 4 20 1 0.80 0.83 0.82 24
Accuracy 0.81 53
Accuracy 0.83 53
Macro avg 0.81 0.81 0.81 53
0 1 Macro avg 0.83 0.83 0.83 53
Weighted avg 0.81 0.81 0.81 53 0 1
Weighted avg 0.83 0.83 0.83 53
Predicted
Predicted
ExtraTreesClassifier
MLP
0 24 5
0 29 0
precision recall f1-score support
precision recall f1-score support
0 0.89 0.83 0.86 29
0 0.67 1.00 0.81 29
Actual
Actual
1 3 21 1 0.81 0.88 0.84 24
1 14 10 1 1.00 0.42 059 24
Accuracy 0.85 53
Accuracy 0.74 53
Macro avg 0.85 0.85 0.85 53
0 1 Macro avg 0.84 0.71 0.70 53
Weighted avg 0.85 0.85 0.85 53 0 1
Weighted avg 0.82 0.74 0.71 53
Predicted
Predicted
RandomForestClassifier
GaussianNB
0 25 4 0 26 3
precision recall f1-score support precision recall f1-score support
0 0.83 0.86 0.85 29 0 0.76 0.90 0.83 29
Actual
Actual
MultinomialNB
0 26 3
precision recall f1-score support
0 0.87 0.90 0.88 29
Actual
Accuracy 0.87 53
Macro avg 0.87 0.86 0.87 53
0 1
Weighted avg 0.87 0.87 0.87 53
Predicted
Logistic regression
0 25 4
precision recall f1-score support
0 0.81 0.86 0.83 29
Actual
Accuracy 0.81 53
Macro avg 0.81 0.81 0.81 53
0 1
Weighted avg 0.81 0.81 0.81 53
Predicted
ExtraTreesClassifier
0 24 5
precision recall f1-score support
0 0.89 0.83 0.86 29
Actual
Accuracy 0.85 53
Macro avg 0.85 0.85 0.85 53
0 1
Weighted avg 0.85 0.85 0.85 53
Predicted
RandomForestClassifier
0 25 4
precision recall f1-score support
0 0.83 0.86 0.85 29
Actual
Accuracy 0.83 53
Macro avg 0.83 0.86 0.83 53
0 1
Weighted avg 0.83 0.83 0.83 53
Predicted
FIGURE 9
862
10981098, 2023, 3, Downloaded from [Link] by Orta Dogu Teknik Universitesi, Wiley Online Library on [08/10/2025]. See the Terms and Conditions ([Link] on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
SAHIN 863
and classification. By adjusting the grid search hyper- 8. Johri S, Goyal M, Jain S, Baranwal M, Kumar V, Upadhyay R.
parameters for the 12 different classifiers used, the effec- A novel machine learning-based analytical framework for auto-
tiveness of the used classifier is improved. With the matic detection of COVID-19 using chest X-ray images. Int J
Imaging Syst Technol. 2021;31(3):1105-1119.
cross-validation method, machine learning algorithms
9. Asim Y, Raza B, Malik AK, Rathore S, Hussain L, Iftikhar MA.
are examined here for 10-folds, the results are obtained A multi-modal, multi-atlas-based approach for Alzheimer
from each algorithms separately. The training and test- detection via machine learning. Int J Imaging Syst Technol.
ing times of the used classifiers are also compared. 2018;28(2):113-123.
When the results are examined, the LDA classifier yields 10. Pranata YD, Wang KC, Wang JC, et al. Deep learning and
the best results, with an accuracy rate of 88.67% and an SURF for automated classification and detection of calcaneus
AUC value of 0.89. It is hoped that the information pro- fractures in CT images. Comput Methods Prog Biomed. 2019;
171:27-37.
vided in this qualitative review will aid clinicians and
11. Li Q, Zhong L, Huang H, et al. Auxiliary diagnosis of develop-
researchers in better understanding the current applica-
mental dysplasia of the hip by automated detection of Sharp's
tion of machine learning in bone fracture as well as its angle on standardized anteroposterior pelvic radiographs. Med-
benefits and drawbacks, especially for those involved in icine. 2019;98(52):e18500.
the field of bone health. The accuracy of the model can 12. Chung SW, Han SS, Lee JW, et al. Automated detection and
be improved by using a different deep learning model. A classification of the proximal humerus fracture by using deep
larger dataset needs to be validated to further evaluate learning algorithm. Acta Orthop. 2018;89(4):468-473.
the perfromance of the system. 13. Avinash Vishnu V, Divya Prakash J, Swathika R, Sree
Sharmila T. Detection and classification of long bone fractures.
Int J Appl Eng Res. 2015;10(20):18315-18320.
CONFLICT OF INTEREST 14. Bayram F, Çakıroglu M. Diffract: Diaphyseal femur fracture
The authors declare no conflicts of interest. classifier system. Biocybern Biomed Eng. 2016;36(1):157-171.
15. Tripathi AM, Upadhyay A., Rajput AS, Singh AP, Kumar B.
DATA AVAILABILITY STATEMENT Automatic detection of fracture in femur bones using image
The data that support the findings of this study are processing. Paper presented at: 2017 International Conference
openly available in Mendeley Data at [Link] on Innovations in Information, Embedded and Communica-
[Link]/datasets/xbdsnzr8ct/1. tion Systems (ICIIECS). IEEE. 2017;1–5.
16. Basha CMAK, Padmaja M, Balaji GN. Computer aided fracture
detection system. J Med Imag Health Inf. 2018;8(3):526-531.
ORCID 17. Guan B, Zhang G, Yao J, Wang X, Wang M. Arm fracture
Muhammet Emin Sahin [Link] detection in X-rays based on improved deep convolutional neu-
7729-990X ral network. Comput Electr Eng. 2020;81:106530.
18. Guan B, Yao J, Zhang G, Wang X. Thigh fracture detection
R EF E RE N C E S using deep learning method based on new dilated convolu-
1. Beyaz S. A brief history of artificial intelligence and robotic sur- tional feature pyramid network. Pattern Recogn Lett. 2019;125:
gery in orthopedics & traumatology and future expectations. 521-526.
Joint Dis Relat Surg. 2020;31(3):653-655. 19. Malik H, Jabbar J, Mehmood H. Wrist Fracture—X-rays. Men-
2. Esteva A, Kuprel B, Novoa RA, et al. Dermatologist-level classi- deley Data; 2020. doi:10.17632/xbdsnzr8ct.1
fication of skin cancer with deep neural networks. Nature. 20. Balcı K. Üretim Otomasyonunda Görüntü Tabanlı Hata
2017;542(7639):115-118. Tanıma Sistemi, Yıldız Teknik Üniversitesi (Master Thesis).
3. Habib N, Hasan M, Reza M, Rahman MM. Ensemble of CheXNet 2008.
and VGG-19 feature extractor with random forest classifier for 21. Ding L, Goshtasby A. On the Canny edge detector. Pattern
pediatric pneumonia detection. SN Comput Sci. 2020;1(6):1-9. Recogn. 2001;34(3):721-725.
4. Olczak J, Fahlberg N, Maki A, et al. Artificial intelligence for 22. Canny J. A computational approach to edge detection. IEEE
analyzing orthopedic trauma radiographs: deep learning Trans Pattern Anal Mach Intell. 1986;6:679-698.
algorithms—are they on par with humans for diagnosing frac- 23. Xu Z, Baojie X, Guoxin W. Canny edge detection based on
tures? Acta Orthop. 2017;88(6):581-586. open CV. Paper presented at: 2017 13th IEEE International
5. Şahin ME, Ulutas H, Esra Y. A deep learning approach for Conference on Electronic Measurement & Instruments
detecting pneumonia in chest X-rays. Avrupa Bilim Ve Tekno- (ICEMI). IEEE. 2017;53–56.
loji Dergisi. 2021;28:562-567. 24. Irwin Sobel, History and Definition of the Sobel Operator.
6. Yaman S, Karakaya B, Erol Y. A novel normalization algorithm 2014.
to facilitate pre-assessment of Covid-19 disease by improving 25. Hough PV. Machine analysis of bubble chamber pictures.
accuracy of CNN and its FPGA implementation. Evol Syst. Paper presented at: Proceedings of the International Confer-
2022;1-11. doi:10.1007/s12530-022-09419-3 ence on High Energy Accelerators and Instrumentation. 1959;
7. Doegar A. Brain tumor detection and classification using 554–556.
machine learning. Recent Trends in Communication and Intelli- 26. Harris C, Stephens M. A combined corner and edge detector.
gent Systems. Springer; 2020:227-234. Alvey Vision Conf. 1988;15(50):10-5244.
10981098, 2023, 3, Downloaded from [Link] by Orta Dogu Teknik Universitesi, Wiley Online Library on [08/10/2025]. See the Terms and Conditions ([Link] on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
SAHIN 865
27. Rao B. Machine learning algorithms: a review. Int J 31. Witten IH, Frank E. Data mining: practical machine learning
Comput Sci Inf Technol. 2016;7(3):1174-1179. doi:10.21275/ tools and techniques with Java implementations. ACM SIG-
ART20203995 MOD Rec. 2002;31(1):76-77.
28. Sahin ME. Deep learning-based approach for detecting
COVID-19 in chest X-rays. Biomed Signal Process Control. 2022;
78:103977. How to cite this article: Sahin ME. Image
29. Bergstra J, Bengio Y. Random search for hyper-parameter opti-
processing and machine learning-based bone
mization. J Mach Learn Res. 2012;13(2):281-305.
30. Klein A, Falkner S, Bartels S, Hennig P, Hutter F. Fast bayesian
fracture detection and classification using X-ray
optimization of machine learning hyperparameters on large images. Int J Imaging Syst Technol. 2023;33(3):
datasets. Artificial Intelligence and Statistics. PMLR; 2017: 853‐865. doi:10.1002/ima.22849
528-536.