File size: 1,901 Bytes
8e8e1d1 6fc668e 8e8e1d1 ac9930b 43bb7ec ac9930b 6fc668e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
---
tags:
- image-classification
- tensorflow
- keras
- computer-vision
- animal-recognition
license: apache-2.0
library_name: keras
language: en
datasets:
- custom-dataset
metrics:
- accuracy
model_creator: AEROVERSE
model_type: Custom CNN
num_classes: 10
training_data: Custom animal dataset
validation_split: 20%
epochs: 500
early_stopping: patience=5, restore_best_weights=True
dropout: 0.5
optimizer: Adam
loss: sparse_categorical_crossentropy
input_shape: (256, 256, 3)
output_activation: softmax
checkpoint: best_model.weights.h5
pipeline_tag: image-classification
---
# 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.
```python
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 |