Seal identification method, device and equipment, medium and product
By applying the object detection model and feature recognition model based on SSD network in banks, the seals in non-formatted contracts are automatically identified and processed, and the problems of management complexity and inefficiency under traditional manual processing methods are solved, and efficient seal management and identification are achieved.
Patent Information
- Application Number
- CN202411830187.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-14
AI Technical Summary
Traditional manual processing is difficult to effectively manage and identify diverse seals in non-formatted contracts, resulting in management complexity and inefficiency.
The target detection model and feature recognition model based on SSD network are used to automatically identify and process seals in non-formatted contracts. The method includes obtaining the image to be identified, determining the target prediction box through the object detection model, and generating seal recognition results through the feature recognition model.
It improves the accuracy and speed of seal positioning, reduces the workload of manual identification, realizes automated archiving, classification and statistics, and improves management efficiency and accuracy.
Smart Images

Figure CN119625740A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a seal recognition method, device, equipment, medium and product. Background Art
[0002] In today's banking industry, contract signing is a critical and frequent activity. Not only are there a large number of standardized contracts that need to be signed, but also the number of non-standard contracts signed with customers is increasing due to the increasing complexity and diversification of business.
[0003] For formatted contracts, the management and processing are relatively simple due to their unified specifications and standards. However, non-formatted contracts bring many challenges. Among them, the seals used in non-formatted contracts show significant diversity. This makes the filing, classification and statistical processing of non-formatted contract seals extremely complicated and difficult.
[0004] The traditional manual processing method is not only inefficient, but also prone to errors and omissions, and it is difficult to meet the needs of rapid development and refined management of banking business. At the same time, with the continuous growth of business volume, the method of manually identifying and processing seals one by one can no longer cope with the huge amount of data and tight time requirements. Summary of the invention
[0005] The present invention provides a seal recognition method, device, equipment, medium and product to realize automatic processing of different non-format contract seals, facilitate the use management of non-format contract seals, and reduce the complexity of bank affairs management.
[0006] According to one aspect of the present invention, a seal recognition method is provided, the method comprising:
[0007] Obtain an image to be identified, and determine a target prediction box in the image to be identified by using a pre-built target detection model, wherein the image to be identified includes an unformatted contract, and the target detection model is built based on a single-shot multi-box detector SSD network;
[0008] The target feature category of the image to be identified is determined according to the target prediction box and the pre-built feature recognition model, and the seal recognition result of the image to be identified is generated according to the target feature category.
[0009] Optionally, the process of constructing the target detection model includes: initializing the main layer of the SSD network using a pre-trained model, and initializing the extension layer of the SSD network using a specified probability distribution; inputting training samples into the SSD network, extracting each candidate box from a feature map of a specified scale through the SSD network, and marking each candidate box as a positive or negative sample according to a preset matching rule; and constructing the target detection model based on the positive and negative samples.
[0010] Optionally, a target prediction frame in the image to be identified is determined by a pre-built target detection model, including: extracting each feature frame from the image to be identified based on a specified scale by the target detection model; determining a score for each feature frame according to a matching degree of each feature frame, and taking a feature frame with a score greater than a preset threshold as a prediction frame; and removing redundant frames from each prediction frame by a non-maximum suppression algorithm to retain the target prediction frame.
[0011] Optionally, the process of constructing the feature recognition model includes: generating input samples according to the mixed data set; building an initial neural network, and training the initial neural network based on the input samples to generate the feature recognition model.
[0012] Optionally, the target feature category of the image to be identified is determined based on the target prediction box and a pre-built feature recognition model, including: determining the position offset of the target prediction box, and determining the position coordinates of the target prediction box based on the position offset; cropping the image to be identified based on the position coordinates to generate a cropped image; processing the cropped image to generate each segmented character, wherein the processing includes grayscale, binarization and pixel projection character segmentation; inputting each segmented character into the feature recognition model to obtain each output feature character; merging each feature character into a digital sequence, and taking the feature category corresponding to the digital sequence as the target feature category.
[0013] Optionally, a seal recognition result of an image to be identified is generated according to a target feature category, including: obtaining an identity identification database, wherein the identity identification database includes identity information corresponding to each feature category; matching the target feature category through the identity identification database to obtain target identity information corresponding to the target feature category; and using the target identity information as the seal recognition result.
[0014] According to another aspect of the present invention, there is provided a seal recognition device, the device comprising:
[0015] The target prediction box determination module is used to obtain the image to be identified and determine the target prediction box in the image to be identified through a pre-built target detection model, wherein the image to be identified includes an unformatted contract, and the target detection model is built based on a single-shot multi-box detector SSD network;
[0016] The seal recognition result generation module is used to determine the target feature category of the image to be recognized based on the target prediction frame and the pre-built feature recognition model, and generate the seal recognition result of the image to be recognized based on the target feature category.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0018] at least one processor;
[0019] and a memory communicatively coupled to the at least one processor;
[0020] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a seal recognition method described in any embodiment of the present invention.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a seal recognition method described in any embodiment of the present invention when executed.
[0022] According to another aspect of the present invention, a computer program product is provided. The computer program product comprises a computer program. When the computer program is executed by a processor, the seal recognition method according to any embodiment of the present invention is implemented.
[0023] The technical solution of the embodiment of the present invention, by utilizing advanced SSD network technology, can adapt to various complex seal styles and image backgrounds, improve the generalization ability of the model, and can detect the target area in the image to be identified through the target detection model, thereby improving the accuracy and speed of seal positioning. The workload of manual seal identification is reduced, and the generated seal recognition results provide valuable information for the bank's non-formatted contract management, which helps to realize automated filing, classification and statistics, and improve management efficiency and accuracy.
[0024] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 is a flow chart of a seal recognition method provided according to the first embodiment of the present invention;
[0027] Figure 2 is a flow chart of another seal recognition method provided according to the second embodiment of the present invention;
[0028] Figure 3is a structural schematic diagram of a seal recognition device provided according to Embodiment 3 of the present invention;
[0029] Figure 4 The present invention is a schematic diagram of the structure of an electronic device for implementing a seal recognition method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Embodiment 1
[0033] Figure 1 A flowchart of a seal recognition method is provided for the first embodiment of the present invention. This embodiment is applicable to the scenario of detecting and recognizing the non-formatted contract seal of a bank. The method can be executed by a seal recognition device. The seal recognition device can be implemented in the form of hardware and / or software. The seal recognition device can be configured in a computer controller. Figure 1 As shown, the method includes:
[0034] S110, obtaining an image to be identified, and determining a target prediction box in the image to be identified by using a pre-built target detection model, wherein the image to be identified includes an unformatted contract, and the target detection model is built based on a single-shot multi-box detector SSD network.
[0035] Among them, the Single Shot MultiBox Detector (SSD) is a target detection algorithm architecture in deep learning. It can fuse feature maps of different scales on a single image, and simultaneously predict the categories of multiple targets in the image and locate their bounding box positions, which is used for object detection tasks in images. The target detection model is a model built based on the SSD network. Its function is to input an image, analyze the image content, find the area where the objects that meet the preset target features are located, and identify the possible locations of the targets by generating target prediction boxes. In the seal recognition scenario, it is to find the possible locations of the seals in the image.
[0036] Optionally, the process of constructing the target detection model includes: initializing the main layer of the SSD network using a pre-trained model, and initializing the extension layer of the SSD network using a specified probability distribution; inputting training samples into the SSD network, extracting each candidate box from a feature map of a specified scale through the SSD network, and marking each candidate box as a positive or negative sample according to a preset matching rule; and constructing the target detection model based on the positive and negative samples.
[0037] Among them, the pre-trained model is usually a deep learning model that has been trained on a large-scale general image dataset, such as ImageNet, which has learned many general image features, and can be a VGG16 network. The main layer of the SSD network is initialized with a pre-trained model, which uses the learned general features to accelerate the convergence speed of the model on seal detection related tasks and reduce the training time. The extension layer of the SSD network is generally an additional part added to meet the needs of specific target detection tasks. Its function is to further mine and fuse features directly related to target detection on the basis of the basic features extracted in the main layer, such as unique features that may be presented by targets at different scales. A specified probability distribution, such as a Gaussian distribution with a mean of 0 and a variance of 0.01, is used to initialize the parameters of the extension layer to give the extension layer network a reasonable initial weight, so that each neuron has a suitable activation state when the network starts training, and can be based on random but certain distribution regular initial values, and gradually adjusted through the subsequent training process to learn the optimal parameter combination suitable for target detection tasks, thereby better playing its expansion and optimization of feature extraction, target positioning and other functions.
[0038] Specifically, the training samples are a batch of image data with labeled information. After inputting them into the SSD network, the network will use its multi-layer convolutional structure to extract features from the image. The SSD network adopts a multi-scale feature map design, and feature maps of different scales can capture the features of targets of different sizes. The feature map of a specified scale is actually a feature layer of several specific resolutions set according to the network architecture, which can be Conv4_3, Conv7, Conv8_2, Conv9_2, Conv10_2, and Conv11_2. Extracting each candidate box from the multi-scale feature map is to infer the area in the image where the seal target may exist based on the feature information on the feature map, so as to generate a series of rectangular boxes of different sizes and positions, each of which represents a candidate position where the seal target may be located.
[0039] It should be noted that the preset matching rules are usually determined based on the intersection-over-union ratio threshold, etc. The intersection-over-union ratio is an indicator that measures the degree of overlap between the candidate box and the real annotated target box. If the intersection-over-union ratio of a candidate box and the real target annotated box in the image is greater than a set positive sample threshold, such as 0.5, it means that the candidate box covers the target object more accurately. At this time, it can be marked as a positive sample, which means that the area framed by the candidate box is likely to be the seal to be detected; if the intersection-over-union ratio is less than the set negative sample threshold, it means that the candidate box does not frame the seal, and it is marked as a negative sample. By marking positive and negative samples, it can be used for subsequent training models to distinguish which are real seal areas and which are not, helping the model learn how to accurately locate seal targets.
[0040] Furthermore, positive and negative samples carry key training information. In the process of building the target detection model, the model uses positive samples as a basis to learn the true feature representation of the seal target and its accurate location information, and understand what kind of regional features correspond to the existence of a real seal. At the same time, negative samples are used to learn how to exclude interference areas that are not seals to improve the recognition ability. During specific training, the loss function can be calculated based on positive and negative samples. The loss function measures the degree of difference between the model's prediction results and the actual annotations. Then, through optimization algorithms such as stochastic gradient descent, the parameters of the model are back-propagated and updated according to the value of the loss function, so that the model gradually improves the detection accuracy of the seal target in continuous iterative training, and finally constructs a target detection model that can accurately detect the seal target from the input image, and realizes the functions of effective positioning of the seal and preliminary category judgment.
[0041] The image to be identified refers to an unformatted contract image that needs to be detected and identified. The target prediction box refers to a rectangular box output by the target detection model that frames the possible seal area in the image. An unformatted contract refers to a contract document image that does not have fixed and unified standards in terms of typesetting and format. Its text content, page layout, background, etc. are more complex and diverse, unlike formatted contracts that are regular, which will bring more background interference to seal recognition.
[0042] Specifically, when the input contains an image to be recognized that contains an unformatted contract, the controller can use the constructed target detection model based on the SSD network for processing. Because the image background, text layout, etc. of unformatted contracts are often complex and diverse, unlike formatted documents that have a fixed style. The advantage of the SSD network lies in its strong adaptability to image content. Whether there are messy texts, different fonts, various signature handwritings around the seal on the contract, or backgrounds of different colors, it can filter out areas that meet the seal characteristics in the pixel information of the image based on the learned feature patterns, and then give the corresponding target prediction box, in preparation for further precise recognition.
[0043] Optionally, a target prediction frame in the image to be identified is determined by a pre-built target detection model, including: extracting each feature frame from the image to be identified based on a specified scale by the target detection model; determining a score for each feature frame according to a matching degree of each feature frame, and taking a feature frame with a score greater than a preset threshold as a prediction frame; and removing redundant frames from each prediction frame by a non-maximum suppression algorithm to retain the target prediction frame.
[0044] When the image to be recognized is input, the object detection model will perform convolution and pooling operations on the image layer by layer to extract features. On the feature map of a specified scale, the object detection model will infer the area where the seal may exist in the image based on the distribution of features and pre-learned patterns, and then generate rectangular feature frames.
[0045] Specifically, the matching degree evaluation of each feature frame can be a scoring method based on the combination of classification probability and positioning accuracy, by assigning a corresponding score to each feature frame to reflect the possibility that the feature frame represents the real target. When the score of the feature frame is greater than the preset threshold, it indicates that the feature frame has a high probability of actually framing the target object, and the controller will use it as a predicted frame.
[0046] Among them, the non-maximum suppression algorithm (NMS) is to filter and retain multiple overlapping prediction boxes according to their scores. In specific operations, the controller will first sort all prediction boxes according to their scores, and then start from the prediction box with the highest score to determine the degree of overlap with other prediction boxes. If other prediction boxes overlap with the current highest-scoring prediction box to a high degree and their own scores are relatively low, it means that the prediction box is likely to be a repeated detection of the same target and is a redundant box. At this time, it can be removed. The controller will continue to repeat the screening operation on the remaining prediction boxes, and what is left in the end are those target prediction boxes that each represent different targets and relatively accurately locate the target, avoiding the increase in complexity of subsequent analysis and recognition work due to too many redundant boxes and possible misjudgment problems, so that subsequent steps such as feature recognition for the target can focus more accurately on the real target area.
[0047] S120, determining the target feature category of the image to be identified according to the target prediction frame and the pre-built feature recognition model, and generating a seal recognition result of the image to be identified according to the target feature category.
[0048] Among them, the feature recognition model refers to the model used to extract and analyze the various features of the input image area, that is, the area framed by the target prediction box, and then determine the feature category of the seal in the area.
[0049] Optionally, the target feature category of the image to be identified is determined based on the target prediction box and a pre-built feature recognition model, including: determining the position offset of the target prediction box, and determining the position coordinates of the target prediction box based on the position offset; based on the position coordinates, intercepting the image to be identified to generate a intercepted image; processing the intercepted image to generate each segmented character, wherein the processing includes grayscale, binarization and pixel projection character segmentation; inputting each segmented character into the feature recognition model to obtain each output feature character; merging each feature character into a digital sequence, and taking the feature category corresponding to the digital sequence as the target feature category.
[0050] The position offset is the offset of the center coordinates, width and height of the target prediction box relative to the prior box. Based on the position offset, the coordinate values of the four vertices or center points of the target prediction box in the image to be identified can be accurately calculated, so as to accurately locate the specific position of the prediction box in the entire image. Then, openCV can be used to extract the corresponding part of the image content from the image to be identified according to the position coordinates to generate a captured image.
[0051] It should be noted that the original intercepted image is often a color image, containing information of multiple color channels such as red, green, and blue, and the grayscale operation is to convert the color image into a grayscale image. For example, the information of multiple color channels is integrated into a single grayscale channel through a weighted average algorithm, which not only simplifies the image data, but also retains the basic characteristic information of the image such as light and shade, contour, etc. Binarization is based on the grayscale image, and the grayscale value is further converted into an image with only two values of 0 and 1 according to the set threshold. By selecting a suitable threshold, the contrast between the target objects such as characters in the image and the background can be highlighted, making the character contour clearer, facilitating subsequent segmentation and recognition operations, simplifying the original continuous grayscale levels into obvious black and white, and enhancing the recognition of image features. Pixel projection character segmentation is based on the pixel distribution characteristics of the characters in the image. After grayscale and binarization, the characters will appear as white pixel clusters, and the background will appear as black pixel areas. By projecting and counting the pixels in the horizontal and vertical directions respectively, that is, counting the number of white pixels in each row and column, and judging the spacing between characters based on the peaks and troughs that appear in the projection data, different character areas can be accurately divided in the image, and the characters in the entire captured image can be separated to generate independent segmented characters, which is convenient for the subsequent input of individual characters into the feature recognition model for recognition.
[0052] Specifically, the feature recognition model can be a LeNet-5 model. When each segmented character is input into the feature recognition model one by one, the model will perform feature extraction and classification judgment on each character image according to its internal convolution, pooling, full connection and other network structures, that is, it will analyze the characteristics of the current input character according to the previously learned feature rules, and finally output the feature character, such as recognizing the number "5". The controller will merge the feature characters identified by the feature recognition model in order according to their order in the original intercepted image to form a digital sequence, and use the feature category corresponding to the digital sequence as the target feature category. The digital sequence includes the complete content information extracted from the image in the target prediction box.
[0053] Optionally, a seal recognition result of an image to be identified is generated according to a target feature category, including: obtaining an identity identification database, wherein the identity identification database includes identity information corresponding to each feature category; matching the target feature category through the identity identification database to obtain target identity information corresponding to the target feature category; and using the target identity information as the seal recognition result.
[0054] The identity database records the correspondence between different seal feature categories and corresponding identity information. The identity information will include key content such as company name, registration number, department to which the seal belongs, etc. By associating various seal feature categories with identity information one by one and storing them in the database, a comprehensive data foundation is provided for subsequent accurate identification of the specific identity represented by the seal.
[0055] Specifically, after obtaining the target feature category of the image to be identified, the controller will compare the existing feature category fields in the identity identification database with the current target feature category one by one to obtain the target identity information corresponding to the target feature category. The target identity information has clarified the specific subject represented by the seal and related attributes. The controller will eventually use the target identity information as the seal recognition result to intuitively present the key attributes and ownership of the seal, which is convenient for judging whether the use of the seal is compliant and whether it has corresponding legal effect based on the seal recognition results in many application scenarios such as contract verification, so as to achieve accurate identification of the seal and serve the purpose of subsequent related business processes.
[0056] The technical solution of the embodiment of the present invention, by utilizing advanced SSD network technology, can adapt to various complex seal styles and image backgrounds, improve the generalization ability of the model, and can detect the target area in the image to be identified through the target detection model, thereby improving the accuracy and speed of seal positioning. The workload of manual seal identification is reduced, and the generated seal recognition results provide valuable information for the bank's non-formatted contract management, which helps to realize automated filing, classification and statistics, and improve management efficiency and accuracy.
[0057] Embodiment 2
[0058] Figure 2 This is a flow chart of a seal recognition method provided in the second embodiment of the present invention. This embodiment adds a specific process of constructing a feature recognition model on the basis of the above-mentioned first embodiment. Among them, the specific content of step S210 is roughly the same as step S110 in the first embodiment, so it will not be repeated in this embodiment. Figure 2 As shown, the method includes:
[0059] S210, obtaining an image to be identified, and determining a target prediction box in the image to be identified by using a pre-built target detection model, wherein the image to be identified includes an unformatted contract, and the target detection model is built based on a single-shot multi-frame detector SSD network.
[0060] Optionally, the process of constructing the target detection model includes: initializing the main layer of the SSD network using a pre-trained model, and initializing the extension layer of the SSD network using a specified probability distribution; inputting training samples into the SSD network, extracting each candidate box from a feature map of a specified scale through the SSD network, and marking each candidate box as a positive or negative sample according to a preset matching rule; and constructing the target detection model based on the positive and negative samples.
[0061] Optionally, a target prediction frame in the image to be identified is determined by a pre-built target detection model, including: extracting each feature frame from the image to be identified based on a specified scale by the target detection model; determining a score for each feature frame according to a matching degree of each feature frame, and taking a feature frame with a score greater than a preset threshold as a prediction frame; and removing redundant frames from each prediction frame by a non-maximum suppression algorithm to retain the target prediction frame.
[0062] S220: Generate input samples according to the mixed data set.
[0063] The mixed data set may be the MNIST data set, which refers to a handwritten digital image data set used for digital recognition related tasks, and contains a large number of handwritten digital image samples. The size of each sample image is relatively uniform, and each sample image is labeled with the corresponding correct digital category. Generating input samples according to the mixed data set is to select a suitable number of handwritten digital images and their corresponding annotation information from the mixed data set, perform corresponding preprocessing on the image data, such as normalization operation, adjust the value range of the image pixels to an interval suitable for model input and subsequent calculations, and organize the corresponding category labels so that they can be input into the subsequent network model in an orderly manner according to a certain format, providing an accurate data basis for the training of the network, so that the network can learn the characteristic patterns of different digital handwritings and the differences between them based on the input samples, and then be used for the subsequent recognition of handwritten digital features in unknown images.
[0064] S230, building an initial neural network, and training the initial neural network based on input samples to generate a feature recognition model.
[0065] Among them, the initial neural network can be LeNet-5, which is a convolutional neural network architecture composed of convolutional layers, pooling layers and fully connected layers. The core principle of the convolutional layer is to slide multiple convolutional kernels on the image to perform convolution operations. Different convolutional kernels can extract different local features of the image. For example, some convolutional kernels can capture the line features of the edge of the number, while others focus on extracting the texture features inside the number. Through multiple convolutional kernels, a rich feature map can be constructed to represent the image content. The pooling layer usually adopts the maximum pooling or average pooling method. Its purpose is to downsample the feature map output by the convolutional layer, while reducing the amount of data and the computational complexity, retaining the most significant feature information of the image and avoiding overfitting. The fully connected layer integrates and maps the features obtained after the previous multi-layer processing, and finally outputs the probability distribution corresponding to different digital categories to realize the classification judgment of the handwritten digits in the input image. Building the initial neural network is to build a network framework with feature extraction and classification functions according to its established network structure and parameter configuration specifications of each layer, in preparation for subsequent training.
[0066] Specifically, the input samples generated according to the mixed data set are input into the constructed initial neural network, and the network will perform forward propagation calculations, that is, the input image is subjected to convolution, nonlinear changes, downsampling, and full connection operations to obtain preliminary classification prediction results. Then, by comparing the prediction results with the actual category labels of the input samples, the difference between the two is calculated as the loss function. Then, an optimization algorithm is used, such as gradient descent, to perform back propagation according to the value of the loss function, that is, to adjust the parameters of each layer of the network from the output layer to the input layer in turn, so that the value of the loss function continues to decrease, that is, to make the network's prediction results closer and closer to the true label. After multiple such iterative training processes, the parameters of each layer of the initial neural network are continuously adjusted, and finally the network can accurately recognize the corresponding feature characters based on the input image.
[0067] S240, determining the target feature category of the image to be identified according to the target prediction frame and the pre-built feature recognition model, and generating a seal recognition result of the image to be identified according to the target feature category.
[0068] Optionally, the target feature category of the image to be identified is determined based on the target prediction box and a pre-built feature recognition model, including: determining the position offset of the target prediction box, and determining the position coordinates of the target prediction box based on the position offset; cropping the image to be identified based on the position coordinates to generate a cropped image; processing the cropped image to generate each segmented character, wherein the processing includes grayscale, binarization and pixel projection character segmentation; inputting each segmented character into the feature recognition model to obtain each output feature character; merging each feature character into a digital sequence, and taking the feature category corresponding to the digital sequence as the target feature category.
[0069] Optionally, a seal recognition result of an image to be identified is generated according to a target feature category, including: obtaining an identity identification database, wherein the identity identification database includes identity information corresponding to each feature category; matching the target feature category through the identity identification database to obtain target identity information corresponding to the target feature category; and using the target identity information as the seal recognition result.
[0070] The technical solution of the embodiment of the present invention, by generating input samples using a mixed data set, ensures the diversity and typicality of the samples, helps the model learn common feature patterns, and improves the generalization ability of the model. By training the neural network based on the input samples, the network can learn the features and rules in the samples, so that it can accurately perform feature recognition. The generated feature recognition model has strong adaptability and robustness, can cope with feature recognition tasks in different situations, and provides strong support for subsequent practical applications.
[0071] Embodiment 3
[0072] Figure 3 This is a schematic diagram of the structure of a seal recognition device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a target prediction box determination module 310, which is used to obtain an image to be identified, and determine a target prediction box in the image to be identified by using a pre-built target detection model, wherein the image to be identified includes an unformatted contract, and the target detection model is built based on a single-shot multi-box detector SSD network;
[0073] The seal recognition result generating module 320 is used to determine the target feature category of the image to be recognized according to the target prediction frame and the pre-built feature recognition model, and generate the seal recognition result of the image to be recognized according to the target feature category.
[0074] Optionally, the device also includes: a target detection model construction module, which is used to: initialize the main layer of the SSD network using a pre-trained model, and initialize the extension layer of the SSD network using a specified probability distribution; input training samples into the SSD network, extract each candidate box from a feature map of a specified scale through the SSD network, and mark each candidate box as a positive or negative sample according to a preset matching rule; and construct a target detection model based on the positive and negative samples.
[0075] Optionally, the target prediction box determination module 310 is specifically used to: extract each feature box from the image to be identified based on a specified scale through a target detection model; determine the score of each feature box according to the matching degree of each feature box, and use the feature box with a score greater than a preset threshold as the prediction box; remove redundant boxes from each prediction box through a non-maximum suppression algorithm to retain the target prediction box.
[0076] Optionally, the device also includes: a feature recognition model construction module, which is used to: generate input samples based on the mixed data set; build an initial neural network, and train the initial neural network based on the input samples to generate a feature recognition model.
[0077] Optionally, the seal recognition result generation module 320 specifically includes: a target feature category determination unit, used to: determine the position offset of the target prediction box, and determine the position coordinates of the target prediction box based on the position offset; based on the position coordinates, intercept the image to be identified to generate a intercepted image; process the intercepted image to generate each segmented character, wherein the processing includes grayscale, binarization and pixel projection character segmentation; input each segmented character into a feature recognition model to obtain each output feature character; merge each feature character into a digital sequence, and use the feature category corresponding to the digital sequence as the target feature category.
[0078] Optionally, the seal recognition result generation module 320 specifically includes: a seal recognition result generation unit, used to: obtain an identity identification database, wherein the identity identification database includes identity information corresponding to each feature category; match the target feature category through the identity identification database to obtain the target identity information corresponding to the target feature category; and use the target identity information as the seal recognition result.
[0079] The technical solution of the embodiment of the present invention, by utilizing advanced SSD network technology, can adapt to various complex seal styles and image backgrounds, improve the generalization ability of the model, and can detect the target area in the image to be identified through the target detection model, thereby improving the accuracy and speed of seal positioning. The workload of manual seal identification is reduced, and the generated seal recognition results provide valuable information for the bank's non-formatted contract management, which helps to realize automated filing, classification and statistics, and improve management efficiency and accuracy.
[0080] A seal recognition device provided by an embodiment of the present invention can execute a seal recognition method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0081] Embodiment 4
[0082] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment 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 assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0083] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0084] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0085] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a seal recognition method.
[0086] In some embodiments, a seal recognition method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of a seal recognition method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a seal recognition method in any other appropriate manner (e.g., by means of firmware).
[0087] Various implementations 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 chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0088] Computer programs for implementing 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, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0089] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0090] To provide interaction with a user, the systems and techniques described herein may 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0091] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0092] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0093] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0094] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A seal recognition method, characterized in that: include: Acquire an image to be identified, and determine a target prediction box in the image to be identified by using a pre-built target detection model, wherein the image to be identified includes an unformatted contract, and the target detection model is built based on a single-shot multi-box detector SSD network; The target feature category of the image to be identified is determined according to the target prediction frame and a pre-built feature recognition model, and a seal recognition result of the image to be identified is generated according to the target feature category.
2. The method according to claim 1, characterized in that The process of constructing the target detection model includes: Use the pre-trained model to initialize the main layer of the SSD network, and use the specified probability distribution to initialize the extension layer of the SSD network; Input training samples to the SSD network, extract each candidate box from the feature map of the specified scale through the SSD network, and mark each candidate box as a positive or negative sample according to the preset matching rules; A target detection model is constructed based on the positive and negative samples.
3. The method according to claim 2, characterized in that The determining of the target prediction frame in the image to be identified by using a pre-built target detection model includes: Extracting each feature frame from the image to be identified based on the specified scale by the target detection model; Determine the score of each feature frame according to the matching degree of each feature frame, and take the feature frame with a score greater than a preset threshold as the predicted frame; Redundant boxes are removed from each of the prediction boxes by a non-maximum suppression algorithm to retain the target prediction box.
4. The method according to claim 1, characterized in that: The process of constructing the feature recognition model includes: Generate input samples based on the mixed dataset; An initial neural network is constructed, and the initial neural network is trained based on the input samples to generate a feature recognition model.
5. The method according to claim 1, characterized in that The step of determining the target feature category of the image to be identified according to the target prediction frame and a pre-built feature recognition model includes: Determining a position offset of the target prediction frame, and determining a position coordinate of the target prediction frame based on the position offset; Based on the position coordinates, the image to be identified is intercepted to generate a intercepted image; Processing the captured image to generate segmented characters, wherein the processing includes grayscale conversion, binarization, and pixel projection character segmentation; Inputting each of the segmented characters into the feature recognition model to obtain output feature characters; Each characteristic character is combined into a digital sequence, and the characteristic category corresponding to the digital sequence is used as the target characteristic category.
6. The method according to claim 5, characterized in that The step of generating a seal recognition result of the image to be recognized according to the target feature category includes: Acquire an identity database, wherein the identity database includes identity information corresponding to each feature category; Matching the target feature category through the identity identification database to obtain target identity information corresponding to the target feature category; The target identity information is used as the seal recognition result.
7. A seal recognition device, characterized in that: include: A target prediction box determination module is used to obtain an image to be identified, and determine a target prediction box in the image to be identified by using a pre-built target detection model, wherein the image to be identified includes an unformatted contract, and the target detection model is built based on a single-shot multi-box detector SSD network; The seal recognition result generating module is used to determine the target feature category of the image to be identified according to the target prediction frame and the pre-built feature recognition model, and generate the seal recognition result of the image to be identified according to the target feature category.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 6.
9. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Cited By
Intelligent seal identification method and device, electronic equipment and storage medium
CN121330689A