CoolFace
Modelpublic

adaptive-classifier/ai-detector

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
4likes349downloads
README.md131 linesDownload Raw Back to root
1---2language: en3tags:4- adaptive-classifier5- text-classification6- ai-detection7- ai-generated-text8- continuous-learning9license: apache-2.010datasets:11- pangram/editlens_iclr12- adaptive-classifier/ai-detector-data13base_model: TrustSafeAI/RADAR-Vicuna-7B14metrics:15- accuracy16- f117pipeline_tag: text-classification18model-index:19- name: adaptive-classifier/ai-detector20  results:21  - task:22      type: text-classification23      name: AI Text Detection (Binary)24    dataset:25      name: EditLens ICLR 202626      type: pangram/editlens_iclr27      split: test28    metrics:29    - type: accuracy30      value: 74.231      name: Accuracy32    - type: f133      value: 73.734      name: Macro F135---36 37# AI Text Detector (adaptive-classifier)38 39A binary AI text detector that classifies text as **human-written** or **AI-generated/edited**, built with [adaptive-classifier](https://github.com/codelion/adaptive-classifier) on the [EditLens ICLR 2026](https://huggingface.co/datasets/pangram/editlens_iclr) benchmark.40 41## How It Works42 43Uses frozen embeddings from [TrustSafeAI/RADAR-Vicuna-7B](https://huggingface.co/TrustSafeAI/RADAR-Vicuna-7B) (a RoBERTa-large model adversarially trained for AI detection) as a feature extractor, with adaptive-classifier's prototype memory + neural head for classification.44 45```46Text → RADAR backbone (frozen, 355M) → 1024-dim embedding → adaptive-classifier head → human / ai47```48 49## Installation50 51```bash52pip install adaptive-classifier53```54 55## Usage56 57```python58from adaptive_classifier import AdaptiveClassifier59 60classifier = AdaptiveClassifier.from_pretrained("adaptive-classifier/ai-detector")61 62predictions = classifier.predict("Your text here")63# Returns: [('ai', 0.85), ('human', 0.15)]64 65# Batch prediction66results = classifier.predict_batch(["text 1", "text 2"], k=2)67 68# Continuous learning — add new examples without retraining69classifier.add_examples(70    ["new human text example", "new ai text example"],71    ["human", "ai"]72)73```74 75## Results76 77Evaluated on the [EditLens ICLR 2026](https://huggingface.co/datasets/pangram/editlens_iclr) test splits.78 79### Binary Classification (Human vs AI)80 81| Model | Method | Test F1 |82|-------|--------|---------|83| EditLens Mistral-Small 24B | QLoRA fine-tuned | 95.6 |84| Pangram v2 | Proprietary | 83.7 |85| Binoculars | Perplexity ratio | 81.4 |86| FastDetectGPT | Log-prob based | 80.5 |87| **This model** | **Frozen RADAR + adaptive-classifier** | **73.7** |88 89### Per-Split Results90 91| Split | Accuracy | Macro-F1 | AI F1 | Human F1 |92|-------|----------|----------|-------|----------|93| test (in-distribution) | 74.2% | 73.7 | 77.5 | 69.9 |94| test_enron (OOD domain) | 79.1% | 75.2 | 85.0 | 65.3 |95| test_llama (OOD model)  | 74.3% | 73.8 | 77.2 | 70.4 |96 97The model generalizes well to OOD splits: accuracy on emails (test_enron) and unseen AI models (Llama 3.3-70B / test_llama) is on par with or above the in-distribution test set.98 99## Training Details100 101- **Backbone**: [TrustSafeAI/RADAR-Vicuna-7B](https://huggingface.co/TrustSafeAI/RADAR-Vicuna-7B) (frozen, 355M params)102- **Dataset**: [pangram/editlens_iclr](https://huggingface.co/datasets/pangram/editlens_iclr) train split103- **Examples**: 1,000 per class (2,000 total), stratified sample104- **Classes**: `human` (human_written), `ai` (ai_edited + ai_generated)105- **Embedding dim**: 1024106- **Prototype weight**: 0.3, Neural weight: 0.7107- **Training time**: ~6 minutes on CPU108 109## Live Predictions Dataset110 111Predictions made through the [hosted Space](https://huggingface.co/spaces/adaptive-classifier/ai-detector) are continuously logged to [adaptive-classifier/ai-detector-data](https://huggingface.co/datasets/adaptive-classifier/ai-detector-data) — a public dataset of real-world predictions with optional user feedback (Correct / Incorrect). This dataset grows over time and can be used to track model performance, find failure cases, and drive future retraining.112 113## Limitations114 115- Binary only (human vs AI) — does not distinguish AI-edited from AI-generated116- Relies on frozen RADAR embeddings; cannot learn new text patterns beyond what RADAR captures117- Minimum ~50 words of text recommended for reliable detection118- Trained on English text from specific domains (reviews, news, creative writing, academic)119 120## Citation121 122```bibtex123@software{adaptive_classifier,124  title = {Adaptive Classifier: Dynamic Text Classification with Continuous Learning},125  author = {Sharma, Asankhaya},126  year = {2025},127  publisher = {GitHub},128  url = {https://github.com/codelion/adaptive-classifier}129}130```131