Instructions to use MeghanaVP/car-subtype-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use MeghanaVP/car-subtype-classifier with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://MeghanaVP/car-subtype-classifier") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
π Car Classification Model (196 Classes)
π Overview
This project implements a deep learning model for fine-grained car classification across 196 categories using TensorFlow/Keras and an EfficientNetB3 backbone.
The model uses custom preprocessing, advanced pooling (GeM), and strong data augmentation to improve performance.
π§ Model Architecture
- Backbone: EfficientNetB3
- Input Shape:
(224, 224, 3) - Output:
196 classes (softmax) - Total Parameters: 11,755,251
Key Components:
Custom Layers:
CastToFloat32EfficientNetPreprocessGeMPooling
Data Augmentation:
- Random Flip
- Rotation
- Zoom
- Brightness & Contrast adjustment
- Translation
Fully Connected Head:
- Dense β BatchNorm β ReLU β Dropout
- Final Softmax layer
π Performance
- Accuracy: 80%
π Model Details
- Weights file:
final_cars.keras - Model is reconstructed programmatically and weights are loaded separately to avoid serialization issues with Lambda layers.
βοΈ Usage
1. Load Model
from tensorflow.keras.models import load_model
# Use the provided architecture code
model.load_weights("final_cars.keras")
2. Inference Example
import numpy as np
from tensorflow.keras.preprocessing import image
img = image.load_img("test.jpg", target_size=(224,224))
img = image.img_to_array(img)
img = np.expand_dims(img, axis=0)
predictions = model.predict(img)
print(predictions)
ποΈ How It Works
- Input image is augmented
- Converted to float32
- Preprocessed using EfficientNet preprocessing
- Passed through EfficientNetB3 backbone
- Features pooled using GeM pooling
- Fully connected layers perform classification
π‘ Highlights
- Avoids Lambda layer serialization issues using custom registered layers
- Uses GeM pooling instead of traditional average pooling
- Strong augmentation pipeline improves generalization
π Notes
- Ensure TensorFlow version compatibility when loading weights
- Model expects input images resized to 224Γ224
π€ Author
Meghana Poojary
- Downloads last month
- 92
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support