https://github.com/chxj1992/captcha_cracker
卷积神经网络实现的验证码识别
https://github.com/chxj1992/captcha_cracker
cnn-keras neural-network tensorflow
Last synced: 19 days ago
JSON representation
卷积神经网络实现的验证码识别
- Host: GitHub
- URL: https://github.com/chxj1992/captcha_cracker
- Owner: chxj1992
- Created: 2017-06-21T13:21:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T23:58:04.000Z (over 2 years ago)
- Last Synced: 2024-08-01T18:39:22.034Z (9 months ago)
- Topics: cnn-keras, neural-network, tensorflow
- Language: Python
- Homepage: http://captcha.chxj.name/
- Size: 15.3 MB
- Stars: 184
- Watchers: 3
- Forks: 54
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-captcha - chxj1992/captcha_cracker - Łamanie CAPTCHA z CNN. (Łamanie / Ogólne)
README
# captcha_cracker

[在线Demo](http://captcha.chxj.name/)
### 简介
这是一个基于 [Keras](https://keras.io/) 编写的卷积神经网络模型,简单实现的验证码识别功能。
[Captcha](https://github.com/mewebstudio/captcha/) 是一款 [Laravel](https://laravel.com) 社区中流行的验证码生成库,
项目模型的训练集以及在线测试所用到的验证码均采用该库生成。运行环境 `Ubuntu16.04` `python3.5.2 virtualenv` `Tensorflow Backend`
### 实现原理
* 用 `Captcha` 生成2组每组2000个4位验证码图片(图片尺寸:36×120),并等分成4份(单张图片尺寸:36×30),将单个字符的图片分类保存在 `images` 目录中作为训练集(每组8000张图片)。
* 生成2组每组500个4位验证码图片(图片尺寸:36×120),并等分成4份(单张图片尺寸:36×30),将单个字符的图片分类保存在 `images` 目录中作为测试集(每组2000张图片)。
* 运行 `pack_data.py` 将图片转为 `RGB` 矩阵并用cPickle打包为单个文件
* 运行 `train.py` 分别使用两组训练、测试数据对模型进行各100轮的训练,模型权重保存在 `weights.hdf5` 文件中生成验证码代码样例可参考 [CaptchaGenerator.php](https://github.com/chxj1992/captcha_cracker/blob/master/CaptchaGenerator.php)