AI-Resistant Python CAPTCHA Library with advanced adversarial protection
Project description
DeepCaptcha
DeepCaptcha is a Python library for generating CAPTCHA images. It includes features to add noise and distortions that provide resistance against automated recognition (OCR and machine learning models) while remaining readable by humans.
Features
- Adjustable Resistance: Supports different levels of noise and perturbations.
- Customizable: Control image dimensions, text length, fonts, and more.
- Color Support: Generate both color and grayscale CAPTCHAs.
- Resource Efficient: Designed for low-latency generation.
Installation
pip install deepcaptcha
Quick Start
from deepcaptcha import DeepCaptcha
# Create a generator instance
gen = DeepCaptcha(ai_resistance_level=1)
# Generate an image and its corresponding text
image, text = gen.generate()
# Save the result
image.save("captcha.png")
print(f"CAPTCHA text: {text}")
Configuration
You can customize the generation process using various parameters:
captcha = DeepCaptcha(
width=300,
height=100,
text_length=5,
color_mode=True,
ai_resistance_level=2,
num_lines=2,
noise_density=0.5
)
Dataset & Research
This library is supported by extensive research and a large-scale dataset of CAPTCHA images designed to train and test OCR models and other CAPTCHA-breaking algorithms.
Available Datasets
The Deep-Captcha dataset is available on the following platforms:
- Hugging Face: Deep_Captcha Dataset
- Description: A comprehensive collection of generated CAPTCHAs with varying levels of difficulty and noise. Ideal for training robust OCR models.
- IEEE DataPort: Deep-Captcha Data
- Description: The official dataset release accompanying the research paper. Contains labeled images categorized by complexity.
Research Visualizations
Our research analyzes the effectiveness of DeepCaptcha against modern recognition systems. Below are key visualizations from our study:
Dataset Analysis
Analysis of the dataset distribution and characteristics.
Model Performance
Heatmap showing the accuracy of recognition models across different CAPTCHA types and difficulty levels.
Character Accuracy
Distribution of recognition accuracy for individual characters, highlighting common confusion pairs.
Confidence Reliability
Reliability diagram showing the relationship between model confidence and actual accuracy.
License
This project is licensed under the MIT License.
Citation
@software{deepcaptcha2026,
title={DeepCaptcha: A Python CAPTCHA Library with AI Resistance},
author={Ayush Shukla},
year={2026},
url={https://github.com/kingknight07/Deep-Captcha}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepcaptcha-1.0.2.tar.gz.
File metadata
- Download URL: deepcaptcha-1.0.2.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ba67b51d41976b4dbeceedd4d493db15e0e189fbcfb80cff424daf0c4a7f99b
|
|
| MD5 |
4107f442bd4ae84e6078e2b28139e9b4
|
|
| BLAKE2b-256 |
3f28b18b3a3cbb1535d2bae35c793ab9d978e7490b4eb70e31d5faad597a7a91
|
File details
Details for the file deepcaptcha-1.0.2-py3-none-any.whl.
File metadata
- Download URL: deepcaptcha-1.0.2-py3-none-any.whl
- Upload date:
- Size: 2.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f3d4d61d17ea140fdbf3702ab0bccc2733fe87e8e3b7417b0ac08e9397a4fe5
|
|
| MD5 |
9e3fd92038c61400fc42c7e075c148b3
|
|
| BLAKE2b-256 |
3c6641296ce4a79c8692c549543be8963c5e0c91076573fca23ab2719a4685ce
|