# Bridging engineering and neuro-oncology: a scalable FastAPI-deployed CNN framework for real-time explainable brain tumor diagnosis

**Authors:** Sajjad Nematzadeh, Ferzat Anka, Fatih Ciftci, Kadriye Yasemin Usta Ayanoğlu, Ali Can Özarslan, Emir Oncu

PMC · DOI: 10.3389/fnins.2026.1772429 · Frontiers in Neuroscience · 2026-03-11

## TL;DR

This paper introduces a scalable and explainable AI system for real-time brain tumor diagnosis using MRI scans, combining deep learning with practical deployment.

## Contribution

A novel CNN framework with FastAPI deployment and Grad-CAM explainability for real-time brain tumor classification.

## Key findings

- The framework achieved stable performance with high accuracy and low inter-fold variance across cross-validation.
- Transfer learning models showed strong classification performance, while the lightweight CNN was suitable for real-time use.
- FastAPI deployment enabled low-latency inference and on-demand visual explanations via Grad-CAM.

## Abstract

Automated and interpretable classification of brain tumors from MRI scans remains a critical challenge in medical imaging and neuro-oncology. This study addresses the need for reliable and deployable AI-driven tools that support timely tumor differentiation while maintaining transparency and practical usability.

A deep learning–based diagnostic framework was developed using convolutional neural networks implemented in TensorFlow. The system was trained and evaluated on a curated dataset of 3,097 axial brain MRI images spanning four classes: glioma, meningioma, pituitary tumor, and normal cases. To ensure robust performance estimation, all models were evaluated using stratified 5-fold cross-validation and benchmarked against multiple state-of-the-art transfer learning architectures. For real-world applicability, the selected models were deployed via a FastAPI-based server, and Gradient-weighted Class Activation Mapping (Grad-CAM) was incorporated to provide qualitative visual explanations.

Across cross-validation folds, the proposed framework demonstrated stable and competitive performance in terms of accuracy, macro-averaged F1-score, and macro-averaged AUC, with low inter-fold variance. Comparative evaluation showed that transfer learning models achieved strong classification performance, while the lightweight custom CNN remained suitable for real-time deployment. The FastAPI implementation enabled low-latency inference and on-demand Grad-CAM visualizations, supporting transparent and responsive model usage.

This work demonstrates the feasibility of bridging deep learning–based brain tumor classification with scalable, real-time deployment. By combining robust cross-validation, state-of-the-art benchmarking, and explainability-aware inference, the proposed framework provides a practical pathway toward integrating artificial intelligence into radiological workflows, while highlighting the importance of interpretability and deployment constraints in neuro-oncological applications.

## Linked entities

- **Diseases:** glioma (MONDO:0021042), meningioma (MONDO:0003057), pituitary tumor (MONDO:0017611)

## Full-text entities

- **Diseases:** meningioma (MESH:D008579), pituitary tumor (MESH:D010911), glioma (MESH:D005910), tumor (MESH:D009369), brain tumor (MESH:D001932)

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC13013460/full.md

## Figures

6 figures with captions in the complete paper: https://tomesphere.com/paper/PMC13013460/full.md

## References

38 references — full list in the complete paper: https://tomesphere.com/paper/PMC13013460/full.md

---
Source: https://tomesphere.com/paper/PMC13013460