대회 소개
Plant Seedlings Classification
Determine the species of a seedling from an image
https://www.kaggle.com/c/plant-seedlings-classification
Description
Can you differentiate a weed from a crop seedling?
The ability to do so effectively can mean better crop yields and better stewardship of the environment.
The Aarhus University Signal Processing group, in collaboration with University of Southern Denmark, has recently released a dataset containing images of approximately 960 unique plants belonging to 12 species at several growth stages.
We’re hosting this dataset as a Kaggle competition in order to give it wider exposure, to give the community an opportunity to experiment with different image recognition techniques, as well to provide a place to cross-pollenate ideas.
Baseline 코드
1 |
|
데이터 불러오기
1 |
|
path | label | |
---|---|---|
0 | /kaggle/input/plant-seedlings-classification/t... | Scentless Mayweed |
1 | /kaggle/input/plant-seedlings-classification/t... | Scentless Mayweed |
2 | /kaggle/input/plant-seedlings-classification/t... | Scentless Mayweed |
3 | /kaggle/input/plant-seedlings-classification/t... | Scentless Mayweed |
4 | /kaggle/input/plant-seedlings-classification/t... | Scentless Mayweed |
... | ... | ... |
4745 | /kaggle/input/plant-seedlings-classification/t... | Shepherds Purse |
4746 | /kaggle/input/plant-seedlings-classification/t... | Shepherds Purse |
4747 | /kaggle/input/plant-seedlings-classification/t... | Shepherds Purse |
4748 | /kaggle/input/plant-seedlings-classification/t... | Shepherds Purse |
4749 | /kaggle/input/plant-seedlings-classification/t... | Shepherds Purse |
4750 rows × 2 columns
데이터 확인
1 |
|
Train, valid dataset 만들기
- Train, Valid Dataset 나누기
1 |
|
ImgaeDataGenerator
로 데이터 전처리하기
1 |
|
1 |
|
Model 학습
1 |
|
- 모델 Summary
1 |
|
1 |
|
Test Dataset 만들기
- Train, Valid dataset 만들듯이
ImageDataGenerator
를 사용해 전처리하면 된다.
1 |
|
path | |
---|---|
0 | /kaggle/input/plant-seedlings-classification/t... |
1 | /kaggle/input/plant-seedlings-classification/t... |
2 | /kaggle/input/plant-seedlings-classification/t... |
3 | /kaggle/input/plant-seedlings-classification/t... |
4 | /kaggle/input/plant-seedlings-classification/t... |
... | ... |
789 | /kaggle/input/plant-seedlings-classification/t... |
790 | /kaggle/input/plant-seedlings-classification/t... |
791 | /kaggle/input/plant-seedlings-classification/t... |
792 | /kaggle/input/plant-seedlings-classification/t... |
793 | /kaggle/input/plant-seedlings-classification/t... |
794 rows × 1 columns
1 |
|
1 |
|
모델로 예측하기
1 |
|
1 |
|
제출
- 가장 높은 확률의 class(string)를 예측값으로 추출해야 한다.
train_generator.class_indices
로 각 클래스에 해당하는 index를 가져온다.
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
file | species | |
---|---|---|
0 | fd87b36ae.png | Loose Silky-bent |
1 | 0e8492cb1.png | Sugar beet |
2 | 8d6acbe9b.png | Common Chickweed |
3 | 54b3afd58.png | Cleavers |
4 | 6049234e6.png | Fat Hen |
... | ... | ... |
789 | 4c7838de4.png | Common Chickweed |
790 | fda39e16f.png | Loose Silky-bent |
791 | da4ed3a28.png | Charlock |
792 | a83820a2c.png | Sugar beet |
793 | e4a76885b.png | Maize |
794 rows × 2 columns
1 |
|