IMS


Introduction


Inventory management plays a crucial role in optimizing supply chain operations. Traditional manual tracking methods are often time-consuming and prone to errors. In this article, we introduce an automated inventory management system powered by computer vision (CV) and machine learning (ML). This system streamlines object classification, data logging, and insight generation, making inventory tracking efficient and accurate.

Our solution integrates image capture, classification, auto-labeling, and data augmentation to track tools, stationery, and electronic devices such as "spoon," "Fevicol," "mouse," and "HC05-Bluetooth" with minimal manual intervention.

System Architecture


Our inventory management system consists of four key components:
Python : 3.10
tensorflow : 3.10
cuda : 12.8


1. Image Capture and Classification


Scripts: itcnt.py, capture.py

Key Features:

User-Friendly GUI: Built with Tkinter for an intuitive experience.

Real-Time Classification: Utilizes a TensorFlow/Keras model trained to recognize objects from labels.txt.

Automated Logging: Captures classified images with metadata (object name, confidence score, timestamp) and saves them to image_counts.xlsx.

Auto-Capture Mode: Captures images every 3 seconds when confidence exceeds 80%.

2. Training Data Collection


Scripts: main.py, capture.py

Key Features:

Image Collection: Captures training images via webcam and organizes them into labeled folders.

CSV Logging: Stores filenames and labels in labels.csv for model retraining.

3. Auto-Labeling with GroundingDINO


Script: dinolabel.py

Key Features:

Automatic Bounding Box Generation: Uses the GroundingDINO model to detect and label objects in YOLO format.

Annotation File Creation: Generates .txt annotation files with normalized coordinates for training object detection models.

4. Data Augmentation


Script: yolo_trainer.py

Key Features:

Synthetic Data Generation: Overlays detected objects on random backgrounds.

YOLO-Compatible Outputs: Generates enhanced datasets for robust model training.

Key Workflows


1. Inventory Tracking


Image Input: Users upload images or capture frames via webcam.

Classification: The TensorFlow model predicts object class and confidence.

Data Logging: Results are saved in an Excel sheet, grouped by date with object counts.

2. Model Training Pipeline


Data Collection: Capture images of new objects using main.py.

Auto-Labeling: Generate annotations with dinolabel.py.

Augmentation: Improve dataset diversity using yolo_trainer.py.

Retraining: Update the TensorFlow/Keras model with new data.

Technical Implementation

  • Machine Learning Framework: TensorFlow/Keras for classification, GroundingDINO for object detection.
  • Image Processing: OpenCV for resizing, normalization, and webcam integration.
  • Data Management:
    • Excel: Stores timestamps, object class IDs, and confidence scores.
    •  CSV & YOLO Files: Facilitate model retraining and object detection.
  • GUI Interface: Tkinter-based design for image display, control buttons, and real-time feedback.

** INSTALL **
1. conda create -n ims2 python=3.10
2. conda activate ims2
3. conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
4. python -m pip install "tensorflow==2.10"
5. conda install -c nvidia cuda-nvcc

pip install vit-keras
pip install tensorflow_addons

ver1- working model
ver2- append/overwrite images
ver3- image file size, give option to choose camera source, 
ver4-  vision transformer vit keras

Benefits

✅ Higher Accuracy: Reduces human error with ML-driven classification (confidence threshold: 80%).
✅ Increased Efficiency: Auto-capture and logging reduce manual effort by approximately 50%.
✅ Scalability: Easily add new object classes via retraining.
✅ Cost-Effective: Built with open-source tools like OpenCV and TensorFlow, avoiding licensing costs.

Challenges and Solutions


Challenge

  • Varied lighting and angles
  • Low-confidence predictions


Solution

  • Data augmentation (yolo_trainer.py)
  • Auto-capture ignores images < 80%



Conclusion


This AI-driven inventory management system revolutionizes tracking by leveraging computer vision and machine learning. By automating classification, labeling, and data augmentation, businesses can enhance efficiency and minimize errors in their inventory processes. With a scalable and cost-effective design, this system offers a practical solution for modern inventory management. 🚀

Comments