How akshwin/intracranial_haemorrghe_detection works
Project Type and Purpose
• This is a single-page Streamlit application for deep-learning inference.
• Purpose: allow users to upload CT scan images and instantly receive a hemorrhage/no-hemorrhage prediction using a pre-trained Keras model (ich.h5).
File Structure
• app.py – the main application script (UI + inference logic).
• ich.h5 – the pre-trained Keras model file.
• requirements.txt – lists Streamlit, Pillow, NumPy, TensorFlow dependencies.
• upload_image/ – (if present) may hold sample images or utility scripts.
• README.md, .gitignore, LICENSE – documentation and metadata.
Extract Insights from README
• UI built with Streamlit – file uploader, buttons, display elements.
• Model inference uses TensorFlow/Keras.
• Input types: JPG, JPEG, PNG.
• No external databases or microservices – self-contained.
Main Components
a. User Interface Layer
– Streamlit Web App (app.py)
– FileUploader widget
– Result display (text + balloons)
b. Preprocessing Module
– Image loading (Pillow)
– Resizing/normalization (NumPy)
c. Inference Engine
– Keras/TensorFlow model loader (ich.h5)
– Prediction function
d. Model Artifact
– ich.h5 stored on disk
e. Hosting/Runtime
– Local/Streamlit Cloud server environment
– Python runtime
Relationships and Data Flow
• User clicks “Upload” → Streamlit UI reads file
• UI passes raw image to Preprocessing Module
• Preprocessing outputs an array to Inference Engine
• Inference Engine loads ich.h5 (on first run or cached) → returns prediction
• UI consumes prediction → displays result and balloons or error
• All steps occur within the same process, no external API calls
Architectural Patterns & Design Principles
• Monolithic single-process design – UI and inference co-located
• Lazy loading & caching of model to optimize performance
• Separation of concerns: clearly delineate UI, preprocessing, inference
Technologies & Libraries
• Streamlit – UI framework
• Python 3.x – runtime
• Pillow – image I/O
• NumPy – numerical processing
• TensorFlow/Keras – deep learning inference
Elements
• Component names and brief descriptions
• Arrowheads indicating request/response or data transformation flow