Tag: captcha code

Train a CNN model to identify captcha code with TensorFlow and Keras

Machine LearningProgramming LanguagesPython

In the last post (Automatically fill in captcha code in course selection system), we exploited the “Play Audio” button function to obtain the captcha code in the course selection system from my college. Today, we will be going through another approch to identify the captcha code by training a CNN model with TensorFlow and Keras.

A captcha code from the course selection system.


Install Needed Packages

Below are the environment and package versions that I perform the training in this post.

MacOS 10.14.6
Python: 3.7.3
numpy: 1.18.0
scikit-learn: 0.22
TensorFlow: 2.0.0
Pillow: 6.2.1

If lacking any of these packages, just simply install them with the following commands.

NumPy: pip install numpy
scikit-learn: pip install scikit-learn
TensorFlow: pip install tensorflow
Pillow: pip install Pillow

Automatically fill in captcha code in course selection system

JavaScriptProgramming Languages

Captcha code is broadly used in different websites to ensure the contents are only accessible by humans rather than bots. The course selection system in my college has also been adopting captcha code in the login page to reduce momentary load of its server. (by slowing down everyone’s time to fill in the code and hit log in)

Besides that, the system was kindly designed a “Play Audio” button as well for visually impaired people to “hear” the captcha code. However, it becomes a defect that we can take advantage of the “Play Audio” button function to fill in the captcha code programmatically for us.

Since I have done my last course selection in my college life, I will demonstrate how to fill in the captcha code by exploiting the “Play Audio” button function in below.