Edit model card

Animal Recognition Model

Model Overview

This model is designed to classify images of animals into predefined categories. It uses a ResNet50V2 base model and has been trained on a custom dataset.

Classes

The model was trained on the following classes:

  • cat
  • dog
  • horse
  • lion
  • tiger
  • elephant

Usage

  1. Load the model using TensorFlow/Keras.
  2. Preprocess the input image to a size of 256x256 and normalize it.
  3. Pass the preprocessed image to the model for prediction.
from keras.models import load_model
import numpy as np
from tensorflow.keras.utils import load_img, img_to_array

def predict_image(image_path, model):
    img = load_img(image_path, target_size=(256, 256))
    img_array = img_to_array(img) / 255.0
    img_array = np.expand_dims(img_array, axis=0)
    prediction = model.predict(img_array)
    return np.argmax(prediction, axis=1)

model = load_model('best_model.weights.h5')
predicted_class = predict_image('image.jpg', model)
print(f"Predicted class: {predicted_class}")

Training Details

  • Base Model: ResNet50V2 (pretrained on ImageNet)
  • Dataset: Custom animal dataset
  • Optimizer: Adam
  • Loss Function: Sparse Categorical Crossentropy
  • Metrics: Accuracy
  • Augmentation: Applied during training

Model Performance

Will be updated soon

Downloads last month
4
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.