X-ray is a type of radiation that passes through the body. The dense parts of the body such as bones show up as clear white areas on the image and softer parts where X-ray can pass through more easily, such as your heart & lungs, show up as darker areas. In adults, a bone fracture appears dark black, or darker than the rest of the bone and is visible like a shady area on a bright white bone. Bones are a significant component of the human body and bone fractures are common. Doctors use X-ray images to diagnose a fractured bone. Nowadays with the help of computer vision technology and image processing, we can classify broken and normal bone X-ray images with high accuracy. For this project, we will use deep neural networks to develop a classification model that can detect fractured and healthy bones in X-ray images.
A Classification model is a program that learns how to assign a label (or class) to input data. Classification belongs to the category of supervised learning where the model is trained with images and their classes as input to predict labels for new images. In this project, we use binary classification which refers to classification tasks with two class labels. The ‘0’ label is assigned to the broken bone class and ‘1’ represents the normal bone class. Classification algorithms are evaluated based on their results. There are different evaluation metrics but we will use 3 of them for this project.
Accuracy is a popular and simple metric used to evaluate the performance of a model based on the predicted labels.
Precision is the ratio of True Positives to all the positives predicted by the model. The more false positives the model predicts, the lower its precision will be.
Recall is the ratio of true positives to all the positives in your dataset. The more false negatives the model predicts, the lower its recall will be.
For this project, I am using the AIEX platform. I will do everything from data collection to model testing on this platform. First, we should create a new classification project
I couldn’t find an available dataset in the desired format so I collected the X-ray images for each class (broken and normal bone) myself. We can use the AIEX platform’s image search engine and choose a class (click on picture classification) as shown below.
After selecting the images, we will check them again. If everything looks good, we will mark the images as Ready to Train.
It’s time to apply data augmentation to our dataset because I don’t have many images for each class. I applied a Horizontal augmentation to 50% of my training images.
AIEX platform supports several different frameworks, I chose the MOBILE NET model from each framework and tried it on my dataset
|Framework||Model name||Accuracy %||Recall %||Precision %|
This is the fun part—trying out the model, and seeing how well it works. I took a new photo and tested it using the deployment section.
In this project, we went over what you need to do to build a classification model from data collection to model testing on the AIEX platform.
A few points about the results of our trained models:
1- Expanding the training dataset by collecting more images for each class, will significantly improve the model’s performance.
2- It is best to try several sets of Hyperparameter values to find the best values for each model and project.
You can enter your email address and subscribe to our newsletter and get the latest practical content. You can enter your email address and subscribe to our newsletter.