Paper handwriting image style clustering and analysis early warning method and system, electronic product and medium
By combining a hybrid model of CNN and Transformer with a multi-stage clustering algorithm, style representation and analysis of paper handwriting images were achieved, solving the problem of verifying the authenticity of paper handwriting data and real-time risk monitoring in financial transaction scenarios, and improving the accuracy and security of handwriting recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies struggle to effectively decouple the writing content and style of the same writer in different scenarios within financial transactions. Paper handwriting images have limited information, and a single network architecture cannot capture micro-stroke and macro-layout features. Furthermore, it is difficult to meet the needs of large-scale handwriting data authenticity screening and real-time risk monitoring.
A hybrid backbone structure based on CNN and Transformer is used to represent the style of paper handwriting images. MiniBatch K-Means preliminary clustering and DBSCAN fine clustering are combined. Through multi-stage clustering and manual review mechanism, style clusters are generated and cluster analysis and early warning are performed.
It significantly improves the accuracy and efficiency of style recognition for paper handwriting images, enabling timely detection of abnormal handwriting and preventing risks such as identity theft. It supports online incremental detection and short-term group anomaly alerts, meeting the security and efficiency requirements of financial scenarios.
Smart Images

Figure CN121768009A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of image processing and pattern recognition technology, and more specifically to paper handwriting image style clustering and analysis early warning technology. Background Technology
[0002] With the increasing digitalization of financial transactions, style analysis and clustering of paper handwriting images have significant application value in fields such as signature authentication and author verification. Currently, research on paper handwriting image style clustering technology mainly revolves around three aspects: feature extraction, similarity calculation, and clustering algorithms.
[0003] The existing technological solutions are as follows: In feature extraction, traditional methods mainly rely on manually designed features, such as stroke shape features, geometric features, and texture features. With the development of deep learning technology, feature extraction methods based on convolutional neural networks (CNNs) have gradually become mainstream. For example, CN110659599A discloses an offline handwriting identification system based on scanned exam papers. This system uses a dual-channel convolutional neural network to treat two images as a single image with two channels, inputting the neural network concurrently to extract features from both images. Then, the extracted local features are clustered to form global features. This method can automatically extract and identify handwriting from exam papers in batches, but it still has limitations when dealing with complex layouts and diverse interference.
[0004] In terms of feature representation learning, CN115620312B discloses a cross-modal character handwriting verification method. This method uses a character spatial attention mechanism to reference standard samples, learns the unique or important writing styles of the standard samples, captures key differences and unique commonalities of characters, and obtains the writer's handwriting feature vector of multimodal character images. This method has achieved good results in character-level handwriting verification, but it does not adequately consider the clustering analysis of the overall signature style.
[0005] In the area of handwriting style recognition, CN119649475A describes a multi-style handwritten electronic signature recognition system. This system collects multiple sample signatures with different styles to construct sample pairs, extracts multi-dimensional handwriting features to construct user representation vectors, and abstracts these multi-dimensional signature handwriting style features through weight sharing to obtain features showing a high degree of consistency in handwriting style between handwritten electronic information and physical signatures. This method has made progress in processing multi-style electronic signature recognition, but it is not applicable to paper handwriting images.
[0006] As can be seen from the existing technological solutions described above, paper handwriting data presented the following challenges in financial transaction scenarios: First, the same writer often writes different content in different contexts, and traditional methods struggle to effectively decouple the content from the writing style, resulting in inaccurate style representation. Second, paper handwriting images themselves carry limited information, and a single network architecture cannot simultaneously capture microscopic stroke features and macroscopic layout features, thus limiting the learning ability of deep models to acquire style information. Third, single clustering methods are insufficient to meet the performance and auditing requirements of large-scale handwriting authenticity screening and risk monitoring in financial scenarios. Fourth, real-time input of new data in real-time requires merging and analysis with existing data, and existing systems struggle to support online incremental detection and risk warning of paper handwriting data. Summary of the Invention
[0007] This invention proposes a method and system for style clustering and analysis of paper handwriting images, which performs style characterization, style clustering, and analysis and early warning on paper handwriting data in scenarios such as finance and public security, meeting the needs of large-scale paper handwriting data authenticity screening and real-time risk monitoring in these scenarios.
[0008] The technical solution of the present invention is as follows: One aspect of this application provides a method for style clustering and analysis-based early warning of paper handwriting images, comprising the following steps: style representation, inputting image data into a trained style representation model based on CNN and Transformer to generate style representation embedding vectors for paper handwriting images; style clustering, including MiniBatch K-Means preliminary clustering and DBSCAN fine clustering, classifying handwriting styles according to style feature vectors and outputting style clusters; cluster analysis and early warning, performing cluster statistics and analysis based on style clusters, providing clustering conclusions for all paper handwriting data under the same user, providing risk warnings for user data with potential risks and submitting it for manual review, and updating and saving the user's style cluster information. This technical solution, by combining deep feature extraction and clustering algorithms, solves the problem of paper handwriting style recognition caused by inconsistent writing content and large data volume, significantly improving the accuracy and efficiency of handwriting verification.
[0009] Preferably, the training of the style representation model based on CNN and Transformer in this method includes: data acquisition, collecting multiple handwriting images of different writing content from multiple writers to construct a style training set labeled with the writer; paper handwriting style representation, randomly initializing the style representation model based on CNN and Transformer, inputting the training images into the style representation model to generate style representation embedding vectors for paper handwriting images; supervised training, using the writer labels as supervision information, calculating a supervised contrastive loss on the style representation embedding vectors to train the style representation model based on CNN and Transformer, learning the common style features among different samples under the same writer, so that different samples under the same writer are close to each other and far away from other writers' samples in the embedding space; repeating the above steps to train the model until the model converges, and saving the model definition and the parameters after training.
[0010] Preferably, the paper handwriting style representation process includes: extracting shallow features of the image through shallow convolution; fusing original image details and shallow convolution features through residual fusion; extracting local style information through convolutional representation; extracting global style information through Transformer representation; and finally integrating the two representations for feature fusion, and mapping the fused representation to a contrastive loss space for style embedding through projection and normalization. Here, feature fusion combines the advantages of these two representation methods, ensuring that the model can see both local details and understand global style. Finally, the fused features are mapped to a suitable vector space through the projection and normalization modules.
[0011] Preferably, the DBSCAN fine clustering in the style clustering step includes identifying core point sets and noise points, calculating the average similarity within the cluster, the standard deviation of similarity, and the silhouette coefficient, to ensure the quality and purity of style clusters.
[0012] Preferably, in the style clustering step, after the two stages of MiniBatch K-Means preliminary clustering and DBSCAN fine clustering, there is also a style cluster merging stage based on the fusion of centroid vector and metadata. In this stage, the clusters to be merged are calculated and screened, sorted by similarity and merged in sequence until there are no more candidate edges or the merging limit is reached, and style cluster Cs_three is generated.
[0013] Preferably, the method further includes a step of activating the monitoring mode, extracting the user's corresponding cluster information when a new sample arrives, performing multi-stage style clustering and cluster analysis on the new sample, updating the cluster, performing cluster analysis and clustering conclusions, and triggering an alarm and entering manual review when a large number of highly similar new samples pointing to the same cluster or similar groups outside the same cluster are detected within a short time window.
[0014] Preferably, manual review is performed on abnormal small clusters (the number of handwriting elements in the cluster is less than 3) or abnormal data in abnormal clusters to confirm the authenticity of the handwriting or abnormal writing style, and to provide risk warnings for high-risk data.
[0015] Another aspect of this application provides a paper handwriting image style clustering and analysis early warning system, including a trained paper handwriting style representation model, a style clustering module, and a clustering analysis and early warning module. The trained paper handwriting style representation model is used to characterize the style of paper handwriting images. Processed image data is input into the model, and the model outputs style representation embedding vectors. The style clustering module uses MiniBatch K-Means preliminary clustering and DBSCAN fine clustering methods to classify handwriting styles based on style feature vectors and output style clusters. The clustering analysis and early warning module performs cluster statistics and analysis based on style clusters, provides clustering conclusions for all paper handwriting data under the same user, provides risk warnings for user data with potential risks and submits them for manual review, and updates and saves the user's style cluster information. The clustering analysis and early warning module, based on a mechanism of normalized centroid and metadata fusion, is used to monitor and alert on abnormal groups in newly added handwriting data in real time.
[0016] Another aspect of this application provides an electronic device, including: a processor; and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to perform the methods described above.
[0017] Another aspect of this application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the above-described method.
[0018] The advantages of this application are as follows: This application utilizes a hybrid backbone structure of CNN and Transformer to effectively improve the extraction accuracy of style features from paper handwriting images. Combined with a multi-stage clustering algorithm, it can not only quickly group styles and effectively identify and cluster the writing styles of different users, but also identify and warn of abnormal groups in a fine-grained manner, greatly improving the limitations of traditional handwriting analysis methods.
[0019] This application employs a manual review mechanism, which not only improves the accuracy of handwriting recognition but also enables the timely detection of abnormal handwriting, preventing risks such as identity theft.
[0020] Through online incremental detection and short-term group anomaly alerts, new data can be responded to in real time, ensuring the immediate detection and processing of high-risk handwriting, and significantly improving the security and efficiency of handwriting analysis.
[0021] Furthermore, the innovative use of metadata fusion and centroid vectors enhances the stability and accuracy of style clustering, providing strong support for writer identity verification and handwriting authentication.
[0022] This intelligent handwriting image style clustering and analysis early warning system can be widely used in banking, forensic identification, education assessment and other fields. It effectively prevents handwriting fraud, ensures the legality and security of documents, and also improves the level of automation of business processes. Attached Figure Description
[0023] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a flowchart of the style clustering and analysis early warning method for paper handwriting images according to the present invention.
[0024] Figure 2 It is a training image of a style representation model for paper handwriting images. Figure 3 This is a structural block diagram of an exemplary electronic device that can be used to implement embodiments of this application. Detailed Implementation
[0025] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0026] It should be understood that the steps described in the method embodiments of this application may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this application is not limited in this respect.
[0027] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc., mentioned in this application are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0028] The terms “a” and “a plurality” used in this application are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as “one or more”.
[0029] The names of the messages or information exchanged between multiple devices in the embodiments of this application are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0030] In one embodiment of this application, a style clustering and analysis early warning method for paper handwriting images is provided. This method performs style characterization, style clustering, and analysis early warning on paper handwriting data in scenarios such as finance and public security, thereby meeting the needs of large-scale paper handwriting data authenticity screening and real-time risk monitoring in these scenarios.
[0031] This method inputs all paper handwriting data under a specified user into a style clustering and analysis early warning system for paper handwriting images. The system sequentially performs style characterization, multi-stage style clustering, analysis, and early warning on the data, as follows: Figure 1 This includes the following processes: Style representation involves inputting the input image data into a trained style representation model based on CNN and Transformer to generate style representation embedding vectors for paper handwriting images. Style clustering, including MiniBatch K-Means preliminary clustering and DBSCAN fine clustering, classifies handwriting styles based on style feature vectors and outputs style clusters; Cluster analysis and early warning: Based on style clusters, perform cluster statistics and analysis, provide clustering conclusions for all paper handwriting data under the same user, provide risk warnings for user data with risks and deliver them for manual review, and update and save the user's style cluster information.
[0032] The above solution combines deep learning technology with traditional clustering algorithms, which can effectively identify and cluster the writing styles of different users. Through multi-stage clustering and manual review mechanisms, it not only improves the accuracy of handwriting recognition, but also can detect abnormal handwriting in a timely manner and prevent risks such as identity theft.
[0033] In this application, the style representation function is provided by a fully trained CNN and Transformer-based style representation model for paper handwriting images. In another embodiment of this application, the training process of the paper handwriting image style representation model is provided, such as... Figure 2 The following are included: Data collection involves collecting multiple handwriting images of different writing content from multiple writers to construct a style training set labeled with the writer.
[0034] The paper handwriting style representation is generated by randomly initializing a style representation model based on CNN and Transformer, and inputting the training image into the style representation model to generate style representation embedding vectors for paper handwriting images.
[0035] Supervised training uses writer labels as supervision information to calculate a supervised contrastive loss on the style representation embedding vector to train a style representation model based on CNN and Transformer. This learns the common style features among different samples under the same writer, so that different samples under the same writer are close to each other and far away from other writers' samples in the embedding space.
[0036] Repeat the above steps to train the model until the generated model converges, and save the model definition and the parameters after training.
[0037] In this embodiment, the training process of the paper handwriting image style clustering and analysis early warning system aims to build an efficient and robust style representation model. First, paper handwriting image data containing multiple writers and diverse writing content is collected to construct a style training set. Next, a style representation model fusing CNN and Transformer is randomly initialized. This model can extract multi-level style features from the image data, including microscopic stroke textures and macroscopic layout patterns. Subsequently, using writer labels as supervision signals, a supervised contrastive loss model is trained to ensure that the embedding vectors of different samples from the same writer are close, while samples from different writers maintain distance in the embedding space, thereby achieving effective separation of writing content and style. Through continuous iterative optimization until the model converges, the trained model parameters are saved. This series of operations provides a solid foundation for subsequent style clustering and analysis, enabling the system to accurately identify writing styles in complex environments and provide early warnings of potential risks, meeting the needs of handwriting authenticity verification and security monitoring in financial scenarios.
[0038] In a further embodiment of this application, the training process of the style representation model is first described in detail.
[0039] Step 1, Data Collection: During the model training phase, multiple paper handwriting images of different writing contents from multiple writers were collected to construct a style training set. ; Sort the writers and use their sort numbers as style tags. For each writer, at least 50 handwriting samples with different content were collected. Among them, the first... The handwriting image data of the writer is Style tags are .
[0040] Step 2, Characterization of paper handwriting style: During the model training phase, style representation models based on CNN and Transformer are randomly initialized. This style representation model A hybrid backbone structure with two branches is adopted, including a shallow convolution module, a residual fusion module, a convolutional representation branch, a Transformer representation branch, a feature fusion module, and a projection and normalization module.
[0041] Specifically, the shallow convolutional module is a set of sub-modules consisting of a two-dimensional convolutional network, normalization layers, and activation layers. Multiple sub-modules are stacked together to extract shallow features. The model training image data is used... The input shallow convolution module performs preliminary feature extraction and resolution adjustment to obtain the shallow intermediate features of the image at each level of convolution. With shallow final features ,in This indicates the number of stacked submodules contained in a shallow convolutional module.
[0042] training image data With shallow final features The input residual fusion module performs residual summation and normalization, preserving original details while fusing the initial local features obtained from shallow convolutions to obtain a shallow fused feature map. .
[0043] The convolutional representation branch can be set up using mainstream convolutional network models, such as ResNet, SENet, and VGGNet. This will convert shallow intermediate features... With shallow final features After summing and normalizing, the input convolutional representation branch extracts local information of the handwriting, such as strokes, textures, and edges, to obtain the convolutional branch representation. .
[0044] The Transformer representation branch can be set to mainstream Transformer-based visual models, such as VIT, PiT, and Swing Transformer. This involves shallowly fusing feature maps. The input Transformer branch captures long-distance dependencies in writing style, such as global cursive patterns across characters and lines, to obtain the Transformer branch representation. .
[0045] The convolutional branches are represented in the feature fusion module. Perform global adaptive average pooling or expand the feature dimension to one dimension, and represent it with the Transformer branch. The dimensions are mapped accordingly. The convolutional branch representations corresponding to each dimension are fused with the Transformer branch representations, for example, by using feature channel concatenation or attention interaction, to obtain the fused representation. .
[0046] The projection and normalization module consists of several feedforward network layers, such as fully connected layers, normalization layers, activation layers, dropout layers, and fully connected layers. Input fusion representation. The projection and normalization module maps the fused representations to the contrastive loss space for supervised contrastive learning, resulting in the final style representation embedding vectors of the data. .
[0047] As seen in this step, the style representation embedding of paper handwriting images is achieved through a series of steps. First, the image is processed by a shallow convolutional module to extract preliminary shallow features. Subsequently, a residual fusion module fuses the original image details with the shallow convolutional features, preserving key information while enhancing the model's expressiveness. The convolutional representation branch focuses on mining local style information, such as stroke details and texture features; while the Transformer representation branch is responsible for capturing long-distance correlations of writing styles, such as global layout and cursive patterns. These two representations are integrated by a feature fusion module and mapped to the contrast loss space through a projection and normalization module, ultimately generating a style embedding vector independent of the writing content. This scheme effectively separates the writing content from the style, enabling the model to focus on extracting style features, thereby accurately identifying the writer's style in complex paper signature scenarios. Through the application of multi-stage clustering and analysis early warning modules, the system can not only quickly perform style clustering on massive amounts of data, but also conduct risk assessment and early warning based on the clustering results, greatly enhancing the security and efficiency of financial transactions.
[0048] Of course, the specific architecture of the convolutional representation branch and the Transformer representation branch can be replaced with other mainstream models of the same type, and the implementation of the feature fusion module can also be adjusted according to the actual situation, such as adopting different feature fusion strategies or introducing additional attention mechanisms to further optimize the accuracy and generalization ability of style representation.
[0049] Step 3, supervised training: Using writer labels as supervision information, a specific in-batch sampling strategy is employed to construct training samples. Each training batch contains a defined number of different writers, and each writer contains a defined number of samples. This ensures that the model can learn common style features among different samples of the same writer, while also distinguishing style differences between different writers. The training process is optimized based on supervised contrastive loss, ensuring that different samples of the same writer are close to each other and far away from samples of other writers within the embedding space.
[0050] The supervised contrastive loss function is defined as: , in This represents the set of indices of all style representation vectors in a training batch. Indicates the current sample, Representation and Sample With the same writer's label The set of positive samples, Representation and Sample A set of negative samples that do not share the same writer's label. This indicates the calculation of cosine similarity. This represents the temperature coefficient parameter.
[0051] In this step, a supervised contrastive loss function is carefully designed to facilitate the learning process of the handwriting image style representation model, ensuring that the model can effectively distinguish the writing styles of different writers while closely associating the features of multiple handwriting images with different content from the same writer. Specifically, the contrastive loss function calculates the similarity (i.e., cosine similarity) between positive examples of each pair of handwriting images of the same writer by summing all style representation vectors in the training batch, and compares it with the similarity of all negative examples (handwriting images of different writers). A temperature coefficient parameter is used to regulate the similarity distribution, thereby guiding the model to narrow the distance between handwriting image features of the same writer in the embedding space, while widening the distance between features of different writers. This technique strengthens the model's understanding of the essence of writer style, reduces confusion caused by content differences, effectively improves the accuracy and robustness of style representation, and thus promotes the accuracy of style clustering. The model trained with supervised contrastive loss can more accurately identify writer style, providing a solid foundation for subsequent clustering and analysis-based early warning.
[0052] Step 4: Repeat steps 1 to 5 to pre-train the model until the generated model converges, and save the model definition and the parameters after training.
[0053] In a further embodiment of this application, a detailed implementation process of a style clustering and analysis early warning method for paper handwriting images in a practical application is provided.
[0054] Step 1, Style Representation: Initialize the style representation model based on CNN and Transformer and load the trained model weights. Input the input image data into the trained style representation model to obtain the style representation embedding. in The number of user style representations.
[0055] Step 3, Style Clustering: A multi-stage clustering method is used to classify handwriting styles based on style feature vectors and output style clusters.
[0056] Phase 1: Initial clustering is performed using the MiniBatch K-Means method, embedding the entire style representation into the set. The system is quickly divided into several manageable-sized clusters to facilitate further parallelization and local refinement. Specifically, the initial number of style clusters is set empirically. Each time, a small batch of samples is sampled to calculate K-Means and iteratively update the cluster centroid until the cluster centroid stabilizes or the number of iterations is reached, thus obtaining... A coarse cluster .
[0057] Phase Two: The DBSCAN method is used for fine-grained clustering. A density-based clustering strategy is applied within each of the initial coarse clusters to obtain purer writing style sub-clusters. DBSCAN fine-grained clustering includes identifying core point sets and noise points, calculating the average similarity within each cluster, the standard deviation of similarity, and the silhouette coefficient to ensure the quality and purity of the style clusters.
[0058] Specifically, for each coarse cluster First, calculate the cluster The set of pairwise distances between all samples within the range: in This refers to either Euclidean or cosine distance. To adapt to density differences within different clusters, statistical methods are used... The distribution dynamically sets the neighborhood radius of DBSCAN. with minimum neighborhood number Neighborhood radius according to The nearest neighbor distance distribution of the first Percentile adaptive setting: , in, This represents the percentile function. The minimum neighborhood number parameter is automatically adjusted based on the coarse cluster size. , That is, for clusters with fewer samples, it ensures at least three neighboring points; for clusters with more samples, the number of neighboring points increases linearly with the cluster size. During the DBSCAN process, the algorithm first identifies the core point set: , in Represents all distances No more than The set of sample points. Isolated points and low-density region samples are marked as noise points, denoted as . Remove image noise features or abnormal writing samples.
[0059] After completing DBSCAN clustering, clusters are obtained. Calculate the average similarity within the cluster. Similarity standard deviation and profile coefficient Cluster consistency score : , in Control the intra-cluster compactness, variance penalty, and structural separation respectively. Set thresholds. ,when When it is marked as a low-quality sub-cluster and enters the subsequent review or re-aggregation process, It is retained as a candidate for a stable style cluster.
[0060] The DBSCAN fine-grained clustering described above effectively eliminates abnormal handwriting samples or image noise features by identifying core point sets and marking noise points, thereby improving the accuracy and reliability of clustering results. By calculating statistical measures such as average similarity within clusters, standard deviation of similarity, and silhouette coefficient, the consistency and compactness of each cluster are evaluated. This helps the system adaptively adjust clustering parameters and enhances robustness to density differences within clusters of different styles. Low-quality subclusters are marked for subsequent review or re-clustering processes, while clusters with consistency scores exceeding a set threshold are retained as stable style cluster candidates, thus achieving fine-grained differentiation of handwriting styles and high-confidence clustering.
[0061] Phase Three: For each candidate subcluster Calculate the cluster centroid And perform L2 normalization : , . Treat subclusters as graphs The nodes, among which For a set of nodes, Let be the set of edges. This is the edge weight matrix. Inter-cluster similarity is calculated based on the normalized centroids: , Keep each node The former Find the most similar neighbors to obtain a sparse symmetric similarity matrix. .
[0062] To more accurately fuse style clusters, metadata from real-world handwriting image data is introduced, such as signing time, signing context, and form type. A metadata similarity matrix is defined. If two clusters appear in the same signing scenario and within a short time window, Otherwise, continuous values are obtained according to the defined rules based on the time difference and the similarity of the form types. The centroid vector similarity and metadata similarity are weighted. To merge: Finally Graphs are constructed by performing symmetry and normalization processes. .exist Based on this, calculate and filter the clusters to be merged. If Greater than or equal to the merging threshold Then it is selected as the merge pair. This yields the set of candidate merge edges. ,according to Sort the nodes from highest to lowest, merge the corresponding clusters in turn, and update the node set, centroid, and consistency score, etc., until there are no candidate edges or the merging limit is reached, thus obtaining the algorithm-generated style clusters. .
[0063] In the third stage described above, a style cluster merging approach based on centroid vector and metadata fusion was adopted to optimize the results of the style clustering in the first two stages. Specifically, centroid vectors were calculated for the sub-clusters obtained from the initial clustering. Then, based on the similarity between centroids and metadata information such as signing time and scenario relevance, a weighted fusion method was used to determine the relationships between clusters. This fusion mechanism allows the system to identify and merge style clusters that, although superficially similar, are closely related in the actual business context. This not only enhances the accuracy of the clustering results but also considers the continuity and complexity of style evolution in financial scenarios. By setting a merging threshold, the system can determine which clusters should be merged, thus avoiding analytical errors caused by overly fine or coarse clustering. This mechanism iterates step by step until there are no more cluster pairs that meet the conditions or the preset merging limit is reached, generating the final style cluster (Cs_three). This design ensures the automation and intelligence of the clustering process while also retaining room for manual intervention to handle special cases or outliers. In system monitoring mode, the addition of new samples will automatically update the clustering results according to this mechanism, realizing the dynamic adaptability of the system and providing timely risk warnings for new sample groups with high similarity in a short period of time.
[0064] Based on style clusters, cluster statistics and analysis are performed, providing clustering conclusions for all paper handwriting data under the same user. Risk warnings are given for user data with potential risks and delivered for manual review. User style cluster information is updated and saved.
[0065] Step 4, Cluster Analysis and Early Warning: Computational clusters Cluster statistics, such as centroid, variance, and intra-cluster similarity, are provided to staff, along with the sample set and cluster statistics information for style clustering. Specifically, style clusters... For abnormal small clusters (with fewer than 3 handwriting elements within a cluster), a risk warning is issued and the cluster is handed over to a human for review. If a similar large cluster exists, the human can merge the abnormal cluster with the large cluster. If there is no similar large cluster and the abnormal cluster contains no abnormal content, the human can retain the small cluster. If the abnormal cluster contains abnormal data, the human should provide a risk warning to the user. After the human review is completed, the system automatically updates and saves the user's style cluster information.
[0066] In this step, for abnormal small clusters with fewer than 3 samples within a cluster in the paper handwriting image data, or when abnormal data is detected in abnormal clusters, a manual review process is initiated. This mechanism ensures the accurate identification and processing of high-risk data. By manually verifying the authenticity of suspected abnormal handwriting, the system can effectively identify high-risk operations such as forged signatures and mass forgery, and promptly provide risk alerts for user data confirmed to be at risk. Manual review, as a supplement to the system process, improves the accuracy of handwriting authenticity screening and the timeliness of risk warnings in financial scenarios, ensuring business security.
[0067] Step 5: Enable monitoring mode for this user. When a new sample arrives under this user's account, extract the corresponding cluster information. Perform steps 5 and 6 on the new sample to update and analyze the clusters, and provide clustering conclusions. For new samples that cluster into small clusters or anomalous clusters, remind staff to conduct manual review. Simultaneously, if a large number of highly similar new samples are detected within a short time window, pointing to the same cluster or similar groups outside the same cluster, trigger an alarm and initiate manual review.
[0068] In this step, when a new sample arrives, the system retrieves pre-saved user style cluster information and transforms the new sample into a style embedding vector using a trained handwriting style representation model. This vector is then incorporated into a multi-stage style clustering process for real-time matching and updating to check if it maintains consistency with existing style clusters or forms new clusters. During this process, the system pays particular attention to whether a large number of highly similar new samples converge on a specific style cluster or form similar groups outside of it within a short time window. If such phenomena are detected, it indicates potential abnormal activity, such as mass forgery or proxy signing. In this case, the system immediately triggers an alarm and pushes the relevant samples to a manual review queue for thorough examination by staff. This online incremental detection mechanism not only accelerates the analysis of new samples but also enhances sensitivity and responsiveness to potential risk events, ensuring the security and compliance of financial transactions.
[0069] In a further embodiment of this application, a paper handwriting image style clustering and analysis early warning system is also provided, including a trained paper handwriting style representation model, a style clustering module, and a clustering analysis and early warning module.
[0070] The style representation module uses the trained paper handwriting style representation model to perform style representation on paper handwriting images. The processed image data is input into the model, and the style representation embedding vector is output.
[0071] Style clustering module: It adopts the method of MiniBatch K-Means preliminary clustering and DBSCAN fine clustering to classify handwriting styles according to style feature vectors and output style clusters.
[0072] Clustering Analysis and Early Warning Module: Based on style clusters, perform cluster statistics and analysis, provide clustering conclusions for all paper handwriting data under the same user, provide risk warnings for user data with risks and deliver them for manual review, and update and save the user's style cluster information.
[0073] The system described above employs a hybrid CNN and Transformer architecture to extract style features from image data and generate style representation embedding vectors. This effectively decouples the writing content from the writing style, improving the accuracy of style representation. The style clustering module uses a multi-stage clustering strategy combining MiniBatch K-Means and DBSCAN to efficiently and accurately cluster the style representation embedding vectors, generating writing style clusters. The clustering analysis and early warning module performs statistical analysis based on these style clusters, assessing handwriting consistency and potential risks, providing clustering conclusions, and triggering a risk warning mechanism to ensure the system's security and reliability. This combination of technical features enables rapid and accurate style clustering and risk warning for paper handwriting images, significantly improving the efficiency and accuracy of signature authenticity verification and risk monitoring in financial scenarios.
[0074] As can be seen from the above embodiments, the technical innovations of this application include at least the following: 1. A hybrid model architecture combining CNN and Transformer is adopted to represent paper handwriting data. At the same time, training data labeled with the writer is collected, and supervised contrastive learning loss is used to decouple the writing content and writing style, so that the model can learn to represent the style information of paper handwriting data.
[0075] 2. Design a multi-stage style clustering method to achieve fast and accurate style clustering even with massive amounts of paper handwriting data. Combine this with cluster statistics methods to merge and optimize the clustering results. Simultaneously, design an interactive method to deliver the clustering results and warning information to staff, who will then manually review the data and decide whether to issue a risk alert to the user.
[0076] 3. Design online incremental clustering and anomaly detection methods to support rapid assignment and cluster updates of new user data, as well as the ability to detect anomalous samples in the short term. It should also be sensitive to and provide timely warnings in the face of sudden proxy signing and mass forgery.
[0077] This application constructs a highly efficient, accurate, and adaptable paper handwriting image style clustering and analysis early warning system through a series of meticulously designed style representation model training, multi-stage style clustering, online monitoring, and anomaly early warning steps. The system can learn handwriting style representation embeddings independent of the writing content in complex paper signature scenarios. Further, a multi-stage clustering method is applied to obtain style clusters, and the clustering results are combined with risk warning information for manual review by staff. Simultaneously, it supports online incremental data detection and short-term group anomaly alerts, meeting the business needs of practical application scenarios. By acquiring content-independent, accurate handwriting style representations, performing multi-stage style clustering and cluster analysis, and providing conclusions, while also supporting online incremental data detection and short-term group anomaly alerts, it effectively solves the practical business needs of financial signature authenticity screening or risk warning.
[0078] like Figure 3 The diagram shows a structural block diagram of an exemplary electronic device that can be used to implement embodiments of this application. The electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the device 300. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0079] Multiple components in electronic device 300 are connected to I / O interface 305, including: input unit 306, output unit 307, storage unit 308, and communication unit 309. Input unit 306 can be any type of device capable of inputting information to electronic device 300. Input unit 306 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 307 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 308 may include, but is not limited to, disk and optical disk. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0080] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 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 computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. In some embodiments, the computing unit 301 may be configured in any other suitable manner to perform a paper handwriting image style clustering and analysis early warning method.
Claims
1. A method for style clustering and analysis of paper handwriting images for early warning, characterized in that, Includes the following steps: Style representation: Input image data into a trained style representation model based on CNN and Transformer to generate style representation embedding vectors for paper handwriting images; Style clustering: includes MiniBatch K-Means preliminary clustering and DBSCAN fine clustering, which classifies handwriting styles based on the style feature vectors and outputs style clusters; Cluster Analysis and Early Warning: Based on the style clusters, perform cluster statistics and analysis, provide clustering conclusions for all paper handwriting data under the same user, issue risk warnings for user data with risks and deliver them for manual review, and update and save the user's style cluster information.
2. The paper handwriting image style clustering and analysis early warning method according to claim 1, characterized in that, The training of the style representation model based on CNN and Transformer includes: Data collection: Collect multiple handwriting images of different writing content from multiple writers to construct a style training set labeled with the writers; Paper handwriting style representation: Randomly initialize a style representation model based on CNN and Transformer, and input the training image into the style representation model to generate a style representation embedding vector of the paper handwriting image; Supervised training: Using writer labels as supervision information, a supervised contrastive loss is calculated on the style representation embedding vector to train the style representation model based on CNN and Transformer. This learns the common style features among different samples under the same writer, so that different samples under the same writer are close to each other and far away from other writers' samples in the embedding space. Repeat the above steps to train the model until the generated model converges, and save the model definition and the parameters after training.
3. The paper handwriting image style clustering and analysis early warning method according to claim 2, characterized in that, The paper handwriting style representation includes: extracting shallow features of the image through shallow convolution; fusing the original image details and shallow convolution features through residual fusion; extracting local style information through convolutional representation; extracting global style information through Transformer representation; finally integrating the two representations for feature fusion, and mapping the fused representation to the contrast loss space through projection and normalization for supervised contrastive learning to obtain the final style representation embedding vector of the data.
4. The paper handwriting image style clustering and analysis early warning method according to claim 2, characterized in that, The supervised contrastive loss function is defined as: , in This represents the set of indices of all style representation vectors in a training batch. Indicates the current sample, Representation and Sample With the same writer's label The set of positive samples, Representation and Sample A set of negative samples that do not share the same writer's label. This indicates the calculation of cosine similarity. This represents the temperature coefficient parameter.
5. The paper handwriting image style clustering and analysis early warning method according to any one of claims 1-4, characterized in that, DBSCAN fine clustering in the style clustering step includes identifying core point sets and noise points, calculating the average similarity within clusters, the standard deviation of similarity, and the silhouette coefficient to ensure the quality and purity of style clusters.
6. The method for style clustering and analysis of paper handwriting images according to any one of claims 1-4, characterized in that, In the style clustering step, after the initial clustering by MiniBatch K-Means and the fine clustering by DBSCAN, there is also a style cluster merging stage based on the fusion of centroid vectors and metadata. In this stage, the clusters to be merged are calculated and screened, sorted by similarity and merged sequentially until there are no more candidate edges or the merging limit is reached, thus generating style clusters. .
7. The paper handwriting image style clustering and analysis early warning method according to any one of claims 1-4, characterized in that, It also includes the steps of enabling monitoring mode, extracting the user's corresponding cluster information when new samples arrive, performing multi-stage style clustering and cluster analysis on the new samples, updating clusters, performing cluster analysis and clustering conclusions, and triggering an alarm and entering manual review when a large number of highly similar new samples are detected within a short time window, pointing to the same cluster or similar groups outside the same cluster.
8. The paper handwriting image style clustering and analysis early warning method according to claim 7, characterized in that, The manual review is a process of manually reviewing abnormal clusters or abnormal data within abnormal clusters to confirm the authenticity of handwriting or abnormal writing style, and to provide risk warnings for high-risk data.
9. A paper handwriting image style clustering and analysis early warning system, characterized in that, This includes a trained paper handwriting style representation model, a style clustering module, and a cluster analysis and early warning module. The trained paper handwriting style representation model based on CNN and Transformer is used to perform style representation on paper handwriting images. The processed image data is input into the model, and the style representation embedding vector is output. Style clustering module: The MiniBatch K-Means preliminary clustering and DBSCAN fine clustering method are used to classify handwriting styles according to the style feature vector and output style clusters; Clustering analysis and early warning module: Based on the style clusters, perform cluster statistics and analysis, give clustering conclusions for all paper handwriting data under the same user, give risk warnings for user data with risks and deliver them to manual review, update and save user style cluster information; The clustering analysis and early warning module, based on the mechanism of normalized centroid and metadata fusion, is used to monitor and alert on abnormal groups in newly added handwriting data in real time.
10. The paper handwriting image style clustering and analysis early warning system according to claim 9, characterized in that, Training of the paper handwriting style representation model based on CNN and Transformer includes: Data collection: Collect multiple handwriting images of different writing content from multiple writers to construct a style training set labeled with the writers; Paper handwriting style representation: Randomly initialize a style representation model based on CNN and Transformer, and input the training image into the style representation model to generate a style representation embedding vector of the paper handwriting image; Supervised training: Using writer labels as supervision information, a supervised contrastive loss is calculated on the style representation embedding vector to train the style representation model based on CNN and Transformer. This learns the common style features among different samples under the same writer, so that different samples under the same writer are close to each other and far away from other writers' samples in the embedding space. Repeat the above steps to train the model until the generated model converges, and save the model definition and the parameters after training.
11. The paper handwriting image style clustering and analysis early warning system according to claim 9 or 10, characterized in that, The style representation model based on CNN and Transformer adopts a hybrid backbone structure with two branches, including a shallow convolution module, a residual fusion module, a convolutional representation branch, a Transformer representation branch, a feature fusion module, and a projection and normalization module. The shallow convolution module extracts shallow features of the image, the residual fusion module fuses the original image details with the shallow convolutional features, the convolutional representation branch extracts local style information, the Transformer representation branch extracts global style information, the feature fusion module integrates the two representations, and the projection and normalization module maps the fused representation to the contrast loss space for supervised contrastive learning, resulting in the final style representation embedding vector of the data.
12. An electronic device, comprising: processor; And a memory for storing a program, characterized in that the program includes instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1-8.
13. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, in, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-8.
Citation Information
Patent Citations
Off-line handwriting identification system based on test paper scanning and use method
CN110659599A