This is a simple Convolutional model for classifying and reading text captchas
NOTE: For simplicity the model can only read captchas with 1 character and it's assumed that it's always a digit. Also it can only detect captchas generated by python captcha library
The model is a convolutional network with 2 convolutional/maxpooling and 2 fully connected layers and a total of 4.3 million parameters
The dataset consists of 10000 images(1000 for each digit). all of the images are of size 100x100 pixels and are all generated using python captcha library. Before training the images are normalized and converted to greyscale
The model is trained with binary cross entropy loss function and gradient descent optimizer. and mini-batches of size 32
First download the compiled model from release page and put it in "models" folder.
now you need a sample image. you can generate it using python captcha library
from captcha.image import ImageCaptcha
image = ImageCaptcha(width=100, height=100)
image.write("4", "test_cptcha.png")
now we have our captcha image
now run the model using following command
$ python.exe .\run_model.py .\test_captcha.png
4
as you can see the model can detect the digit in the captcha image