基于深度学习的银行卡号识别系统的设计与实现毕业论文
2021-11-05 19:05:42
摘 要
近年来,我国经济发展迅速,科技进步明显,智能手机大面积普及,互联网行业也有了很好的发展,特别是网上支付的兴起,使得人们的生活更加方便快捷,在进行网上支付之前,用户通常需要绑定个人银行卡才能消费,通常是人工手动输入银行卡号来完成绑定,由于银行卡有15至20位不等的数字,手动输入容易出错且效率低下,故本文开发了一种能够自发识别银行卡号的系统,通过对银行卡的数据图像进行处理来识别银行卡号,从而可以自动完成绑定个人银行卡操作,大大提高了有关银行卡绑定等手续的业务效率,使得用户的体验得到改善。本文设计的银行卡号识别系统有三个模块,它们分别是基于OpenCV的银行卡号定位、基于深度学习的卡号识别以及基于PyQt5的GUI界面设计。第一,卡号定位部分和自然场景下的文本检测问题类似,卡号文本的定位受噪声、光照条件和对比度等因素影响,字体大小、种类、排列方式的多样性也会干扰定位。除此以外,卡号背景的复杂程度也对最终的卡号检测和识别结果有影响。目前实际使用的银行卡背景多样,卡号有黑体印刷和凹凸压印等方式,故在银行卡的卡号定位方面,将银行卡分为凹凸压印和黑体印刷两种类型。对凹凸压印类型的银行卡,对输入图像依次进行灰度化、尺寸归一化、高斯模糊、canny边缘检测,膨胀腐蚀等操作,实现了凹凸压印银行卡号的定位。针对黑体印刷类型的银行卡,对输入图像依次进行灰度化、尺寸归一化、高斯模糊、二值化、膨胀腐蚀、轮廓检测等操作,实现了黑体印刷类型的银行卡号的定位。第二,在卡号识别部分,由定位部分得到的截取的银行卡号行图片作为输入,采用了当前流行的CNN和RNN相结合的模型,并以CTC作为损失函数。CNN部分使用了VGG16网络,RNN部分采用的是BLSTM。第三,在GUI界面设计部分,使用PyQt5编写了GUI界面,实现与用户的交互。本文收集了1085张部分银行卡号样本图片,其中851张用于网络的训练,234张用于测试,该网络识别精度为89.61%。
关键词:银行卡号识别,OpenCV,深度学习,PyQt5。
Abstract
In recent years, China's economy has been developing rapidly, science and technology has made remarkable progress, smart phones have been widely used, and the Internet industry has also developed well, especially the rise of online payment, has made people's life more convenient and fast. Before making online payments, users usually need to bind their personal bank cards to make purchases, usually manually enter the bank card number to complete the binding. Because the bank card of 15 to 20 Numbers, manual input error-prone and low efficiency, this paper developed a kind of automatic identification of the bank card number system, through to the card image recognition to automatically enter the bank card number, greatly improving the online payment involved in the bank card binding operations such as efficiency, effectively improve the user experience. The bank card number identification system designed in this paper includes three modules: OpenCV based bank card number positioning, deep learning based card number identification and GUI interface design. First, the positioning of the card number is similar to the text detection problem in the natural scene. The positioning of the card number text is affected by such factors as noise, light conditions and contrast, and the diversity of font size, type and arrangement will also interfere with the positioning. In addition, the complexity of the card number background also has an impact on the final card number detection and recognition results. At present, the actual use of the bank card background is diverse, the card number has black body printing and embossing, so in the bank card number positioning, the bank card is divided into concave-convex embossing and black body printing two types. For the concave-convex embossing type of bank card, the input image was successively grayscale, size normalization, gaussian blur, canny edge detection, expansion and corrosion, etc., so as to realize the positioning of concave-convex embossing bank card number. For the blackbody printed type of bank card, the input image was successively grayscale, size normalization, gaussian blur, binarization, expansion corrosion, contour detection, etc., so as to realize the location of the blackbody printed type of bank card number. Second, in the identification part of the card number, the intercepted bank card number line picture obtained from the positioning part is used as the input. The current popular model combining CNN and RNN is adopted, and CTC is used as the loss function. Part of CNN USES VGG16 network, part of RNN USES BLSTM. Thirdly, in the GUI interface design part, the GUI interface is written with PyQt5 to realize the interaction with users. In this paper, 1085 bank card number sample pictures were collected, of which 851 were used for network training and 234 for testing, and the network identification accuracy was 89.61%.
Key Words:Bank card number recognition ; OpenCV ; deep learning ; PyQt5.
目 录
第1章绪论1
1.1研究背景和意义 1
1.2国内外研究现状 2
1.3本文的研究内容及工作安排 3
第2章 银行卡卡号行定位 5
2.1银行卡的预处理 5
2.1.1图像灰度化5
2.1.2高斯模糊6
2.1.3图像二值化6
2.1.4膨胀腐蚀7
2.1.5 Canny边缘检测7
2.1.6轮廓检测8
2.2 凹凸压印卡定位流程及结果展示9
2.3 黑体印刷卡定位流程及结果展示11
2.4 本章小结14
第3章 银行卡卡号识别系统的设计15
3.1 CNN RNN CTC模型介绍15
3.2 卡号识别流程及结果分析18
3.3 本章小结19
第4章 GUI界面的设计与实现20
4.1 GUI界面设计20
4.2 结果展示与分析21
4.3 本章小结24
第5章 工作总结与展望25
5.1 工作总结25
5.2 未来展望25
参考文献27
致谢28
第1章 绪论
1.1 研究背景和意义
21世纪以来,随着互联网、通讯等产业的进一步发展,手机、平板电脑等网络智能化产品日渐普及,特别是近年来广受欢迎的移动终端设备,以平板、智能手机为代表,使得人们可以很方便快捷地获取图像、视频等视觉图像数据,同时这也解决了机器视觉、图像处理等其他问题的数据来源问题。随着智能手机等具有拍照、摄像功能设备的流行,人们可以越来越方便快捷地利用视频和图像来记录和分享生活。
同时,自然场景中也存在着各种各样的文本信息,其中大部分包含着易于人们理解的明确的言语信息,如店铺招牌、路边的标语等,要实现对这些场景内容的分析和理解,就必须要实现对场景文本的检测和识别,由于自然条件下文本周围的其它非文本场景的影响以及其它环境因素的干扰,想要完整地对这类文本进行检测和识别是有很大难度的。