Downloads · 30 days
0
SaifulAnw/sa-trashnet-classifier
sa-trashnet-classifier is a machine learning model from SaifulAnw. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This project is a deep learning model for classifying types of trash using the TrashNet dataset. The model is built using PyTorch and includes data preprocessing, model training, evaluation, and performance analysis.
Downloads · 30 days
0
Access
Public
Updated Oct 28, 2024
Repo size
67.1 MB
Likes
0
Public
Click a slice to open those files.
.pth67.1 MB · 100%
From the Hugging Face model README
This project is a deep learning model for classifying types of trash using the TrashNet dataset. The model is built using PyTorch and includes data preprocessing, model training, evaluation, and performance analysis.
To run this project, you'll need to install the required libraries. You can do this by running:
pip install -r requirements.txt
To use the trained model, you can load it and make predictions on new images. Example code for loading the model and making predictions:
import torch
from model import SimpleCNN # Adjust the import based on your project structure
# Load the model
model = SimpleCNN()
model.load_state_dict(torch.load("model.pth"))
model.eval()
# Prepare an image for prediction
# Your image preprocessing code here...
# Make predictions
with torch.no_grad():
outputs = model(image_tensor)
_, predicted = torch.max(outputs.data, 1)
The model is trained using the TrashNet dataset. The training process includes data augmentation, normalization, and the use of a simple CNN architecture. The training script can be found in Modelling-DeepL.py.
The model's performance is evaluated using metrics such as accuracy, precision, recall, and F1-score. The evaluation results are stored in evaluation_results.txt.
The model achieves an accuracy of approximately 0.65 on the validation set. The confusion matrix and classification report provide insights into the model's performance across different trash categories.
Confusion Matrix
This project is licensed under the MIT License - see the LICENSE file for details.