How ashishchourasia17/ai-medical-diagnosis works
Main Components
• App Layer (User Interface/API):
• Folder: app
• Files: app.py and utils.py
• Role: Likely the entry point for user requests (e.g., a REST API or a web-based interface) that interact with the diagnosis service.
• Data Layer:
• Folder: data
• Files: Multiple CSV files representing raw datasets for different medical conditions.
• Role: Contain the raw data used for training the models and possibly for on-the-fly predictions.
• Model Management & Training:
• Folder: models
• Files: Saved model objects (with .sav extension) and training scripts for each disease (e.g., train_diabetes.py, train_heart_disease.py, etc.).
• Role: Manage the machine learning models, including training routines and storing the resulting models.
• Preprocessing & Training Pipeline:
• Folder: src
• Files: preprocess.py and train_model.py
• Role: Contain the core logic for data preprocessing and additional training routines that either support or complement the models in the models folder.
Understand the Interactions and Data Flow
• User requests enter via the App Layer (app/app.py), which calls utility functions (app/utils.py) to parse requests and possibly prepare data.
• The system accesses raw data from the Data Layer for either training or inference.
• Preprocessing is conducted by components in the src directory (e.g., preprocess.py) to clean and prepare the input data.
• Trained models are stored in the Models folder; during inference, the App Layer loads these models to make diagnoses.
• Training pipelines exist in both the models directory (individual training scripts) and in src/train_model.py for more general model training tasks, indicating a flexible modular training setup.
Key Architectural Patterns and Integration Points
• Separation of concerns: The project cleanly separates data handling, model training, and application logic.
• Modular design: Different modules are responsible for different diagnoses (each disease has its own model and training script).
• Pipeline pattern: Data flows from raw CSVs to preprocessing, then to training, and finally to inference via the loaded models.
• Possible API Gateway: The app might serve as an endpoint that abstracts the complexity of multiple models behind a unified service.