Skip to content

kalpanibhagya/oral-cancer-detection-gradcam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oral Cancer Detection with Grad-CAM

This repository contains Jupyter notebooks, dataset organization, and training/evaluation experiments for building deep convolutional neural networks to detect oral (tongue) lesions and visualize model decisions using Grad-CAM.

Repository structure

  • *.ipynb — Several Jupyter notebooks for dataset splitting, augmentation, training and Grad-CAM visualizations. Notable notebooks:

    • 1_traintestvalsplit.ipynb — data split (train/test/val)
    • 2_Augmentation.ipynb — augmentation pipeline used during experiments
    • cnn-basemodel-training-and-eval.ipynb — baseline CNN training and evaluation
    • densenet-training-and-eval.ipynb — DenseNet-based experiments
    • inception-training-and-eval.ipynb — Inception-based experiments
    • mobilenet-training-and-eval.ipynb — MobileNet experiments
    • xception-training-and-eval.ipynb — Xception experiments
    • Grad-cam-mobilenet-roi_48.ipynb, Grad-cam-mobilenet-roi-56.ipynb, Grad-cam-mobilenet-roi-65.ipynb, Grad-cam-mobilenet-roi-121.ipynb — Grad-CAM visualization notebooks for different MobileNet variants and ROI sizes
  • Tonguedata/ — dataset folder with class subfolders:

    • normal/
    • potential_benign/
    • potential_malignant/

Note: This repository currently uses Jupyter notebooks as the primary artefacts. If you plan to run full training outside notebooks, consider extracting code into Python scripts for reproducibility.

Dataset Credits

The Tonguedata/ used in this project is derived from the "Oral Images Dataset" (2021). We gratefully acknowledge the original dataset creators:

Authors:

  • H. Chandrashekar
  • A. G. Kiran
  • S. Murali
  • M. Dinesh
  • B. Nanditha

Source: The dataset is available on Mendeley Data:
DOI

License: This dataset is licensed under the Creative Commons Attribution 4.0 International License.

When using this code or the dataset, please cite the original work:

Chandrashekar, H., Kiran, A. G., Murali, S., Dinesh, M., & Nanditha, B. (2021). Oral Images Dataset [Data set]. Mendeley Data, V2. https://doi.org/10.17632/mhjyrn35p4.2

Goals

  • Train CNN models to classify tongue images into normal / potential_benign / potential_malignant
  • Evaluate models (accuracy, confusion matrix, class-wise metrics)
  • Produce Grad-CAM visual explanations to localize evidence for model decisions

Requirements (recommended)

  • Python 3.8–3.10
  • Jupyter (Notebook or Lab)
  • TensorFlow (2.x) or Keras (if using a separate Keras installation)
  • Common data science packages: numpy, pandas, scikit-learn, matplotlib, seaborn
  • OpenCV (cv2) for image processing

If you have a GPU and want to leverage it, install the appropriate tensorflow build that supports your CUDA/cuDNN versions (see TensorFlow official install guide).

How to run the notebooks

  1. Start the Jupyter server from the project root:
jupyter lab
# or
jupyter notebook
  1. Open the notebook you want to run. Typical workflow:
    • Run 1_traintestvalsplit.ipynb to produce the train/val/test splits (or confirm the existing splits)
    • Run 2_Augmentation.ipynb to preview augmentation settings
    • Run a training notebook such as mobilenet-training-and-eval.ipynb or densenet-training-and-eval.ipynb
    • Open the corresponding Grad-cam-*.ipynb notebook to generate visual explanations for selected images/models

Notes:

  • Some notebooks may assume specific directory paths or precomputed splits; open the first cells in a notebook and adjust paths if necessary.

Expected outputs

  • Evaluation metrics and plots (training curves, confusion matrices)
  • Grad-CAM heatmap overlays demonstrating which regions influenced predictions

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For questions about the experiments or dataset, contact the repository owner.

About

Deep transfer learning models to identify oral tongue cancer from limited public datasets, utilizing Grad-CAM for model explainability

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors