This project was made for creating of Machine Learning Model for Tumor Detection on MRI Images. We are going to use tensorflow
and tensorflow.keras
libraries for training our model.
Using my notebooks I have generated two models, they are: tumor_detection.keras
and tumor_detection.h5
. Both are the same, though with different extensions.
Here is the detailed process of installation:
- Clone the repository -
git clone https://github.com/pyc4che/oncoscope.git | cd oncoscope
- Create the Virtual Environment -
python -m venv .venv
- Activate the Virtual Environment -
source ./.venv/bin/activate
- Install required packages using
requirements.txt
file -python -m pip install -r requirements.txt
After all of this steps you are ready to launch the program, for this type: jupyter notebook
. YOur default browser will be opened automatically.
The only notebook you see is tumor_detection.ipynb
the main purpose of this notebook is the training, testing and saving of the model. It works with 100% accuracy !!!
Let's deepen into our Machine Learning process a bit.
For the Machine Learning process we have to read, make our data preprocessed, train our model and save it. So for this all actions we need the variate of required packages, like:
- Pandas - Read our Dataset;
- Numpy - Linear Algebra actions;
- Seaborn and Matplotlib - Data Visualization;
- TensorFlow, TensorFlow.Keras, Scikit-Learn - Data Preprocessing and Model Training;
- Some other libraries for different action;
As dataset I am going to use this kaggle dataset
- Dataset Formation - Splitting data into topics and creation of Dataframe
- Dataset Visualization - Plotting the Diagrams
As the result we have one diagram:
Well, this is the most interesting part. Now, we are going to train our model and then save it. So let's move on.
This process divides into several steps:
- Dataset Splitting - Preparing data for ML manipulations
- Trining & Validation - Creating the Image Dataset
- Modeling - Training of the Model
- Scoring the model - Analyzing the Model Results
- Confusion Matrix - Post-Analysis, Visualizing Accuracy
- Saving Model - Writing to a File
- A confusion matrix in machine learning is a table that helps evaluate the performance of a classification algorithm.
The models could be find by path: /output/models/keras
.