Instructions to use bennybor/catfish with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use bennybor/catfish with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://bennybor/catfish") - Notebooks
- Google Colab
- Kaggle
Cat or Fish: a small CNN for 28x28 drawings
Trained in Google Colab as a classroom example.
Input
- 28x28 grayscale drawing, white strokes (255) on a black background (0)
- 784 pixels row by row, divided by 255 before the model
- Full details in
config.json
Output
Softmax over two classes: 0 = Cat, 1 = Fish
Architecture
Augmentation (shift, rotate, zoom; training only) -> stroke thickening (3x3 max filter) -> 3 x Conv2D (32/64/64) with max pooling -> global max pooling -> Dropout(0.3) -> Dense(64) -> Dense(2, softmax). Trained with balanced class weights.
Results
- Test accuracy: 82.4% (74 drawings never used during training)
- Validation accuracy: 87.8% (74 drawings, used to choose the stopping epoch)
- Training: early stopping on validation loss; best epoch 40 of 50
Limitations
Small dataset of student drawings; expect mistakes on unusual drawings.
Try it
- Downloads last month
- 121