A method, device and storage medium for determining the validity of a seal file
By combining seal image and paper texture detection models with stamp information, the problem of difficulty in determining the authenticity of seal documents is solved, and efficient, accurate and valid identification of seal documents is achieved.
Patent Information
- Application Number
- CN202310471210.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-04-27
AI Technical Summary
Existing technologies are insufficient to effectively determine the authenticity and validity of seal documents, especially the issues of seal text anti-counterfeiting and seal document validity.
By acquiring the seal paper image and stamping information of the seal document, and using the seal image detection model and paper texture detection model, the validity is determined by combining the seal image information and stamping information.
It simplifies and efficiently determines the validity of stamped documents, improves the timeliness and ease of use of the detection, and ensures robustness and accuracy.
Smart Images

Figure CN116630996B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of visual technology, and particularly relates to a seal document validity determination method, device, equipment and storage medium. BACKGROUND
[0002] As a legal document for confirming the identity and will of a legal person, a seal document has been playing an indispensable role in social and economic life in China. How to determine whether a seal document is safe and effective has become an important problem to be solved at present.
[0003] At present, a large number of files, contracts and certificates are made of ordinary A4 paper, which is easy to be forged. The existing seal and seal text anti-counterfeiting technology methods mainly include seal surface engraving anti-counterfeiting marks, using special ink or seal oil, embedding chips into seals, adding seal control devices and combining seal information filing. However, the seal surface engraving anti-counterfeiting marks are difficult to resist high-precision copying of seal texts; the use of special ink or seal oil is difficult to popularize on a large scale and is difficult to prevent imitation; the embedding of chips into seals, the addition of seal control devices and the combination of seal information filing mainly aim at the authenticity identification of the seal itself, and are difficult to solve the problems of seal text anti-counterfeiting and seal document effectiveness determination. SUMMARY
[0004] The present application provides a seal document validity determination method, device, equipment and storage medium, which obtains seal image information of a seal document through a seal image detection model and a paper texture detection model, and determines the effectiveness of the seal document in combination with seal information of the seal document, so as to solve the problems of seal text anti-counterfeiting difficulty and seal document effectiveness determination difficulty.
[0005] According to a first aspect of the present application, a seal document validity determination method is provided, comprising:
[0006] obtaining a seal paper image of a seal document and seal information of the seal document; the seal paper image is a paper image containing a seal image in the seal document;
[0007] inputting the seal paper image into a seal image detection model to obtain a seal image;
[0008] inputting the seal image into a paper texture detection model to obtain paper texture grid image information corresponding to the seal image, and determining seal image information according to the paper texture grid image information of the seal image;
[0009] determining whether the seal document is effective according to the seal image information and the seal information.
[0010] According to a second aspect of the present application, a seal document validity determination device is provided, comprising:
[0011] The seal information acquisition module is configured to acquire a seal paper image of the seal file and seal information of the seal file, wherein the seal paper image is a paper image containing a seal image in the seal file.
[0012] The seal image acquisition module is configured to input the seal paper image into a seal image detection model to obtain a seal image.
[0013] The image information determination module is configured to input the seal image into a paper texture detection model to obtain paper texture grid image information corresponding to the seal image, and determine seal image information according to the paper texture grid image information of the seal image.
[0014] The file validity determination module is configured to determine whether the seal file is valid according to the seal image information and the seal information.
[0015] According to a third aspect of the present application, an electronic device is provided, and the electronic device comprises:
[0016] at least one processor; and
[0017] a memory connected to the at least one processor in communication; wherein
[0018] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the determination method of the seal file validity according to any one of the embodiments of the present application.
[0019] According to a fourth aspect of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores computer instructions for enabling a processor to implement the determination method of the seal file validity according to any one of the embodiments of the present application when the processor executes the computer instructions.
[0020] The embodiment of the present application provides a kind of seal file effectiveness determination method, device, equipment and storage medium, by obtaining the seal paper image of seal file and the seal information of the seal file;The seal paper image is the paper image containing seal image in the seal file;Seal paper image is input into seal image detection model and obtains seal image;The paper texture square image information corresponding to the seal image is obtained by inputting the seal image into paper texture detection model, and the seal image information is determined according to the paper texture square image information of the seal image;According to the seal image information and the seal information, it is determined whether the seal file is effective.The above technical scheme is used, according to seal paper image, seal image detection model and paper texture detection model, to determine seal image information, and the seal image information is combined with seal information to determine whether the seal file is effective, which solves the problem of seal anti-fake difficulty and seal file effectiveness determination difficulty.The above technical scheme realizes the off-line of seal file effectiveness determination by model, simplifies, effectively improves the timeliness and ease of use of seal file detection;Whether the seal file is effective is determined from multiple dimensions, to ensure the robustness and accuracy of seal file effectiveness determination.
[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0023] Figure 1 It is a flow chart of a seal file effectiveness determination method provided by the first embodiment of the present application;
[0024] Figure 2 It is a paper texture square division example diagram provided by the first embodiment of the present application;
[0025] Figure 3 It is a flow chart of a seal file effectiveness determination method provided by the second embodiment of the present application;
[0026] Figure 4 It is a seal paper square image example diagram provided by the second embodiment of the present application;
[0027] Figure 5It is a paper texture square image example corresponding to a seal image according to the second embodiment of the present application;
[0028] Figure 6A It is a corner point schematic diagram according to the second embodiment of the present application;
[0029] Figure 6B It is a seal rotation angle schematic diagram according to the second embodiment of the present application;
[0030] Figure 7 It is a seal file validity determination method flowchart example according to the second embodiment of the present application;
[0031] Figure 8 It is a structure schematic diagram of a seal file validity determination device according to the third embodiment of the present application;
[0032] Figure 9 It is a structure schematic diagram of an electronic device for implementing a seal file validity determination method according to the present application. DETAILED DESCRIPTION
[0033] In order to make the personnel in the technical field better understand the present application scheme, the technical scheme in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0034] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0035] Embodiment one
[0036] Figure 1This is a flowchart of a method for determining the validity of a seal document according to Embodiment 1 of the present invention. This embodiment is applicable to situations where the validity of a seal document needs to be determined. This method can be executed by a seal document validity determination device, which can be implemented in hardware and / or software. Figure 1 As shown, the method includes:
[0037] S101. Obtain the image of the seal paper in the seal document and the stamping information of the seal document; the seal paper image is the paper image in the seal document that contains the seal image.
[0038] In this context, a stamped document can be understood as a document with a stamp image on at least one page, such as a contract document with stamps on some pages. A stamp paper image can be understood as an image captured from the paper containing the stamp image in the stamped document; a stamp image can be understood as an image of a stamp imprinted on the document, which may include the stamp text, inscription, stamp pattern, and decorative elements. Stamping information can be understood as pre-determined parameter information when the stamped document is stamped, such as stamping position, stamping direction, stamping rotation angle, and paper texture; this embodiment does not impose limitations on these parameters.
[0039] Specifically, during the process of stamping a document, a camera captures an image of the stamped paper. This image is then preprocessed, including mirroring, rotation, and image enhancement, to ensure correct text and paper orientation. To determine the validity of the stamped document, the stamping position, rotation angle, and paper texture of the stamped area also need to be obtained.
[0040] S102. Input the image of the stamp paper into the stamp image detection model to obtain the stamp image.
[0041] Among them, the seal image detection model can be understood as a model used to identify and detect seal images in seal paper images.
[0042] Specifically, to determine the validity of the stamped document, the stamp paper image is input into the stamp image detection model. The Haar cascade classifier is used to identify the stamp image in the stamp paper image, and the stamp image, the corresponding paper image of the stamp image region, and the X-axis vector direction and Y-axis vector direction of the stamp image are obtained.
[0043] Before inputting the stamp paper image into the stamp image detection model, the stamp image detection model needs to be constructed. Specifically, based on the settings of convolution stride of 2, convolution kernel size of 3, and pooling size, the VGG (Visual Geometry Group) network is used to traverse the features of the stamp paper image through the stochastic gradient descent algorithm, and a large number of stamp paper images are trained to obtain a fully trained stamp image detection model.
[0044] S103. Input the seal image into the paper texture detection model to obtain the paper texture grid image information corresponding to the seal image, and determine the seal image information based on the paper texture grid image information of the seal image.
[0045] The paper texture detection model can be understood as a model used to identify and detect the paper texture image of the stamp image portion. The paper texture grid image information can be understood as the information of each paper texture grid image after dividing the paper into equal grids. Figure 2 This is an example diagram of equal division of paper texture squares according to Embodiment 1 of the present invention, such as... Figure 2 As shown, an A4 sheet of paper is divided into 12 equal parts horizontally and 60 equal parts vertically, resulting in 720 paper texture grid images. It is understood that the paper size and the standard for dividing the paper into grids are determined according to actual needs, and this embodiment does not impose any limitations on them. The stamp image information can be understood as the parameter information of the stamp image relative to the stamp paper image. For example, it may include the paper texture grid image information of the stamp image portion, the paper texture grid image information corresponding to the center point of the stamp image, the position of the stamp image relative to the stamp paper image, and the rotation angle, etc., and this embodiment does not impose any limitations on these aspects.
[0046] Specifically, the stamp image is input into the paper texture detection model. Based on the model output, paper texture grid images that overlap with the stamp image are obtained, along with information about these paper texture grid images. The stamp image information is then determined based on the paper texture grid image information of the stamp image.
[0047] S104. Determine whether the seal document is valid based on the seal image information and the stamping information.
[0048] Specifically, the stamping position, rotation angle, and paper texture of the stamped portion of the document are compared with the stamp image information and pre-recorded stamping information to determine whether the conditions for validity are met. If the conditions are met, the document is considered valid; otherwise, it is invalid. The conditions for validity can be whether the stamp image information and stamping information are completely identical, or whether the degree of similarity between the stamp image information and stamping information reaches a threshold. This embodiment does not impose any limitations on these conditions.
[0049] In this embodiment, the process involves acquiring the image of the stamped paper and the stamping information of the stamped document. The stamped paper image is the paper image within the stamped document that contains the stamp image. The stamped paper image is input into a stamp image detection model to obtain the stamp image. The stamp image is then input into a paper texture detection model to obtain the corresponding paper texture grid image information. The stamp image information is determined based on the paper texture grid image information of the stamp image. Finally, the validity of the stamped document is determined based on the stamp image information and the stamping information. This technical solution, by determining the stamp image information based on the stamped paper image, the stamp image detection model, and the paper texture detection model, and combining the stamp image information with the stamping information to determine the validity of the stamped document, solves the problems of difficulty in anti-counterfeiting of seals and difficulty in determining the validity of stamped documents. This technical solution simplifies and automates the determination of the validity of stamped documents through a model, effectively improving the timeliness and ease of use of stamped document detection. By determining the validity of stamped documents from multiple dimensions, it ensures the robustness and accuracy of the determination of the validity of stamped documents.
[0050] Optionally, in step S101, obtaining the image of the seal paper in the seal document includes:
[0051] S1011. Obtain the image of the seal document.
[0052] Among them, the image of a seal document can be understood as an image of the entire seal document, including file images containing seal images and file images not containing seal images.
[0053] Specifically, in order to obtain the image of the seal paper in the seal document, the first step is to obtain the image of the entire seal document.
[0054] S1012. Input the seal document image into the seal paper detection model to obtain the seal paper image.
[0055] The stamp and paper detection model can be understood as a model used to identify stamped document images and determine the stamped paper image. The stamp and paper detection model is obtained by training a first convolutional neural network based on a training set of stamp and paper image samples. The training set includes paper images containing stamps and paper images not containing stamps. The stamp and paper image sample training set can be understood as the set of training samples used to train the stamp and paper detection model. The first convolutional neural network can be understood as a convolutional neural network (CNN) that has not been trained on the stamp and paper image sample training set.
[0056] Specifically, when a document is stamped, an image of the stamped document is automatically captured. The image library of stamped document images is used as a dataset. Each stamped document image in the dataset is cropped to a preset size, for example, 210×297 pixels, but other sizes are also possible; this embodiment does not limit this. A training set of stamped paper image samples is generated based on the cropped stamped document images. The training set includes paper images containing stamps and paper images without stamps. Images from the training set are read, represented as n = H*W dimensional vectors, and preprocessed. A first convolutional neural network is constructed using the VGG network. This first convolutional neural network includes 13 convolutional layers, 1 connection layer, a batch normalization layer, an activation layer, and a pooling layer without weights. The first convolutional neural network is trained using the stamped paper image sample set to obtain a fully trained stamped paper detection model. The stamped document image is input into the stamped paper detection model to obtain the stamped paper image output by the model.
[0057] Example 2
[0058] Figure 3 This is a flowchart illustrating a method for determining the validity of a seal document according to Embodiment 2 of the present invention. This embodiment is a further optimization of the above embodiments. Figure 3 As shown, the method includes:
[0059] S201. Obtain the image of the seal paper and the stamping information of the seal document.
[0060] S202. Input the image of the seal paper into the seal image detection model to obtain the seal image.
[0061] S203. Convert the stamp paper image into a preset number of stamp paper grid images.
[0062] The stamp paper grid image can be understood as the image after the stamp paper image is divided into a preset number of squares. For example, a stamp paper image can be divided into m*n stamp paper grid images, where m is the number of squares to be divided horizontally and n is the number of squares to be divided vertically.
[0063] Specifically, a coordinate system is established for the paper, and the stamp paper image is divided into a preset number of squares to obtain a preset number of stamp paper square images. Each stamp paper square image has its corresponding position coordinates.
[0064] For example, Figure 4 This is an example diagram of a grid image of a stamp paper according to Embodiment 2 of the present invention. Figure 4As shown, a coordinate system is established with the lower left corner of the paper as the origin. The paper is divided into 720 grid images according to a preset number, resulting in 12*60 grid images. Each grid image has corresponding grid coordinates, which can be represented as P(x, y), where x≤12, y≤60. For example... Figure 4 The grid coordinates of the selected stamp paper grid image are P(10, 40).
[0065] S204. Use each square in the stamp paper grid image as a training sample to train the second convolutional neural network and obtain the paper texture detection model.
[0066] The second convolutional neural network can be understood as a convolutional neural network that has not been trained with a grid.
[0067] Specifically, each square in the stamp paper grid image is used as a training sample to generate a training sample set. The training sample set is read, and each square image in the training samples is represented as an n = H*W dimensional vector, followed by image preprocessing. A second convolutional neural network (CNN) is constructed using the ResNet18 residual network, which includes 17 convolutional layers, 1 connection layer, a batch normalization (BN) layer, and a pooling layer without weights. Based on settings such as a convolution stride of 2, a kernel size of 3, and pooling size, the features of the grid image are traversed using the stochastic gradient descent algorithm and extracted using a local binary pattern (LBP) texture extraction algorithm. The second CNN is then trained using the stamp paper grid image to obtain a paper texture detection model.
[0068] S205. Input the seal image into the paper texture detection model to obtain the paper texture grid image corresponding to the seal image and the paper texture grid image information; wherein, the paper texture grid image information includes: the grid number and grid coordinates of each grid in the paper texture grid image in the seal paper grid image.
[0069] The paper texture grid image can be understood as a grid image that records the paper texture and its position coordinates. It is a grid image that is converted from the stamp paper grid image by exchanging the same preset number of squares. The paper texture grid image information can be understood as the position information corresponding to each square in the paper texture grid image, including the square number and the square coordinates.
[0070] Specifically, the stamp image is input into the paper texture detection model to obtain the paper texture grid images corresponding to the stamp image range, as well as the grid number and grid coordinates corresponding to each paper texture grid image.
[0071] For example, Figure 5This is an example diagram of a paper texture grid image corresponding to a seal image according to Embodiment 2 of the present invention. Figure 5 As shown, the paper texture grid image corresponding to the stamp image and the paper texture grid image information are obtained. The paper texture grid image information includes the grid coordinates between P(7,13) and P(12,34) and the grid numbers corresponding to these coordinates. The method of determining the grid coordinates and grid numbers is determined according to actual needs, and this embodiment does not limit this.
[0072] S206. Determine the texture of the seal image based on the paper texture grid image information of the seal image.
[0073] The seal image texture can be understood as the paper texture of the seal image portion.
[0074] Specifically, the position of the paper corresponding to the stamp image is determined based on the grid coordinates and grid number of the stamp image, the paper texture at the stamp image position is obtained, and it is determined as the stamp image texture.
[0075] S207. Determine the seal rotation angle of the seal image on the seal paper image based on the paper texture grid image information of the seal image.
[0076] The seal rotation angle can be understood as the angle by which the seal image rotates relative to the X-axis vector direction and the Y-axis vector direction.
[0077] Specifically, the grid coordinates and grid numbers of the stamp image are compared with the grid coordinates and grid numbers corresponding to the stamp being stamped in the correct orientation. The offset angle of the stamp image relative to the X-axis vector direction and the Y-axis vector direction is determined, and the offset angle is determined as the stamp rotation angle of the stamp image on the stamp paper image.
[0078] Optionally, the seal rotation angle of the seal image on the seal paper image is determined based on the paper texture grid image information of the seal image, including:
[0079] S2071. Extract multiple corner points from the seal image based on the corner detection algorithm.
[0080] Corner points can be understood as key points used to determine the position of the seal.
[0081] Specifically, corner points in the seal pattern area of the seal image are obtained based on corner detection algorithms. For example, the corner detection algorithm can be the Harris corner algorithm.
[0082] S2072. Determine the grid number of the square corresponding to each corner point in the paper texture grid image of the stamp image.
[0083] Specifically, determine the paper texture grid image corresponding to the corner point of the stamp image in the stamp paper image, and obtain the grid number of the paper texture grid image corresponding to the grid where the corner point is located.
[0084] S2073. Determine the rotation angle of the seal image on the seal paper image based on the grid coordinates corresponding to the grid numbers of each corner point.
[0085] Specifically, the grid coordinates corresponding to the grid numbers of each corner point are compared with the grid coordinates of the corner point corresponding to the positive stamping, and the stamp rotation angle of the stamp image on the stamp paper image is calculated based on the two coordinates.
[0086] For example, Figure 6A This is a corner point diagram provided according to Embodiment 2 of the present invention, such as... Figure 6A As shown, if the corner points of the seal image are corner points A and B, the slope of the line connecting corner points A and B is determined based on the grid coordinates corresponding to the grid numbers of the squares containing corner points A and B. The angle of the seal image is then calculated based on this slope. The seal rotation angle is determined by the difference between this angle and the default angle (0 degrees) of the seal image when it is placed upright. This seal rotation angle can be either clockwise or counterclockwise. Figure 6B This is a schematic diagram of a seal rotation angle provided according to Embodiment 2 of the present invention, as shown below. Figure 6B As shown, the rotation angle of the seal in the clockwise direction is calculated to be 320° based on the grid coordinates of each corner point.
[0087] Optionally, obtain the stamping information of the stamped document, including:
[0088] During the process of stamping documents to obtain stamped documents, the stamping position and rotation angle on the stamped document, as well as the texture of the stamped paper, are collected.
[0089] Here, "stamp position" can be understood as determining the valid stamp position on the document. "Stamp rotation angle" can be understood as determining the valid rotation angle of the stamped image. "Stamp paper texture" can be understood as determining the valid paper texture.
[0090] Specifically, during the process of stamping a document, the effective stamping position and rotation angle, as well as the paper texture, are collected. The calculation methods for the stamp rotation angle and the seal rotation angle can be the same.
[0091] It is understood that in this embodiment, the stamped document is a document that is determined to be valid, while the seal document is a document whose validity is to be checked.
[0092] S208. Determine the coordinate position of the grid number corresponding to the center point of the seal image as the coordinate position of the seal image on the seal paper image.
[0093] Specifically, the grid coordinates are determined by the grid number corresponding to the center point of the stamp image, and these grid coordinates are used to determine the coordinate position of the stamp image on the stamp paper image.
[0094] S209. Determine whether the seal document is valid based on the seal image information and the stamping information.
[0095] Specifically, the seal image texture, the seal rotation angle of the seal image on the seal paper image, and the coordinate position of the seal image on the seal paper image are compared with the seal paper texture, seal position, and seal rotation angle at the time of stamping. The validity of the seal document is determined based on the comparison results.
[0096] Optionally, the validity of a stamped document can be determined based on the stamp image information and stamping information, including:
[0097] S2091. Determine the texture score of the stamp paper image based on the texture of the stamp image and the texture of the stamped paper.
[0098] Specifically, the texture of the seal image and the texture of the stamped paper are judged according to a preset scoring method to determine the texture score of the seal paper image. The preset scoring method may be determined based on whether the textures of the seal image and the stamped paper are the same or similar; this embodiment does not limit this method.
[0099] For example, the higher the similarity between the texture of the stamp image and the texture of the stamped paper image, the higher the texture score of the stamped paper image; if the texture of the stamp image and the texture of the stamped paper image are the same, the texture score of the stamped paper image is 1.
[0100] S2092. Determine the rotation angle score of the stamp paper image based on the stamp rotation angle and the stamping rotation angle of the stamp image.
[0101] Specifically, the rotation angles of the stamp image and the stamping rotation angle are judged according to a preset scoring method to determine the rotation angle score of the stamp paper image. The preset scoring method may be determined based on whether the stamp rotation angle and the stamping rotation angle of the stamp image are the same or similar; this embodiment does not limit this method.
[0102] For example, if the rotation angle of the seal image is the same as the rotation angle of the stamp, the rotation angle score of the seal document is 1; if the rotation angles are different, the rotation angle score is 0; or the score can be determined based on the angle difference, the smaller the difference, the higher the score.
[0103] S2093. Determine the position score of the seal image based on the coordinate position of the seal image on the seal paper image and the stamping position.
[0104] Specifically, it is determined whether the coordinate position of the seal image on the seal paper image is the same as the stamping position, and the position score of the seal paper image is determined based on the judgment result.
[0105] For example, if the coordinates of the stamp image on the stamp paper image are the same as the stamping position, the position score of the stamp paper image is 1; if the positions are different, the position score of the stamp paper image is 0.
[0106] S2094. Determine the effective score of the stamp paper image based on the texture score, rotation angle score, and position score.
[0107] Specifically, the texture score, rotation angle score, and position score of the stamp paper image are fused and calculated, and the effective score of the stamp paper image is determined based on the calculation result. The fusion calculation can be performed by multiplying the texture score a, rotation angle score b, and position score c, i.e., the effective score f = a*b*c; or it can be calculated based on the scores and weights of the texture score, rotation angle score, and position score, i.e., the effective score f = (a*x) + (b*y) + (c*z), where x, y, and z are the weights of the texture score, rotation angle score, and position score, respectively. This embodiment does not limit the method for determining the effective score.
[0108] For example, with texture score a = 1 and weight x = 0.5; rotation angle score b = 1 and weight y = 0.2; and position score c = 1 and weight z = 0.3, the effective score of the stamp paper image can be determined to be 1.
[0109] S2095. If the valid score of each stamp paper image in the stamp file is greater than or equal to the preset score, then the stamp file is determined to be valid.
[0110] Specifically, the stamp file contains multiple stamp paper images with stamp images. Each stamp paper image has its corresponding valid score. If the valid score of each stamp paper image is greater than or equal to the preset score, it can be determined that each stamp paper image in the stamp file is valid, and therefore the stamp file can be determined to be valid.
[0111] In this embodiment, the process involves acquiring an image of the stamped paper and the stamping information of a document; inputting the stamped paper image into a stamp image detection model to obtain a stamp image; dividing the stamped paper image into a preset number of stamped paper grid images; using each grid in the stamped paper grid images as training samples to train a second convolutional neural network to obtain a paper texture detection model; inputting the stamp image into the paper texture detection model to obtain the corresponding paper texture grid images and paper texture grid image information; wherein, the paper texture grid image information includes: the grid number and grid coordinates of each grid in the paper texture grid images in the stamped paper grid image; determining the stamp image texture based on the paper texture grid image information of the stamp image; determining the stamp rotation angle of the stamp image on the stamped paper image based on the paper texture grid image information of the stamp image; determining the coordinate position corresponding to the grid number of the center point of the stamp image as the coordinate position of the stamp image on the paper image; and determining whether the document is valid based on the stamp image information and the stamping information. The above technical solution determines the seal image information based on the seal paper image, seal image detection model, and paper texture detection model. Combining the seal image information and stamping information, it determines the validity of the seal document, solving the problems of difficulty in anti-counterfeiting seal text and difficulty in determining the validity of seal documents. This technical solution uses a deep learning model to achieve offline and simplified seal document validity determination, effectively improving the timeliness and ease of use of seal document detection. By determining the validity of the seal document through three dimensions—texture, rotation angle, and position of the seal paper image—it ensures the robustness and accuracy of seal document validity determination.
[0112] For example, Figure 7 This is a flowchart illustrating a method for determining the validity of a seal document according to Embodiment 2 of the present invention. Figure 7 As shown, when a document is stamped, the document's stamped paper texture, stamp rotation angle, and stamp position are identified and recorded in real time. The validity of the stamped document is determined based on this stamping information. A convolutional neural network (CNN) is used to obtain the stamped paper image of the document. Image preprocessing is performed on the stamped paper image, and a training sample set is generated based on the preprocessed stamped paper image. The CNN is then trained using the training sample set to generate a fully trained stamp image detection model. Alternatively, a CNN is used to obtain a 12*60 standard grid image of the stamped paper image. This grid image is preprocessed, and each grid is used as a training sample to construct a training sample set. The CNN is then trained using these training samples to generate a fully trained paper texture detection model.
[0113] The stamp image is input into a stamp image detection model to obtain the stamp image output by the model. The stamp image is then input into a paper texture detection model to obtain the corresponding paper texture grid image and its information. Based on the paper texture grid image information, the stamp image texture, rotation angle, and coordinate position of the stamp image portion are determined. A texture score is determined based on the stamp and stamp paper textures; a rotation angle score is generated based on the stamp and stamp rotation angles; and a position score is generated based on the stamp coordinate position and stamp position. The texture score, rotation angle score, and position score are multiplied or weighted and summed to determine the valid score for each stamp image. If the valid score for each stamp image reaches a preset score, the stamp document is considered valid.
[0114] Example 3
[0115] Figure 8 This is a schematic diagram of a device for determining the validity of a stamped document according to Embodiment 3 of the present invention. Figure 8 As shown, the device includes:
[0116] The stamping information acquisition module 31 is used to acquire the stamp paper image of the stamp document and the stamping information of the stamp document; the stamp paper image is the paper image containing the stamp image in the stamp document.
[0117] The seal image acquisition module 32 is used to input the seal paper image into the seal image detection model to obtain the seal image;
[0118] The image information determination module 33 is used to input the seal image into the paper texture detection model to obtain the paper texture grid image information corresponding to the seal image, and to determine the seal image information based on the paper texture grid image information of the seal image.
[0119] The document validity determination module 34 is used to determine whether the seal document is valid based on the seal image information and the stamping information.
[0120] This embodiment provides a device for determining the validity of seal documents. By implementing offline and simplified seal document validity determination through a model, it effectively improves the timeliness and ease of use of seal document detection. It judges whether a seal document is valid from multiple dimensions, ensuring the robustness and accuracy of seal document validity determination.
[0121] Optionally, the image information determination module 33 is specifically used for:
[0122] The stamp paper image is converted into a preset number of stamp paper square images;
[0123] Each square in the stamp paper grid image is used as a training sample to train the second convolutional neural network to obtain a paper texture detection model.
[0124] The stamp image is input into the paper texture detection model to obtain the paper texture grid image and paper texture grid image information corresponding to the stamp image.
[0125] The paper texture grid image information includes: the grid number and grid coordinates of each grid in the paper texture grid image in the stamp paper grid image.
[0126] Optionally, the image information determination module 33 includes:
[0127] An image texture determination unit is used to determine the texture of the seal image based on the paper texture grid image information of the seal image;
[0128] A rotation angle determination unit is used to determine the rotation angle of the seal image on the seal paper image based on the paper texture grid image information of the seal image.
[0129] The coordinate position determination unit is used to determine the coordinate position corresponding to the grid number of the center point of the seal image as the coordinate position of the seal image on the seal paper image.
[0130] Optionally, the rotation angle determination unit is specifically used for:
[0131] Multiple corner points of the seal image are extracted based on a corner detection algorithm;
[0132] Determine the grid number of the square corresponding to each corner point in the paper texture grid image of the stamp image;
[0133] The rotation angle of the seal image on the seal paper image is determined based on the grid coordinates corresponding to the grid numbers of each corner point.
[0134] Optionally, the stamp information acquisition module 31 is specifically used for:
[0135] During the process of stamping a document to obtain a stamped document, the stamping position and rotation angle on the stamped document, as well as the texture of the stamped paper, are collected.
[0136] Optionally, the file validity determination module 34 is specifically used for:
[0137] The texture score of the stamp paper image is determined based on the texture of the stamp image and the texture of the stamped paper.
[0138] The rotation angle score of the stamp paper image is determined based on the stamp rotation angle of the stamp image and the stamping rotation angle.
[0139] The position score of the stamp paper image is determined based on the coordinate position of the stamp image on the stamp paper image and the stamping position;
[0140] The effective score of the stamp paper image is determined based on the texture score, the rotation angle score, and the position score.
[0141] If the valid score of each stamp paper image in the stamp file is greater than or equal to the preset score, then the stamp file is determined to be valid.
[0142] Optionally, the stamp information acquisition module 31 is also specifically used for:
[0143] Obtain the image of the seal document;
[0144] The image of the seal document is input into the seal paper detection model to obtain the seal paper image;
[0145] The stamp paper detection model is obtained by training a first convolutional neural network based on a stamp paper image sample training set; the stamp paper image sample training set includes: paper images containing stamps and paper images not containing stamps.
[0146] The device for determining the validity of a seal document provided in this embodiment of the invention can execute the method for determining the validity of a seal document provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0147] Example 4
[0148] Figure 9 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0149] like Figure 9As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0150] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0151] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a method for determining the validity of a stamped document.
[0152] In some embodiments, a method for determining the validity of a stamped document may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for determining the validity of a stamped document described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a method for determining the validity of a stamped document by any other suitable means (e.g., by means of firmware).
[0153] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0154] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0155] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0156] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0157] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0158] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0159] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0160] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for determining the validity of a stamped document, characterized in that, include: Obtain the image of the seal paper in the seal document and the stamping information of the seal document; The stamp paper image is a paper image containing the stamp image in the stamp file, wherein the stamping information is parameter information predetermined in advance when the stamp file is stamped; The stamp paper image is input into the stamp image detection model to obtain the stamp image; The stamp image is input into the paper texture detection model to obtain the paper texture grid image information corresponding to the stamp image. The stamp image information is determined based on the paper texture grid image information of the stamp image. The paper texture grid image information is the information of each paper texture grid image after the stamp paper is divided into grids. The stamp image information is the parameter information of the stamp image relative to the stamp paper image. The validity of the seal document is determined based on the seal image information and the stamping information. The step of determining the seal image information based on the paper texture grid image information of the seal image includes: The texture of the seal image is determined based on the paper texture grid image information of the seal image; The rotation angle of the seal image on the seal paper image is determined based on the paper texture grid image information of the seal image. The coordinate position corresponding to the grid number of the center point of the seal image is determined as the coordinate position of the seal image on the seal paper image; The step of determining whether the seal document is valid based on the seal image information and the stamping information includes: The texture score, rotation angle score, and position score of the seal paper image are determined based on the seal image information and the stamping information, respectively. The effective score of the stamp paper image is determined based on the texture score, the rotation angle score, and the position score. If the valid score of each stamp paper image in the stamp file is greater than or equal to the preset score, then the stamp file is determined to be valid.
2. The method according to claim 1, characterized in that, The step of inputting the seal image into the paper texture detection model to obtain the paper texture grid image information corresponding to the seal image includes: The stamp paper image is divided into a preset number of stamp paper square images; Each square in the stamp paper grid image is used as a training sample to train the second convolutional neural network to obtain a paper texture detection model. The stamp image is input into the paper texture detection model to obtain the paper texture grid image and paper texture grid image information corresponding to the stamp image. The paper texture grid image information includes: the grid number and grid coordinates of each grid in the paper texture grid image in the stamp paper grid image.
3. The method according to claim 1, characterized in that, Determining the seal rotation angle of the seal image on the seal paper image based on the paper texture grid image information of the seal image includes: Multiple corner points of the seal image are extracted based on a corner detection algorithm; Determine the grid number of the square corresponding to each corner point in the paper texture grid image of the stamp image; The rotation angle of the seal image on the seal paper image is determined based on the grid coordinates corresponding to the grid numbers of each corner point.
4. The method according to claim 1, characterized in that, Obtaining the stamping information of the stamped document includes: During the process of stamping a document to obtain a stamped document, the stamping position and rotation angle on the stamped document, as well as the texture of the stamped paper, are collected.
5. The method according to claim 4, characterized in that, The step of determining whether the seal document is valid based on the seal image information and the stamping information includes: The texture score of the stamp paper image is determined based on the texture of the stamp image and the texture of the stamped paper. The rotation angle score of the stamp paper image is determined based on the stamp rotation angle of the stamp image and the stamping rotation angle. The position score of the stamp paper image is determined based on the coordinate position of the stamp image on the stamp paper image and the stamping position; The effective score of the stamp paper image is determined based on the texture score, the rotation angle score, and the position score. If the valid score of each stamp paper image in the stamp file is greater than or equal to the preset score, then the stamp file is determined to be valid.
6. The method according to claim 1, characterized in that, The process of obtaining the seal paper image of the seal document includes: Obtain the image of the seal document; The image of the seal document is input into the seal paper detection model to obtain the seal paper image; The stamp paper detection model is obtained by training a first convolutional neural network based on a stamp paper image sample training set; the stamp paper image sample training set includes: paper images containing stamps and paper images not containing stamps.
7. A device for determining the validity of a stamped document, characterized in that, include: The stamping information acquisition module is used to acquire the image of the stamp paper of the stamped document and the stamping information of the stamped document. The stamp paper image is a paper image containing the stamp image in the stamp file, wherein the stamping information is parameter information predetermined in advance when the stamp file is stamped; The seal image acquisition module is used to input the seal paper image into the seal image detection model to obtain the seal image. The image information determination module is used to input the seal image into the paper texture detection model to obtain the paper texture grid image information corresponding to the seal image, and to determine the seal image information based on the paper texture grid image information of the seal image. The paper texture grid image information is the information of each paper texture grid image after the seal paper is divided into grids. The seal image information is the parameter information of the seal image relative to the seal paper image. The document validity determination module is used to determine whether the seal document is valid based on the seal image information and the stamping information. The image information determination module includes: An image texture determination unit is used to determine the texture of the seal image based on the paper texture grid image information of the seal image; A rotation angle determination unit is used to determine the rotation angle of the seal image on the seal paper image based on the paper texture grid image information of the seal image. The coordinate position determination unit is used to determine the coordinate position corresponding to the grid number of the center point of the seal image as the coordinate position of the seal image on the seal paper image. The file validity determination module is specifically used for: The texture score, rotation angle score, and position score of the seal paper image are determined based on the seal image information and the stamping information, respectively. The effective score of the stamp paper image is determined based on the texture score, the rotation angle score, and the position score. If the valid score of each stamp paper image in the stamp file is greater than or equal to the preset score, then the stamp file is determined to be valid.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a method for determining the validity of a seal document according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement a method for determining the validity of a seal document according to any one of claims 1-6.
Citation Information
Patent Citations
Seal authenticity verification method and device and computer readable storage medium
CN109977750A
Stamped file anti-counterfeiting mark generation and verification method based on chip stamp
CN113486998A