Code Monkey home page Code Monkey logo

solving-captcha-using-tensorflow's Introduction

Solving-Captcha-Using-Tensorflow

A CAPTCHA is a type of challenge-response test used in computing to determine whether or not the user is human. There are so much development in Deep Learning that we can train a model to predict the text in a captcha image.

Dataset

The Dataset which I have used are hand picked from certain websites using web scrapping methods. I'm not providing the code for collecting captcha in this repository. But you can find the 10,000 captcha images and also the preprocessed images in this repository. Let's look at few sample captcha images.

Each of the captcha images have six letters and they are only alphabets. To train the model, we have to preprocess these images and split the image into six separate letters. After preprocessing the images, the six letters looks like this.

Requirements

We are using Tensorflow framework to implement the CNN model.

pip install tensorflow

Please check the requirements.txt file for all the packages whcih you need to install. Most of the packages can be installed using the pip package manager.

Simplifying the problem

We simplify the problem by spliting the captcha image into single letters. Now, we only have to train the neural network to recognize a single letter at a time.

We can automate the process of splitting the images into separate letters. In image processing, we often need to detect “blobs” of pixels that have the same color. The boundaries around those continuous pixels blobs are called contours. OpenCV has a built-in findContours() function that we can use to detect these continuous regions.

Training the model

Since the captcha images are split into letters, a simple convolutional network would be sufficient to achieve a better prediction. The architecture which is used here consists of two convlutional layers and two fully connected layers.

Using the model to solve CAPTCHAs

After training the model, predicting captcha becomes simpler.

  1. Split the captcha image into separate letters.
  2. Use the trained model to predict the letters separately.
  3. After the predictions of all six letters, combine the predictions to form the captcha output.

Have questions? Need help with the code?

If you're having issues with or have questions about the bot, file an issue in this repository so that I can get back to you soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.