File size: 3,303 Bytes
10efad5
 
 
 
30ec24d
 
 
 
 
 
 
 
 
 
 
dbb6a9f
 
cf89351
12d9300
 
 
 
 
dbb6a9f
 
 
 
 
 
 
 
 
 
 
 
 
 
12d9300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
license: apache-2.0
datasets:
- drveronika/x_fake_profile_detection
language:
- en
base_model:
- google/siglip2-base-patch16-224
pipeline_tag: image-classification
library_name: transformers
tags:
- bot-detection
- x
- twitter
- experimental
---

![ADS.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/qpUh38BrGJA1PNebSFovB.png)

# **x-bot-profile-detection**

> **x-bot-profile-detection** is a SigLIP2-based classification model designed to detect **profile authenticity types on social media platforms** (such as X/Twitter). It categorizes a profile image into four classes: **bot**, **cyborg**, **real**, or **verified**. Built on `google/siglip2-base-patch16-224`, the model leverages advanced vision-language pretraining for robust image classification.

```py
Classification Report:
              precision    recall  f1-score   support

         bot     0.9912    0.9960    0.9936      2500
      cyborg     0.9940    0.9880    0.9910      2500
        real     0.8634    0.9936    0.9239      2500
    verified     0.9948    0.8460    0.9144      2500

    accuracy                         0.9559     10000
   macro avg     0.9609    0.9559    0.9557     10000
weighted avg     0.9609    0.9559    0.9557     10000
```

![download.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/P0MispJOjkolSsYPbYuhC.png)

---

## **Label Classes**

The model predicts one of the following profile types:

```
0: bot        → Automated accounts  
1: cyborg     → Partially automated or suspiciously mixed behavior  
2: real       → Genuine human users  
3: verified   → Verified accounts or official profiles
```

---

## **Installation**

```bash
pip install transformers torch pillow gradio
```

---

## **Example Inference Code**

```python
import gradio as gr
from transformers import AutoImageProcessor, SiglipForImageClassification
from PIL import Image
import torch

# Load model and processor
model_name = "prithivMLmods/x-bot-profile-detection"
model = SiglipForImageClassification.from_pretrained(model_name)
processor = AutoImageProcessor.from_pretrained(model_name)

# Define class mapping
id2label = {
    "0": "bot",
    "1": "cyborg",
    "2": "real",
    "3": "verified"
}

def detect_profile_type(image):
    image = Image.fromarray(image).convert("RGB")
    inputs = processor(images=image, return_tensors="pt")

    with torch.no_grad():
        outputs = model(**inputs)
        logits = outputs.logits
        probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()

    prediction = {
        id2label[str(i)]: round(probs[i], 3) for i in range(len(probs))
    }

    return prediction

# Create Gradio UI
iface = gr.Interface(
    fn=detect_profile_type,
    inputs=gr.Image(type="numpy"),
    outputs=gr.Label(num_top_classes=4, label="Predicted Profile Type"),
    title="x-bot-profile-detection",
    description="Upload a social media profile picture to classify it as Bot, Cyborg, Real, or Verified using a SigLIP2 model."
)

if __name__ == "__main__":
    iface.launch()
```

---

## **Use Cases**

* Social media moderation and automation detection
* Anomaly detection in public discourse
* Botnet analysis and influence operation research
* Platform integrity and trust verification