- Python 3.10
- MatPlotLib 3.9.1
- NumPy 2.0.0
- Pillow 10.4.0
- TensorFlow 2.17.0
- One Piece Character Image Set
Troubleshooting:
- Installing TensorFlow can be finicky, check out the official TensorFlow pip install guide if you are having issues.
Setup and Usage:
- Clone and enter the repo
git clone [email protected]:greshbasic/OP-Image-Recognition.git
cd OP-Image-Recognition
- Create a venv and install requirements
python3 -m venv <name>
source <name>/bin/activate
pip install -r requirements.txt
- Run the main.py file
python3 main.py
What to Expect:
- A lot of information is logged to the console, mostly warnings. You can ignore those as they aren't going to negatively impact the model. However, if you want to build upon my work it may eventually become something you need to look into.
- On my mid-range PC build it takes about 2 minutes for the model to fully train.
- The model averages between 70-75% validation accuracy and is slightly overfit.
- Users will be shown 9 random images and the model's classification of each, alongside the training history
Epoch 1/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 26s 58ms/step - accuracy: 0.0551 - loss: 2.9549 - val_accuracy: 0.0739 - val_loss: 2.8883 - learning_rate: 0.0010
Epoch 2/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 8s 26ms/step - accuracy: 0.0798 - loss: 2.8492 - val_accuracy: 0.1483 - val_loss: 2.6521 - learning_rate: 0.0010
Epoch 3/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 23ms/step - accuracy: 0.1881 - loss: 2.5654 - val_accuracy: 0.2438 - val_loss: 2.3851 - learning_rate: 0.0010
Epoch 4/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 23ms/step - accuracy: 0.2864 - loss: 2.2582 - val_accuracy: 0.3511 - val_loss: 2.1002 - learning_rate: 0.0010
Epoch 5/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 23ms/step - accuracy: 0.3707 - loss: 1.9949 - val_accuracy: 0.4432 - val_loss: 1.8730 - learning_rate: 0.0010
Epoch 6/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 23ms/step - accuracy: 0.4450 - loss: 1.7575 - val_accuracy: 0.4818 - val_loss: 1.7609 - learning_rate: 0.0010
Epoch 7/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 22ms/step - accuracy: 0.5161 - loss: 1.5475 - val_accuracy: 0.5028 - val_loss: 1.6314 - learning_rate: 0.0010
Epoch 8/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 22ms/step - accuracy: 0.5589 - loss: 1.3771 - val_accuracy: 0.5665 - val_loss: 1.4851 - learning_rate: 0.0010
Epoch 9/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 22ms/step - accuracy: 0.6136 - loss: 1.2008 - val_accuracy: 0.5761 - val_loss: 1.4158 - learning_rate: 0.0010
Epoch 10/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 22ms/step - accuracy: 0.6428 - loss: 1.1050 - val_accuracy: 0.6074 - val_loss: 1.3171 - learning_rate: 0.0010
Epoch 11/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 22ms/step - accuracy: 0.6845 - loss: 0.9817 - val_accuracy: 0.6313 - val_loss: 1.2414 - learning_rate: 0.0010
Epoch 12/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 22ms/step - accuracy: 0.7127 - loss: 0.8847 - val_accuracy: 0.6097 - val_loss: 1.2567 - learning_rate: 0.0010
Epoch 13/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 22ms/step - accuracy: 0.7490 - loss: 0.7974 - val_accuracy: 0.6585 - val_loss: 1.1779 - learning_rate: 0.0010
Epoch 14/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 23ms/step - accuracy: 0.7575 - loss: 0.7488 - val_accuracy: 0.6562 - val_loss: 1.1683 - learning_rate: 0.0010
Epoch 15/15
312/312 ━━━━━━━━━━━━━━━━━━━━ 7s 22ms/step - accuracy: 0.7769 - loss: 0.6842 - val_accuracy: 0.6784 - val_loss: 1.1223 - learning_rate: 0.0010