Downloads · 30 days
10
12% of all-time downloads
KarimSayed/cat-breed-encoder
cat-breed-encoder is a machine learning model from KarimSayed. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for keras. The card lists the license as mit.
This model leverages transfer learning with the EfficientNetV2-L architecture as the backbone to classify images of five different cat breeds. The model is fine-tuned to identify distinct types of cats based on image…
Downloads · 30 days
10
12% of all-time downloads
All-time downloads
82
Public
Repo size
1.4 GB
Likes
0
Public
Click a slice to open those files.
.keras1.4 GB · 100%
From the Hugging Face model README
This model leverages transfer learning with the EfficientNetV2-L architecture as the backbone to classify images of five different cat breeds. The model is fine-tuned to identify distinct types of cats based on image features, and the later layers of the EfficientNetV2-L backbone are exposed and used to create embeddings.
The model is trained to classify the following five cat breeds:
EfficientNetV2-L is a state-of-the-art image classification model that provides a good balance of speed and accuracy while achieving high performance on image recognition tasks.
This model is designed for the classification of cat breeds in images. It can be used for:
You can easily load this model and use it to classify cat images with the following code snippet:
import tensorflow as tf
from tensorflow.keras.models import load_model
import numpy as np
from tensorflow.keras.preprocessing import image
# Load the pre-trained model
model = tf.keras.models.load_model("path_to_model")
# Example image preprocessing
img_path = "path_to_image.jpg"
img = image.load_img(img_path, target_size=(128, 128)) # Resize to 128x128
img_array = image.img_to_array(img)
img_array = np.expand_dims(img_array, axis=0) # Add batch dimension
img_array /= 255.0 # Normalize to [0, 1]
# Predict the cat breed
predictions = model.predict(img_array)
# Predict the cat breed
predictions = model.predict(img_array)
class_labels = ["Bengal", "Domestic Shorthair", "Maine Coon", "Ragdoll", "Siamese"]
predicted_breed = class_labels[np.argmax(predictions)]
predicted_breed = class_labels[np.argmax(predictions)]
print(f"Predicted Cat Breed: {predicted_breed}")
This model was trained on the Cats Breed Dataset, available on Kaggle. The dataset consists of labeled images for each breed, which were resized to 128x128 pixels for training. The images were also normalized to a [0, 1] range to match the input size required by EfficientNetV2-L. Data augmentation techniques such as random rotations, flips, and scaling were applied to increase model robustness and reduce overfitting.