{"id":21697972,"url":"https://github.com/firefly55lm/cnn_for_pokemon_detection","last_synced_at":"2026-05-09T10:26:15.898Z","repository":{"id":232063943,"uuid":"783376308","full_name":"Firefly55lm/cnn_for_pokemon_detection","owner":"Firefly55lm","description":"Convolutional Neural Network for Pokémon detection","archived":false,"fork":false,"pushed_at":"2024-06-03T18:06:52.000Z","size":4616,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T14:26:01.084Z","etag":null,"topics":["computer-vision","convolutional-neural-networks","pokemon","python","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Firefly55lm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-07T18:10:12.000Z","updated_at":"2024-09-12T21:52:38.000Z","dependencies_parsed_at":"2024-06-03T20:30:12.342Z","dependency_job_id":"3863cda4-77c7-4ad2-a325-984a131758b4","html_url":"https://github.com/Firefly55lm/cnn_for_pokemon_detection","commit_stats":null,"previous_names":["firefly55lm/cnn_for_pokemon_detection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firefly55lm%2Fcnn_for_pokemon_detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firefly55lm%2Fcnn_for_pokemon_detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firefly55lm%2Fcnn_for_pokemon_detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firefly55lm%2Fcnn_for_pokemon_detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firefly55lm","download_url":"https://codeload.github.com/Firefly55lm/cnn_for_pokemon_detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244637102,"owners_count":20485446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","convolutional-neural-networks","pokemon","python","tensorflow"],"created_at":"2024-11-25T19:30:21.505Z","updated_at":"2026-05-09T10:26:10.854Z","avatar_url":"https://github.com/Firefly55lm.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CONVOLUTIONAL NEURAL NETWORK FOR POKÉMON DETECTION\nConvolutional neural network experiment for 1st gen Pokémons detection, made with TensorFlow.\n\n## TRY IT OUT!\nThe model is available on [this HuggingFace repository](https://huggingface.co/Firefly55lm/vera_cnn_v1).\nHere is a [Colab Notebook](https://colab.research.google.com/drive/1DX4Yw6NkOcHwxUItwf4LrYGUAl53U97C?usp=sharing) to test it.\n\n## DATASET\nThe [training dataset](https://www.kaggle.com/datasets/mikoajkolman/pokemon-images-first-generation17000-files) contains 17000 pictures divided in 143 classes of 1st gen Pokémons.\n\n## ARCHITECTURE\n![architecture](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/80dbb7d00a71df9616506fff25a9a9e72badb713/pictures/architecture.png)\n\nThe input has been preprocessed with 200x200 resizing and augmented with random orizontal flip and 20% zoom range.\n\nEvery convolutional layer has a LeakyReLU (alpha = 0.15) activation function to prevent vanishing gradients and disappearing relu issues, with padding 'same' and 'he_normal' kernel initialization.\nIn every layers pack there are a Batch Normalization, a Max Pooling layer (2x2) and a 20% Dropout to prevent overfitting.\n\nFrom the 2nd to the 4th convolutional layers pack, the dilation rate increases from 1x1 to 3x3, to upgrade the area of intervention of every filer\nand increase the features detection performance, according with the same principle described in [this paper](https://ieeexplore.ieee.org/document/8756165).\nThis solution increases the accuracy on validation and test set of 3% (95% accuracy).\n\nAfter the convolutional layers, the learning and classification is performed by two Dense layers with 512 and 256 weights, with a 40% Dropout.\n\nHere is a plot of the feature maps extracted from every convolutional layers pack:\n![feature_maps_plot_1](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/269ee3ed60e0f831b158fb36dc5acd8536b02425/pictures/feature_maps_1.png)\n![feature_maps_plot_2](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/269ee3ed60e0f831b158fb36dc5acd8536b02425/pictures/feature_maps_2.png)\n\n### TESTED SOLUTIONS\nIf you are curious about the visual differences between the feature maps of different kinds of layers, I made a few plots comparing them with the same 6 filters (initializer = GlorotUniform(seed=5)).\n\nThis is the list of tested solutions:\n- Classic Conv2D, 1 layer, 3x3 kernel\n- Separable Depthwise Convolution, 1 layer, 3x3 kernel\n- Classic Conv2D, 1 layer, 5x5 kernel\n- Dilated Convolution, 1 layer, 3x3 kernel, 2x2 dilation rate\n- Dilated Convolution, 1 layer, 3x3 kernel, 3x3 dilation rate\n- Dilated Convolution, 3 layers, 3x3 kernel, dilation rates 1x1-2x2-3x3\n- Classic Conv2D, 3 layers, 3x3 kernel, 2 layers for MaxPooling 2x2\n- Classic Conv2D, 3 layers, 3x3 kernel, 2 layers for AveragePooling 2x2\n- Classic Conv2D, 3 layers, 3x3 kernel, 1 layer for MaxPooling 2x2, 1 layer for AveragePooling 2x2\n- Dilated Convolution, 3 layers, 3x3 kernel, dilation rates 1x1-2x2-3x3, 2 layers for MaxPooling 2x2\n- Dilated Convolution, 3 layers, 3x3 kernel, dilation rates 1x1-2x2-3x3, 2 layers for AveragePooling 2x2\n- Dilated Convolution, 3 layers, 3x3 kernel, dilation rates 1x1-2x2-3x3, 1 layer for MaxPooling 2x2, 1 layer for AveragePooling 2x2\n\n![test1](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test1.png)\n![test2](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test2.png)\n![test3](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test3.png)\n![test4](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test4.png)\n![test5](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test5.png)\n![test6](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test6.png)\n![test7](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test7.png)\n![test8](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test8.png)\n![test9](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test9.png)\n![test10](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test10.png)\n![test11](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test11.png)\n![test12](https://github.com/Firefly55lm/cnn_for_pokemon_detection/blob/59de42e7b6f02538f0bdff1640ff55c621acc83b/pictures/test12.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirefly55lm%2Fcnn_for_pokemon_detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirefly55lm%2Fcnn_for_pokemon_detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirefly55lm%2Fcnn_for_pokemon_detection/lists"}