Downloads · 30 days
38
1% of all-time downloads
abhi099k/ai-text-detector-v-n4.0
ai-text-detector-v-n4.0 is a text classification model from abhi099k. Use it when you need a label for a piece of text. The card lists the license as mit.
Downloads · 30 days
38
1% of all-time downloads
All-time downloads
3.1K
Public
Parameters
435M
10.4 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors1.7 GB · 99%
From the Hugging Face model README
| Field | Description |
|---|---|
| Model Name | ai-text-detector-v-n4.0 |
| Base Model | microsoft/deberta-v3-large |
| Task | Text Classification (Human-written vs AI-generated) |
| Language | English |
| Framework | PyTorch, Transformers |
| Trained by | Abhinav |
| Fine-tuned using | Hugging Face Trainer API with early stopping, mixed precision (fp16), and F1 optimization. |
This model fine-tunes DeBERTa-v3-large for detecting whether a given text is written by a Human or generated by an AI.
It was trained on a custom dataset containing 10,000+ samples of diverse text across multiple topics, labeled as:
0 → Human-written text1 → AI-generated textThe goal is to identify subtle linguistic differences and stylistic cues between natural human writing and machine-generated content.
| Parameter | Value |
|---|---|
| Epochs | 4 |
| Batch size | 8 |
| Learning Rate | 2e-5 |
| Max Sequence Length | 256 |
| Optimizer | AdamW |
| Scheduler | Linear decay |
| Weight Decay | 0.01 |
| Seed | 42 |
| Mixed Precision | ✅ Yes (fp16) |
| Gradient Accumulation Steps | 2 |
| Frameworks | PyTorch, Transformers, Datasets |
| Field | Value |
|---|---|
| Source | Custom dataset (gpt_5_with_10k.csv) |
| Columns | text, label |
| Labels | 0 = Human, 1 = AI |
| Split | 90% Train / 10% Test |
| Cleaning | Removed special characters, normalized whitespace, and standardized punctuation. |
| Metric | Score |
|---|---|
| Accuracy | ~0.97 |
| F1 Score | ~0.97 |
| Precision / Recall | Balanced |
Confusion Matrix Example:
[[4800 90] → True Human
[ 110 5000]] → True AI
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_id = "abhi099k/ai-text-detector-v-n4.0"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
text = "This article explores the evolution of large language models..."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
outputs = model(**inputs)
pred = torch.argmax(outputs.logits, dim=1).item()
print("🧑 Human" if pred == 0 else "🤖 AI")
| Component | Library |
|---|---|
| Tokenization | AutoTokenizer |
| Model | AutoModelForSequenceClassification |
| Trainer | transformers.Trainer |
| Metrics | evaluate (accuracy, f1) |
| Visualization | matplotlib (confusion matrix) |
If you use this model, please cite:
@model{abhinav_ai_text_detector_v1,
title = {AI Text Detector v1.0 – DeBERTa-v3-large Fine-tune},
author = {Abhinav},
year = {2025},
url = {https://huggingface.co/Abhinav/ai-text-detector-v-n4.0}
}