[PYTHON] "Garbage classification by image!" App creation diary day1 ~ Data set creation ~

Introduction

How much do you know about garbage classification?

For example, an extension cord that you can't let go of when traveling. I think that it is also very active around the desk. Such an extension cord, for example, when you throw it away because it becomes unusable due to poor contact, what kind of garbage do you throw away?

Would you like to dispose of it as combustible waste? The answer is resources (metals) and the area where I live, but the exact answer depends on the municipality. For example, it seems to be combustible waste in Yokohama City. In addition, it seems to be treated as non-burnable garbage in Nagareyama City. As you can see, how to dispose of the same garbage depends on the incineration facility and the population (that is, the amount of garbage generated), but are you disposing of the garbage correctly? Few people are familiar with how to put out trash, let alone check everything from scratch on the day when the way of throwing away changes due to moving. So, I decided to make a web application that would tell me the proper classification if I took a picture of the garbage.

Since it is a great deal, I would like to keep a record of this process in the form of a diary. I hope you look forward to the sequel if you like.


Article list

-"Trash classification by image!" App creation diary day1 ~ Data set creation ~ ← Imakoko -"Trash classification by image!" App creation diary day2-Fine-tuning with VGG16- -"Trash classification by image!" App creation diary day3 ~ Web application with Django ~ -"Trash classification by image!" App creation diary day4 ~ Prepare the front end with Bootstrap ~ -"Trash classification by image!" App creation diary day5-Prepare front end with Bootstrap 2- -"Trash classification by image!" App creation diary day6 ~ Correction of directory structure ~

Description of the app to make

First of all, when you take a picture, the place where the garbage classification is displayed is the minimum you want to do. For the time being, the classification criteria are based on the city of Kashiwa where the author lives (I would like to expand it further if there is demand). Also, I want to be able to display not only the classification but also the points to note when putting out, such as how to put out. For that matter, it would be great if you could add a function to automatically add to the calendar and notify you. I would like to develop while imagining the above.

Specific flow

  1. Creating a dataset
  2. Model creation (VGG16 fine tuning)
  3. Backend implementation (Django)
  4. Frontend implementation (HTML, CSS, Bootstrap)
  5. Create features to add to your calendar

I want to go like this.

Creating a dataset

First of all, I would like to create a dataset on the first day. There are three options:

--Divert existing dataset --Scraping

From the conclusion, I will make my own this time. The main reason is that I want to be able to classify things around me as much as possible considering what I will use. Also, with other methods, I gave up because the existing data set does not contain much likely household waste (naturally), and scraping unexpectedly contains different things in the search results. Did. However, the number of data that can be created by yourself is limited, so if you want to increase the data, you should scrape it.

take a picture

I will take pictures to create a dataset.

PET bottle Tissue (unused) battery
IMG_20201108_105949.jpg IMG_20201108_165803.jpg IMG_20201108_104844.jpg

I finished taking a picture like this. There are 499 in total. I've been shooting for a couple of hours and it was quite difficult, but I didn't get together unexpectedly ... I'll do my best with padding.

Folder structure

The folder structure of images is like this. train ├ Combustible waste │ └ Images (same below) ├ Recyclables ├ Non-burnable garbage ├ Packaging container plastics └ Harmful garbage val ├ Combustible waste │ └ Images (same below) ├ Recyclables ├ Non-burnable garbage ├ Packaging container plastics └ Harmful garbage

This is configured like this so that the classification is automatically generated when creating the model.

github repository

I will develop this app using github. The link (https://github.com/eycjur/garbage).

By the way, I would like to conclude the first day with such a thing. Please look forward to next time


Article list

-"Trash classification by image!" App creation diary day1 ~ Data set creation ~ ← Imakoko -"Trash classification by image!" App creation diary day2-Fine-tuning with VGG16- -"Trash classification by image!" App creation diary day3 ~ Web application with Django ~ -"Trash classification by image!" App creation diary day4 ~ Prepare the front end with Bootstrap ~ -"Trash classification by image!" App creation diary day5-Prepare front end with Bootstrap 2- -"Trash classification by image!" App creation diary day6 ~ Correction of directory structure ~

Recommended Posts

"Garbage classification by image!" App creation diary day1 ~ Data set creation ~
"Garbage classification by image!" App creation diary day2-Fine-tuning with VGG16-
"Trash classification by image!" App creation diary day8 ~ heroku deployment ~
"Trash classification by image!" App creation diary day3 ~ Web application with Django ~
"Trash classification by image!" App creation diary day6 ~ Correction of directory structure ~
"Classify garbage by image!" App creation diary day5 ~ Prepare front end with Bootstrap 2 ~
"Classify garbage by image!" App creation diary day4 ~ Prepare the front end with Bootstrap ~
Web application creation with Django
"Trash classification by image!" App creation diary day3 ~ Web application with Django ~
File creation
Python day 1
Web application development in Go language_Hands-on day 1
WEB application development using Django [Admin screen creation]
Until Django application creation by terminal (development environment)
Deep learning learned by implementation 2 (image classification)