All Projects → libowei1213 → 12306_captcha

libowei1213 / 12306_captcha

基于深度学习识别12306验证码

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to 12306 captcha

Captcha
基于CNN的验证码整体识别
Stars: ✭ 125 (+40.45%)
Mutual labels:  cnn, captcha
3d Densenet
3D Dense Connected Convolutional Network (3D-DenseNet for action recognition)
Stars: ✭ 118 (+32.58%)
Mutual labels:  cnn, densenet
Pytorch classification
利用pytorch实现图像分类的一个完整的代码,训练,预测,TTA,模型融合,模型部署,cnn提取特征,svm或者随机森林等进行分类,模型蒸馏,一个完整的代码
Stars: ✭ 395 (+343.82%)
Mutual labels:  cnn, densenet
Hyperdensenet
This repository contains the code of HyperDenseNet, a hyper-densely connected CNN to segment medical images in multi-modal image scenarios.
Stars: ✭ 124 (+39.33%)
Mutual labels:  cnn, densenet
Asr syllable
基于卷积神经网络的语音识别声学模型的研究
Stars: ✭ 127 (+42.7%)
Mutual labels:  cnn, densenet
Eeg Dl
A Deep Learning library for EEG Tasks (Signals) Classification, based on TensorFlow.
Stars: ✭ 165 (+85.39%)
Mutual labels:  cnn, densenet
Captcha break keras
keras theano 验证码破解 字母+数字
Stars: ✭ 60 (-32.58%)
Mutual labels:  cnn, captcha
Segan
A PyTorch implementation of SEGAN based on INTERSPEECH 2017 paper "SEGAN: Speech Enhancement Generative Adversarial Network"
Stars: ✭ 82 (-7.87%)
Mutual labels:  cnn
Pytorch Classification
Classification with PyTorch.
Stars: ✭ 1,268 (+1324.72%)
Mutual labels:  densenet
Recursive Cnns
Implementation of my paper "Real-time Document Localization in Natural Images by Recursive Application of a CNN."
Stars: ✭ 80 (-10.11%)
Mutual labels:  cnn
Pcn Ncnn
PCN based on ncnn framework.
Stars: ✭ 78 (-12.36%)
Mutual labels:  cnn
Dltk
Deep Learning Toolkit for Medical Image Analysis
Stars: ✭ 1,249 (+1303.37%)
Mutual labels:  cnn
Svg Captcha
generate svg captcha in node
Stars: ✭ 1,276 (+1333.71%)
Mutual labels:  captcha
Hooman
http interceptor to hoomanize cloudflare requests
Stars: ✭ 82 (-7.87%)
Mutual labels:  captcha
Visual Feature Attribution Using Wasserstein Gans Pytorch
Implementation of Visual Feature Attribution using Wasserstein GANs (VAGANs, https://arxiv.org/abs/1711.08998) in PyTorch
Stars: ✭ 88 (-1.12%)
Mutual labels:  cnn
Dispnet Flownet Docker
Dockerfile and runscripts for DispNet and FlowNet1 (estimation of disparity and optical flow)
Stars: ✭ 78 (-12.36%)
Mutual labels:  cnn
Sleepeegnet
SleepEEGNet: Automated Sleep Stage Scoring with Sequence to Sequence Deep Learning Approach
Stars: ✭ 89 (+0%)
Mutual labels:  cnn
Slidercaptcha
Slider captcha support mobile
Stars: ✭ 88 (-1.12%)
Mutual labels:  captcha
Sentiment 2017 Imavis
From Pixels to Sentiment: Fine-tuning CNNs for Visual Sentiment Prediction
Stars: ✭ 85 (-4.49%)
Mutual labels:  cnn
Tensorflow Cifar 10
Cifar-10 CNN implementation using TensorFlow library with 20% error.
Stars: ✭ 85 (-4.49%)
Mutual labels:  cnn

基于深度学习识别12306验证码

简介

使用深度学习的方法识别12306验证码,采用了当前效果最好的卷积网络模型之一:DenseNet

代码参考了一种DenseNet的Keras实现:titu1994/DenseNet

12306验证码图片地址为:https://kyfw.12306.cn/passport/captcha/captcha-image

需要识别的有2部分:

  • 上方的文字部分
  • 下方的8张图片

文字部分有两种:

图片 图片

文字部分出现两个词时,需要对其进行切割。

运行环境

  • Keras 2.1.3 (TensorFlow backend)
  • TensorFlow 1.4

准备数据

把图片数据保存在以类别名称命名的文件夹下,如:

训练模型

修改run.py文件开头的训练参数

batch_size = 64
n_gpus = 2                  # 训练时使用的GPU数
n_epochs = 40               # 训练轮数
image_shape = (64, 64, 3)   # 图片大小(其他尺寸的图片会被调整到此尺寸)
n_classes = 80              # 类别数(12306验证码图片为80类)
initial_learning_rate = 0.1 # 初始的学习率
reduce_lr_epoch_1 = 20
reduce_lr_epoch_2 = 30      # 指定每次学习率衰减的训练轮数
image_dir = "图片文件夹路径"

训练模型

# DenseNet模型
python run.py --train -m=DenseNet -k=12 -d=40

# DenseNet-BC模型
python run.py --train -m=DenseNet-BC

# 模型参数
python run.py --help

训练时每个epoch后,模型权重文件保存在saves文件夹下,文件名如:DenseNet-BC_k=12_d=40.weight

再次开始运行相同模型的训练,会先读取已保存的权重。

评估/测试模型

run.py中指定评估图片的文件夹image_dir,执行:

python run.py --test -m=DenseNet -k=12 -d=40
# 模型参数与训练参数一致

在12306上进行验证码识别/提交测试

模拟12306验证码验证流程:

  1. 下载验证码图片到本地
  2. 读取两个模型,分别识别文字部分、图像部分
  3. 根据识别的结果,提交post请求验证
  4. 12306返回验证结果

验证成功的文字部分和图像部分会分别按类别保存到指定文件夹中。若验证失败,保存原始图片。

修改12306_test.py

n_classes = 80
image_shape = (64, 64, 3)
text_model_weight = "saves/DenseNet-BC_k=12_d=40.weight"    # 文字部分模型保存路径
image_model_weight = "saves/DenseNet-BC_k=24_d=40.weight"   # 图片部分模型保存路径
save_path = "D:\IMAGE"      # 验证成功的图片保存路径
save_fail_path = "D:\IMAGE\FAIL"    # 验证失败的图片保存路径

运行12306_test.py

python 12306_test.py

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].