My Inspiration
When I clean out my closet, I find many clothes, accessories, and footwear that I have either grown out of or no longer use. Instead of letting them pile up in the back of my drawers, I wondered if I could upcycle them in a creative way. After doing some research, I learned that the fashion industry is one of the biggest contributors to environmental waste. This inspired me to create EcoThreads—an intelligent tool to help people repurpose their old clothes by offering fun, practical, and sustainable ways to upcycle them.
Impact for Hong Kong
EcoThreads could significantly impact Hong Kong's fashion landscape, where fast fashion is a major contributor to waste. Hong Kong is a global fashion hub, with a retail market worth over USD 4-5 billion in apparel sales annually, but it also faces severe environmental challenges. The city generates approximately 300 tonnes of textile waste each day, with the majority of clothing being discarded after only a few uses. Fast fashion, driven by trends, has led to a culture of disposable clothing, making it one of the largest environmental pollutants in Hong Kong. EcoThreads provides a solution by encouraging sustainable practices through upcycling, helping individuals to repurpose old garments instead of discarding them. Its AI-powered platform is easily accessible, making sustainable fashion creativity available to a wide audience—from casual users to eco-conscious creators. As Hong Kong continues to push for more sustainable solutions—such as its "Waste Blueprint for Hong Kong 2035" aiming to cut waste by 40%—the platform aligns with the city's green initiatives and can directly contribute to reducing textile waste while promoting a shift toward a circular economy. By combining technology with sustainability, EcoThreads can help Hong Kong's fashion industry evolve toward a more environmentally responsible and innovative future.
What EcoThreads does
EcoThreads is a web application that helps users classify and upcycle clothes, accessories, and other textiles to reduce waste. It uses a deep-learning image classification model to identify seven clothing categories: Apparel, Accessories, Footwear, Personal Care, Free Items (a Miscellaneous category), Sporting Goods, and Home. Users can upload images of their wardrobe items, and, after classifying them, EcoThreads suggests creative upcycling ideas to repurpose the clothing, helping extend its life and avoid landfills.
How I Built EcoThreads
I used a Vision Transformer pre-trained model for image classification, and fine-tuned the model with a "fashion-images" dataset, which includes over 44,000 samples and seven categories of wardrobe items. In my training loop, I adjusted class weights to handle imbalances in the dataset, improving model performance. I developed the backend of the app using the Flask framework to load the trained model and handle image uploads, creating API routes to process user inputs and return classification results in JSON format. Finally, I tied this all together by developing a clean, user-friendly front-end using HTML, CSS, and JavaScript to display predictions and upcycling suggestions.
Challenges I Faced
After training my model for the first time and encountering errors with its classification accuracy, I discovered that my “fashion-dataset” is imbalanced–around half of the 44,000+ samples are of the “Apparel” category. I attempted various undersampling techniques—first, I created class weights based on the frequencies of each category, which would hold the smaller categories to higher weightage, training the model equally. When that didn’t affect the model’s accuracy, I then created a method which would reduce the sample size of each category—however, that reduced the frequencies of every class, not just the larger ones, resulting in a still imbalanced dataset. Finally, I reduced the size of the Apparel category to 8000 samples, so that it is similar to the distributions of the Accessories and Footwear categories. This finally worked! I was then able to train my model and achieve an average accuracy of 80-90%.
Accomplishments I’m Proud Of!
I’m proud of my integration of my app’s frontend and backend! There is a smooth and uninterrupted communication between the Flask framework and HTML, especially while handling image uploads and predictions. I’m also proud that I was able to successfully develop a deep learning model that classifies seven categories of textiles with an accuracy of 80-90%.
What I Learned
Through this project, I learned so much about deep learning and image classification, handling data efficiently, and web development. I gained hands-on experience with Vision Transformer models, and learned how to fine-tune pre-trained models for specific tasks. Through my challenges while training my model, I learned how to handle imbalanced datasets, using undersampling techniques and by adjusting class weights. Developing the frontend for my application helped me grow in web development skills and strengthen my previous experience with HTML, CSS, and JavaScript—now, I’ve also picked up the skill of integrating machine learning models with web applications using the Flask framework.
What's Next for EcoThreads
I have many ideas to continue developing EcoThreads! First, I would add more categories to the model, such as outerwear, bags, and household textiles. This would provide the users a wider range of upcycling suggestions. I could also enhance these suggestions by integrating a recommendation system to offer more personalized upcycling ideas based on user preferences and the type of item uploaded—for example, the system could share different DIY projects based on the resources/time/abilities the user has. EcoThreads could also grow to include a collaborative forum, where users can share their own upcycling ideas and creations, building a community around sustainability and creativity.
Built With
- flask
- html/css
- hugging-face-datasets-api
- hugging-face-transformers-api
- javascript
- pico.css
- python
- pytorch
- scikit-learn
- tensorflow
- torchvision
- tqdm
- vision-transformer
Log in or sign up for Devpost to join the conversation.