How vedantkadam/lung_cancer_streamlit works
Project Overview
• This is a machine learning and computer vision application aimed at detecting lung cancer from medical images (X-rays, CT scans).
• The project uses Python and leverages frameworks such as Streamlit for the user interface, along with TensorFlow/Keras for deep learning (notably CNNs).
Main Components
a. User Interface & Application Layer:
• The entry point is app.py which runs the Streamlit application.
b. Machine Learning / Model Components:
• Two separate directories indicate model artifacts: "cnn model" (with labels.txt, lungcancer_model_cnn.h5) and "models" (with final_model.sav and keras_model.h5).
• These represent the trained model files (possibly for different experiments/approaches) that are loaded by the backend for prediction.
• That these are likely used by the application via TensorFlow/Keras or other Python libraries.
c. Data & Dataset Management:
• "datasets" contains CSV files for training and testing data, which suggests the models have been trained and validated on structured datasets.
• "ctscan_images" (with train/test splits and further folder categorization e.g., normal vs. large.cell.carcinoma) shows how the image data is organized.
d. Experimentation & Development Notebooks:
• The "pynb files" directory contains Jupyter notebooks used for developing and testing different algorithms (like the CNN and SVM models).
• This component can be shown as a “Development/Experimentation” environment that influenced the finalized model selections.
e. Supporting Files & Documentation:
• Files like requirements.txt and README explain the dependencies and instructions.
• While not part of the runtime, these support the maintainability and reproducibility (deployment) of the system.
Relationships and Interactions
• That the models (whether CNN from “cnn model” or other final models in “models”) rely on pre-processed data (images, CSV dataset entries) and were developed in an iterative process (referencing “pynb files”).
• Flow:
• User Input (via Streamlit) → Image Preprocessing (if any in app.py) → Model Prediction (CNN/Keras models) → Output/Visualization (back into the UI).
• Additionally, include references for dataset management, where the datasets fed into training form the backbone of model accuracy.
Architectural Patterns & Design Principles
• Separation of Concerns: Clear segmentation between the presentation layer (Streamlit UI), the business logic/model inference layer (loading and running models), and data handling (organized datasets and image directories).
• Modularity: The presence of different directories for model artifacts, datasets, and notebooks indicates a modular setup where model training, testing, and deployment are relatively decoupled.
• Experimentation Lifecycle: Notebooks (pynb files) contain the iterative experiments which eventually influence the production models in “models” and “cnn model” directories.
Final Reminders
• Use clear, readable labels for every component.
• Aim for a high level of detail that distinguishes experimental components (notebooks) from production usage (app.py and deployed models).