How rayen03/tumor-detect works
Project Type and Purpose
• A Streamlit-based web app for tumor prediction using a pre‐trained TensorFlow model
• Includes a Jupyter notebook for exploratory data analysis/training (offline)
• Serves image-based inputs (Chest CT scans) and returns classification output
Main Components
1. User Interface (Streamlit Frontend)
2. Inference Service (app.py)
3. Model Storage (TensorFlow SavedModel on disk)
4. Data Input Sources
– User-uploaded CT scan images
– Preloaded sample dataset
5. Offline Notebook (Tumor_Detect.ipynb)
– Data exploration & model training
– Produces the SavedModel
6. External Dependencies
– TensorFlow, Streamlit, image-processing libs
Interactions & Data Flow
• The user opens the Streamlit UI in their browser →
• Streamlit server (app.py) renders upload/component widgets →
• Uploaded image or sample image is passed to a preprocessing function →
• Preprocessed tensor is fed into the loaded TensorFlow model →
• Model returns prediction (e.g., “tumor” vs. “no tumor”) →
• Prediction is displayed in the UI
Offline (optional) flow:
• Analyst runs Tumor_Detect.ipynb locally →
• Notebook loads raw data, trains/evaluates TensorFlow model →
• Exports a SavedModel file used by the Streamlit app
Architectural Patterns & Design Principles
• Clear separation of concerns:
– UI layer (Streamlit) vs. Inference layer (model) vs. Data layer (inputs & model files)
• Stateless service: each user request is independent
• Single process server: no microservices (monolith)
• Reusable artifact: the TensorFlow SavedModel can be swapped without UI changes
Elements
– Component blocks: “Streamlit Frontend”, “Inference Engine (app.py)”, “Model Storage”
– Input sources: “User-Uploaded Images”, “Sample Images”
– Offline block: “Jupyter Notebook (Data Analysis & Training)”
– Dependencies cluster: “TensorFlow”, “Streamlit”, “Pillow” etc.
• UI (blue),
• Compute (green),
• Storage (orange),
• Offline/Training (gray)
Putting It All Together
– Top lane: Online Inference Workflow
2. In the top lane, left to right:
[User Browser] → [Streamlit UI (app.py)] → [Preprocessor Module] → [TensorFlow Model] → [UI Renderer]
3. In the bottom lane:
[Tumor_Detect.ipynb] → [Data Loader] → [Model Training] → [Export SavedModel]