• Stars
    star
    878
  • Rank 51,627 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

2019CCF-BDCI大赛 最佳创新探索奖获得者 基于OCR身份证要素提取赛题冠军 天晨破晓团队 赛题源码

整体介绍

赛题介绍

我们的队名是:鹏脱单攻略队 后面改为"天晨破晓" 最终我们团队成绩在复赛AB榜均排在第一名,识别准确率达0.996952

官网截图

团队成绩:2019CCF-BDCI大赛 最佳创新探索奖 和 "基于OCR的身份证要素提取"单赛题冠军

系统处理流程图

流程图

方案亮点

我们采用条件生成对抗网络(CGAN)处理赛题中的水印干扰,取到了比较好的效果,展示一下效果图片: 去水印效果

生成仿真数据源码,生成仿真训练数据训练去水印模型和文字识别模型

方案PPT 方案论文

执行方式介绍

完整执行示例:
CPU执行,单进程:
python main_process.py --test_experiment_name test_example --test_data_dir ./test_data --gan_ids -1 --pool_num 0
参数详解:
--test_experiment_name:实验名,将决定中间数据结果存放目录
--test_data_dir: 数据目录
--gan_ids: 去水印模型:如果是-1 则是cpu运行, 大于0,则是GPU
--pool_num 0单进程 大于0多进程
其他参数参考main_process.py中的help

项目整体文件结构说明:

(按照处理流程介绍,具体文件介绍见文件内的readme)

身份证区域提取模块 cut_twist_process

剪切、翻转部分代码;用于将身份证正反面从原始图片中切分出来

去除水印\关键文本定位模块 watermask_remover_and_split_data

进行水印去除,身份证切割,提取文字部分,滤波

去水印模型 pytorch-CycleGAN-and-pix2pix

我们训练好的去除水印模型地址:

参考资料

去水印模型采用条件gan网络。论文链接

参考了GitHub上gan pix2pix 项目,链接,我们基于此项目进行了一些更改

文字识别模块 recognize_process

用于识别图片中的文字信息

参考资料

识别模型采用CRNN。论文链接

参考了GitHub上两个模型的TensorFlow实现

项目1

项目2

文本纠正模块 data_correction_and_generate_csv_file

对识别结果进行纠正,以及生成最终的csv文件

data_temp

中间数据存放目录,目录名称:实验名+日期

CCFTestResultFixValidData_release.csv

生成的结果文件

main_process.py

执行脚本

Requirement.txt

运行的环境要求

注意

去水印模型地址

这项是工程的submodel,需要克隆的时候需要加上"--recursive"参数 去水印模型较大,采用了git-lfs,要安装这个包,不然可能会导致clone失败或者比较慢

由于lfs超出限额,功能失效,可能会导致模型文件(文字识别和去水印模型)clone失败,我们把模型文件上传百度云了,由于数据文件包含身份证图片,数据敏感,百度云链接很容易失效,需要赛题数据和模型文件的话,添加我百度网盘好友,具体见About data download

!!!注:测试数据跟初赛和复赛的数据格式需要保持一致,每面身份证左上角需要有:"仅限DBCI比赛(复赛)使用"字样, 且字体大小格式位置应该跟初赛和复赛的保持一致,否则将严重影响识别的准确性甚至代码运行出错 原因:对于身份证各个元素的识别,我们是先裁剪出来,再识别的.我们在裁剪的时候,是以"限DBCI"为参考的 ,每次裁剪前,都会用模板在图片匹配对应的位置,得到参考坐标,再相对于这个参考坐标裁剪各个元素.

More Repositories

1

2019-CCF-BDCI-OCR-MCZJ-fake_data_generator

2019CCF-BDCI大赛 OCR赛题第一名 天晨破晓团队 仿真数据生成方案源码
Python
79
star
2

PVE-MCC_for_unsignalized_intersection

Aiming at the problem of the traffic efficiency of intelligent networked vehicles passing through unsignalized-intersection in the future smart cities, this project proposed a Progressive Value-expectation Estimation Multi-agent Cooperative Control (PVE-MCC) algorithm based on reinforcement learning. The algorithm takes the intelligent networked vehicles as the research object and designed the reward function for the optimization objective from the three aspects of traffic efficiency, safety, and comfort.
Python
31
star
3

MiVeCC_with_DRL

This is a Multi-intersection Vehicular Cooperative Control (MiVeCC) scheme to enable cooperation among vehicles in a 3*3 unsignalized intersections. we proposed a algorithm combined heuristic-rule and two-stage deep reinforcement learning. The heuristic-rule achieves vehicles across the intersections without collisions. Based on the heuristic-rule, DDPG is used to optimize the collaborative control of vehicles and improve the traffic efficiency. Simulation results show that the proposed algorithm can improve travel efficiency at multiple intersections by up to 4.59 times without collision compared with existing methods.
Python
19
star
4

models_data

2019CCF-BDCI大赛 OCR赛题第一名 天晨破晓团队 去水印网络CGAN模型baseline
13
star
5

ckpt_save

2019CCF-BDCI大赛 OCR赛题第一名 天晨破晓团队 文字识别模型baseline
4
star
6

CCF-BDCI-IdentificationCard

Python
4
star
7

Learn-record

这是我的学习过程中对于每个知识点的总结和相关资料的存档
C++
2
star
8

coolweather

This is an android development exercise
Java
1
star
9

mingzhi

1
star
10

-txt-

转换bag包转成的txt的格式,增强可读性
Python
1
star