Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ Smart Retail Inventory Management System with AI/ML

A full-stack Django-based Smart Retail Inventory Management System integrated with Machine Learning for anomaly detection. The system helps retailers manage products, inventory, sales, reports, authentication, and AI-powered analytics.


πŸ“Œ Features

πŸ‘€ Authentication

  • User Login
  • User Registration
  • Forgot Password
  • Password Reset via Email
  • Logout
  • Role-Based Access Control (Admin, Manager, Staff)

πŸ“¦ Product Management

  • Add Products
  • Update Products
  • Delete Products
  • Product Listing
  • Product Search

πŸ“Š Inventory Management

  • Stock In
  • Stock Out
  • Inventory Records
  • Low Stock Detection

πŸ’° Sales Management

  • Record Sales
  • Sales History
  • Revenue Calculation
  • Sales Analytics

πŸ“‘ Reports

  • Sales Report (PDF)
  • Inventory Report (Excel)
  • AI Anomaly Report (PDF)

πŸ€– AI Analytics

Three anomaly detection techniques are implemented.

Method 1 – Z-Score

Statistical anomaly detection based on standard deviation.

Method 2 – Isolation Forest

Machine Learning model trained using historical retail sales data.

Method 3 – Local Outlier Factor (LOF)

Density-based anomaly detection algorithm.


πŸ”’ Role Based Access

Admin

  • Full Access

Manager

  • Products
  • Inventory
  • Sales
  • Reports
  • AI Analytics

Staff

  • Products
  • Inventory
  • Sales

Staff users cannot access:

  • Reports
  • AI Analytics

🧠 Machine Learning Workflow

Training Dataset
        β”‚
        β–Ό
Data Preprocessing
        β”‚
        β–Ό
StandardScaler
        β”‚
        β–Ό
Isolation Forest
        β”‚
        β–Ό
Local Outlier Factor
        β”‚
        β–Ό
Save Trained Models (.pkl)
──────────────────────────────────
        β”‚
        β–Ό
Django Application
        β”‚
        β–Ό
Load Trained Models
        β”‚
        β–Ό
Predict Anomalies

πŸ—οΈ Project Structure

SmartRetailInventory/

β”‚
β”œβ”€β”€ accounts/
β”œβ”€β”€ analytics_dashboard/
β”œβ”€β”€ api/
β”œβ”€β”€ inventory/
β”œβ”€β”€ products/
β”œβ”€β”€ reports/
β”œβ”€β”€ sales/
β”‚
β”œβ”€β”€ ai_engine/
β”‚   β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ train_model.py
β”‚   β”œβ”€β”€ predict.py
β”‚   β”œβ”€β”€ predict_lof.py
β”‚   β”œβ”€β”€ database_detector.py
β”‚   β”œβ”€β”€ database_isolation.py
β”‚   β”œβ”€β”€ database_lof.py
β”‚   └── anomaly_detector.py
β”‚
β”œβ”€β”€ static/
β”œβ”€β”€ templates/
β”œβ”€β”€ manage.py
└── requirements.txt

βš™οΈ Technologies Used

Backend

  • Python
  • Django
  • Django REST Framework

Frontend

  • HTML5
  • CSS3
  • Bootstrap 5
  • JavaScript
  • Chart.js

Database

  • SQLite3

Machine Learning

  • Scikit-learn
  • Isolation Forest
  • Local Outlier Factor
  • Z-Score
  • StandardScaler
  • Joblib
  • Pandas
  • NumPy

Reporting

  • ReportLab
  • OpenPyXL

πŸš€ Installation

Clone Repository

git clone https://github.com/YOUR_USERNAME/SmartRetailInventory.git

cd SmartRetailInventory

Create Virtual Environment

Windows

python -m venv myenv

myenv\Scripts\activate

Linux / macOS

python3 -m venv myenv

source myenv/bin/activate

Install Dependencies

pip install -r requirements.txt

Apply Migrations

python manage.py makemigrations

python manage.py migrate

Create Superuser

python manage.py createsuperuser

Train Machine Learning Models

python ai_engine/train_model.py

This creates:

ai_engine/models/

isolation_forest.pkl

lof.pkl

scaler.pkl

Run Server

python manage.py runserver

Open

http://127.0.0.1:8000/

πŸ“‘ REST API

Example APIs

GET /api/products/

GET /api/inventory/

GET /api/sales/

πŸ“Έ Screenshots

Login Page

Login Page


Dashboard

Dashboard


Products

Products


Inventory

Inventory

Sales

Sales


Reports

Reports


AI Analytics

Analytics


πŸ“Š Machine Learning Models

Algorithm Purpose
Z-Score Statistical anomaly detection
Isolation Forest Machine Learning anomaly detection
Local Outlier Factor Density-based anomaly detection

🎯 Future Enhancements

  • Email Notifications
  • Barcode Scanner
  • QR Code Support
  • Demand Forecasting
  • Sales Prediction
  • Deep Learning Models
  • Cloud Deployment
  • PostgreSQL Support

πŸ‘¨β€πŸ’» Developer

  • Anamika Kumari
  • Shekhar Kumar Ray
  • Ashwini Kumar Sinku

Computer Science and Engineering Student

AI | Machine Learning | Full Stack Django Developer


⭐ If you like this project

Please consider giving it a ⭐ on GitHub.

About

AI-powered retail inventory management system with real-time tracking, analytics, anomaly detection, and smart alerts.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages