EfficientNet Model for AI Data Classification using PyTorch

This is a machine learning model trained on AI data using the EfficientNet architecture in PyTorch. The model achieved an accuracy of 97.314% on the validation set.

Requirements

  • Python 3.x
  • PyTorch
  • torchvision

Usage

To use the model, simply import it and load the weights:

import torch
from efficientnet_model import EfficientNetModel

# create an instance of the model
model = EfficientNetModel()

# load the weights
model.load_state_dict(torch.load("path/to/weights.pth"))

Once the weights are loaded, you can use the model for inference on new data:

# load your data
data = ...

# preprocess the data
preprocessed_data = ...

# move the data to GPU if available
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
preprocessed_data = preprocessed_data.to(device)

# make a prediction
with torch.no_grad():
    prediction = model(preprocessed_data)

# print the predicted class
predicted_class = torch.argmax(prediction, dim=1)
print(predicted_class)

Training
The model was trained on a labeled dataset of AI data using the EfficientNet architecture in PyTorch. The data was split into a training set and a validation set, with a 80/20 split. The model was trained using the Adam optimizer with a learning rate of 0.001 and categorical cross-entropy loss.

To train the model on your own dataset, you can use the train.py script provided in this repository. Simply modify the script to load your own data and configure the training parameters.

Evaluation
The model achieved an accuracy of 97.314% on the validation set. To reproduce this result, you can use the evaluate.py script provided in this repository. Simply modify the script to load your own data and configure the evaluation parameters.

![model_accuracy.PNG](https://s3.amazonaws.com/moonup/production/uploads/1679046217102-641293af00634c4fe986e8b9.png)
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support