WO2019037259A1 - Electronic device, method and system for categorizing invoices, and computer-readable storage medium - Google Patents

Electronic device, method and system for categorizing invoices, and computer-readable storage medium Download PDF

Info

Publication number
WO2019037259A1
WO2019037259A1 PCT/CN2017/108762 CN2017108762W WO2019037259A1 WO 2019037259 A1 WO2019037259 A1 WO 2019037259A1 CN 2017108762 W CN2017108762 W CN 2017108762W WO 2019037259 A1 WO2019037259 A1 WO 2019037259A1
Authority
WO
WIPO (PCT)
Prior art keywords
invoice
straight line
image
training
picture
Prior art date
Application number
PCT/CN2017/108762
Other languages
French (fr)
Chinese (zh)
Inventor
王健宗
韩茂琨
刘鹏
肖京
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019037259A1 publication Critical patent/WO2019037259A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • G06T3/608Skewing or deskewing, e.g. by two-pass or three-pass rotation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • the present application relates to the field of communications technologies, and in particular, to an electronic device, a method and system for invoicing an invoice, and a computer readable storage medium.
  • the purpose of the present application is to provide an electronic device, a method and system for invoice classification, and a computer readable storage medium, which are intended to quickly correct and classify batch invoice images and improve processing efficiency.
  • the present application provides an electronic device including a memory and a processor coupled to the memory, wherein the memory stores an identification system operable on the processor, the identification The system implements the following steps when executed by the processor:
  • the predetermined correction rules include:
  • the present application also provides a method for invoice classification, and the method for invoice classification includes:
  • the predetermined correction rules include:
  • the present application further provides an identification system, the identification system comprising:
  • a correction module configured to perform a tilt correction on the invoice image by using a predetermined correction rule after receiving the invoice image to be processed
  • the identification module is configured to perform category identification on the indented image after the tilt correction by using the invoice image recognition model generated by the pre-training, and output the category recognition result;
  • the predetermined correction rules include:
  • the application further provides a computer readable storage medium having an identification system stored thereon, the implementation system implementing the steps when the recognition system is executed by the processor:
  • the predetermined correction rules include:
  • the beneficial effects of the present application are as follows: after receiving the invoice image to be processed, the present application performs a tilt correction on the invoice image by using a predetermined correction rule, and then adopts a pre-trained invoice image recognition model to correct the invoice image after the tilt correction. Perform category identification and output category recognition results. Compared with the existing manual correction and classification of batch uploading invoice images, this application can quickly correct and classify batch invoice images, saving time. Save effort and improve the efficiency of business processing.
  • FIG. 1 is a schematic diagram of an optional application environment of each embodiment of the present application.
  • FIG. 2 is a schematic flow chart of an embodiment of a method for classifying an invoice according to the present application
  • Figure 3 is a schematic illustration of the predetermined correction rule shown in Figure 2.
  • first, second and the like in the present application are for the purpose of description only, and are not to be construed as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. .
  • features defining “first” and “second” may include at least one of the features, either explicitly or implicitly.
  • the technical solutions between the various embodiments may be combined with each other, but must be based on the realization of those skilled in the art, and when the combination of the technical solutions is contradictory or impossible to implement, it should be considered that the combination of the technical solutions does not exist. Nor is it within the scope of protection required by this application.
  • FIG. 1 it is a schematic diagram of an application environment of a preferred embodiment of the method for invoicing an invoice of the present application.
  • the application environment diagram includes an electronic device 1 and a terminal device 2.
  • Electronic device 1 can pass A suitable technology such as a network or a near field communication technology performs data interaction with the terminal device 2.
  • the terminal device 2 includes, but is not limited to, any electronic product that can interact with a user through a keyboard, a mouse, a remote controller, a touch panel, or a voice control device, for example, a personal computer, a tablet computer, or a smart phone.
  • PDA Personal Digital Assistant
  • game consoles Internet Protocol Television (IPTV)
  • IPTV Internet Protocol Television
  • smart wearable devices navigation devices, etc.
  • mobile devices such as digital TVs, desktop computers, Fixed terminal for notebooks, servers, etc.
  • the electronic device 1 is an apparatus capable of automatically performing numerical calculation and/or information processing in accordance with an instruction set or stored in advance.
  • the electronic device 1 may be a computer, a single network server, a server group composed of multiple network servers, or a cloud-based cloud composed of a large number of hosts or network servers, where cloud computing is a type of distributed computing.
  • a super virtual computer consisting of a group of loosely coupled computers.
  • the electronic device 1 may include, but is not limited to, a memory 11 communicably connected to each other through a system bus, a processor 12, and a network interface 13, and the memory 11 stores an identification system operable on the processor 12. It should be noted that FIG. 1 only shows the electronic device 1 having the components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the storage device 11 includes a memory and at least one type of readable storage medium.
  • the memory provides a cache for the operation of the electronic device 1;
  • the readable storage medium may be, for example, a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM).
  • a non-volatile storage medium such as a read only memory (ROM), an electrically erasable programmable read only memory (EEPROM), a programmable read only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, or the like.
  • the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1; in other embodiments, the non-volatile storage medium may also be external to the electronic device 1.
  • a storage device such as a plug-in hard disk equipped with an electronic device 1, a smart memory card (SMC), a Secure Digital (SD) card, a flash card, or the like.
  • the readable storage medium of the storage device 11 is generally used to store an operating system installed in the electronic device 1 and various types of application software, such as program codes of the identification system in an embodiment of the present application. Further, the storage device 11 can also be used to temporarily store various types of data that have been output or are to be output.
  • the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
  • the processor 12 is typically used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with the terminal device 2.
  • the processor 12 is configured to run program code or process data stored in the memory 11, such as running an identification system or the like.
  • the network interface 13 may comprise a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the electronic device 1 and other electronic devices.
  • the network interface 13 is mainly used to connect the electronic device 1 with one or more terminal devices 2, in the electronic A device 1 establishes a data transmission channel and a communication connection with one or more terminal devices 2.
  • the identification system is stored in the memory 11 and includes at least one computer readable instruction stored in the memory 11, the at least one computer readable instruction being executable by the processor 12 to implement the methods of various embodiments of the present application;
  • the at least one computer readable instruction can be classified into different logic modules according to different functions implemented by the various parts thereof.
  • the embodiment includes a correction module and an identification module.
  • the above identification system is implemented by the processor 12 to implement the following steps:
  • Step S1 after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule
  • the invoice image is tilt corrected by using a predetermined correction rule, wherein the predetermined correction rule includes a plurality of types:
  • the predetermined correction rule may be: obtaining an angle at which the invoice image is tilted, and correcting the invoice image based on the tilted angle;
  • the predetermined correction rule may be: using a probability algorithm of Hough transform to separate the short length of the invoice picture that is less than or equal to the first preset length.
  • a straight line segment wherein the Hough transform probability algorithm is capable of detecting a straight line (line segment) from a black and white image of the invoice picture, the first preset length being, for example, 3 mm, and the separated short straight line segments being as many as possible.
  • a preset threshold for example, a preset threshold of 0.5 mm
  • the straight segments are divided into one category until all the separated short straight segments are divided into several categories.
  • a short straight line segment belonging to the same class is used as a target class straight line, and a long straight line segment similar to each target class straight line is obtained by least square method, wherein the least square method finds the most straight line of each target class by minimizing the square sum of errors Good function matching (ie long straight line segments).
  • the least square method finds the most straight line of each target class by minimizing the square sum of errors Good function matching (ie long straight line segments).
  • Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment and compare the median and mean of the calculated slope to determine the slope with a small median and mean. And adjusting the inclination of the invoice picture according to the determined smaller slope.
  • the slope corresponding to the median minimum or the slope corresponding to the minimum value may be determined, and the slope corresponding to the median minimum or the mean is the smallest.
  • the corresponding slope adjusts the inclination of the invoice picture.
  • the angle of the inclination corresponding to the slope is obtained, and then the angle of the inclination is adjusted in the opposite direction of the invoice picture.
  • step S2 the invoice image recognition model generated by the pre-training is used to classify the obliquely corrected invoice image, and the category recognition result is output.
  • the invoice picture recognition model generated by the pre-training is a deep convolutional neural network model, wherein when the depth-convolution neural network model is used to classify the tilt-corrected invoice picture, preferably, the use can be performed in CaffeNet. Deep convolutional neural network
  • the target detection algorithm classifies the invoice image after the tilt correction.
  • other algorithms can also be used to identify the invoice image after the tilt correction, which is not limited here.
  • the types of invoices for hospitals include outpatient invoices and hospital invoices. After classifying the invoice images after the tilt correction, the category corresponding to each invoice image is output.
  • the target detection algorithm includes an infrastructure and an auxiliary architecture, specifically, including one input layer, 13 convolution layers, 5 pooling layers, 2 fully connected layers, and 1 sorting layer, as shown in Table 1 below. :
  • the Layer Name column indicates the name of each layer
  • the Batch Size indicates the number of input images of the current layer
  • the Kernel Size indicates the scale of the current layer convolution kernel (for example, the Kernel Size can be equal to 3, indicating that the scale of the convolution kernel is 3x 3 Stride Size indicates the moving step size of the convolution kernel, that is, the distance moved to the next convolution position after one convolution
  • the Pad Size indicates the size of the image padding in the current network layer.
  • Input represents the input layer
  • Conv represents the convolutional layer
  • Conv1 represents the first convolutional layer
  • MaxPool represents the maximum pooled layer
  • MaxPool1 represents the first maximum pooled layer
  • Fc represents the fully connected layer
  • Fc1 represents the first Fully connected layer
  • Softmax represents the Softmax classifier.
  • the embodiment uses the predetermined after receiving the invoice image to be processed.
  • the correction rule performs the tilt correction on the invoice image, and then uses the pre-trained invoice picture recognition model to classify the indented image after the tilt correction, and outputs the category recognition result, compared to the existing manual method for batch uploading
  • the invoice picture is used for angle correction and classification. This embodiment can quickly correct and classify batch invoice pictures, save time and effort, and improve the efficiency of business processing.
  • the preset invoice image category includes a plurality of, for example, an outpatient invoice and an inpatient invoice, and the first preset number is, for example, 1000 sheets, the first ratio is, for example, 75%, and the second ratio is, for example, 25%. Wherein, the sum of the first ratio and the second ratio is less than or equal to 1.
  • the sample of the certificate picture corresponding to the invoice picture category is the standard invoice picture corresponding to the invoice picture category
  • the invoice picture of the standard is the invoice picture with the label and the information not having the problem
  • the second preset quantity is, for example, 1000 sheets.
  • the first ratio is, for example, 75%
  • the second ratio is, for example, 25%, wherein the sum of the first ratio and the second ratio is less than or equal to 1.
  • the recognition system in order to improve the efficiency of training the deep convolutional neural network model, is implemented by the processor 12 before performing the training of the deep convolutional neural network model. The following steps:
  • the transposition of the remaining picture samples after the cleaning is analyzed, and the transposition is reversed.
  • analyzing the image information of the training set and the annotation information of the image sample of the verification set for example, analyzing whether the key position information of the image sample is missing or exceeding the entire image range, and the seal labeling Whether the location is in the center of the invoice and other data marked with errors. If the image sample of the above problem occurs, it will be cleaned or discarded to ensure that the annotation information of the image sample is accurate.
  • the transposition of the image samples determines the transposition of the image samples according to their aspect ratio information and the position of the seal, and make a flip adjustment for the transposed image samples: when the aspect ratio is greater than 1, the invoice image is high. The width is reversed. If the stamp position is on the left side of the image sample, the image sample is rotated clockwise by ninety degrees. If the stamp position is on the right side of the invoice image, the invoice image is rotated counterclockwise by ninety degrees; When the width ratio is less than 1, the height and width of the image sample are not reversed. If the stamp position is on the lower side of the invoice image, the invoice image is rotated clockwise by one hundred and eighty degrees. If the stamp position is on the upper side of the invoice image, the label is not made. deal with.
  • the label data of the image sample subjected to the flipping adjustment is corrected, and the label data of each image sample refers to the position information of the rectangular frame of the image sample, and the coordinates of the upper left corner of the rectangular frame (xmin, ymin) are used. And the lower right corner coordinates (xmax, ymax) are represented by four numbers. If xmax ⁇ xmin, the positions of the two are reversed, and the same processing is performed for the y coordinates to ensure that max>min.
  • FIG. 2 is a schematic flowchart of a method for classifying an invoice according to an application, and the method for classifying the invoice includes the following steps:
  • Step S1 after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule
  • the invoice image is tilt corrected by using a predetermined correction rule, wherein the predetermined correction rule includes a plurality of types:
  • the predetermined correction rule may be: obtaining an angle at which the invoice image is tilted, and correcting the invoice image based on the tilted angle;
  • the predetermined correction rule may be: separating the invoice image by the probability algorithm using the Hough transform Hough to be equal to or less than the first preset.
  • a short straight line segment of length wherein the Hough transform probability algorithm is capable of detecting a straight line (line segment) from a black and white image of the invoice picture, the first predetermined length being, for example, 3 mm, and the separated short straight line segments being as many as possible.
  • a preset threshold for example, a preset threshold of 0.5 mm
  • the straight segments are divided into one category until all the separated short straight segments are divided into several categories.
  • a short straight line segment belonging to the same class is used as a target class straight line, and a long straight line segment similar to each target class straight line is obtained by least square method, wherein the least square method finds the most straight line of each target class by minimizing the square sum of errors Good function matching (ie long straight line segments).
  • the least square method finds the most straight line of each target class by minimizing the square sum of errors Good function matching (ie long straight line segments).
  • Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment and compare the median and mean of the calculated slope to determine the slope with a small median and mean. And adjusting the inclination of the invoice picture according to the determined smaller slope.
  • the slope corresponding to the median minimum or the slope corresponding to the minimum value may be determined, and the slope corresponding to the median minimum or the mean is the smallest.
  • the corresponding slope adjusts the inclination of the invoice picture, in addition, according to the slope
  • When adjusting the inclination of the invoice picture obtain the angle of the inclination corresponding to the slope, and then adjust the angle of the inclination in the opposite direction of the invoice picture.
  • step S2 the invoice image recognition model generated by the pre-training is used to classify the obliquely corrected invoice image, and the category recognition result is output.
  • the invoice picture recognition model generated by the pre-training is a deep convolutional neural network model, wherein when the depth-convolution neural network model is used to classify the tilt-corrected invoice picture, preferably, the use can be performed in CaffeNet.
  • the object detection algorithm based on deep convolutional neural network selected in the environment classifies the invoice image after tilt correction.
  • other algorithms can also be used to identify the invoice image after tilt correction.
  • the types of invoices for hospitals include outpatient invoices and hospital invoices. After classifying the invoice images after the tilt correction, the category corresponding to each invoice image is output.
  • the target detection algorithm includes an infrastructure and an auxiliary architecture, specifically, including one input layer, 13 convolution layers, 5 pooling layers, 2 fully connected layers, and one sorting layer, as shown in Table 1 above. Show, no longer repeat here.
  • the Layer Name column indicates the name of each layer
  • the Batch Size indicates the number of input images of the current layer
  • the Kernel Size indicates the scale of the current layer convolution kernel (for example, the Kernel Size can be equal to 3, indicating that the scale of the convolution kernel is 3x 3 Stride Size indicates the moving step size of the convolution kernel, that is, the distance moved to the next convolution position after one convolution
  • the Pad Size indicates the size of the image padding in the current network layer.
  • Input represents the input layer
  • Conv represents the convolutional layer
  • Conv1 represents the first convolutional layer
  • MaxPool represents the maximum pooled layer
  • MaxPool1 represents the first maximum pooled layer
  • Fc represents the fully connected layer
  • Fc1 represents the first Fully connected layer
  • Softmax represents the Softmax classifier.
  • the embodiment After receiving the invoice image to be processed, the embodiment corrects the invoice image by using a predetermined correction rule, and then uses the pre-trained invoice image recognition model to identify the invoice image after the tilt correction, and outputs the invoice image.
  • the present embodiment can quickly correct and classify batch invoice images, save time and effort, and improve business processing. s efficiency.
  • the method further includes:
  • the preset invoice image category includes a plurality of, for example, an outpatient invoice and an inpatient invoice, and the first preset number is, for example, 1000 sheets, the first ratio is, for example, 75%, and the second ratio is, for example, 25%. Wherein, the sum of the first ratio and the second ratio is less than or equal to 1.
  • the sample of the certificate picture corresponding to the invoice picture category is the standard corresponding to the invoice picture category.
  • the invoice picture, the standard invoice picture is an upright, invoice picture with no problem with the label information
  • the second preset quantity is, for example, 1000 sheets
  • the first ratio is, for example, 75%
  • the second ratio is, for example, 25%, wherein The sum of the first ratio and the second ratio is less than or equal to 1.
  • the method for invoice classification further includes:
  • the transposition of the remaining picture samples after the cleaning is analyzed, and the transposition is reversed.
  • analyzing the image information of the training set and the annotation information of the image sample of the verification set for example, analyzing whether the key position information of the image sample is missing or exceeding the entire image range, and the seal labeling Whether the location is in the center of the invoice and other data marked with errors. If the image sample of the above problem occurs, it will be cleaned or discarded to ensure that the annotation information of the image sample is accurate.
  • the transposition of the image samples determines the transposition of the image samples according to their aspect ratio information and the position of the seal, and make a flip adjustment for the transposed image samples: when the aspect ratio is greater than 1, the invoice image is high. The width is reversed. If the stamp position is on the left side of the image sample, the image sample is rotated clockwise by ninety degrees. If the stamp position is on the right side of the invoice image, the invoice image is rotated counterclockwise by ninety degrees; When the width ratio is less than 1, the height and width of the image sample are not reversed. If the stamp position is on the lower side of the invoice image, the invoice image is rotated clockwise by one hundred and eighty degrees. If the stamp position is on the upper side of the invoice image, the label is not made. deal with.
  • the label data of the image sample subjected to the flipping adjustment is corrected, and the label data of each image sample refers to the position information of the rectangular frame of the image sample, and the coordinates of the upper left corner of the rectangular frame (xmin, ymin) are used. And the lower right corner coordinates (xmax, ymax) are represented by four numbers. If xmax ⁇ xmin, the positions of the two are reversed, and the same processing is performed for the y coordinates to ensure that max>min.
  • the present application also provides a computer readable storage medium having stored thereon an identification system, the steps of which are implemented by the processor to implement the method of invoicing the invoice described above.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, Hardware, but in many cases the former is a better implementation.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Abstract

An electronic device, a method and system for categorizing invoices, and a computer-readable storage medium. The electronic device comprises a memory (11) and a processor (12) connected to the memory (11). The memory (11) is stored with an identification system operable by the processor (12). The identification system, when executed by the processor (12), performs the following steps: upon receiving images of invoices to be processed, performing tilt correction on the images of the invoices using a preset correction rule (S1); and performing category identification on the tilt-corrected images of the invoices using a pre-trained and generated invoice image identification model and outputting a result of category identification (S2). The electronic device can perform fast angle correction and categorization on batches of invoice images, improving the effect of processing.

Description

电子装置、发票分类的方法、系统及计算机可读存储介质Electronic device, method and system for invoicing, and computer readable storage medium
优先权申明Priority claim
本申请基于巴黎公约申明享有2017年08月20日递交的申请号为CN 201710715451.7、名称为“电子装置、发票分类的方法及计算机可读存储介质”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。This application is based on the priority of the Chinese Patent Application entitled "Electronic Device, Method of Invoice Classification and Computer-Readable Storage Media", filed on August 20, 2017, with the application number of CN 201710715451.7, which is filed on Aug. 20, 2017. The entire content is incorporated herein by reference.
技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种电子装置、发票分类的方法、系统及计算机可读存储介质。The present application relates to the field of communications technologies, and in particular, to an electronic device, a method and system for invoicing an invoice, and a computer readable storage medium.
背景技术Background technique
目前,对于需要进行集中式财务数据处理的操作,例如,寿险理赔、员工费用报销等,在对批量上传的发票图片进行集中业务处理之前,通常需要人工方式预先对发票图片进行角度矫正及对发票图片进行分类,以供进行集中业务处理,集中业务处理包括进行发票核算、发票信息录入等等,现有的采用人工方式对批量上传的发票图片进行角度矫正和分类的方案费时费力,效率低下。At present, for operations that require centralized financial data processing, such as life insurance claims, employee expense reimbursement, etc., before the centralized processing of batch uploading invoice images, it is usually necessary to manually correct the invoice image and correct the invoice. The images are classified for centralized business processing. The centralized business processing includes invoice accounting, invoice information entry, etc. The existing manual correction and classification of batch uploading invoice images is time-consuming and laborious, and inefficient.
发明内容Summary of the invention
本申请的目的在于提供一种电子装置、发票分类的方法、系统及计算机可读存储介质,旨在快速对批量的发票图片进行角度矫正和分类,提高处理效率。The purpose of the present application is to provide an electronic device, a method and system for invoice classification, and a computer readable storage medium, which are intended to quickly correct and classify batch invoice images and improve processing efficiency.
为实现上述目的,本申请提供一种电子装置,所述电子装置包括存储器及与所述存储器连接的处理器,所述存储器中存储有可在所述处理器上运行的识别系统,所述识别系统被所述处理器执行时实现如下步骤:To achieve the above object, the present application provides an electronic device including a memory and a processor coupled to the memory, wherein the memory stores an identification system operable on the processor, the identification The system implements the following steps when executed by the processor:
S1,在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;S1, after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule;
S2,利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果;S2, using the invoice image recognition model generated by the pre-training to classify the tilt corrected invoice image, and output the category recognition result;
所述预先确定的矫正规则包括:The predetermined correction rules include:
利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段;Separating a short straight line segment of the invoice picture that is less than or equal to the first preset length by using a probability algorithm of Hough transform Hough;
基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类;Dividing each of the separated short straight line segments into several classes based on the x coordinate or the y coordinate of each of the separated short straight line segments;
将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段;Using a short straight line segment belonging to the same class as a target class straight line, and using a least squares method to obtain a long straight line segment similar to each target class straight line;
计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值, 比较计算出的斜率的中位数和均值的大小以确定出较小者,并根据确定出的较小者调整发票图片的倾角。Calculate the slope of each long straight line segment and the median and mean of the slope of each long straight line segment, The median and mean of the calculated slope are compared to determine the smaller one, and the inclination of the invoice image is adjusted based on the smaller one determined.
为实现上述目的,本申请还提供一种发票分类的方法,所述发票分类的方法包括:To achieve the above object, the present application also provides a method for invoice classification, and the method for invoice classification includes:
S1,在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;S1, after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule;
S2,利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果;S2, using the invoice image recognition model generated by the pre-training to classify the tilt corrected invoice image, and output the category recognition result;
所述预先确定的矫正规则包括:The predetermined correction rules include:
利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段;Separating a short straight line segment of the invoice picture that is less than or equal to the first preset length by using a probability algorithm of Hough transform Hough;
基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类;Dividing each of the separated short straight line segments into several classes based on the x coordinate or the y coordinate of each of the separated short straight line segments;
将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段;Using a short straight line segment belonging to the same class as a target class straight line, and using a least squares method to obtain a long straight line segment similar to each target class straight line;
计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小以确定出较小者,并根据确定出的较小者调整发票图片的倾角。Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, compare the calculated median and mean of the slope to determine the smaller one, and according to the smaller one determined Adjust the inclination of the invoice image.
为实现上述目的,本申请还提供一种识别系统,所述识别系统包括:To achieve the above object, the present application further provides an identification system, the identification system comprising:
矫正模块,用于在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;a correction module, configured to perform a tilt correction on the invoice image by using a predetermined correction rule after receiving the invoice image to be processed;
识别模块,用于利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果;The identification module is configured to perform category identification on the indented image after the tilt correction by using the invoice image recognition model generated by the pre-training, and output the category recognition result;
所述预先确定的矫正规则包括:The predetermined correction rules include:
利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段;Separating a short straight line segment of the invoice picture that is less than or equal to the first preset length by using a probability algorithm of Hough transform Hough;
基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类;Dividing each of the separated short straight line segments into several classes based on the x coordinate or the y coordinate of each of the separated short straight line segments;
将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段;Using a short straight line segment belonging to the same class as a target class straight line, and using a least squares method to obtain a long straight line segment similar to each target class straight line;
计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小以确定出较小者,并根据确定出的较小者调整发票图片的倾角。Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, compare the calculated median and mean of the slope to determine the smaller one, and according to the smaller one determined Adjust the inclination of the invoice image.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有识别系统,所述识别系统被处理器执行时实现步骤:The application further provides a computer readable storage medium having an identification system stored thereon, the implementation system implementing the steps when the recognition system is executed by the processor:
S1,在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正; S1, after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule;
S2,利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果;S2, using the invoice image recognition model generated by the pre-training to classify the tilt corrected invoice image, and output the category recognition result;
所述预先确定的矫正规则包括:The predetermined correction rules include:
利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段;Separating a short straight line segment of the invoice picture that is less than or equal to the first preset length by using a probability algorithm of Hough transform Hough;
基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类;Dividing each of the separated short straight line segments into several classes based on the x coordinate or the y coordinate of each of the separated short straight line segments;
将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段;Using a short straight line segment belonging to the same class as a target class straight line, and using a least squares method to obtain a long straight line segment similar to each target class straight line;
计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小以确定出较小者,并根据确定出的较小者调整发票图片的倾角。Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, compare the calculated median and mean of the slope to determine the smaller one, and according to the smaller one determined Adjust the inclination of the invoice image.
本申请的有益效果是:本申请在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正,之后,采用预先训练的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果,相比于现有的采用人工方式对批量上传的发票图片进行角度矫正和分类的方案,本申请能够快速对批量的发票图片进行角度矫正和分类,省时省力,提高业务处理的效率。The beneficial effects of the present application are as follows: after receiving the invoice image to be processed, the present application performs a tilt correction on the invoice image by using a predetermined correction rule, and then adopts a pre-trained invoice image recognition model to correct the invoice image after the tilt correction. Perform category identification and output category recognition results. Compared with the existing manual correction and classification of batch uploading invoice images, this application can quickly correct and classify batch invoice images, saving time. Save effort and improve the efficiency of business processing.
附图说明DRAWINGS
图1为本申请各个实施例一可选的应用环境示意图;1 is a schematic diagram of an optional application environment of each embodiment of the present application;
图2为本申请发票分类的方法一实施例的流程示意图;2 is a schematic flow chart of an embodiment of a method for classifying an invoice according to the present application;
图3为图2所示预定的矫正规则的示意图。Figure 3 is a schematic illustration of the predetermined correction rule shown in Figure 2.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions of "first", "second" and the like in the present application are for the purpose of description only, and are not to be construed as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. . Thus, features defining "first" and "second" may include at least one of the features, either explicitly or implicitly. In addition, the technical solutions between the various embodiments may be combined with each other, but must be based on the realization of those skilled in the art, and when the combination of the technical solutions is contradictory or impossible to implement, it should be considered that the combination of the technical solutions does not exist. Nor is it within the scope of protection required by this application.
参阅图1所示,是本申请发票分类的方法的较佳实施例的应用环境示意图。该应用环境示意图包括电子装置1及终端设备2。电子装置1可以通过 网络、近场通信技术等适合的技术与终端设备2进行数据交互。Referring to FIG. 1, it is a schematic diagram of an application environment of a preferred embodiment of the method for invoicing an invoice of the present application. The application environment diagram includes an electronic device 1 and a terminal device 2. Electronic device 1 can pass A suitable technology such as a network or a near field communication technology performs data interaction with the terminal device 2.
所述终端设备2包括,但不限于,任何一种可与用户通过键盘、鼠标、遥控器、触摸板或者声控设备等方式进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理(Personal Digital Assistant,PDA)、游戏机、交互式网络电视(Internet Protocol Television,IPTV)、智能式穿戴式设备、导航装置等等的可移动设备,或者诸如数字TV、台式计算机、笔记本、服务器等等的固定终端。The terminal device 2 includes, but is not limited to, any electronic product that can interact with a user through a keyboard, a mouse, a remote controller, a touch panel, or a voice control device, for example, a personal computer, a tablet computer, or a smart phone. , Personal Digital Assistant (PDA), game consoles, Internet Protocol Television (IPTV), smart wearable devices, navigation devices, etc., or mobile devices such as digital TVs, desktop computers, Fixed terminal for notebooks, servers, etc.
所述电子装置1是一种能够按照事先设定或者存储的指令,自动进行数值计算和/或信息处理的设备。所述电子装置1可以是计算机、也可以是单个网络服务器、多个网络服务器组成的服务器组或者基于云计算的由大量主机或者网络服务器构成的云,其中云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。The electronic device 1 is an apparatus capable of automatically performing numerical calculation and/or information processing in accordance with an instruction set or stored in advance. The electronic device 1 may be a computer, a single network server, a server group composed of multiple network servers, or a cloud-based cloud composed of a large number of hosts or network servers, where cloud computing is a type of distributed computing. A super virtual computer consisting of a group of loosely coupled computers.
在本实施例中,电子装置1可包括,但不仅限于,可通过系统总线相互通信连接的存储器11、处理器12、网络接口13,存储器11存储有可在处理器12上运行的识别系统。需要指出的是,图1仅示出了具有组件11-13的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。In the present embodiment, the electronic device 1 may include, but is not limited to, a memory 11 communicably connected to each other through a system bus, a processor 12, and a network interface 13, and the memory 11 stores an identification system operable on the processor 12. It should be noted that FIG. 1 only shows the electronic device 1 having the components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
其中,存储设备11包括内存及至少一种类型的可读存储介质。内存为电子装置1的运行提供缓存;可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等的非易失性存储介质。在一些实施例中,可读存储介质可以是电子装置1的内部存储单元,例如该电子装置1的硬盘;在另一些实施例中,该非易失性存储介质也可以是电子装置1的外部存储设备,例如电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。本实施例中,存储设备11的可读存储介质通常用于存储安装于电子装置1的操作系统和各类应用软件,例如本申请一实施例中的识别系统的程序代码等。此外,存储设备11还可以用于暂时地存储已经输出或者将要输出的各类数据。The storage device 11 includes a memory and at least one type of readable storage medium. The memory provides a cache for the operation of the electronic device 1; the readable storage medium may be, for example, a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM). A non-volatile storage medium such as a read only memory (ROM), an electrically erasable programmable read only memory (EEPROM), a programmable read only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, or the like. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1; in other embodiments, the non-volatile storage medium may also be external to the electronic device 1. A storage device, such as a plug-in hard disk equipped with an electronic device 1, a smart memory card (SMC), a Secure Digital (SD) card, a flash card, or the like. In this embodiment, the readable storage medium of the storage device 11 is generally used to store an operating system installed in the electronic device 1 and various types of application software, such as program codes of the identification system in an embodiment of the present application. Further, the storage device 11 can also be used to temporarily store various types of data that have been output or are to be output.
所述处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器12通常用于控制所述电子装置1的总体操作,例如执行与所述终端设备2进行数据交互或者通信相关的控制和处理等。本实施例中,所述处理器12用于运行所述存储器11中存储的程序代码或者处理数据,例如运行识别系统等。The processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 12 is typically used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with the terminal device 2. In this embodiment, the processor 12 is configured to run program code or process data stored in the memory 11, such as running an identification system or the like.
所述网络接口13可包括无线网络接口或有线网络接口,该网络接口13通常用于在所述电子装置1与其他电子设备之间建立通信连接。本实施例中,网络接口13主要用于将电子装置1与一个或多个终端设备2相连,在电子 装置1与一个或多个终端设备2之间建立数据传输通道和通信连接。The network interface 13 may comprise a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the electronic device 1 and other electronic devices. In this embodiment, the network interface 13 is mainly used to connect the electronic device 1 with one or more terminal devices 2, in the electronic A device 1 establishes a data transmission channel and a communication connection with one or more terminal devices 2.
所述识别系统存储在存储器11中,包括至少一个存储在存储器11中的计算机可读指令,该至少一个计算机可读指令可被处理器器12执行,以实现本申请各实施例的方法;以及,该至少一个计算机可读指令依据其各部分所实现的功能不同,可被划为不同的逻辑模块,本实施例包括矫正模块及识别模块。The identification system is stored in the memory 11 and includes at least one computer readable instruction stored in the memory 11, the at least one computer readable instruction being executable by the processor 12 to implement the methods of various embodiments of the present application; The at least one computer readable instruction can be classified into different logic modules according to different functions implemented by the various parts thereof. The embodiment includes a correction module and an identification module.
在一实施例中,上述识别系统被所述处理器12执行时实现如下步骤:In an embodiment, the above identification system is implemented by the processor 12 to implement the following steps:
步骤S1,在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;Step S1, after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule;
本实施例中,在接收到批量的待处理的发票图片后,利用预定的矫正规则对发票图片进行倾斜矫正,其中预定的矫正规则包括多种:In this embodiment, after receiving the batch of the invoice image to be processed, the invoice image is tilt corrected by using a predetermined correction rule, wherein the predetermined correction rule includes a plurality of types:
在一实施例中,预定的矫正规则可以是:获取发票图片倾斜的角度,基于该倾斜的角度矫正该发票图片;In an embodiment, the predetermined correction rule may be: obtaining an angle at which the invoice image is tilted, and correcting the invoice image based on the tilted angle;
在另一实施例中,为了更准确地对发票图片进行矫正,预定的矫正规则可以是:利用霍夫变换(Hough)的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段,其中,霍夫变换的概率算法能够从发票图片的黑白图像中检测直线(线段),第一预设长度例如为3mm,分离出的短直线段尽可能多。基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类,具体地,从分离出的短直线段中确定出水平倾角小于等于预设角度(例如预设角度为5度或10度)的短直线段,将确定出的直线段中x坐标值相差小于等于预设阈值(例如预设阈值为0.5mm)的短直线段分为一类,直至将所有分离出的短直线段分为若干类,或者,将所确定出的水平倾角小于等于预设角度的短直线段中y坐标值相差小于等于预设阈值(例如预设阈值为0.5mm)的短直线段分为一类,直至将所有分离出的短直线段分为若干类。将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段,其中,最小二乘法通过最小化误差的平方和寻找各个目标类直线的最佳函数匹配(即长直线段)。计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小,以确定出中位数和均值均较小的斜率,并根据确定出的较小的斜率调整发票图片的倾角,在其他实施例中,也可以确定出中位数最小对应的斜率或者均值最小对应的斜率,以中位数最小对应的斜率或者均值最小对应的斜率调整发票图片的倾角,此外,在根据斜率调整发票图片的倾角时,获取该斜率对应的倾角的角度,然后将发票图片反方向调整该倾角的角度即可。In another embodiment, in order to correct the invoice picture more accurately, the predetermined correction rule may be: using a probability algorithm of Hough transform to separate the short length of the invoice picture that is less than or equal to the first preset length. A straight line segment, wherein the Hough transform probability algorithm is capable of detecting a straight line (line segment) from a black and white image of the invoice picture, the first preset length being, for example, 3 mm, and the separated short straight line segments being as many as possible. Dividing each of the separated short straight line segments into several categories based on the x coordinate or the y coordinate of each of the separated short straight line segments, specifically, determining that the horizontal tilt angle is less than or equal to a preset angle from the separated short straight line segments (eg, preset A short straight line segment with an angle of 5 degrees or 10 degrees, and a short straight line segment in which the determined x coordinate values differ by less than or equal to a preset threshold (for example, a preset threshold of 0.5 mm) is divided into one class until all The separated short straight line segments are divided into several categories, or the shortest straight line segments whose determined horizontal tilt angle is less than or equal to the preset angle are short enough that the difference of the y coordinate values is less than or equal to a preset threshold (for example, a preset threshold of 0.5 mm). The straight segments are divided into one category until all the separated short straight segments are divided into several categories. A short straight line segment belonging to the same class is used as a target class straight line, and a long straight line segment similar to each target class straight line is obtained by least square method, wherein the least square method finds the most straight line of each target class by minimizing the square sum of errors Good function matching (ie long straight line segments). Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, and compare the median and mean of the calculated slope to determine the slope with a small median and mean. And adjusting the inclination of the invoice picture according to the determined smaller slope. In other embodiments, the slope corresponding to the median minimum or the slope corresponding to the minimum value may be determined, and the slope corresponding to the median minimum or the mean is the smallest. The corresponding slope adjusts the inclination of the invoice picture. In addition, when adjusting the inclination of the invoice picture according to the slope, the angle of the inclination corresponding to the slope is obtained, and then the angle of the inclination is adjusted in the opposite direction of the invoice picture.
步骤S2,利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果。In step S2, the invoice image recognition model generated by the pre-training is used to classify the obliquely corrected invoice image, and the category recognition result is output.
本实施例中,预先训练生成的发票图片识别模型为深度卷积神经网络模型,其中,利用深度卷积神经网络模型对倾斜矫正后的发票图片进行类别识别时,优选地,利用可以在CaffeNet的环境下选取的基于深度卷积神经网络 的目标检测算法对倾斜矫正后的发票图片进行类别识别,当然,也可以利用其它算法对倾斜矫正后的发票图片进行类别识别,此处不做过多限定。此外,发票的类别较多,例如对于医院的发票的类别包括门诊发票和住院发票等,在对倾斜矫正后的发票图片进行类别识别后,输出每一发票图片对应的类别。In this embodiment, the invoice picture recognition model generated by the pre-training is a deep convolutional neural network model, wherein when the depth-convolution neural network model is used to classify the tilt-corrected invoice picture, preferably, the use can be performed in CaffeNet. Deep convolutional neural network The target detection algorithm classifies the invoice image after the tilt correction. Of course, other algorithms can also be used to identify the invoice image after the tilt correction, which is not limited here. In addition, there are many types of invoices. For example, the types of invoices for hospitals include outpatient invoices and hospital invoices. After classifying the invoice images after the tilt correction, the category corresponding to each invoice image is output.
优选地,目标检测算法包括基础架构及辅助架构,具体地,包括1个输入层,13个卷积层,5个池化层,2个全连接层,1个分类层,如下表1所示:Preferably, the target detection algorithm includes an infrastructure and an auxiliary architecture, specifically, including one input layer, 13 convolution layers, 5 pooling layers, 2 fully connected layers, and 1 sorting layer, as shown in Table 1 below. :
Layer NameLayer Name Batch SizeBatch Size Kernel SizeKernel Size Stride SizeStride Size Pad SizePad Size
InputInput 128128 N/AN/A N/AN/A N/AN/A
Conv1Conv1 128128 33 11 11
Conv2Conv2 128128 33 11 11
MaxPool1MaxPool1 128128 22 22 00
Conv3Conv3 128128 33 11 11
Conv4Conv4 128128 33 11 11
MaxPool2MaxPool2 128128 22 22 00
Conv5Conv5 128128 33 11 11
Conv6Conv6 128128 33 11 11
Conv7Conv7 128128 33 11 11
MaxPool3MaxPool3 128128 22 22 00
Conv8Conv8 128128 33 11 11
Conv9Conv9 128128 33 11 11
Conv10Conv10 128128 33 11 11
MaxPool4MaxPool4 128128 22 22 00
Conv11Conv11 128128 33 11 11
Conv12Conv12 128128 33 11 11
Conv13Conv13 128128 33 11 11
MaxPool5MaxPool5 128128 22 22 00
Fc1Fc1 40964096 11 11 00
Fc2Fc2 20482048 11 11 00
SoftmaxSoftmax 33 N/AN/A N/AN/A N/AN/A
表1Table 1
其中,Layer Name列表示每一层的名称,Batch Size表示当前层的输入图像数目,Kernel Size表示当前层卷积核的尺度(例如,Kernel Size可以等于3,表示卷积核的尺度为3x 3),Stride Size表示卷积核的移动步长,即做完一次卷积之后移动到下一个卷积位置的距离,Pad Size表示对当前网络层之中的图像填充的大小。Input表示输入层,Conv表示卷积层,Conv1表示第1个卷积层,MaxPool表示最大值池化层,MaxPool1表示第1个最大值池化层,Fc表示全连接层,Fc1表示第1个全连接层,Softmax表示Softmax分类器。The Layer Name column indicates the name of each layer, the Batch Size indicates the number of input images of the current layer, and the Kernel Size indicates the scale of the current layer convolution kernel (for example, the Kernel Size can be equal to 3, indicating that the scale of the convolution kernel is 3x 3 Stride Size indicates the moving step size of the convolution kernel, that is, the distance moved to the next convolution position after one convolution, and the Pad Size indicates the size of the image padding in the current network layer. Input represents the input layer, Conv represents the convolutional layer, Conv1 represents the first convolutional layer, MaxPool represents the maximum pooled layer, MaxPool1 represents the first maximum pooled layer, Fc represents the fully connected layer, and Fc1 represents the first Fully connected layer, Softmax represents the Softmax classifier.
与现有技术相比,本实施例在接收到待处理的发票图片后,利用预定的 矫正规则对所述发票图片进行倾斜矫正,之后,采用预先训练的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果,相比于现有的采用人工方式对批量上传的发票图片进行角度矫正和分类的方案,本实施例能够快速对批量的发票图片进行角度矫正和分类,省时省力,提高业务处理的效率。Compared with the prior art, the embodiment uses the predetermined after receiving the invoice image to be processed. The correction rule performs the tilt correction on the invoice image, and then uses the pre-trained invoice picture recognition model to classify the indented image after the tilt correction, and outputs the category recognition result, compared to the existing manual method for batch uploading The invoice picture is used for angle correction and classification. This embodiment can quickly correct and classify batch invoice pictures, save time and effort, and improve the efficiency of business processing.
在一优选的实施例中,在上述实施例的基础上,所述识别系统被所述处理器12执行类别识别之前,还实现如下步骤:In a preferred embodiment, based on the above embodiment, before the identification system is executed by the processor 12, the following steps are further implemented:
为每一预设的发票图片类别分别准备第一预设数量的标注有对应的类别的发票图片样本,将所述发票图片样本分为第一比例的训练子集和第二比例的验证子集,其中,预设的发票图片类别包括多种,例如包括门诊类发票和住院类发票等,第一预设数量例如为1000张,第一比例例如为75%,第二比例例如为25%,其中,第一比例与第二比例之和小于等于1。Preparing, for each preset invoice picture category, a first preset number of invoice picture samples marked with corresponding categories, and dividing the invoice picture sample into a first proportion of the training subset and a second proportion of the verification subset The preset invoice image category includes a plurality of, for example, an outpatient invoice and an inpatient invoice, and the first preset number is, for example, 1000 sheets, the first ratio is, for example, 75%, and the second ratio is, for example, 25%. Wherein, the sum of the first ratio and the second ratio is less than or equal to 1.
获取每一预设的发票图片类别对应的第二预设数量证件图片样本,将所述证件图片样本分为第一比例的训练子集和第二比例的验证子集,其中,每一预设的发票图片类别对应的证件图片样本为该发票图片类别对应的标准的发票图片,该标准的发票图片为正置的、标注信息未出现问题的发票图片,第二预设数量例如为1000张,第一比例例如为75%,第二比例例如为25%,其中,第一比例与第二比例之和小于等于1。Obtaining a second preset number of certificate image samples corresponding to each preset invoice picture category, and dividing the certificate picture sample into a first proportion of the training subset and a second proportion of the verification subset, wherein each preset The sample of the certificate picture corresponding to the invoice picture category is the standard invoice picture corresponding to the invoice picture category, and the invoice picture of the standard is the invoice picture with the label and the information not having the problem, and the second preset quantity is, for example, 1000 sheets. The first ratio is, for example, 75%, and the second ratio is, for example, 25%, wherein the sum of the first ratio and the second ratio is less than or equal to 1.
将所有训练子集中的图片样本进行混合以得到训练集,将所有验证子集中的图片样本进行混合以得到验证集,利用所述训练集训练所述深度卷积神经网络模型,利用所述验证集验证训练后的深度卷积神经网络模型的准确率,若所述准确率大于或者等于预设准确率(预设准确率例如为0.98),则训练结束,以训练后的深度卷积神经网络模型作为所述步骤S2中的发票图片识别模型,或者,若所述准确率小于预设准确率,则增加每一预设的发票图片类别对应的证件图片样本的数量,以重新进行训练。Mixing picture samples from all training subsets to obtain a training set, mixing picture samples in all verification subsets to obtain a verification set, and training the deep convolutional neural network model with the training set, using the verification set Verify the accuracy of the deep convolutional neural network model after training. If the accuracy is greater than or equal to the preset accuracy (preset accuracy is, for example, 0.98), the training ends, and the post-training deep convolutional neural network model As the invoice picture recognition model in the step S2, or if the accuracy rate is less than the preset accuracy rate, the number of the certificate picture samples corresponding to each preset invoice picture category is increased to re-train.
在一优选的实施例中,在上述实施例的基础上,为了提高训练深度卷积神经网络模型的效率,所述识别系统被所述处理器12执行训练深度卷积神经网络模型之前,还实现如下步骤:In a preferred embodiment, on the basis of the above embodiments, in order to improve the efficiency of training the deep convolutional neural network model, the recognition system is implemented by the processor 12 before performing the training of the deep convolutional neural network model. The following steps:
在训练所述深度卷积神经网络模型前,分析训练集的图片样本及验证集的图片样本的标注信息,将标注信息错误的图片样本进行清理;Before training the deep convolutional neural network model, analyzing the image data of the training set and the annotation information of the image sample of the verification set, and cleaning the image sample with the wrong information;
根据发票图片的高宽比信息以及印章的位置分析清理后剩余的图片样本的转置情况,并对发生转置的进行翻转调整。According to the aspect ratio information of the invoice picture and the position of the seal, the transposition of the remaining picture samples after the cleaning is analyzed, and the transposition is reversed.
其中,在训练所述深度卷积神经网络模型前,分析训练集的图片样本及验证集的图片样本的标注信息,例如分析图片样本的关键位置信息是否缺失或超出整张图片范围,以及印章标注位置是否位于发票中央等明显标注错误的数据,若出现上述问题的图片样本,则对其进行清理或丢弃,以确保图片样本的标注信息准确无误。 Before training the deep convolutional neural network model, analyzing the image information of the training set and the annotation information of the image sample of the verification set, for example, analyzing whether the key position information of the image sample is missing or exceeding the entire image range, and the seal labeling Whether the location is in the center of the invoice and other data marked with errors. If the image sample of the above problem occurs, it will be cleaned or discarded to ensure that the annotation information of the image sample is accurate.
对于清理后剩余的图片样本,根据其高宽比信息以及印章的位置判断图片样本的转置情况,并对发生转置的图片样本做翻转调整:当高宽比大于1时,说明发票图片高宽颠倒,若印章位置在发图片样本左侧,则对图片样本做顺时针旋转九十度处理,若印章位置在发票图片右侧,则对发票图像做逆时针旋转九十度处理;当高宽比小于1时,说明图片样本高宽未颠倒,若印章位置在发票图片下侧,则对发票图像做顺时针旋转一百八十度处理,若印章位置在发票图片上侧,则不做处理。For the remaining image samples after cleaning, determine the transposition of the image samples according to their aspect ratio information and the position of the seal, and make a flip adjustment for the transposed image samples: when the aspect ratio is greater than 1, the invoice image is high. The width is reversed. If the stamp position is on the left side of the image sample, the image sample is rotated clockwise by ninety degrees. If the stamp position is on the right side of the invoice image, the invoice image is rotated counterclockwise by ninety degrees; When the width ratio is less than 1, the height and width of the image sample are not reversed. If the stamp position is on the lower side of the invoice image, the invoice image is rotated clockwise by one hundred and eighty degrees. If the stamp position is on the upper side of the invoice image, the label is not made. deal with.
另外,对经过翻转调整的图片样本的标注数据进行修正,每个图片样本的标注数据指的是框出这个图片样本的矩形框的位置信息,用这个矩形框的左上角坐标(xmin,ymin)和右下角坐标(xmax,ymax)四个数来表示,如果xmax<xmin,则颠倒二者位置,对y坐标做同样的处理,以确保max>min。In addition, the label data of the image sample subjected to the flipping adjustment is corrected, and the label data of each image sample refers to the position information of the rectangular frame of the image sample, and the coordinates of the upper left corner of the rectangular frame (xmin, ymin) are used. And the lower right corner coordinates (xmax, ymax) are represented by four numbers. If xmax < xmin, the positions of the two are reversed, and the same processing is performed for the y coordinates to ensure that max>min.
如图2所示,图2为本申请发票分类的方法一实施例的流程示意图,该发票分类的方法包括以下步骤:As shown in FIG. 2, FIG. 2 is a schematic flowchart of a method for classifying an invoice according to an application, and the method for classifying the invoice includes the following steps:
步骤S1,在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;Step S1, after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule;
本实施例中,在接收到批量的待处理的发票图片后,利用预定的矫正规则对发票图片进行倾斜矫正,其中预定的矫正规则包括多种:In this embodiment, after receiving the batch of the invoice image to be processed, the invoice image is tilt corrected by using a predetermined correction rule, wherein the predetermined correction rule includes a plurality of types:
在一实施例中,预定的矫正规则可以是:获取发票图片倾斜的角度,基于该倾斜的角度矫正该发票图片;In an embodiment, the predetermined correction rule may be: obtaining an angle at which the invoice image is tilted, and correcting the invoice image based on the tilted angle;
在另一实施例中,为了更准确地对发票图片进行矫正,结合参阅图3,预定的矫正规则可以是:利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段,其中,霍夫变换的概率算法能够从发票图片的黑白图像中检测直线(线段),第一预设长度例如为3mm,分离出的短直线段尽可能多。基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类,具体地,从分离出的短直线段中确定出水平倾角小于等于预设角度(例如预设角度为5度或10度)的短直线段,将确定出的直线段中x坐标值相差小于等于预设阈值(例如预设阈值为0.5mm)的短直线段分为一类,直至将所有分离出的短直线段分为若干类,或者,将所确定出的水平倾角小于等于预设角度的短直线段中y坐标值相差小于等于预设阈值(例如预设阈值为0.5mm)的短直线段分为一类,直至将所有分离出的短直线段分为若干类。将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段,其中,最小二乘法通过最小化误差的平方和寻找各个目标类直线的最佳函数匹配(即长直线段)。计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小,以确定出中位数和均值均较小的斜率,并根据确定出的较小的斜率调整发票图片的倾角,在其他实施例中,也可以确定出中位数最小对应的斜率或者均值最小对应的斜率,以中位数最小对应的斜率或者均值最小对应的斜率调整发票图片的倾角,此外,在根据斜 率调整发票图片的倾角时,获取该斜率对应的倾角的角度,然后将发票图片反方向调整该倾角的角度即可。In another embodiment, in order to correct the invoice picture more accurately, referring to FIG. 3, the predetermined correction rule may be: separating the invoice image by the probability algorithm using the Hough transform Hough to be equal to or less than the first preset. A short straight line segment of length, wherein the Hough transform probability algorithm is capable of detecting a straight line (line segment) from a black and white image of the invoice picture, the first predetermined length being, for example, 3 mm, and the separated short straight line segments being as many as possible. Dividing each of the separated short straight line segments into several categories based on the x coordinate or the y coordinate of each of the separated short straight line segments, specifically, determining that the horizontal tilt angle is less than or equal to a preset angle from the separated short straight line segments (eg, preset A short straight line segment with an angle of 5 degrees or 10 degrees, and a short straight line segment in which the determined x coordinate values differ by less than or equal to a preset threshold (for example, a preset threshold of 0.5 mm) is divided into one class until all The separated short straight line segments are divided into several categories, or the shortest straight line segments whose determined horizontal tilt angle is less than or equal to the preset angle are short enough that the difference of the y coordinate values is less than or equal to a preset threshold (for example, a preset threshold of 0.5 mm). The straight segments are divided into one category until all the separated short straight segments are divided into several categories. A short straight line segment belonging to the same class is used as a target class straight line, and a long straight line segment similar to each target class straight line is obtained by least square method, wherein the least square method finds the most straight line of each target class by minimizing the square sum of errors Good function matching (ie long straight line segments). Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, and compare the median and mean of the calculated slope to determine the slope with a small median and mean. And adjusting the inclination of the invoice picture according to the determined smaller slope. In other embodiments, the slope corresponding to the median minimum or the slope corresponding to the minimum value may be determined, and the slope corresponding to the median minimum or the mean is the smallest. The corresponding slope adjusts the inclination of the invoice picture, in addition, according to the slope When adjusting the inclination of the invoice picture, obtain the angle of the inclination corresponding to the slope, and then adjust the angle of the inclination in the opposite direction of the invoice picture.
步骤S2,利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果。In step S2, the invoice image recognition model generated by the pre-training is used to classify the obliquely corrected invoice image, and the category recognition result is output.
本实施例中,预先训练生成的发票图片识别模型为深度卷积神经网络模型,其中,利用深度卷积神经网络模型对倾斜矫正后的发票图片进行类别识别时,优选地,利用可以在CaffeNet的环境下选取的基于深度卷积神经网络的目标检测算法对倾斜矫正后的发票图片进行类别识别,当然,也可以利用其它算法对倾斜矫正后的发票图片进行类别识别,此处不做过多限定。此外,发票的类别较多,例如对于医院的发票的类别包括门诊发票和住院发票等,在对倾斜矫正后的发票图片进行类别识别后,输出每一发票图片对应的类别。In this embodiment, the invoice picture recognition model generated by the pre-training is a deep convolutional neural network model, wherein when the depth-convolution neural network model is used to classify the tilt-corrected invoice picture, preferably, the use can be performed in CaffeNet. The object detection algorithm based on deep convolutional neural network selected in the environment classifies the invoice image after tilt correction. Of course, other algorithms can also be used to identify the invoice image after tilt correction. . In addition, there are many types of invoices. For example, the types of invoices for hospitals include outpatient invoices and hospital invoices. After classifying the invoice images after the tilt correction, the category corresponding to each invoice image is output.
优选地,目标检测算法包括基础架构及辅助架构,具体地,包括1个输入层,13个卷积层,5个池化层,2个全连接层,1个分类层,如上述表1所示,此处不再赘述。Preferably, the target detection algorithm includes an infrastructure and an auxiliary architecture, specifically, including one input layer, 13 convolution layers, 5 pooling layers, 2 fully connected layers, and one sorting layer, as shown in Table 1 above. Show, no longer repeat here.
其中,Layer Name列表示每一层的名称,Batch Size表示当前层的输入图像数目,Kernel Size表示当前层卷积核的尺度(例如,Kernel Size可以等于3,表示卷积核的尺度为3x 3),Stride Size表示卷积核的移动步长,即做完一次卷积之后移动到下一个卷积位置的距离,Pad Size表示对当前网络层之中的图像填充的大小。Input表示输入层,Conv表示卷积层,Conv1表示第1个卷积层,MaxPool表示最大值池化层,MaxPool1表示第1个最大值池化层,Fc表示全连接层,Fc1表示第1个全连接层,Softmax表示Softmax分类器。The Layer Name column indicates the name of each layer, the Batch Size indicates the number of input images of the current layer, and the Kernel Size indicates the scale of the current layer convolution kernel (for example, the Kernel Size can be equal to 3, indicating that the scale of the convolution kernel is 3x 3 Stride Size indicates the moving step size of the convolution kernel, that is, the distance moved to the next convolution position after one convolution, and the Pad Size indicates the size of the image padding in the current network layer. Input represents the input layer, Conv represents the convolutional layer, Conv1 represents the first convolutional layer, MaxPool represents the maximum pooled layer, MaxPool1 represents the first maximum pooled layer, Fc represents the fully connected layer, and Fc1 represents the first Fully connected layer, Softmax represents the Softmax classifier.
本实施例在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正,之后,采用预先训练的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果,相比于现有的采用人工方式对批量上传的发票图片进行角度矫正和分类的方案,本实施例能够快速对批量的发票图片进行角度矫正和分类,省时省力,提高业务处理的效率。After receiving the invoice image to be processed, the embodiment corrects the invoice image by using a predetermined correction rule, and then uses the pre-trained invoice image recognition model to identify the invoice image after the tilt correction, and outputs the invoice image. Compared with the existing manual correction method for manually correcting the batch invoice image, the present embodiment can quickly correct and classify batch invoice images, save time and effort, and improve business processing. s efficiency.
在一优选的实施例中,在上述图2的实施例的基础上,在所述步骤S2之前还包括:In a preferred embodiment, based on the foregoing embodiment of FIG. 2, before the step S2, the method further includes:
为每一预设的发票图片类别分别准备第一预设数量的标注有对应的类别的发票图片样本,将所述发票图片样本分为第一比例的训练子集和第二比例的验证子集,其中,预设的发票图片类别包括多种,例如包括门诊类发票和住院类发票等,第一预设数量例如为1000张,第一比例例如为75%,第二比例例如为25%,其中,第一比例与第二比例之和小于等于1。Preparing, for each preset invoice picture category, a first preset number of invoice picture samples marked with corresponding categories, and dividing the invoice picture sample into a first proportion of the training subset and a second proportion of the verification subset The preset invoice image category includes a plurality of, for example, an outpatient invoice and an inpatient invoice, and the first preset number is, for example, 1000 sheets, the first ratio is, for example, 75%, and the second ratio is, for example, 25%. Wherein, the sum of the first ratio and the second ratio is less than or equal to 1.
获取每一预设的发票图片类别对应的第二预设数量证件图片样本,将所述证件图片样本分为第一比例的训练子集和第二比例的验证子集,其中,每一预设的发票图片类别对应的证件图片样本为该发票图片类别对应的标准 的发票图片,该标准的发票图片为正置的、标注信息未出现问题的发票图片,第二预设数量例如为1000张,第一比例例如为75%,第二比例例如为25%,其中,第一比例与第二比例之和小于等于1。Obtaining a second preset number of certificate image samples corresponding to each preset invoice picture category, and dividing the certificate picture sample into a first proportion of the training subset and a second proportion of the verification subset, wherein each preset The sample of the certificate picture corresponding to the invoice picture category is the standard corresponding to the invoice picture category. The invoice picture, the standard invoice picture is an upright, invoice picture with no problem with the label information, the second preset quantity is, for example, 1000 sheets, the first ratio is, for example, 75%, and the second ratio is, for example, 25%, wherein The sum of the first ratio and the second ratio is less than or equal to 1.
将所有训练子集中的图片样本进行混合以得到训练集,将所有验证子集中的图片样本进行混合以得到验证集,利用所述训练集训练所述深度卷积神经网络模型,利用所述验证集验证训练后的深度卷积神经网络模型的准确率,若所述准确率大于或者等于预设准确率(预设准确率例如为0.98),则训练结束,以训练后的深度卷积神经网络模型作为所述步骤S2中的发票图片识别模型,或者,若所述准确率小于预设准确率,则增加每一预设的发票图片类别对应的证件图片样本的数量,以重新进行训练。Mixing picture samples from all training subsets to obtain a training set, mixing picture samples in all verification subsets to obtain a verification set, and training the deep convolutional neural network model with the training set, using the verification set Verify the accuracy of the deep convolutional neural network model after training. If the accuracy is greater than or equal to the preset accuracy (preset accuracy is, for example, 0.98), the training ends, and the post-training deep convolutional neural network model As the invoice picture recognition model in the step S2, or if the accuracy rate is less than the preset accuracy rate, the number of the certificate picture samples corresponding to each preset invoice picture category is increased to re-train.
在一优选的实施例中,在上述实施例的基础上,为了提高训练深度卷积神经网络模型的效率,所述发票分类的方法还包括:In a preferred embodiment, based on the foregoing embodiment, in order to improve the efficiency of training the deep convolutional neural network model, the method for invoice classification further includes:
在训练所述深度卷积神经网络模型前,分析训练集的图片样本及验证集的图片样本的标注信息,将标注信息错误的图片样本进行清理;Before training the deep convolutional neural network model, analyzing the image data of the training set and the annotation information of the image sample of the verification set, and cleaning the image sample with the wrong information;
根据发票图片的高宽比信息以及印章的位置分析清理后剩余的图片样本的转置情况,并对发生转置的进行翻转调整。According to the aspect ratio information of the invoice picture and the position of the seal, the transposition of the remaining picture samples after the cleaning is analyzed, and the transposition is reversed.
其中,在训练所述深度卷积神经网络模型前,分析训练集的图片样本及验证集的图片样本的标注信息,例如分析图片样本的关键位置信息是否缺失或超出整张图片范围,以及印章标注位置是否位于发票中央等明显标注错误的数据,若出现上述问题的图片样本,则对其进行清理或丢弃,以确保图片样本的标注信息准确无误。Before training the deep convolutional neural network model, analyzing the image information of the training set and the annotation information of the image sample of the verification set, for example, analyzing whether the key position information of the image sample is missing or exceeding the entire image range, and the seal labeling Whether the location is in the center of the invoice and other data marked with errors. If the image sample of the above problem occurs, it will be cleaned or discarded to ensure that the annotation information of the image sample is accurate.
对于清理后剩余的图片样本,根据其高宽比信息以及印章的位置判断图片样本的转置情况,并对发生转置的图片样本做翻转调整:当高宽比大于1时,说明发票图片高宽颠倒,若印章位置在发图片样本左侧,则对图片样本做顺时针旋转九十度处理,若印章位置在发票图片右侧,则对发票图像做逆时针旋转九十度处理;当高宽比小于1时,说明图片样本高宽未颠倒,若印章位置在发票图片下侧,则对发票图像做顺时针旋转一百八十度处理,若印章位置在发票图片上侧,则不做处理。For the remaining image samples after cleaning, determine the transposition of the image samples according to their aspect ratio information and the position of the seal, and make a flip adjustment for the transposed image samples: when the aspect ratio is greater than 1, the invoice image is high. The width is reversed. If the stamp position is on the left side of the image sample, the image sample is rotated clockwise by ninety degrees. If the stamp position is on the right side of the invoice image, the invoice image is rotated counterclockwise by ninety degrees; When the width ratio is less than 1, the height and width of the image sample are not reversed. If the stamp position is on the lower side of the invoice image, the invoice image is rotated clockwise by one hundred and eighty degrees. If the stamp position is on the upper side of the invoice image, the label is not made. deal with.
另外,对经过翻转调整的图片样本的标注数据进行修正,每个图片样本的标注数据指的是框出这个图片样本的矩形框的位置信息,用这个矩形框的左上角坐标(xmin,ymin)和右下角坐标(xmax,ymax)四个数来表示,如果xmax<xmin,则颠倒二者位置,对y坐标做同样的处理,以确保max>min。In addition, the label data of the image sample subjected to the flipping adjustment is corrected, and the label data of each image sample refers to the position information of the rectangular frame of the image sample, and the coordinates of the upper left corner of the rectangular frame (xmin, ymin) are used. And the lower right corner coordinates (xmax, ymax) are represented by four numbers. If xmax < xmin, the positions of the two are reversed, and the same processing is performed for the y coordinates to ensure that max>min.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有识别系统,所述识别系统被处理器执行时实现上述的发票分类的方法的步骤。The present application also provides a computer readable storage medium having stored thereon an identification system, the steps of which are implemented by the processor to implement the method of invoicing the invoice described above.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通 过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, Hardware, but in many cases the former is a better implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。 The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种电子装置,其特征在于,所述电子装置包括存储器及与所述存储器连接的处理器,所述存储器中存储有可在所述处理器上运行的识别系统,所述识别系统被所述处理器执行时实现如下步骤:An electronic device, comprising: a memory and a processor coupled to the memory, wherein the memory stores an identification system operable on the processor, the identification system being The processor implements the following steps when it executes:
    S1,在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;S1, after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule;
    S2,利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果;S2, using the invoice image recognition model generated by the pre-training to classify the tilt corrected invoice image, and output the category recognition result;
    所述预先确定的矫正规则包括:The predetermined correction rules include:
    利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段;Separating a short straight line segment of the invoice picture that is less than or equal to the first preset length by using a probability algorithm of Hough transform Hough;
    基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类;Dividing each of the separated short straight line segments into several classes based on the x coordinate or the y coordinate of each of the separated short straight line segments;
    将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段;Using a short straight line segment belonging to the same class as a target class straight line, and using a least squares method to obtain a long straight line segment similar to each target class straight line;
    计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小以确定出较小者,并根据确定出的较小者调整发票图片的倾角。Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, compare the calculated median and mean of the slope to determine the smaller one, and according to the smaller one determined Adjust the inclination of the invoice image.
  2. 根据权利要求1所述的电子装置,其特征在于,所述发票图片识别模型为深度卷积神经网络模型,所述深度卷积神经网络模型包括目标检测算法。The electronic device according to claim 1, wherein the invoice picture recognition model is a deep convolutional neural network model, and the deep convolutional neural network model comprises a target detection algorithm.
  3. 根据权利要求2所述的电子装置,其特征在于,所述深度卷积神经网络模型包括1个输入层、13个卷积层、5个池化层、2个全连接层及1个分类层。The electronic device according to claim 2, wherein the deep convolutional neural network model comprises one input layer, 13 convolution layers, 5 pooling layers, 2 fully connected layers, and 1 sorting layer. .
  4. 根据权利要求2所述的电子装置,其特征在于,所述识别系统被所述处理器执行时,还实现如下步骤:The electronic device according to claim 2, wherein when the identification system is executed by the processor, the following steps are further implemented:
    为每一预设的发票图片类别分别准备第一预设数量的标注有对应的类别的发票图片样本,将所述发票图片样本分为第一比例的训练子集和第二比例的验证子集;Preparing, for each preset invoice picture category, a first preset number of invoice picture samples marked with corresponding categories, and dividing the invoice picture sample into a first proportion of the training subset and a second proportion of the verification subset ;
    获取每一预设的发票图片类别对应的第二预设数量证件图片样本,将所述证件图片样本分为第一比例的训练子集和第二比例的验证子集;Obtaining a second preset number of certificate picture samples corresponding to each preset invoice picture category, and dividing the certificate picture sample into a first proportion of the training subset and a second proportion of the verification subset;
    将所有训练子集中的图片样本进行混合以得到训练集,将所有验证子集中的图片样本进行混合以得到验证集;Mixing the image samples of all training subsets to obtain a training set, and mixing the image samples of all the verification subsets to obtain a verification set;
    利用所述训练集训练所述深度卷积神经网络模型;Training the deep convolutional neural network model with the training set;
    利用所述验证集验证训练后的深度卷积神经网络模型的准确率;Using the verification set to verify the accuracy of the trained deep convolutional neural network model;
    若所述准确率大于或者等于预设准确率,则训练结束,以训练后的深度卷积神经网络模型作为所述步骤S2中的发票图片识别模型,或者,若所述准确率小于预设准确率,则增加每一预设的发票图片类别对应的证件图片样 本的数量,以重新进行训练。If the accuracy rate is greater than or equal to the preset accuracy rate, the training ends, and the trained deep convolutional neural network model is used as the invoice picture recognition model in the step S2, or if the accuracy rate is less than the preset accuracy Rate, then increase the image of the certificate corresponding to each preset invoice image category. The number of this to re-train.
  5. 根据权利要求4所述的电子装置,其特征在于,所述识别系统被所述处理器执行时,还实现如下步骤:The electronic device according to claim 4, wherein when the identification system is executed by the processor, the following steps are further implemented:
    在训练所述深度卷积神经网络模型前,分析训练集的图片样本及验证集的图片样本的标注信息,将标注信息错误的图片样本进行清理;Before training the deep convolutional neural network model, analyzing the image data of the training set and the annotation information of the image sample of the verification set, and cleaning the image sample with the wrong information;
    根据发票图片的高宽比信息以及印章的位置分析清理后剩余的图片样本的转置情况,并对发生转置的进行翻转调整。According to the aspect ratio information of the invoice picture and the position of the seal, the transposition of the remaining picture samples after the cleaning is analyzed, and the transposition is reversed.
  6. 一种发票分类的方法,其特征在于,所述发票分类的方法包括:A method for classifying invoices, characterized in that the method for classifying invoices comprises:
    S1,在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;S1, after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule;
    S2,利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果;S2, using the invoice image recognition model generated by the pre-training to classify the tilt corrected invoice image, and output the category recognition result;
    所述预先确定的矫正规则包括:The predetermined correction rules include:
    利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段;Separating a short straight line segment of the invoice picture that is less than or equal to the first preset length by using a probability algorithm of Hough transform Hough;
    基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类;Dividing each of the separated short straight line segments into several classes based on the x coordinate or the y coordinate of each of the separated short straight line segments;
    将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段;Using a short straight line segment belonging to the same class as a target class straight line, and using a least squares method to obtain a long straight line segment similar to each target class straight line;
    计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小以确定出较小者,并根据确定出的较小者调整发票图片的倾角。Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, compare the calculated median and mean of the slope to determine the smaller one, and according to the smaller one determined Adjust the inclination of the invoice image.
  7. 根据权利要求6所述的发票分类的方法,其特征在于,所述发票图片识别模型为深度卷积神经网络模型,所述深度卷积神经网络模型包括目标检测算法。The method of invoice classification according to claim 6, wherein the invoice picture recognition model is a deep convolutional neural network model, and the deep convolutional neural network model comprises a target detection algorithm.
  8. 根据权利要求7所述的发票分类的方法,其特征在于,所述深度卷积神经网络模型包括1个输入层、13个卷积层、5个池化层、2个全连接层及1个分类层。The method for invoice classification according to claim 7, wherein the deep convolutional neural network model comprises an input layer, 13 convolution layers, 5 pooling layers, 2 fully connected layers, and 1 Classification layer.
  9. 根据权利要求7所述的发票分类的方法,其特征在于,所述步骤S2之前还包括:The method of invoice classification according to claim 7, wherein the step S2 further comprises:
    为每一预设的发票图片类别分别准备第一预设数量的标注有对应的类别的发票图片样本,将所述发票图片样本分为第一比例的训练子集和第二比例的验证子集;Preparing, for each preset invoice picture category, a first preset number of invoice picture samples marked with corresponding categories, and dividing the invoice picture sample into a first proportion of the training subset and a second proportion of the verification subset ;
    获取每一预设的发票图片类别对应的第二预设数量证件图片样本,将所述证件图片样本分为第一比例的训练子集和第二比例的验证子集;Obtaining a second preset number of certificate picture samples corresponding to each preset invoice picture category, and dividing the certificate picture sample into a first proportion of the training subset and a second proportion of the verification subset;
    将所有训练子集中的图片样本进行混合以得到训练集,将所有验证子集中的图片样本进行混合以得到验证集;Mixing the image samples of all training subsets to obtain a training set, and mixing the image samples of all the verification subsets to obtain a verification set;
    利用所述训练集训练所述深度卷积神经网络模型;Training the deep convolutional neural network model with the training set;
    利用所述验证集验证训练后的深度卷积神经网络模型的准确率; Using the verification set to verify the accuracy of the trained deep convolutional neural network model;
    若所述准确率大于或者等于预设准确率,则训练结束,以训练后的深度卷积神经网络模型作为所述步骤S2中的发票图片识别模型,或者,若所述准确率小于预设准确率,则增加每一预设的发票图片类别对应的证件图片样本的数量,以重新进行训练。If the accuracy rate is greater than or equal to the preset accuracy rate, the training ends, and the trained deep convolutional neural network model is used as the invoice picture recognition model in the step S2, or if the accuracy rate is less than the preset accuracy Rate, then increase the number of sample picture samples corresponding to each preset invoice picture category to re-train.
  10. 根据权利要求9所述的发票分类的方法,其特征在于,所述发票分类的方法还包括:The method of invoice classification according to claim 9, wherein the method for invoice classification further comprises:
    在训练所述深度卷积神经网络模型前,分析训练集的图片样本及验证集的图片样本的标注信息,将标注信息错误的图片样本进行清理;Before training the deep convolutional neural network model, analyzing the image data of the training set and the annotation information of the image sample of the verification set, and cleaning the image sample with the wrong information;
    根据发票图片的高宽比信息以及印章的位置分析清理后剩余的图片样本的转置情况,并对发生转置的进行翻转调整。According to the aspect ratio information of the invoice picture and the position of the seal, the transposition of the remaining picture samples after the cleaning is analyzed, and the transposition is reversed.
  11. 一种识别系统,其特征在于,所述识别系统包括:An identification system, wherein the identification system comprises:
    矫正模块,用于在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;a correction module, configured to perform a tilt correction on the invoice image by using a predetermined correction rule after receiving the invoice image to be processed;
    识别模块,用于利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果;The identification module is configured to perform category identification on the indented image after the tilt correction by using the invoice image recognition model generated by the pre-training, and output the category recognition result;
    所述预先确定的矫正规则包括:The predetermined correction rules include:
    利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段;Separating a short straight line segment of the invoice picture that is less than or equal to the first preset length by using a probability algorithm of Hough transform Hough;
    基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类;Dividing each of the separated short straight line segments into several classes based on the x coordinate or the y coordinate of each of the separated short straight line segments;
    将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段;Using a short straight line segment belonging to the same class as a target class straight line, and using a least squares method to obtain a long straight line segment similar to each target class straight line;
    计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小以确定出较小者,并根据确定出的较小者调整发票图片的倾角。Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, compare the calculated median and mean of the slope to determine the smaller one, and according to the smaller one determined Adjust the inclination of the invoice image.
  12. 根据权利要求11所述的识别系统,其特征在于,所述发票图片识别模型为深度卷积神经网络模型,所述深度卷积神经网络模型包括目标检测算法。The identification system according to claim 11, wherein said invoice picture recognition model is a deep convolutional neural network model, and said deep convolutional neural network model comprises a target detection algorithm.
  13. 根据权利要求12所述的识别系统,其特征在于,所述深度卷积神经网络模型包括1个输入层、13个卷积层、5个池化层、2个全连接层及1个分类层。The identification system according to claim 12, wherein said deep convolutional neural network model comprises an input layer, 13 convolution layers, 5 pooling layers, 2 fully connected layers, and 1 sorting layer. .
  14. 根据权利要求12所述的识别系统,其特征在于,所述识别系统还包括训练模块,用于为每一预设的发票图片类别分别准备第一预设数量的标注有对应的类别的发票图片样本,将所述发票图片样本分为第一比例的训练子集和第二比例的验证子集;获取每一预设的发票图片类别对应的第二预设数量证件图片样本,将所述证件图片样本分为第一比例的训练子集和第二比例的验证子集;将所有训练子集中的图片样本进行混合以得到训练集,将所有验证子集中的图片样本进行混合以得到验证集;利用所述训练集训练所述深度卷积神经网络模型;利用所述验证集验证训练后的深度卷积神经网络模型 的准确率;若所述准确率大于或者等于预设准确率,则训练结束,以训练后的深度卷积神经网络模型作为所述识别模块中的发票图片识别模型,或者,若所述准确率小于预设准确率,则增加每一预设的发票图片类别对应的证件图片样本的数量,以重新进行训练。The identification system according to claim 12, wherein the identification system further comprises a training module, configured to prepare a first preset number of invoice images marked with corresponding categories for each preset invoice picture category. a sample, the invoice picture sample is divided into a first proportion of the training subset and the second proportion of the verification subset; obtaining a second preset number of certificate picture samples corresponding to each preset invoice picture category, the document is The picture sample is divided into a first proportion of the training subset and the second proportion of the verification subset; the picture samples of all the training subsets are mixed to obtain a training set, and the picture samples of all the verification subsets are mixed to obtain a verification set; Training the deep convolutional neural network model with the training set; verifying the trained deep convolutional neural network model by using the verification set The accuracy rate; if the accuracy rate is greater than or equal to the preset accuracy rate, the training ends, and the trained deep convolutional neural network model is used as the invoice picture recognition model in the identification module, or if the accuracy rate is If it is less than the preset accuracy rate, the number of the certificate picture samples corresponding to each preset invoice picture category is increased to re-train.
  15. 根据权利要求14所述的识别系统,其特征在于,所述识别系统还包括:The identification system of claim 14, wherein the identification system further comprises:
    分析模块,用于在训练所述深度卷积神经网络模型前,分析训练集的图片样本及验证集的图片样本的标注信息,将标注信息错误的图片样本进行清理;An analysis module, configured to analyze the image data of the training set and the annotation information of the image sample of the verification set before training the deep convolutional neural network model, and clean the image sample with the wrong information;
    调整模块,用于根据发票图片的高宽比信息以及印章的位置分析清理后剩余的图片样本的转置情况,并对发生转置的进行翻转调整。The adjustment module is configured to analyze the transposition condition of the remaining image samples after the cleaning according to the aspect ratio information of the invoice picture and the position of the seal, and perform the inversion adjustment of the transposition.
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有识别系统,所述识别系统被处理器执行时实现步骤:A computer readable storage medium, wherein the computer readable storage medium stores an identification system, and when the identification system is executed by the processor, the steps are:
    S1,在接收到待处理的发票图片后,利用预定的矫正规则对所述发票图片进行倾斜矫正;S1, after receiving the invoice image to be processed, performing tilt correction on the invoice image by using a predetermined correction rule;
    S2,利用预先训练生成的发票图片识别模型对倾斜矫正后的发票图片进行类别识别,并输出类别识别结果;S2, using the invoice image recognition model generated by the pre-training to classify the tilt corrected invoice image, and output the category recognition result;
    所述预先确定的矫正规则包括:The predetermined correction rules include:
    利用霍夫变换Hough的概率算法分离出所述发票图片中小于等于第一预设长度的短直线段;Separating a short straight line segment of the invoice picture that is less than or equal to the first preset length by using a probability algorithm of Hough transform Hough;
    基于各分离出的短直线段的x坐标或y坐标将各分离出的短直线段分成若干类;Dividing each of the separated short straight line segments into several classes based on the x coordinate or the y coordinate of each of the separated short straight line segments;
    将属于同一类的短直线段作为一个目标类直线,并利用最小二乘法获取与各个目标类直线相似的长直线段;Using a short straight line segment belonging to the same class as a target class straight line, and using a least squares method to obtain a long straight line segment similar to each target class straight line;
    计算各个长直线段的斜率,以及各个长直线段的斜率的中位数和均值,比较计算出的斜率的中位数和均值的大小以确定出较小者,并根据确定出的较小者调整发票图片的倾角。Calculate the slope of each long straight line segment, and the median and mean of the slope of each long straight line segment, compare the calculated median and mean of the slope to determine the smaller one, and according to the smaller one determined Adjust the inclination of the invoice image.
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述发票图片识别模型为深度卷积神经网络模型,所述深度卷积神经网络模型包括目标检测算法。The computer readable storage medium of claim 16, wherein the invoice picture recognition model is a deep convolutional neural network model, and the deep convolutional neural network model comprises a target detection algorithm.
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述深度卷积神经网络模型包括1个输入层、13个卷积层、5个池化层、2个全连接层及1个分类层。The computer readable storage medium according to claim 17, wherein said deep convolutional neural network model comprises an input layer, 13 convolutional layers, 5 pooling layers, 2 fully connected layers, and 1 Classification layer.
  19. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述识别系统被所述处理器执行时,还实现如下步骤:The computer readable storage medium according to claim 17, wherein when said identification system is executed by said processor, the following steps are further implemented:
    为每一预设的发票图片类别分别准备第一预设数量的标注有对应的类别的发票图片样本,将所述发票图片样本分为第一比例的训练子集和第二比例的验证子集;Preparing, for each preset invoice picture category, a first preset number of invoice picture samples marked with corresponding categories, and dividing the invoice picture sample into a first proportion of the training subset and a second proportion of the verification subset ;
    获取每一预设的发票图片类别对应的第二预设数量证件图片样本,将所 述证件图片样本分为第一比例的训练子集和第二比例的验证子集;Obtaining a second preset number of certificate image samples corresponding to each preset invoice image category, The sample picture of the document is divided into a training subset of the first ratio and a verification subset of the second ratio;
    将所有训练子集中的图片样本进行混合以得到训练集,将所有验证子集中的图片样本进行混合以得到验证集;Mixing the image samples of all training subsets to obtain a training set, and mixing the image samples of all the verification subsets to obtain a verification set;
    利用所述训练集训练所述深度卷积神经网络模型;Training the deep convolutional neural network model with the training set;
    利用所述验证集验证训练后的深度卷积神经网络模型的准确率;Using the verification set to verify the accuracy of the trained deep convolutional neural network model;
    若所述准确率大于或者等于预设准确率,则训练结束,以训练后的深度卷积神经网络模型作为所述步骤S2中的发票图片识别模型,或者,若所述准确率小于预设准确率,则增加每一预设的发票图片类别对应的证件图片样本的数量,以重新进行训练。If the accuracy rate is greater than or equal to the preset accuracy rate, the training ends, and the trained deep convolutional neural network model is used as the invoice picture recognition model in the step S2, or if the accuracy rate is less than the preset accuracy Rate, then increase the number of sample picture samples corresponding to each preset invoice picture category to re-train.
  20. 根据权利要求19所述的计算机可读存储介质,其特征在于,所述识别系统被所述处理器执行时,还实现如下步骤:The computer readable storage medium according to claim 19, wherein when said identification system is executed by said processor, the following steps are further implemented:
    在训练所述深度卷积神经网络模型前,分析训练集的图片样本及验证集的图片样本的标注信息,将标注信息错误的图片样本进行清理;Before training the deep convolutional neural network model, analyzing the image data of the training set and the annotation information of the image sample of the verification set, and cleaning the image sample with the wrong information;
    根据发票图片的高宽比信息以及印章的位置分析清理后剩余的图片样本的转置情况,并对发生转置的进行翻转调整。 According to the aspect ratio information of the invoice picture and the position of the seal, the transposition of the remaining picture samples after the cleaning is analyzed, and the transposition is reversed.
PCT/CN2017/108762 2017-08-20 2017-10-31 Electronic device, method and system for categorizing invoices, and computer-readable storage medium WO2019037259A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710715451.7A CN107292823A (en) 2017-08-20 2017-08-20 Electronic installation, the method for invoice classification and computer-readable recording medium
CN201710715451.7 2017-08-20

Publications (1)

Publication Number Publication Date
WO2019037259A1 true WO2019037259A1 (en) 2019-02-28

Family

ID=60106382

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/108762 WO2019037259A1 (en) 2017-08-20 2017-10-31 Electronic device, method and system for categorizing invoices, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN107292823A (en)
WO (1) WO2019037259A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059689A (en) * 2019-03-19 2019-07-26 平安科技(深圳)有限公司 Sample set construction method, device, computer equipment and storage medium
CN111753842A (en) * 2020-06-28 2020-10-09 中国银行股份有限公司 Bill text region detection method and device
CN112396048A (en) * 2020-11-17 2021-02-23 中国平安人寿保险股份有限公司 Picture information extraction method and device, computer equipment and storage medium
CN113158895A (en) * 2021-04-20 2021-07-23 北京中科江南信息技术股份有限公司 Bill identification method and device, electronic equipment and storage medium
CN113538291A (en) * 2021-08-02 2021-10-22 广州广电运通金融电子股份有限公司 Card image tilt correction method and device, computer equipment and storage medium
CN113963147A (en) * 2021-09-26 2022-01-21 西安交通大学 Key information extraction method and system based on semantic segmentation
CN116204769A (en) * 2023-03-06 2023-06-02 深圳市乐易网络股份有限公司 Data cleaning method, system and storage medium based on data classification and identification
CN113538291B (en) * 2021-08-02 2024-05-14 广州广电运通金融电子股份有限公司 Card image inclination correction method, device, computer equipment and storage medium

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107292823A (en) * 2017-08-20 2017-10-24 平安科技(深圳)有限公司 Electronic installation, the method for invoice classification and computer-readable recording medium
CN108229299B (en) * 2017-10-31 2021-02-26 北京市商汤科技开发有限公司 Certificate identification method and device, electronic equipment and computer storage medium
CN108805285B (en) * 2018-05-30 2022-03-29 山东浪潮科学研究院有限公司 Convolutional neural network pooling unit design method
CN109657694A (en) * 2018-10-26 2019-04-19 平安科技(深圳)有限公司 Picture automatic classification method, device and computer readable storage medium
CN109740417B (en) * 2018-10-29 2023-05-16 深圳壹账通智能科技有限公司 Invoice type identification method, invoice type identification device, storage medium and computer equipment
CN109815954A (en) * 2019-01-31 2019-05-28 科大讯飞股份有限公司 Correction for direction method, apparatus, equipment and the storage medium of VAT invoice image
US20200279219A1 (en) * 2019-03-01 2020-09-03 Accenture Global Solutions Limited Machine learning-based analysis platform
CN111178345A (en) * 2019-05-20 2020-05-19 京东方科技集团股份有限公司 Bill analysis method, bill analysis device, computer equipment and medium
CN110348441B (en) * 2019-07-10 2021-08-17 深圳市华云中盛科技股份有限公司 Value-added tax invoice identification method and device, computer equipment and storage medium
CN110490267B (en) * 2019-08-23 2022-03-01 四川长虹电器股份有限公司 Bill sorting method based on deep learning
CN111241966A (en) * 2020-01-06 2020-06-05 广东工业大学 Invoice target area positioning method, device, equipment and medium
CN111507181B (en) * 2020-03-11 2023-05-26 平安科技(深圳)有限公司 Correction method and device for bill image and computer equipment
CN112686255A (en) * 2020-12-31 2021-04-20 深圳赛安特技术服务有限公司 Seal identification method, device, equipment and storage medium based on Hough transform
CN113011249A (en) * 2021-01-29 2021-06-22 招商银行股份有限公司 Bill auditing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101625760A (en) * 2009-07-28 2010-01-13 谭洪舟 Method for correcting certificate image inclination
CN103955669A (en) * 2014-04-10 2014-07-30 西安理工大学 Invoice date positioning method based on segmentation Hough transformation straight line detection
CN105808610A (en) * 2014-12-31 2016-07-27 中国科学院深圳先进技术研究院 Internet picture filtering method and device
CN106909882A (en) * 2017-01-16 2017-06-30 广东工业大学 A kind of face identification system and method for being applied to security robot
CN107292823A (en) * 2017-08-20 2017-10-24 平安科技(深圳)有限公司 Electronic installation, the method for invoice classification and computer-readable recording medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101625760A (en) * 2009-07-28 2010-01-13 谭洪舟 Method for correcting certificate image inclination
CN103955669A (en) * 2014-04-10 2014-07-30 西安理工大学 Invoice date positioning method based on segmentation Hough transformation straight line detection
CN105808610A (en) * 2014-12-31 2016-07-27 中国科学院深圳先进技术研究院 Internet picture filtering method and device
CN106909882A (en) * 2017-01-16 2017-06-30 广东工业大学 A kind of face identification system and method for being applied to security robot
CN107292823A (en) * 2017-08-20 2017-10-24 平安科技(深圳)有限公司 Electronic installation, the method for invoice classification and computer-readable recording medium

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059689B (en) * 2019-03-19 2024-05-03 平安科技(深圳)有限公司 Sample set construction method, device, computer equipment and storage medium
CN110059689A (en) * 2019-03-19 2019-07-26 平安科技(深圳)有限公司 Sample set construction method, device, computer equipment and storage medium
CN111753842A (en) * 2020-06-28 2020-10-09 中国银行股份有限公司 Bill text region detection method and device
CN111753842B (en) * 2020-06-28 2024-02-27 中国银行股份有限公司 Method and device for detecting text region of bill
CN112396048B (en) * 2020-11-17 2023-09-29 中国平安人寿保险股份有限公司 Picture information extraction method and device, computer equipment and storage medium
CN112396048A (en) * 2020-11-17 2021-02-23 中国平安人寿保险股份有限公司 Picture information extraction method and device, computer equipment and storage medium
CN113158895B (en) * 2021-04-20 2023-11-14 北京中科江南信息技术股份有限公司 Bill identification method and device, electronic equipment and storage medium
CN113158895A (en) * 2021-04-20 2021-07-23 北京中科江南信息技术股份有限公司 Bill identification method and device, electronic equipment and storage medium
CN113538291A (en) * 2021-08-02 2021-10-22 广州广电运通金融电子股份有限公司 Card image tilt correction method and device, computer equipment and storage medium
CN113538291B (en) * 2021-08-02 2024-05-14 广州广电运通金融电子股份有限公司 Card image inclination correction method, device, computer equipment and storage medium
CN113963147B (en) * 2021-09-26 2023-09-15 西安交通大学 Key information extraction method and system based on semantic segmentation
CN113963147A (en) * 2021-09-26 2022-01-21 西安交通大学 Key information extraction method and system based on semantic segmentation
CN116204769A (en) * 2023-03-06 2023-06-02 深圳市乐易网络股份有限公司 Data cleaning method, system and storage medium based on data classification and identification
CN116204769B (en) * 2023-03-06 2023-12-05 深圳市乐易网络股份有限公司 Data cleaning method, system and storage medium based on data classification and identification

Also Published As

Publication number Publication date
CN107292823A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
WO2019037259A1 (en) Electronic device, method and system for categorizing invoices, and computer-readable storage medium
WO2019174130A1 (en) Bill recognition method, server, and computer readable storage medium
WO2019104879A1 (en) Information recognition method for form-type image, electronic device and readable storage medium
CN107798299B (en) Bill information identification method, electronic device and readable storage medium
CN107766809B (en) Electronic device, bill information identification method, and computer-readable storage medium
CN109829453B (en) Method and device for recognizing characters in card and computing equipment
CN108229299B (en) Certificate identification method and device, electronic equipment and computer storage medium
WO2018205467A1 (en) Automobile damage part recognition method, system and electronic device and storage medium
US20200320273A1 (en) Remote sensing image recognition method and apparatus, storage medium and electronic device
WO2018010657A1 (en) Structured text detection method and system, and computing device
WO2020238054A1 (en) Method and apparatus for positioning chart in pdf document, and computer device
US9235758B1 (en) Robust method to find layout similarity between two documents
CN108898142B (en) Recognition method of handwritten formula and computing device
US9171359B1 (en) Method and system for auto-correcting perspective distortion in document images
US8977054B2 (en) Candidate identification by image fingerprinting and model matching
CN111814785B (en) Invoice recognition method, training method of relevant model, relevant equipment and device
CN107038441B (en) Clipboard detection and correction
WO2021147219A1 (en) Image-based text recognition method and apparatus, electronic device, and storage medium
CN113837151B (en) Table image processing method and device, computer equipment and readable storage medium
CN110837796B (en) Image processing method and device
WO2019085338A1 (en) Electronic apparatus, image-based age classification method and system, and storage medium
CN113568965A (en) Method and device for extracting structured information, electronic equipment and storage medium
WO2019095587A1 (en) Face recognition method, application server, and computer-readable storage medium
US10896339B2 (en) Detecting magnetic ink character recognition codes
CN112396047B (en) Training sample generation method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17922267

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17922267

Country of ref document: EP

Kind code of ref document: A1