Run this model with HF Jobs

Run MeghanaVP/car-subtype-classifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/MeghanaVP/car-subtype-classifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/MeghanaVP/car-subtype-classifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

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:

    • CastToFloat32
    • EfficientNetPreprocess
    • GeMPooling
  • 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

  1. Input image is augmented
  2. Converted to float32
  3. Preprocessed using EfficientNet preprocessing
  4. Passed through EfficientNetB3 backbone
  5. Features pooled using GeM pooling
  6. 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
39
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support