Skip to content

Akhila707/Intellistock

Repository files navigation

Β  Β 

πŸ† Presented at ICNCS 2025, VIT Chennai Hybrid LSTM + YOLOv8 system for predictive demand forecasting and real-time smart shelf monitoring


πŸ“Œ Table of Contents


🧠 Overview

IntelliStock is an intelligent, hybrid inventory management system that combines the power of deep learning-based time series forecasting (LSTM/BiLSTM) with real-time computer vision (YOLOv8) to automate stock monitoring and predict demand before shortages occur.

Traditional inventory systems are reactive β€” they restock after products run out. IntelliStock flips this model by:

  • πŸ“· Seeing shelf stock levels in real-time via camera feeds using YOLOv8
  • πŸ“ˆ Predicting future demand using LSTM-based sequence modeling
  • πŸ”” Alerting when to reorder, before shelves go empty

This makes it ideal for retail stores, warehouses, supermarkets, and smart supply chains.


✨ Key Features

  • 🎯 Hybrid AI Pipeline β€” Seamlessly integrates YOLOv8 object detection with LSTM demand forecasting
  • πŸ“Š Predictive Refill Alerts β€” Forecasts stock depletion before it happens
  • πŸ–ΌοΈ Image-Driven Inventory Tracking β€” Real shelf images β†’ automatic item counts
  • ⚑ Scalable Batch Pipelines β€” Efficiently processes large-scale image and time-series data
  • πŸ“‰ Ultra-Low Forecasting Error β€” Achieved MAE = 0.0020 on test data
  • πŸ”„ End-to-End Automation β€” From image capture to reorder recommendation, fully automated
  • πŸ“¦ Modular Design β€” Vision and forecasting modules can be used independently

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    IntelliStock Pipeline                 β”‚
β”‚                                                         β”‚
β”‚  πŸ“· Camera / Image Feed                                  β”‚
β”‚           β”‚                                             β”‚
β”‚           β–Ό                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   YOLOv8 Module │────▢│  Stock Count Extractor    β”‚  β”‚
β”‚  β”‚  (Object Det.)  β”‚     β”‚  (ROI-based Counting)     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                      β”‚                  β”‚
β”‚                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚                          β”‚   Time Series Database     β”‚  β”‚
β”‚                          β”‚   (Stock Level History)    β”‚  β”‚
β”‚                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                      β”‚                  β”‚
β”‚                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚                          β”‚   LSTM / BiLSTM Forecaster β”‚  β”‚
β”‚                          β”‚   (Demand Prediction)      β”‚  β”‚
β”‚                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                      β”‚                  β”‚
β”‚                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚                          β”‚   Alert & Reorder Engine   β”‚  β”‚
β”‚                          β”‚   πŸ“¦ Refill Recommendation β”‚  β”‚
β”‚                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Category Tools
Computer Vision YOLOv8 (Ultralytics), OpenCV
Deep Learning PyTorch, LSTM, BiLSTM
Data Processing Pandas, NumPy
Visualization Matplotlib, Seaborn
ML Utilities Scikit-learn
Deployment Flask / Streamlit
Version Control Git, GitHub
Language Python 3.9+

πŸ“ Project Structure

IntelliStock/
β”‚
β”œβ”€β”€ πŸ“‚ data/
β”‚   β”œβ”€β”€ raw/                    # Raw image datasets & sales records
β”‚   β”œβ”€β”€ processed/              # Cleaned & preprocessed data
β”‚   └── time_series/            # Stock level time series data
β”‚
β”œβ”€β”€ πŸ“‚ models/
β”‚   β”œβ”€β”€ yolov8/                 # YOLOv8 weights & config
β”‚   β”‚   β”œβ”€β”€ best.pt             # Trained YOLOv8 model
β”‚   β”‚   └── data.yaml           # Dataset config
β”‚   └── lstm/
β”‚       β”œβ”€β”€ lstm_model.pth      # Trained LSTM weights
β”‚       └── bilstm_model.pth    # Trained BiLSTM weights
β”‚
β”œβ”€β”€ πŸ“‚ src/
β”‚   β”œβ”€β”€ detection/
β”‚   β”‚   β”œβ”€β”€ detect_shelf.py     # YOLOv8 shelf detection
β”‚   β”‚   └── roi_extractor.py    # ROI-based stock counter
β”‚   β”œβ”€β”€ forecasting/
β”‚   β”‚   β”œβ”€β”€ lstm_model.py       # LSTM architecture
β”‚   β”‚   β”œβ”€β”€ bilstm_model.py     # BiLSTM architecture
β”‚   β”‚   └── train.py            # Training script
β”‚   β”œβ”€β”€ pipeline/
β”‚   β”‚   β”œβ”€β”€ batch_pipeline.py   # Scalable batch processing
β”‚   β”‚   └── alert_engine.py     # Reorder alert system
β”‚   └── utils/
β”‚       β”œβ”€β”€ preprocess.py       # Data preprocessing
β”‚       └── visualize.py        # Plotting & dashboards
β”‚
β”œβ”€β”€ πŸ“‚ notebooks/
β”‚   β”œβ”€β”€ EDA.ipynb               # Exploratory data analysis
β”‚   β”œβ”€β”€ LSTM_Training.ipynb     # Model training walkthrough
β”‚   └── YOLOv8_Training.ipynb   # Vision model training
β”‚
β”œβ”€β”€ πŸ“‚ results/
β”‚   β”œβ”€β”€ metrics/                # MAE, RMSE, accuracy logs
β”‚   └── plots/                  # Forecast charts & detection outputs
β”‚
β”œβ”€β”€ app.py                      # Streamlit / Flask app entry point
β”œβ”€β”€ requirements.txt
└── README.md

πŸš€ Getting Started

Prerequisites

Python >= 3.9
pip
Git

1. Clone the Repository

git clone https://github.com/Akhila707/Intellistock.git
cd Intellistock

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate        # Linux/Mac
venv\Scripts\activate           # Windows

3. Install Dependencies

pip install -r requirements.txt

4. Run Object Detection Module

python src/detection/detect_shelf.py --source data/raw/shelf_images/

5. Train LSTM Forecasting Model

python src/forecasting/train.py --epochs 100 --model lstm

6. Run the Full Pipeline

python src/pipeline/batch_pipeline.py

7. Launch Dashboard

streamlit run app.py

πŸ€– Model Details

🎯 YOLOv8 β€” Shelf Object Detection

Parameter Value
Base Model YOLOv8n / YOLOv8s
Task Object Detection
Input Shelf camera images
Output Bounding boxes + item counts
Training Data Custom shelf image dataset
  • Detects individual products on retail shelves
  • Counts items per shelf zone using ROI (Region of Interest) extraction
  • Feeds real-time stock count data into the forecasting pipeline

πŸ“ˆ LSTM / BiLSTM β€” Demand Forecasting

Parameter Value
Architecture LSTM / Bidirectional LSTM
Input Sequential stock level history
Output Predicted future demand
Loss Function Mean Absolute Error (MAE)
Test MAE 0.0020
Optimizer Adam
  • Learns temporal patterns in stock depletion
  • BiLSTM captures both forward and backward dependencies in demand patterns
  • Outputs future demand values to trigger reorder alerts

πŸ“Š Results

Metric Value
MAE (Mean Absolute Error) 0.0020
Detection Accuracy High precision on shelf items
Pipeline Scalability Batch processing ready
Alert Lead Time Configurable (hours / days ahead)

πŸ“‰ MAE of 0.0020 achieved on demand forecasting test set β€” indicating near-perfect stock prediction accuracy.


πŸ”„ Pipeline Workflow

1. πŸ“·  Capture shelf images (live camera / batch upload)
        β”‚
2. πŸ”  YOLOv8 detects & counts products per shelf zone
        β”‚
3. πŸ“₯  Stock counts logged to time series database
        β”‚
4. 🧠  LSTM/BiLSTM forecasts next N-day demand
        β”‚
5. ⚠️  Alert engine checks forecast vs. reorder threshold
        β”‚
6. πŸ“¦  Reorder recommendation generated automatically

πŸ† Conference

This project was presented at:

ICNCS 2025 β€” International Conference on Networks and Communication Systems Venue: VIT Chennai Paper: IntelliStock β€” Predictive Refill & Smart Shelf Monitoring Author: PV Akhila


πŸ‘©β€πŸ’» Author

PV Akhila Data Scientist | AI & ML Researcher | Physics Background


⭐ If you find this project useful, please consider giving it a star!

About

IntelliStock is an intelligent, hybrid inventory management system that combines the power of deep learning-based time series forecasting (LSTM/BiLSTM) with real-time computer vision (YOLOv8) to automate stock monitoring and predict demand before shortages occur.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages