Real-Time Brain Tumor Detection and Classification Using a FastAPI-Deployed CNN Model with Grad-CAM Visualization
preprint
OA: closed
CC-BY-4.0
Abstract
Brain cancer refers to the uncontrolled growth of abnormal cells within the brain, leading to the formation of tumors that can interfere with normal brain function. The current study presents a Convolutional Neural Network (CNN) model designed for classifying brain Magnetic Resonance Imaging (MRI) images into four categories: glioma tumor, meningioma tumor, normal brain tissue, and pituitary tumor. The model leverages a dataset of 3,097 MRI images, using advanced data preprocessing techniques such as normalization and augmentation to improve generalization. The CNN architecture, implemented in Python using TensorFlow and Keras, consists of several convolutional layers followed by max-pooling layers, and a final dense layer for classification. Performance metrics such as accuracy, precision, recall, F1-score, and Matthews Correlation Coefficient (MCC) were evaluated, with the model achieving an overall accuracy of 97% and robust performance across all classes. Despite this high accuracy, minor misclassifications were observed, particularly between glioma and meningioma tumors, highlighting areas for potential improvement. The model's interpretability was enhanced using Grad-CAM, providing transparency into the regions of the MRI images influencing classification decisions. Furthermore, the model was deployed via a FastAPI server for real-time analysis, with response times averaging 3-5 seconds per prediction. The study emphasizes the potential of CNNs in assisting clinicians with fast, reliable diagnostic support, particularly in distinguishing between different types of brain tumors. Future work will focus on expanding the dataset, refining model performance, and exploring additional interpretability techniques to further improve the system's reliability and applicability in clinical settings.
My notes (saved in your browser only)
Citation neighborhood (no data yet)
We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2024) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.
Source provenance
- europepmc
- last seen: 2026-05-20T01:45:00.602351+00:00
- unpaywall
- last seen: 2026-05-22T02:00:06.705733+00:00
License: CC-BY-4.0