Hi ya all!
It has been a really long time since my last
What are Captchas?
Captchas were built to test whether a human or a machine is using an online service. Usually, they are a combination of letters which have been visually blurred, transformed or otherwise made hard to read. As we all know, the human mind is a fascinating thing and is still able to recognise the different letters and make guesses about them. A machine should not be able to read a captcha and can therefore not know what is written.
Emphasis on should – because by now they can and this is exactly what I wanted to do when starting this project.
About the project
When I say I, what I really mean is we 🙂 I did this project for school and I worked together with a school mate on this. I have her permission to write this blog, and I hope she likes it!
There are several sources for pictures of captchas which are open and free to use. There are also different kinds of captchas. Some are
Divide and Conquer
I downloaded the data and saved in a folder. Now that we have the material to work with, we need to decide what to do.
If you look at the problem as a whole, it most often looks overwhelming. But as soon as you break it down into little pieces, it becomes
Idea of how to proceed
It is clear that we will work with Python, as this is the language we are working with at school. As we are working with pictures here, a convolutional neural network (CNN) seems to be a good choice to teach the computer to read captchas.
The captchas in our dataset have four letters. It does not make sense to train the net on the captchas as a whole. Rather, we should train it on the single letters. Therefore we will have to cut the captchas into four single letters.
In this data
When we have the single letters, we need to know which letter they are representing. So we need to map the labels to the different letters.
Last but not least, we also need to make sure that the pictures of the letters have the same size. This is a
Having prepared the data, we can separate the dataset into a training, test and validation set and finally start to work on the CNN.
From the above, we roughly had the following steps in mind:
Figure out what to do. This is what we are doing right now!
Find out how to work with pictures and separate one captcha into four different letters.
Do step 1 for all the captchas and label them in the process. Meanwhile, also make sure they all have the same size.
Define, compile, fit and evaluate the CNN. This is an iterative process.
Make predictions! (and write a blogpost about it ;))
I think we have now an outline of the project and will proceed with Step 2 the next time!
Thank you so much for reading!