Skip to content

dukn/Captcha-recognition-Keras

Repository files navigation

Captcha-recognition-Keras

A cool project using deep learning to decaptcha

Captcha recognition Captcha recognition

Getting Started

Project using deep learing with Keras + Tensorflow framework to recognition multi-digit captcha. Using convolutional neural network, this project is so powerful but also requires a lot of data. Data is captchas generated by Captcha-php. You can modify 2 Captcha_Generator/Captcha-php/CaptchaBuilder.php and Captcha_Generator/Captcha-php/PhraseBuilder.php files to create more difficult captcha.

In this project, I have 3 main file:

  • Preprocessing.py: Read image data and prepare for training.
  • Train.py: Training model.
  • Recognition.py: Recognition captcha.

Prerequisites

You must have knowledge of deep learning and Keras/Tensorflow to understand it. Also you need to install the following libs:

Python2.7
Keras 2.1.5
Tensorflow 1.4.0
Numpy 1.14.1
Pickle
Matplotlib
Scipy

Installing

Here I will direct you to install on linux (Ubuntu). You can do the same on Windows and MacOS yourself.

Install tensorflow, you can follow the detailed instructions here or below:

$ sudo apt-get install python-pip python-dev   # for Python 2.7
$ sudo pip install tensorflow      # Python 2.7; CPU support (no GPU support)
$ pip install keras # install Keras

Install Numpy and Scipy

$ sudo pip install numpy scipy

Install cPickle :

$ sudo pip install cpickle

Install Matplotlib:

$ sudo apt-get install python-matplotlib

It's so easy!

Running the tests

Generated Captchas and put them at ./Data/ and lable at ./Data/pass.txt.

$ make clean # clean old data
$ make captcha # create new data

Preprocessing data

$ make preprocessing

Train model by run Train.py:

$ make train

The model will automatically save after the train finished. You can break with Ctrl + C whenever you want.

Recognition by run Recognition.py:

$ make recognition

Show tensorboard:

$ tensorboard --logdir ./logs

Authors

  • Dukn - Initial work - Dukn

TOOLS

  • Deep leaning for computer vision
  • Keras + Tensorflow framework
  • Python

About

Recognize captcha using deep learning and Keras tool

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published