농산물 상품 등급을 위해, 이미지데이터와 csv데이터를 제공한다.
먼저 이미지 데이터로 상품의 종류를 분류해야한다.
이후, 분류된 상품 종류와, csv데이터를 고려하여 상품의 등급을 예측해야 한다.
이미지 데이터는 8 종류, 각 train 800장, test 100장 그리고 채점 데이터 Validation 100장을 제공한다.
csv데이터는 ['fruit_name', 'grade', 'width', 'height', 'weight']의 컬럼이 존재하며, 마찬가지로 train, test, validation을 제공한다.
최종적으로, Validation의 데이터로 ['fruit_name', 'grade']를 예측하여 csv파일로 제출한다
- 농산물 종류는 ['apple_fuji', 'apple_yanggwang', 'mandarine_onjumilgam', 'mandarine_hallabong', 'pear_chuhwang', 'pear_singo', 'persimmon_daebong', 'persimmon_bansi', 'persimmon_booyu'] 로 총 8가지가 있다.
!git clone https://github.com/yuri0329/AIFactory_FruitQC.gitTrain / 800 /content/AIFactory_FruitQC/Train/persimmon_daebong_L_18-34_4DI45.png

Train / 800 /content/AIFactory_FruitQC/Train/persimmon_bansi_L_22-24_4DI45.png

Train / 800 /content/AIFactory_FruitQC/Train/persimmon_booyu_L_11-40_5DI90.png

Train / 800 /content/AIFactory_FruitQC/Train/apple_fuji_L_3-4_4DI45.png

Train / 800 /content/AIFactory_FruitQC/Train/pear_chuhwang_L_28-16_1TOP.png

Train / 800 /content/AIFactory_FruitQC/Train/mandarine_hallabong_M_58-4_4DI45.png

Train / 800 /content/AIFactory_FruitQC/Train/mandarine_onjumilgam_L_12-2_2FR45.png

Train / 800 /content/AIFactory_FruitQC/Train/pear_singo_L_22-18_3FR90.png

Conv2D, Activation, MaxPooling2D, Flatten, Dense, Dropout을 사용한다.
특히, 모델의 Dropout 0.5를 적용하여 과적합을 방지한다.
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d (Conv2D) (None, 126, 126, 32) 896
activation (Activation) (None, 126, 126, 32) 0
max_pooling2d (MaxPooling2D (None, 63, 63, 32) 0
)
conv2d_1 (Conv2D) (None, 61, 61, 32) 9248
activation_1 (Activation) (None, 61, 61, 32) 0
max_pooling2d_1 (MaxPooling (None, 30, 30, 32) 0
2D)
conv2d_2 (Conv2D) (None, 28, 28, 64) 18496
activation_2 (Activation) (None, 28, 28, 64) 0
max_pooling2d_2 (MaxPooling (None, 14, 14, 64) 0
2D)
flatten (Flatten) (None, 12544) 0
dense (Dense) (None, 1024) 12846080
activation_3 (Activation) (None, 1024) 0
dropout (Dropout) (None, 1024) 0
dense_1 (Dense) (None, 8) 8200
activation_4 (Activation) (None, 8) 0
=================================================================
Total params: 12,882,920
Trainable params: 12,882,920
Non-trainable params: 0
_________________________________________________________________


fruit_name cate3 width height weight
0 apple_fuji 상 8.6 7.5 290
40 apple_fuji 상 9.5 7.5 295
80 apple_fuji 상 8.8 7.2 270
120 apple_fuji 상 8.6 7.1 275
160 apple_fuji 상 8.1 7.1 265
... ... ... ... ... ...
46398 pear_chuhwang 상 8.6 8.8 455
46435 pear_chuhwang 상 10.0 9.2 485
46463 pear_chuhwang 상 9.3 8.6 470
46499 pear_chuhwang 상 9.8 8.4 455
46557 pear_chuhwang 상 10.2 9.0 535








농산물 등급 (cate3) 항목은 ‘width’와 'weight;항목에 연관이 가장 높았다.
<Normalize Scale>
('LogisticRegression', -0.429136594493451, {'penalty': 'l2'})
_________________________________________________________
('RandomForestClassifier', -0.6322507350975675, {'criterion': 'gini', 'max_depth': 5, 'min_samples_leaf': 0.5})
_________________________________________________________
('KNeighborsClassifier', -0.2807270783213044, {'algorithm': 'brute', 'n_neighbors': 6, 'weights': 'distance'})
_________________________________________________________
('Ridge', -0.2909873526073136, {'alpha': 0.01})
_________________________________________________________
('Lasso', -0.29102530552666706, {'alpha': 0.001})
_________________________________________________________
('ElasticNet', -0.29249897461189617, {'alpha': 0.001})
_________________________________________________________
<Standard Scale>
('LogisticRegression', -0.3491446137396418, {'penalty': 'l2'})
_________________________________________________________
('RandomForestClassifier', -0.6322507350975675, {'criterion': 'gini', 'max_depth': 5, 'min_samples_leaf': 0.5})
_________________________________________________________
('KNeighborsClassifier', -0.28191659983961503, {'algorithm': 'kd_tree', 'n_neighbors': 6, 'weights': 'uniform'})
_________________________________________________________
('Ridge', -0.2909152829665002, {'alpha': 1})
_________________________________________________________
('Lasso', -0.29085022953188533, {'alpha': 0.001})
_________________________________________________________
('ElasticNet', -0.2908715799677278, {'alpha': 0.001})
_________________________________________________________