Creating the dataset
In this chapter, to spice up things a little, let us take on the role of the bad guy. We want to create a program that can beat CAPTCHAs, allowing our comment spam program to advertise on someone's website. It should be noted that our CAPTCHAs will be a little easier than those used on the web today and that spamming isn't a very nice thing to do.
Note
We play the bad guy today, but please don't use this against real world sites. One reason to "play the bad guy" is to help improve the security of our website, by looking for issues with it.
Our experiment will simplify a CAPTCHA to be individual English words of four letters only, as shown in the following image:
Our goal will be to create a program that can recover the word from images like this. To do this, we will use four steps:
- Break the image into individual letters.
- Classify each individual letter.
- Recombine the letters to form a word.
- Rank words with a dictionary to try to fix errors.
Note
Our CAPTCHA-busting algorithm...