Skip to content

Ajinkya-Ghuge/Datasphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Project Banner

Expiry Date Predictor

πŸ§ͺ Smart AI Shelf-Life Prediction Platform

By Ajinkya Ghuge

An AI-powered intelligence platform built to predict the expiry dates and shelf stability of food and pharmaceutical products using machine learning.


Python Flask scikit-learn Pandas


"No more manual tracking or guesswork. Just smart, accurate stability predictions based on data."


πŸ“‹ Table of Contents

# 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

🎯 Project Overview

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.

Core Objectives

  • 🧾 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.

✨ Key Features

  • πŸ” 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.

πŸ—οΈ System Architecture

Component Diagram

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
Loading

πŸ”„ Request Flow

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
Loading

πŸ€– Machine Learning Pipeline

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"]
Loading

πŸš€ Project Workflow

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])
Loading

πŸ› οΈ Tech Stack

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

πŸ“‚ Project Structure

expiry-predictor/
β”‚
β”œβ”€β”€ data/
β”‚   └── datasets/
β”‚
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ js/
β”‚   └── images/
β”‚
β”œβ”€β”€ templates/
β”‚
β”œβ”€β”€ notebooks/
β”‚
β”œβ”€β”€ app.py
β”œβ”€β”€ model.py
β”œβ”€β”€ constraint.py
β”œβ”€β”€ requirements.txt
└── README.md

⚑ Installation & Local Setup

Prerequisites

  • Python 3.8+
  • pip

Clone Repository

git clone https://github.com/Ajinkya-Ghuge/Datasphere.git

cd Datasphere

Create Virtual Environment

python -m venv venv

Windows:

venv\Scripts\activate

Linux/macOS:

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Run Application

python app.py

Open:

http://localhost:5000

πŸ”Œ API Reference

Method Endpoint Description
GET / Load Dashboard
POST /predict Predict Expiry Date

Example Request

{
  "temperature": 25,
  "humidity": 60,
  "packaging": "Plastic",
  "ingredients": "Milk Powder"
}

Example Response

{
  "predicted_shelf_life_days": 365,
  "confidence_score": 0.94
}

πŸ‘€ Author

Ajinkya Ghuge

GitHub: https://github.com/Ajinkya-Ghuge

⭐ Star this repository if you found it useful!

About

Shelf life prediction solution To Avoid Wastage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors