Yuechen Yang commited on
Commit
9bfbbce
1 Parent(s): 868dd89

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +53 -0
README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Garbage Classification
2
+
3
+ ## Overview
4
+
5
+ ### Backgroud
6
+ Garbage classification refers to the separation of several types of different categories in accordance with the environmental impact of the use of the value of the composition of garbage components and the requirements of existing treatment methods.
7
+
8
+ The significance of garbage classification:
9
+ 1. Garbage classification reduces the mutual pollution between different garbage, which is beneficial to the recycling of materials.
10
+ 2. Garbage classification is conducive to reducing the final waste disposal volume.
11
+ 3. Garbage classification is conducive to enhancing the degree of social civilization.
12
+
13
+ ### Dataset
14
+ The garbage classification dataset is from Kaggle. There are totally 2467 pictures in this dataset. And this model is an image classification model for this dataset. There are 6 classes for this dataset, which are cardboard (393), glass (491), metal (400), paper(584), plastic (472), and trash(127).
15
+
16
+ ### Model
17
+ The model is based on the [ViT](https://huggingface.co/google/vit-base-patch16-224-in21k) model, which is short for the Vision Transformer. It was introduced in the paper [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://arxiv.org/abs/2010.11929), which was introduced in June 2021 by a team of researchers at Google Brain. And first released in [this repository](https://github.com/rwightman/pytorch-image-models). I trained this model with PyTorch. I think the most different thing between using the transformer to train on an image and on a text is in the tokenizing step.
18
+
19
+ There are 3 steps to tokenize the image:
20
+ 1. Split an image into a grid of sub-image patches
21
+ 2. Embed each patch with a linear projection
22
+ 3. Each embedded patch becomes a token, and the resulting sequence of embedded patches is the sequence you pass to the model.
23
+
24
+ I trained the model with 10 epochs, and I use Adam as the optimizer. The accuracy on the test set is 95%.
25
+
26
+ ## Huggingface Space
27
+ Huggingface space is [here](https://huggingface.co/yangy50/garbage-classification).
28
+
29
+ ## Huggingface Model Card
30
+ Huggingface model card is [here](https://huggingface.co/yangy50/garbage-classification/tree/main).
31
+
32
+ ## Critical Analysis
33
+ 1. Next step: build a CNN model on this dataset and compare the accuracy and training time for these two models.
34
+
35
+ 2. Didn’t use the Dataset package to store the image data. Want to find out how to use the Dataset package to handle image data.
36
+
37
+
38
+ ## Resource Links
39
+
40
+ [vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k)
41
+
42
+ [Garbage dataset](https://huggingface.co/cardiffnlp/twitter-roberta-base)
43
+
44
+ [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://arxiv.org/abs/2010.11929)
45
+
46
+ ## Code Demo
47
+
48
+ [Code Demo](https://github.com/yuechen-yang/garbage-classification) is inside this repo
49
+
50
+ ## Repo
51
+ In this repo
52
+
53
+ ## Video Recording