How ashandilgith/fetal_health works
Project type and purpose
• This is a full-stack, end-to-end machine-learning application for predicting fetal health status from CTG data.
• It supports data ingestion, model training, artifact management, a serving API, and a simple web UI.
File structure
• Top-level
• file_creation.py – orchestration or data-prep script
• fetal-health-system/ – main project directory
• fetal-health-system/backend/
• app.py / app2.py – web service entry points (likely Flask or FastAPI)
• requirements.txt – Python dependencies
• model/
– model.py, model2.py – training code
– fetal_model.pkl, fetal_best_model_713PM.pkl – trained model artifacts
– scaler.pkl, scaler_713PM.pkl – preprocessing objects
– test_model.py, test_model2.py – unit tests for training logic
• utils/alerts.py – notification utility
• fetal-health-system/data/
• fetal_health.csv – raw dataset
• fetal-health-system/templates/
• index.html, index2.html – HTML pages for user input & results
README for additional insights
• Confirms an ML pipeline: data → training (TensorFlow/Keras) → classification.
• Tech stack: Python, TensorFlow/Keras, Scikit-learn, Pandas/NumPy, optional FastAPI/Streamlit.
• Goal: assist healthcare professionals with fetal health decision support.
a. Main components
• Data Layer (fetal_health.csv)
• Training Pipeline (model.py/model2.py)
• Model Artifacts (PKL files & scalers)
• Serving API (app.py/app2.py + alerts.py)
• Frontend UI (HTML templates)
• QA Layer (test_model.py/test_model2.py)
b. Relationships & interactions
1. Data Layer → Training Pipeline
2. Training Pipeline → Model Artifacts
3. API loads Model Artifacts & Scaler
4. Frontend issues HTTP requests to API → receives classification & alerts
c. Architectural patterns
• Layered architecture separating offline batch training from online serving
• Explicit model versioning and artifact management
• Separation of concerns: data, training, serving, presentation, testing
d. Key technologies
• TensorFlow/Keras (modeling)
• Scikit-learn (preprocessing)
• Flask or FastAPI (API server)
• Jinja2 HTML templates (UI)
• Pandas/NumPy (data handling)
Essential details to capture
• Multiple model versions (fetal_model.pkl vs fetal_best_model_713PM.pkl)
• Scaler objects alongside models
• utils/alerts.py as a dedicated notification micro-module
• test scripts as a separate QA layer
• The flow of data from raw CSV through training into live predictions