ABD1's picture
Create README.md
cb64f4c
metadata
datasets:
  - competitions/aiornot
metrics:
  - accuracy
pipeline_tag: image-classification
tags:
  - resnet
  - computer vision
  - image classification

ResNet Model

This is a ResNet model trained on the AI or Not dataset, which consists of images generated by an AI and images taken from the real world. The model was implemented from scratch using PyTorch.

Usage

This model can be used for binary image classification tasks. Given an image, the model outputs a probability between 0 and 1 representing the likelihood that the image was generated by an AI.

How to Get Started with the Model

The code below can be used to get started with the model:

# Load the model from the checkpoint
model = ResNet18()
model.load_state_dict(torch.load("AI_Detector.pt"))

# Set the model to evaluation mode
model.eval()

Input

The model expects input images of size 224x224 with 3 color channels (RGB).

Output

The model outputs a single value between 0 and 1 representing the probability that the input image was generated by an AI.

Training

The model was trained for 10 epochs using the Adam optimizer with a learning rate of 0.001 and a batch size of 256. The BCEWithLogitsLoss function was used as the loss function.

The training set was split into 80% training data and 20% validation data, with a separate test set used for evaluating the final accuracy of the model.

Evaluation

The final accuracy of the model on the test set was 0.97, with a loss of 0.07. The model achieved a validation accuracy of 0.96 after 10 epochs of training.

Limitations and Bias

It's important to note that this model was trained on a specific dataset and may not generalize well to other image classification tasks. Additionally, the AI or Not dataset may contain biases that could impact the performance of the model.