Textile Sort AI Smart Bin
by humna fatima in Circuits > Raspberry Pi
42 Views, 0 Favorites, 0 Comments
Textile Sort AI Smart Bin
The Textile Sort AI Smart Bin is a prototype designed to automate textile sorting using Artificial Intelligence and computer vision. The system captures images of textile samples using a Digital Microscopic camera mounted inside the bin and classifies the material as Cotton, Denim, Polyester, or Wool using a deep learning model(Semantic Segmentation) which is mainly focus on image pixel.
After classification, the system provides visual and audio feedback through an LCD display, RGB LED, and buzzer. A servo-controlled trapdoor mechanism can automatically sort recyclable materials into the compartment and Non-recycle material take it back from Compartment.
This project demonstrates how AI can contribute to smarter textile recycling and support future circular economy initiatives.
Key Features
- AI-powered textile classification
- Raspberry Pi 5 based system
- Digital Microscopic Camera-based fabric detection
- LCD display for classification results
- RGB LED status indicators
- Buzzer notifications
- Servo-controlled sorting mechanism
- Database logging
- Gradio web dashboard for monitoring and control
Supplies
Raspberry Pi 5
USB Digital Microscope Camera
I2C LCD Display
RGB LED
Buzzer
Push Button
2 × Servos
Breadboard
T-Cobbler GPIO Breakout
Jumper Wires
1kΩ Resistors
Power Supply
Cardboard Enclosure
Overview
In this project, a textile sample is placed under a camera inside the bin. The camera captures an image and sends it to an AI model running on the Raspberry Pi.
The AI model analyzes the textile texture and predicts whether the sample is:
- Cotton
- Denim
- Polyester
- Wool
The prediction result is displayed on the LCD screen and stored in database. Depending on the classification result, RGB LEDs, buzzer, and servo motors provide feedback and sorting actions.
System Architecture
Raspberry Pi 5
Camera
AI Model
LCD
RGB LED
Buzzer
Servo Motors
PostgreSQL Database
Gradio Interface
Connect All Components to the Raspberry Pi GPIO Pins:
To make wiring user friendly ,make 20x20 enclosure box.Then Digital Microscopic Camera connect to Raspberry pi to capture the image ,LCD,RGB LED ,2 x servo motors are also connected to Arduino to Display Results, RGB LED turn green and Buzzer beep once or twice to show the indication and 2x servo motors to open and close the trapdoor . Wiring for this mechanism ensure all grounds are connected together and use current-limiting resistors for all components.
Collection and Training of AI Model
Step 4: Collection of the Dataset
For this dataset,100 microscopic images per class were collected as following:
- Cotton
- Denim
- Polyester
- Wool
There are some limitations for collection of dataset for this project. For example Camera should be mounted at the specific distance from trapdoor which also act as a base for textile. for this project ,distance from Camera to base was 13 cm.Light and Camera's focus/Resolution should be static.
After collecting dataset,it was annotated by drawing Polygon shape in Roboflow and export as 50/25/25 to Train model locally .
A UNet MobileNet semantic segmentation model was used to learn textile texture patterns from microscope images.
For Training Model for this project,semantic segmentation's model UNet-MobileNet used in google colab.Because this is fast and simple model to train . And in attached images the confusion matrix ,heatmap and F1 score are present .
The final model achieved reliable classification performance suitable for prototype testing.
Hardware and Software Deployment
After training the dataset ,need to deploy hardware and software wireless.so for testing ,prototype should work like actual Smart Bin.
For this need to following following steps:
- After plugin the pi start.
- Lcd shows the IP adress with welcome note and ready for scan/test.
- Place the fabric/piece of textile on base/Trapdoor.
- Mounted Camera scan with the short press of GPIO button.
- Model predict the Reult or class of Textile/Fabric.
- Based on predicted result ,LCD shows name,confidence score and status(recycle/non-recycle)
- If Recycle,RGB LED turns green ,buzzer beep once,Servo move 90 rightside and -90 leftside to open trapdoor,represent class cotton,
- If DownScale,RGB LED,turns blue,buzzer beep 3 ,servo movement same as cotton(trapdoor open) represent class Denim .
- If DownScale,RGB LED,turns blue,buzzer beep 3 ,servo movement same as cotton(trapdoor open)represent class wool.
- If Non-Recycle,RGB LED turns red,buzzer beep 2,servo dont move and fabric need to be take it out from base,represent class Polyester.
- this operation perfom without directly connect to Gradio/interface but with IP adress can be possible.
Database Logging
For Datalogging,use this erd to save every scan into database. And by connectiong gradio with databse,its easy to get scan history .
Future Work
Future improvements include increasing the dataset size, adding support for blended fabrics, improving segmentation accuracy, integrating multiple sorting bins, and implementing automatic dataset expansion through user feedback. The system could also be adapted for industrial textile recycling facilities and smart waste management systems.