/ Модель

Характеристики

Параметры
22,9 млн
Лицензия
MIT
Архитектура
captcha_convolutional_transformer · dense
Библиотека
transformers
Опубликована
23 фев 2026

captcha-conv-transformer-finetuned

Описание изображенийИзображение → текст3 профессии

Свёрточный трансформер Graf-J распознаёт латинские буквы и цифры на изображениях CAPTCHA.

82скачиваний за 30 дней0лайковвеса обновлены1 мар 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Graf-J/captcha-conv-transformer-finetuned — модель Graf-J для распознавания буквенно-цифровых CAPTCHA по изображениям. Она использует свёрточный трансформерный энкодер, сочетающий CNN и Transformer Encoder, и обучалась с функцией потерь CTC. Модель выдаёт последовательность длиной от 1 до 8 символов из латинских букв в верхнем и нижнем регистре и цифр; размер составляет 22,9 млн параметров.

Модель предварительно обучена на очищенной версии набора hammer888/captcha-data, а затем дообучена на 200 000 синтетических изображений, созданных Python Captcha Library. В описании приведены анализ ошибок и примеры CAPTCHA, но численные показатели качества для этой версии не представлены. Для запуска предусмотрен Transformers pipeline. Модель распространяется по лицензии MIT.

Сценарии применения

  • распознавание буквенно-цифровых CAPTCHA на изображениях
  • извлечение кода CAPTCHA из синтетических изображений
  • автоматическая проверка тестовых CAPTCHA в экспериментальных наборах данных

Ограничения

Распознаёт только последовательности длиной от 1 до 8 символов из латинских букв и цифр; качество на других стилях CAPTCHA в карточке не установлено. Модель может путать визуально похожие символы, например 0 и O или 1 и l.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

✨ DeepCaptcha-Conv-Transformer: Sequential Vision for OCR

Convolutional Transformer Fine-Tuned

License: MIT Python 3.13+ Hugging Face Model

🚀 Live Demo:
👉 Try the Model in Your Browser


Advanced sequence recognition using a Convolutional Transformer Encoder with Connectionist Temporal Classification (CTC) loss.


📋 Model Details

  • Task: Alphanumeric Captcha Recognition
  • Input: Images
  • Output: String sequences (Length 1–8 characters)
  • Vocabulary: Alphanumeric (a-z, A-Z, 0-9)
  • Architecture: Convolutional Transformer Encoder (CNN + Transformer Encoder)

📊 Performance Metrics

This project features four models exploring the trade-offs between recurrent (LSTM) and attention-based (Transformer) architectures, as well as the effects of fine-tuning on capchas generated by the Python Captcha Library.

MetricCRNN (Base)CRNN (Finetuned)Conv-Transformer (Base)Conv-Transformer (Finetuned)
ArchitectureCRNNCRNNConvolutional TransformerConvolutional Transformer
Training Datahammer888/captcha-datahammer888/captcha-data Python Captcha Libraryhammer888/captcha-datahammer888/captcha-data Python Captcha Library
# Parameters3,570,9433,570,94312,279,55112,279,551
Model Size14.3 MB14.3 MB51.7 MB51.7 MB
Sequence Accuracy (hammer888/captcha-data)96.81%92.98%97.38%95.36%
Character Error Rate (CER) (hammer888/captcha-data)0.70%1.59%0.57%1.03%
Sequence Accuracy (Python Captcha Library)9.65%86.20%11.59%88.42%
Character Error Rate (CER) (Python Captcha Library)43.98%2.53%38.63%2.08%
Throughput (img/sec)447.26447.26733.00733.00
Compute HardwareNVIDIA RTX A6000NVIDIA RTX A6000NVIDIA RTX A6000NVIDIA RTX A6000
LinkGraf-J/captcha-crnn-baseGraf-J/captcha-crnn-finetunedGraf-J/captcha-conv-transformer-baseGraf-J/captcha-conv-transformer-finetuned

🧪 Try It With Sample Images

The following are images sampled of the test set of the hammer888/captcha-data dataset. Click any image below to download it and test the model locally.


🚀 Quick Start (Pipeline - Recommended)

The easiest way to perform inference is using the custom Hugging Face pipeline.

from transformers import pipeline
from PIL import Image

# Initialize the pipeline
pipe = pipeline(
    task="captcha-recognition", 
    model="Graf-J/captcha-conv-transformer-finetuned", 
    trust_remote_code=True
)

# Load and predict
img = Image.open("path/to/image.png")
result = pipe(img)
print(f"Decoded Text: {result['prediction']}")

🔬 Advanced Usage (Raw Logits & Custom Decoding)

Use this method if you need access to the raw logits or internal hidden states.

import torch
from PIL import Image
from transformers import AutoModel, AutoProcessor

# Load Model & Custom Processor
repo_id = "Graf-J/captcha-conv-transformer-finetuned"
processor = AutoProcessor.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True)

model.eval()

# Load and process image
img = Image.open("path/to/image.png")
inputs = processor(img) 

# Inference
with torch.no_grad():
    outputs = model(inputs["pixel_values"])
    logits = outputs.logits

# Decode the prediction via CTC logic
prediction = processor.batch_decode(logits)[0]
print(f"Prediction: '{prediction}'")

🎨 Generate Your Own CAPTCHAs

You can generate synthetic CAPTCHA images using the Python Captcha Library. To reproduce the same style, download the Nunito font and pass it to the ImageCaptcha class as shown below.

pip install captcha matplotlib
from transformers import pipeline
from PIL import Image
import matplotlib.pyplot as plt
from captcha.image import ImageCaptcha

# Define CAPTCHA text to be generated (a-z A-Z 0-9 and length between 1 and 8)
captcha_text = "aZ93eiL"
assert captcha_text.isalnum() and 1 <= len(captcha_text) <= 8

# Generate CAPTCHA image
generator = ImageCaptcha(fonts=["path/to/Nunito.ttf"])
image_data = generator.generate(captcha_text)
image = Image.open(image_data)

# Initialize the pipeline
pipe = pipeline(
    task="captcha-recognition",
    model="Graf-J/captcha-conv-transformer-finetuned",
    trust_remote_code=True
)

# Predict
result = pipe(image)["prediction"]

# Display result
plt.imshow(image)
plt.title(f"Model Prediction: {result}", fontsize=14, fontweight='bold', pad=12)
plt.axis('off')
plt.show()

⚙️ Training

The model was developed intwo distinct stages:

  • Pre-training: The base model was trained on a refined version of the hammer888/captcha-data (1,365,874 images). This dataset underwent a specialized cleaning process where multiple pre-trained models were used to identify and prune inconsistent data. Specifically, images where models were "confidently incorrect" regarding casing (upper/lower-case errors) were removed to ensure high-fidelity ground truth for the final training run.
  • Fine-tuning: To further improve robustness and handle modern variations, the model was fine-tuned on 200,000 generated images created specifically for this project using the Python Captcha Library.

Parameters

  • Optimizer: Adam (lr=0.0005)
  • Scheduler: ReduceLROnPlateau (factor=0.5, patience=3)
  • Batch Size: 128
  • Loss Function: CTCLoss
  • Augmentations: ElasticTransform, Random Rotation, Grayscale Resize

🔍 Error Analysis

The following confusion matrices illustrate the character-level performance across the alphanumeric vocabulary for the test dataset of the images generated via Python.

Full Confusion Matrix

Full-Confusion-Matrix

Misclassification Deep Dive

This matrix highlights only the misclassification patterns, stripping away correct predictions to visualize which character pairs (such as '0' vs 'O' or '1' vs 'l') the model most frequently confuses. Full-Confusion-Matrix


⚖️ License & Citation

This project is licensed under the MIT License. If you use this model in your research, portfolio, or applications, please attribute the author.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
CaptchaConvolutionalTransformer
Ревизия весов
4bc31fa

0 моделей