Commit 7b2584df authored by igraf's avatar igraf
Browse files

Update figures in README

parent 3178a159
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -96,6 +96,9 @@ The following table summarizes the performance of different baseline models on t

### Decision Tree




### Random Forest

### CNN (Convolutional Neural Network)
@@ -152,9 +155,11 @@ param_grid = { 'var_smoothing': np.logspace(0,-20, num=20)}
- for some classes, the diagonal is quite bright (e.g. apricots and passion fruits) :arrow_right: the classifier is quite good at predicting these classes
- but we also see that the classifier has a **strong bias** towards some classes (e.g. apricots, jostaberries and passion fruits and figs)

![Naive Bayes Best Parameters](figures/naive_bayes/grid_search_results_50x50_hsv_sobel_var_smoothing_best_params.png)

### Decision Tree

![Decision Tree Best Parameters](figures/decision_tree/grid_search_results_50x50_hsv_sobel_decision_tree_best_params.png)

### Random Forest
**Feature Combinations:**
@@ -225,15 +230,6 @@ Results for RandomForestClassifier classifier on 100x100_standard images:
| 125x125 | Canny 300 threshold | 0.200 |  `{'max_depth': 70, 'max_features': 'sqrt', 'min_samples_leaf': 2, 'min_samples_split': 2, 'n_estimators': 100}` | 0.97 min | 0.0007 min


- **No filters** - best parameters:
![Confusion Matrix](figures/random_forest/RandomForestClassifier_50x50__confusion_matrix_max_depth_70_max_features_sqrt_min_samples_leaf_2_min_samples_split_2_n_estimators_100.png)

- **HSV + Sobel** - best parameters:
![Confusion Matrix](figures/random_forest/RandomForestClassifier_50x50_hsv_sobel_confusion_matrix_max_depth_40_max_features_sqrt_min_samples_leaf_2_min_samples_split_5_n_estimators_100.png)

- **HSV only** - best parameters:
![Confusion Matrix](figures/random_forest/RandomForestClassifier_50x50_hsv-only_confusion_matrix_max_depth_40_max_features_sqrt_min_samples_leaf_2_min_samples_split_2_n_estimators_100.png)

- Observations:
    - Classifiers both make the same mistakes, e.g. confusing raspberries, redcurrants and strawberries :strawberry: (see bottom right corner of confusion matrix)

@@ -243,9 +239,12 @@ Results for RandomForestClassifier classifier on 100x100_standard images:
    - if we also want to find out how the parameters influence the accuracy, we can visualize the results of the grid search as below; the code we used for this is slightly adapted from a [stackoverflow response](https://stackoverflow.com/questions/37161563/how-to-graph-grid-scores-from-gridsearchcv)
        - :mag: the figure shows the accuracy when all parameters are fixed to their best value except for the one for which the accuracy is plotted (both for train and dev set)

![GridSearch](figures/random_forest/grid_search_results_50x50_standard_max_depth_10_80.png)
![GridSearch](figures/random_forest/grid_search_results_50x50_hsv_sobel_max_depth_10_80.png)
![GridSearch](figures/random_forest/grid_search_results_50x50_hsv-only_max_depth_10_80.png)

Confusion Matrix -  No filters  - best parameters        |  Confusion Matrix -  HSV features - best parameters
:-------------------------:|:-------------------------:
![Random Forest Grid Search](figures/random_forest/RandomForestClassifier_50x50_standard_confusion_matrix_max_depth_70_max_features_sqrt_min_samples_leaf_2_min_samples_split_2_n_estimators_100.png)  |  ![Random Forest Grid Search](figures/random_forest/RandomForestClassifier_50x50_hsv-only_confusion_matrix_max_depth_40_max_features_sqrt_min_samples_leaf_2_min_samples_split_2_n_estimators_100.png)

![Random Forest Best Parameters](figures/random_forest/grid_search_results_50x50_hsv_random_forest_best_params.png)


### CNN (Convolutional Neural Network)