How lakshmir2802/ai-waste-segregation works
Project type and purpose
• This is an AI-powered embedded automation system combining a computer-vision model, real-time inference on a Raspberry Pi, and a servo-motor–driven physical sorting mechanism. Its purpose is to classify waste (organic, recyclable, non-recyclable) and actuate bin flaps accordingly.
File structure
• Top-level artifacts:
• Jupyter notebooks (“Fine Tuning MobileNetV2.ipynb”, “Webcam integration.ipynb”) → model training and inference workflows
• Python script (“servo_motor_control.py”) → hardware control logic for servos
• Demo videos (.mp4) → illustrative system behavior
• README.md & LICENSE → project documentation
• No separate “src” or “backend” folders; code is organized by function (training vs inference vs actuation).
README for additional insights
• Three main sub-systems: model training, real-time classification, physical sorting mechanism
• Hardware stack: Raspberry Pi, webcam, RPi.GPIO, servo motors
• Software stack: Python, TensorFlow/Keras, OpenCV
a. Main components
1. Model Training Environment
• Jupyter notebook
• MobileNetV2 base + custom dataset + data-augmentation
• Output: Saved model artifact (e.g., .h5 or TensorFlow SavedModel)
2. Inference Engine on Raspberry Pi
• Webcam captures frames → OpenCV preprocessing → load model → classify frame
• Service layer (could be simple Python script or notebook) emitting classification events
3. Sorting Actuator
• Servo-motor controller module (servo_motor_control.py)
• RPi.GPIO interface → physical servos → bin flaps
4. Physical Bins
• Three compartments (organic, recyclable, non-recyclable)
5. (Optional) Data Store/Logging
• Logging classifications and actuator actions (could be a simple text file or database)
b. Relationships and interactions
• Training → produces model file → deployed to Pi’s inference directory
• Inference component pulls live frames from webcam → runs model → outputs label
• (Optional) Every classification + action logged for later analysis
c. Architectural patterns & design principles
• Modular separation: training vs. inference vs. actuation
• Clear “data flow” pipeline: raw image → preprocessor → model → decision → actuator
• Hardware abstraction in servo_motor_control.py for easy reuse/improvements
d. Key technologies/frameworks
• TensorFlow/Keras (MobileNetV2)
• OpenCV (frame capture & preprocessing)
• RPi.GPIO (servo control)
• Jupyter notebooks for experimentation and demos