Skip to content

rusito-23/simpsons-characters-class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simpsons Character Classification

Using Tensorflow's Keras.

ACKNOWLEDGEMENT: Most of this repo is based on alexattia's Kaggle kernel

Model

The model is a Convolutional Neural Network, with 6 Conv2D's and MaxPooling.

The structure can be found here.

Dataset

This repo uses the Kaggle Simpsons Dataset from alexattia.

One of the main challenges for this dataset was the data preprocessing, as there were several labels missing data, or some labels with two much data (i.e Homer Simpson).

Notebooks

Train

python source/train.py \
	--dataset_path path/to/downloaded/dataset \
	--output_path path/to/model/output

This script will create a folder output_path/v<VersionNumber>, and will store:

  • checkpoints in output_path/v<Version>/chcks
  • training history in output_path/v<Version>/history.csv
  • tensorboard logs in output_path/v<Version>/logs
  • labels in output_path/v<Version>/labels.txt (the labels resulting from the dataset cleaning)

Test

To test an existing model run the script source/test.py, example:

python source/test.py \
	--weights model/v1/chcks/chck_30.h5 \
	--model_path model/v1 \
	--testset_path path/to/testet

This script will generate the following reports:

  • results per image in testset in output_path/v<Version>/test_results.csv
  • sklearn class report in output_path/v<Version>/class_report.csv
  • confusion matrix in output_path/v<Version>/confusion_matrix.png
  • test viz in output_path/v<Version>/samples.png

Results

The pretrained wheights included, gave the following results when tested:

Confusion matrix:

Confusion matrix

Results visualization:

Visualization

CREDITS

About

Simpsons Character Classification with Keras

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published