An AI-powered intelligence platform built to predict the expiry dates and shelf stability of food and pharmaceutical products using machine learning.
"No more manual tracking or guesswork. Just smart, accurate stability predictions based on data."
| # | Section |
|---|---|
| 1 | Project Overview |
| 2 | Key Features |
| 3 | System Architecture |
| 4 | Machine Learning Pipeline |
| 5 | Project Workflow |
| 6 | Tech Stack |
| 7 | Project Structure |
| 8 | Installation & Local Setup |
| 9 | API Reference |
Manual tracking and guesswork regarding product expiration lead to massive inventory losses, safety risks, and operational waste. The Expiry Date Predictor acts as an automated solution that evaluates intricate raw feature variablesβsuch as dynamic ingredients, volatile packaging materials, and active storage environment conditionsβto forecast an exact, data-backed shelf life duration matrix.
- π§Ύ Minimize Resource Waste: Assists production facilities in mitigating supply chain decay through preventative timelines.
- π‘οΈ Optimize Safety Assurance: Provides chemical, pharmaceutical, and consumable goods providers with predictive safety safety nets.
- π¦ Streamline Inventory Flow: Equips warehouse managers with accurate predictive indices for first-expired, first-out (FEFO) strategies.
- π Multi-Variable Feature Analysis: Aggregates multi-dimensional product configurations (e.g., compounding components, air exposure profiles, baseline temperature bounds).
- π§ Advanced Regression Inference: Uses trained scikit-learn estimators to convert dynamic environmental thresholds into real-time shelf life counts.
- π Insightful Exploratory Dashboards: Packaged alongside exploratory rendering matrices utilizing Matplotlib and Seaborn for dataset profiling.
- π API Integration Layer: Exposes modular HTTP service routes designed to accept payload vectors and stream instantaneous predictions out to client ERP nodes.
flowchart TB
subgraph ClientLayer["User Web Interface Layer"]
A["HTML Input Dashboard<br/>Product Parameter Form UI"]
B["Static Assets<br/>Validation Engine"]
end
subgraph ServerLayer["Flask Backend"]
C["app.py<br/>HTTP Route Handlers"]
end
subgraph CoreEngine["Predictive AI Layer"]
D["model.py<br/>ML Inference Engine"]
end
subgraph AnalyticsLayer["Analytics & Validation"]
E["Jupyter Notebooks<br/>EDA & Model Evaluation"]
end
A --> B
B -->|JSON Request| C
C -->|Prediction Request| D
D -->|Prediction Response| C
E -->|Model Validation| D
C -->|JSON Response| B
sequenceDiagram
actor User
participant Browser
participant FlaskApp
participant Model
participant Analytics
User->>Browser: Enter Product Information
Browser->>FlaskApp: POST /predict
FlaskApp->>Model: Preprocess Features
activate Model
Model->>Model: Feature Engineering
Model->>Model: Run ML Prediction
Model-->>FlaskApp: Predicted Shelf Life
deactivate Model
FlaskApp->>Analytics: Log Prediction Metrics
Analytics-->>FlaskApp: Tracking Information
FlaskApp-->>Browser: JSON Response
Browser-->>User: Display Expiry Prediction
flowchart LR
A["Data Collection"] -->
B["Data Cleaning & Preprocessing"]
B -->
C["Feature Engineering"]
C -->
D["Model Training"]
D -->
E["Model Evaluation"]
E -->
F["Expiry Date Prediction"]
flowchart TD
Start([Start])
--> Load[Load Model]
Load --> Validate{Model Available?}
Validate -->|No| Error[Raise Error]
Validate -->|Yes| Run[Start Flask Server]
Run --> Wait[Wait For User Request]
Wait --> Input[Receive Product Details]
Input --> Process[Preprocess Data]
Process --> Predict[Generate Prediction]
Predict --> Result[Create Response]
Result --> Display[Show Prediction]
Display --> End([Finish])
| Category | Technology | Purpose |
|---|---|---|
| Language | Python 3.8+ | Core Development |
| Backend | Flask | Web Application |
| Data Processing | Pandas, NumPy | Data Manipulation |
| Machine Learning | Scikit-Learn | Prediction Models |
| Visualization | Matplotlib, Seaborn | Analytics |
| Experimentation | Jupyter Notebook | Model Training |
expiry-predictor/
β
βββ data/
β βββ datasets/
β
βββ static/
β βββ css/
β βββ js/
β βββ images/
β
βββ templates/
β
βββ notebooks/
β
βββ app.py
βββ model.py
βββ constraint.py
βββ requirements.txt
βββ README.md
- Python 3.8+
- pip
git clone https://github.com/Ajinkya-Ghuge/Datasphere.git
cd Dataspherepython -m venv venvWindows:
venv\Scripts\activateLinux/macOS:
source venv/bin/activatepip install -r requirements.txtpython app.pyOpen:
http://localhost:5000
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Load Dashboard |
| POST | /predict | Predict Expiry Date |
{
"temperature": 25,
"humidity": 60,
"packaging": "Plastic",
"ingredients": "Milk Powder"
}{
"predicted_shelf_life_days": 365,
"confidence_score": 0.94
}GitHub: https://github.com/Ajinkya-Ghuge
β Star this repository if you found it useful!