An optimized system to solve text-based CAPTCHA

Ye Wang, Mi LuarXiv 2018

Abstract

CAPTCHA (Completely Automated Public Turing test to Tell Computers and Humans Apart) can be used to protect data from auto bots. Countless kinds of CAPTCHAs are thus designed, while we most frequently utilize text-based scheme because of most convenience and user-friendly way \cite{bursztein2011text}. Currently, various types of CAPTCHAs need corresponding segmentation to identify single character due to the numerous different segmentation ways. Our goal is to defeat the CAPTCHA, thus firstly the CAPTCHAs need to be split into character by character. There isn't a regular segmentation algorithm to obtain the divided characters in all kinds of examples, which means that we have to treat the segmentation individually. In this paper, we build a whole system to defeat the CAPTCHAs as well as achieve state-of-the-art performance. In detail, we present our self-adaptive algorithm to segment different kinds of characters optimally, and then utilize both the existing methods and our own constructed convolutional neural network as an extra classifier. Results are provided showing how our system work well towards defeating these CAPTCHAs.

Introduction

Text-based CAPTCHAs remain the most common way to distinguish humans from bots, but they are becoming increasingly sophisticated. Modern versions often include heavy noise, overlapping characters, extreme rotations, and even multi-language math problems (e.g., "9 plus 5 equals?"). Researchers from Texas A&M University have developed a high-performance system designed to crack these complex challenges.

Examples of various text-based CAPTCHAs including math problems and multi-language characters.

Traditional tools like Optical Character Recognition (OCR) or Template Matching (TM) struggle with these distortions. Furthermore, most "deCAPTCHA" systems are slow because they try to guess the CAPTCHA type sequentially. The proposed system intelligently "triages" the CAPTCHA type to speed up the entire pipeline while handling visual noise and rotation.

Methods

The system follows a three-stage pipeline: Preprocessing, Adaptive Segmentation, and CNN Classification.

The proposed CAPTCHA recognition pipeline, from input image to text output.

Preprocessing

To handle noise, the system employs a median filter, which is particularly effective at removing "salt and pepper" noise while preserving character edges. Affine transformations are also used to "upright" rotated characters, making them easier for the classifier to read.

Adaptive Segmentation

Instead of trying every possible segmentation method one by one, the authors developed a decision-tree approach based on character width. Because Chinese characters, Arabic numerals, and mathematical symbols have distinct widths (e.g., Chinese characters are ~20 pixels wide, while digits are ~11), the system can quickly identify the CAPTCHA's structure and the length of the operator. This heuristic leads to a massive 10.67x speedup in the segmentation phase.

CNN Classification

The final recognition is handled by a 6-layer CNN inspired by the classic LeNet-5 architecture. It consists of four convolutional layers followed by two fully connected layers, ending in an 82-way softmax output capable of identifying digits, English letters, and both simplified and traditional Chinese characters.

Datasets and Training

The study utilized over 7,000 real-world samples sourced from three major Chinese institutional websites: the State Administration for Industry & Commerce, the Credit Reference Center, and the State Intellectual Property Office. To improve robustness, the authors used data augmentation, rotating training samples every 5 degrees (from -50° to +50°) to create a larger training set capable of handling varied orientations found in the wild.

Key Results

The system demonstrates significant improvements in both speed and accuracy:

  • Speed: The adaptive segmentation algorithm is 10.67 times faster than traditional sequential testing.
  • Accuracy: The CNN achieved a peak individual character accuracy of 99.65%, significantly outperforming OCR/TM.
  • Robustness: For full CAPTCHA solving under difficult rotation conditions, the CNN maintained a success rate of roughly 54-66%, whereas traditional methods plummeted to as low as 33%.

Conclusion

While the system is highly effective for text-based math CAPTCHAs, it requires significant manual labeling for training. Future work may explore automated synthetic data generation and expanding the scope to include image-based or behavioral security measures. The current preprocessing assumes rotation angles are somewhat predictable; more dynamic, "warped" text might require more advanced spatial transformer networks.

Summary updated

BibTeX
@misc{wang2018optimized,
  author = {Ye Wang and Mi Lu},
  title = {{An optimized system to solve text-based CAPTCHA}},
  year = {2018},
  eprint = {1806.07202},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1806.07202},
}
Figure