Code Monkey home page Code Monkey logo

id-recognition's Introduction

id-recognition

基于tensorflow2 使用CNN进行图片中数字或者文字序列的识别

基本过程

  1. 生成数字序列图片
  2. 使用CNN进行卷积识别

CNN设计

参考AlexNet,结构如下

    _model = keras.Sequential([
        keras.layers.Conv2D(32, (3, 3), activation="relu", input_shape=(IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_CHANNELS)),
        keras.layers.MaxPool2D((2, 2)),
        keras.layers.Conv2D(64, (3, 3), activation="relu"),
        keras.layers.MaxPool2D((2, 2)),
        keras.layers.Conv2D(128, (3, 3), activation="relu"),
        keras.layers.MaxPool2D((2, 2)),
        keras.layers.Conv2D(64, (1, 1), activation="relu"),
        keras.layers.Flatten(),
        keras.layers.Dense(1024, activation='relu'),
        keras.layers.Dense(ID_LEN * CHAR_SET_LEN, activation="softmax"),
        keras.layers.Reshape([ID_LEN, CHAR_SET_LEN]),
    ])
  1. ID_LEN:生成的id号码的长度
  2. CHAR_SET_LEN:生成Id号码的字符集(0-9)长度

使用

生成数据集

python3 idcard_genner.py

训练模型

python3 model_train.py

预测

python3 model_predict.py

在默认的参数情况下,基本上可以达到100%的准确率。

参考地址

https://github.com/JackonYang/captcha-tensorflow

id-recognition's People

Contributors

icesx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.