
ScoliosisAI
Ahead of the curve

Our Work
We have developed an AI model that can detect scoliosis based on bare-back images. Our AI model is implemented in this website: https://scoliosis.keyneswu.top/
01
Overview and methodology

Throughout the whole project, we have tested many AI models, including machine learning algorithms and deep learning algorithms. We used datasets available on Kaggle to create the training dataset. We used train_val split to access the model with validation accuracy. Finally, we used external bare back images found online from sources such as Shutterstock, Alamy stock photo,123RF, Dreamstime, Scoliosisuk.co.uk to access the model's performance on unseen dataset.
​
Before training the model, we resized the image to 224 x 224 and performed data augmentation to generalize the AI model
02
Machine Learning Algorithms (K-Nearest Neighbors)
K-Nearest Neighbors (KNN) is a common simple machine learning algorithm that is often employed in image classification. It represents the image by extracting the features as a feature vector. Based on the nearest neighbors, it classifies the image into the class that occurs most frequently among the K neighbors.
After trials in the KNN model, the results indicate that 13-nearest neighbors offer the most optimal result.
​
This result leads to a 76% validation accuracy and 69% testing accuracy. This shows that our model is just slightly overfitted to the training data but is overall fairly accurate at predicting scoliosis.
​
Moreover, the key in the confusion matrix shows that there are minimal number of false positives*, which helps us prevent worst case scenarios: adolescents who have scoliosis are not detected.





03
Deep Learning Algorithms (Convolutional Neural Network)
In addition to the KNN machine learning algorithm, we also implemented a CNN (Convolutional Neural Network). This deep learning algorithm first analyzes the image in different sections and extract their most prominent feature (using max-pooling technique). It then downsamples the image and create the output. After calculating the loss function, it adjusts the weights of the neurons using backward propagation and attempts to improve the accuracy.
​
As you can see, this complex approach to image classification leads to a better result than the KNN model with a 77% validation accuracy and 72% testing accuracy. However, it takes more computing resources to run this deep learning algorithm.
​
The specific hyperparameters that provides the best results are:
Learning Rate: 0.0009739
Dropout: 0.2
Epochs: 30
04
Diagnosis Website
We have used django framework to import the AI models and publish the publicly accessible website for everyone to try diagnosing scoliosis.
​
Since the accuracy are similar in both models, we implemented the KNN model on our website to avoid using too much computing resources.
​
It is never too late to check now!
