![]() ![]() To aid in visualizing the project, we created a GUI that will pit the player against the model in predicting the type of random pokemon. Extension: Fun Pokemon Type Classification Game!!! Note that the prediction is done on each image once to generate a numpy array to be passed into the classification_report and accuracy_score functions from trics.Īll boolean values p and e are set to True by default. Note that these statistics are computed using the metrics module from sklearn as keras does not support computing these values. Furthermore, to further aid in assessing the performance, the program will compute the precision, recall, and f-score metrics on the entire test set and print to the terminal screen. Then, if e = True in the main method, the program will then perform evaluations on the test sets using the evaluation_generator function from Keras to return the test accuracy and loss in the writeup. Will perform load the saved models and if p = True in the main method, the program will perform primary and secondary type predictions on a random pokemon image from the dataset such as: Run.py contains the necessary functions to load the model and preform predictions and evaluations. Running Predictions and Evaluations on the Models png representation of the model architecture is saved to \model such as:Īll boolean values s and plt are set to True by default. Optional training accuracy and loss charts will be generated by matplotlib if plt = True in the mian function. The classifiers, after training for 20 epochs, will be saved to \model as. Will begin training the primary and secondary type models on the test and training data sets. Some sample plots are shown below:Ĭnn.py contains the functions to build, train, and save the convolutional neural network models. However, these functions are intended for use in other parts of the project as well as for generating figures for the final writeup. ![]() Running the program will print some same plots. Visualization.py contains the necessary functions to visualize the dataset as well as various model performance metrics. The necessary functions to extract pokemon name and type information from the pokemon csv dataset from kaggle are all contained in this program as well. preprocess.py also contains an image resizing function by Hemagso taken from his repo here. RunningĮach time will create new sets of training and test data taken from the data/ directory divided into primary and secondary types in type1_sorted and type2_sorted respectively. Preprocess.py contains the necessary functions to preprocess the image and pokemon type data necessary for training. If an issue occurs, one can always retrain the models by running python3 cnn.py Running the code Preprocessing The Data There have been some issues with loading the models in the anaconda environment due to serialization, but packages installed with pip3 should work fine. To run the code, use python3, and ensure the following packages are installed: The labels are extracted from the main games, and are copyright of Nintendo Inc. The pokemon stat and type data comes from kaggle and contains id, stats, type, and legendary status information on all the pokemon to date.Īdditionally, in /data/type_labels are the type labels of all 18 types for use in visualization and the GUI. The image dataset comes from veekun containing pokemon sprite images from games spanning Generation I to V, as well as icons, Global-Link artwork, and the spinoff Pokemon Conquest. This project aims to classify the primary and secondary types of a given pokemon from its image using convolutional neural networks. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |