CancerXAI is a full-stack machine learning web application that predicts cancer subtypes from high-dimensional gene expression data and provides interpretable predictions using SHAP (SHapley Additive exPlanations).
The project combines machine learning, dimensionality reduction, explainable AI and full-stack development through a Django REST API backend and React frontend.
๐ Live Demo: cancerxai.vercel.app
Gene expression datasets can contain tens of thousands of biological features, making cancer subtype classification a challenging machine learning problem.
CancerXAI was developed as my Final Year Computer Science Project at the University of Surrey to investigate how machine learning and explainable AI could be combined within an accessible web application.
The project involved:
- Processing high-dimensional gene expression data
- Cleaning and preparing data for machine learning
- Reducing dimensionality using PCA
- Training and comparing multiple classification models
- Evaluating classification performance
- Applying SHAP for model explainability
- Developing a REST API for machine learning inference
- Building an interactive frontend for uploading data and viewing predictions
- ๐ค Upload gene expression data in CSV format
- ๐งฌ Predict cancer subtypes from gene expression profiles
- ๐ค Machine learning-based classification
- ๐ Process multiple samples in a single upload
- ๐ SHAP-based model explanations
- ๐ View prediction results through an interactive interface
- ๐ฅ Download batch prediction results as CSV
- ๐ป Responsive web interface
The machine learning workflow was designed to process high-dimensional gene expression data and produce cancer subtype predictions.
The preprocessing pipeline included:
- Handling missing values
- Cleaning and preparing gene expression features
- Standardising numerical features
- Encoding target labels
- Preparing datasets for model training and evaluation
Gene expression datasets contain a very large number of features.
Principal Component Analysis (PCA) was used to reduce the dimensionality of the feature space, helping make model training more computationally manageable while retaining useful information for classification.
Multiple machine learning approaches were trained and compared:
- Support Vector Machine (SVM)
- Random Forest
- Neural Network
Model performance was evaluated and compared during development to identify an effective approach for cancer subtype classification.
SHAP was incorporated to improve the interpretability of model predictions.
Rather than presenting only a predicted subtype, the application was designed to provide information about which features contributed to the model's predictions.
This adds an explainability layer to the machine learning pipeline and helps make model behaviour easier to investigate.
During development, the classification pipeline improved from an initial baseline accuracy of approximately:
65% โ ~80%
Dimensionality reduction using PCA substantially reduced the original high-dimensional gene expression feature space while supporting downstream classification.
The project received a First-Class project grade (70%+) as part of my BSc (Hons) Computer Science degree at the University of Surrey.
CancerXAI follows a full-stack architecture:
Gene Expression CSV
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ React Frontend โ
โ โ
โ Upload Interface โ
โ Results Dashboard โ
โ SHAP Visualisation โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
โ HTTP / REST
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ Django REST API โ
โ โ
โ Data Processing โ
โ Model Inference โ
โ Prediction API โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ Machine Learning โ
โ โ
โ Preprocessing โ
โ PCA โ
โ Classification โ
โ SHAP Explainability โ
โโโโโโโโโโโโโโโโโโโโโโโ
| Area | Technologies |
|---|---|
| Programming | Python, JavaScript |
| Data Processing | Pandas, NumPy |
| Machine Learning | scikit-learn, PyTorch |
| Dimensionality Reduction | PCA |
| Explainable AI | SHAP |
| Backend | Django, Django REST Framework |
| Frontend | React.js, Material UI, CSS |
| API | REST |
| Version Control | Git, GitHub |
CancerXAI/
โ
โโโ cancer_classification_project/
โ โ
โ โโโ backend/
โ โ โโโ models/
โ โ โโโ api/
โ โ โโโ datasets/
โ โ โโโ ...
โ โ
โ โโโ frontend/
โ โ โโโ src/
โ โ โโโ public/
โ โ โโโ ...
โ โ
โ โโโ ...
โ
โโโ docs/
โ โโโ images/
โ โโโ cancerxai-home.jpeg
โ โโโ cancerxai-results.png
โ
โโโ .gitattributes
โโโ .gitignore
โโโ README.md
โโโ ...
The exact project structure may evolve as the application is developed and maintained.
CancerXAI accepts gene expression data in CSV format.
Each row represents a sample, while gene identifiers are represented as input features.
Example:
ENSG00000000003,ENSG00000000005,ENSG99999999999
12.4,0.00,7.4
15.9,0.05,6.7The application processes the uploaded data before passing it through the trained machine learning pipeline.
The backend returns predictions containing information such as the sample, predicted subtype and associated cancer type.
Example:
{
"predictions": [
{
"sample": 1,
"subtype": "BRCA_LumA",
"cancer_type": "Breast"
},
{
"sample": 2,
"subtype": "Papillary",
"cancer_type": "Kidney"
}
]
}The frontend presents these predictions through the CancerXAI results interface.
git clone https://github.com/atriyaaa/CancerXAI.git
cd CancerXAIIf required by the repository:
git lfs install
git lfs pullNavigate to the backend directory:
cd cancer_classification_project/backendCreate a virtual environment:
python3 -m venv venvActivate it on macOS/Linux:
source venv/bin/activateOn Windows:
venv\Scripts\activateInstall the required dependencies:
pip install -r requirements.txtStart the Django development server:
python manage.py runserverOpen another terminal and navigate to the frontend directory:
cd cancer_classification_project/frontendInstall dependencies:
npm installStart the React development server:
npm startThe frontend will normally be available at:
http://localhost:3000
The Django backend will normally run at:
http://127.0.0.1:8000
One of the main goals of CancerXAI is to go beyond producing a classification result.
Machine learning models can be difficult to interpret, particularly when working with high-dimensional biological data.
CancerXAI therefore incorporates SHAP to provide insight into the contribution of input features to model predictions.
This allows the application to combine:
Prediction
+
Feature Importance
+
Model Interpretation
rather than presenting the model purely as a black box.
Developing CancerXAI provided practical experience across the full lifecycle of a machine learning application, including:
- Working with high-dimensional datasets
- Data cleaning and preprocessing
- Dimensionality reduction
- Training and evaluating classification models
- Applying explainable AI techniques
- Building REST APIs
- Connecting machine learning models to a web application
- Developing a React-based user interface
- Debugging frontend/backend integration
- Managing a larger software project with Git and GitHub
The project also strengthened my understanding of the challenges involved in translating a machine learning model into a usable end-to-end application.
Potential future development includes:
- More detailed SHAP visualisations for individual samples
- Additional model evaluation and comparison metrics
- Support for additional datasets and subtype classifications
- Improved error handling and data validation
- Authentication and user accounts
- Prediction history
- Improved deployment architecture
- Containerisation with Docker
- Automated testing and CI/CD
- Further frontend accessibility and usability improvements
CancerXAI was developed as an academic Computer Science project.
The predictions generated by the application are intended for educational and research demonstration purposes and should not be used for clinical diagnosis or medical decision-making.
CancerXAI was developed as my Final Year Project for the BSc (Hons) Computer Science degree at the University of Surrey.
The project demonstrates practical experience across:
Machine Learning โข Data Analytics โข Explainable AI โข REST APIs โข Full-Stack Development โข Software Engineering
Atriya Sivakumar
BSc (Hons) Computer Science
University of Surrey
โญ If you found this project interesting, feel free to explore the repository and application.

