A handwriting feature extraction method based on pseudo-paragraph handwriting prototype guidance
By using a pseudo-paragraph handwriting prototype-guided method and employing ProtoNCE loss and GuideNCE loss functions, the overall and local style features of the writer are extracted, which solves the problem that existing handwriting verification technologies cannot accurately reflect the writer's style and improves the accuracy of handwriting verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2025-05-26
- Publication Date
- 2026-05-01
AI Technical Summary
Existing handwriting verification technology cannot accurately reflect the writer's overall style, thus affecting the verification effect.
We employ a pseudo-paragraph handwriting prototype-guided approach, using the ProtoNCE loss and GuideNCE loss functions to extract the writer's overall and local style features, and then utilize pseudo-paragraph-guided feature encoder learning.
It improves the accuracy and performance of handwriting verification, enabling more accurate recognition of the writer's genuine handwriting.
Smart Images

Figure CN120496098B_ABST
Abstract
Description
A Handwriting Feature Extraction Method Based on Pseudo-Paragraph Handwriting Prototype Technical Field
[0001] This invention belongs to the field of computer vision, and specifically relates to a method for extracting handwriting features based on pseudo-paragraph handwriting prototypes. Background Technology
[0002] Handwriting, a uniquely human skill, is widely used in various social scenarios. From a biometric perspective, handwriting contains rich personal characteristics and can be used to identify a person. With the rapid development of information technology, handwriting verification technology has been widely applied in identity verification fields such as banking, finance, and e-commerce. In the legal field, accurately determining the authenticity of handwritten documents such as contracts, wills, and testaments is crucial to ensuring their legal validity. Courts currently rely on forensic document examiners (FDEs) for handwriting verification; however, obtaining FDE certification requires two years of training, and the verification process is very time-consuming. Therefore, it is of great significance to quickly and automatically verify the authenticity of a given handwritten image by comparing it with a reference sample of the actual author.
[0003] The main technical challenge of handwriting verification is extracting stable and discriminative feature representations from handwritten text images. These representations can reflect the uniqueness of an individual's handwriting and are crucial for accurately distinguishing genuine articles from highly similar forgeries. Early handwriting verification research designed various types of feature representations, including character tilt, centroid ratio, and stroke curvature; however, these traditional methods share a common problem: they require complex preprocessing steps, such as foreground-background separation, contour extraction, and character segmentation.
[0004] Some advanced deep learning-based methods can automatically extract features from handwritten text images. However, the training process of these methods only focuses on the relationship between individual sample pairs, such as a pair of similar characters, making the encoder more biased towards the local style features of these sample pairs. However, the handwriting style features of the same individual are usually reflected in the style commonality across multiple handwritten samples, such as consistent character shape, slant and stroke thickness in multiple handwritten samples.
[0005] In summary, existing handwriting verification technologies often focus on the writer's local stylistic features, failing to accurately reflect the writer's overall stylistic features. This affects the effectiveness of handwriting verification and hinders its application. Therefore, there is an urgent need for a method that can more accurately reflect the writer's overall style to improve handwriting verification performance. Summary of the Invention
[0006] (1) Technical problems to be solved
[0007] This invention provides a handwriting feature extraction method based on pseudo-paragraph handwriting prototype guidance, aiming to solve the problem that existing handwriting verification technologies cannot accurately reflect the writer's overall style, thus affecting the handwriting verification effect.
[0008] (2) Technical solution
[0009] A handwriting feature extraction method based on pseudo-paragraph handwriting prototype guidance, characterized by the following steps:
[0010] Step 1: Collect multiple handwritten text samples from multiple writers; for a single writer, randomly select several handwritten text samples and combine them into pseudo-paragraphs, and then process them through a prototype encoder to obtain the handwritten handwriting prototype;
[0011] Step 2: For the handwriting prototype, construct a positive sample set and a negative sample set and design a prototype contrastive learning loss function ProtoNCE loss to obtain mutual information between handwriting prototypes with the highest similarity to the same writer, thereby obtaining a more discriminative handwriting prototype.
[0012] Step 3: Using the more discriminative handwriting prototype as an anchor point, the feature encoder selects positive and negative handwriting features and designs a Guided Contrast Learning loss function (GuideNCE loss) to guide the training of the feature encoder to obtain handwriting features that represent the writer's characteristics.
[0013] Step 4: In the query phase, multiple real handwriting samples of the specified writer and the handwriting to be queried are processed by the trained feature encoder to obtain the handwriting features to be queried and the real handwriting features. The average feature of the real handwriting features is calculated, and then the cosine distance between the handwriting features to be queried and the average feature is calculated. The cosine distance is compared with a predefined threshold to determine whether the handwriting belongs to the real handwriting of the specified writer.
[0014] Further, step 1 includes the following steps:
[0015] Step 101: Collect several independent individual handwritten text samples from multiple writers;
[0016] Step 102: For a given writer, randomly select m handwritten text samples and combine them into a pseudo-paragraph. ;
[0017] Step 103: The pseudo-paragraph After the prototype encoder Processing to obtain the prototype of the handwritten handwriting ;
[0018] Step 104: For different writers, repeat steps 102 to 103 above to obtain multiple pseudo-paragraphs corresponding to each writer and generated randomly. and multiple handwriting prototypes. .
[0019] Further, step 102 includes the following steps:
[0020] Step 10201: Randomly divide m handwritten text samples of a certain writer into several subsets, each subset containing several of the handwritten text samples, and randomly combine them into text lines;
[0021] Step 10202: Select the shortest text line as the baseline, and trim the remaining text lines to match the width uniformly, so that the widths of the text lines are aligned with each other.
[0022] Step 10203: Concatenate the text lines together to form the pseudo-paragraph and adapt it to the prototype encoder.
[0023] Furthermore, step 2 includes the following steps:
[0024] Step 201: Select a batch containing data from several writers with a batch size of [missing information]. Given a set of handwriting prototypes, select a specific handwriting prototype of a specific writer from the set, and use the other handwriting prototypes of that writer as the positive sample set, denoted as . The handwriting prototypes of other different writers are used as the negative sample set, denoted as... ;
[0025] Step 202: Utilize the positive sample set and the negative sample set The ProtoNCE loss function is designed to obtain mutual information between handwriting prototypes with the highest similarity to the same writer, thereby obtaining more discriminative handwriting prototypes. .
[0026] Further, step 202 includes the following steps:
[0027] Design a prototype contrastive learning loss function, ProtoNCE loss, denoted as... Specifically, it is expressed as:
[0028]
[0029] in, It's a temperature parameter. This represents the size of the set of handwritten handwriting prototypes. This represents the index of the handwritten handwriting prototype described in the set. Represents the set of indices, indexes This indicates that it is different from Other indexes, for any element, This indicates that a prototype of the handwritten handwriting is specified. Represents any element in the set of handwriting prototypes. This indicates the similarity between a specified handwriting prototype and a positive sample. This indicates the similarity between a specified handwriting prototype and any element within the set of handwriting prototypes. This represents a multilayer perceptron (MLP).
[0030] Furthermore, step 3 includes the following steps:
[0031] Step 301: Transform the more distinctive handwriting prototype As anchor points, a total of several different writers were selected. The system was trained using a set of more discriminative handwriting prototype samples, in which writers were selected. Another random sample was processed by the feature encoder Processing yields positive sample handwritten features Select different writers Each random sample is processed by a feature encoder. Processing yields negative sample handwritten features ;
[0032] Step 302: Design the contrastive learning loss function GuideNCE loss, denoted as... Specifically, it is expressed as:
[0033]
[0034] in, It's a temperature parameter. Indicates anchor point Similarity between handwritten features and positive samples Indicates anchor point Similarity between handwritten features and negative samples To be consistent with the above Multilayer perceptrons (MLPs) have the same structure. express Index of handwritten features from negative samples, This represents the size of the set of prototype samples of handwritten handwriting.
[0035] Step 303: Guide the training of the feature encoder using the contrastive learning loss function GuideNCE loss. .
[0036] Furthermore, step 4 includes the following steps:
[0037] Step 401: Given the handwritten handwriting to be queried and n real handwritten samples from the specified writer ;
[0038] Step 402: Transfer the handwritten handwriting Input into the trained feature encoder In the process, the handwritten features to be queried are obtained. ;
[0039] Step 403: Transfer the real handwritten sample The inputs are respectively fed into the trained feature encoder. In the process, n real handwritten features are obtained. Then, average the values to obtain the average characteristics. ;
[0040] Step 404: Calculate the handwritten features to be queried and average characteristics The cosine distance between them is denoted as The formula is:
[0041]
[0042] in, express Norm;
[0043] Step 405: Given a predefined threshold t, if the cosine distance Then the handwritten handwriting is determined. It must be the authentic handwriting of the designated writer; otherwise, it must be determined that it is not the authentic handwriting of the designated writer.
[0044] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0045] By employing a handwritten prototype learning strategy using the ProtoNCE loss function and a feature-guided learning strategy using the GuideNCE loss function, pseudo-paragraph guidance is used to enhance individual prototype feature learning. This enables the encoder to extract highly discriminative handwritten features from handwritten samples and perform verification analysis, thereby improving the performance and accuracy of handwritten verification. Attached Figure Description
[0046] Figure 1 shows a flowchart of the method for implementing the present invention;
[0047] Figure 2 shows a flowchart of step 4 of the present invention; Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some, not all, of the embodiments of this invention. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0049] To better understand the technical content of this embodiment, let's first introduce the explanation of the terms involved in this embodiment.
[0050] MLP: Multilayer Perceptron, is a feedforward artificial neural network model that maps multiple input datasets to a single output dataset.
[0051] : Norm refers to the square root of the sum of the squares of the elements in a pointer.
[0052] ResNet (Residual Network) is a convolutional neural network architecture in the field of deep learning.
[0053] Pseudo-paragraph: A text paragraph randomly composed of several independently written samples.
[0054] Loss function: Used to measure the degree of discrepancy between the model's predictions and the actual values.
[0055] Temperature parameter: A hyperparameter that controls the diversity and determinism of text generation.
[0056] Mutual information: In information theory, it is a measure of information, which is the amount of information about another random variable contained in one random variable.
[0057] Anchor point: A sample representing a certain class in the feature space, used to guide the model in classification or metric learning.
[0058] Handwriting prototype: refers to the class center of the writer, specifically manifested as the characteristic features in the feature space.
[0059] Class center: refers to the central location or representative feature used to describe a certain category (or category) of data.
[0060] Figure 1 shows a flowchart of an embodiment of the present invention. A handwriting feature extraction method based on a pseudo-paragraph handwriting prototype includes the following steps:
[0061] Step 1: Collect multiple handwritten text samples from multiple writers. For a single writer, randomly select several handwritten text samples and combine them into pseudo-paragraphs. Then, process them through a prototype encoder to obtain the handwritten handwriting prototype.
[0062] Step 2: For the handwriting prototype, construct a positive sample set and a negative sample set and design a prototype contrastive learning loss function ProtoNCE loss to obtain mutual information between handwriting prototypes with the highest similarity to the same writer, thereby obtaining a more discriminative handwriting prototype.
[0063] Step 3: Using the more discriminative handwriting prototype as an anchor point, the feature encoder selects positive and negative handwriting features and designs a Guided Contrast Learning loss function (GuideNCE loss) to guide the training of the feature encoder to obtain handwriting features that represent the writer's characteristics.
[0064] Step 4: In the query phase, multiple real handwriting samples of the specified writer and the handwriting to be queried are processed by the trained feature encoder to obtain the handwriting features to be queried and the real handwriting features. The average feature of the real handwriting features is calculated, and then the cosine distance between the handwriting features to be queried and the average feature is calculated. The cosine distance is compared with a predefined threshold to determine whether the handwriting belongs to the real handwriting of the specified writer.
[0065] Perform step 1.
[0066] Specifically, step 1 includes the following steps:
[0067] Step 101: Collect several independent individual handwritten text samples from multiple writers, wherein the individual handwritten text sample may be a single text image;
[0068] Step 102: For a given writer, randomly select m handwritten text samples and combine them into a pseudo-paragraph. ;
[0069] Step 103: The pseudo-paragraph After the prototype encoder Processing to obtain the prototype of the handwritten handwriting ;
[0070] Step 104: For different writers, repeat steps 102 to 103 above to obtain multiple pseudo-paragraphs corresponding to each writer and generated randomly. and multiple handwriting prototypes. .
[0071] Specifically, step 102 includes the following specific steps:
[0072] Step 10201: Randomly divide m handwritten text samples of a certain writer into several subsets, each subset containing several of the handwritten text samples, and randomly combine them into text lines; for example, for 16 text images written by a certain writer, divide them into 4 subsets on average, each subset containing 4 text images, and each subset is randomly concatenated into a text line.
[0073] Step 10202: Select a text line of a certain length as a reference, and crop the remaining text lines to match the width uniformly, so that the widths of each text line are aligned with each other; since the number of selected text images is also random, the size of each subset may differ, so the shortest text line is used as a reference to crop the other text lines to make the widths of each text line aligned, which is convenient for calculation.
[0074] Step 10203: The text lines are spliced together to form the pseudo-paragraph image, and the pixels of the pseudo-paragraph image are adjusted to match the prototype encoder; that is, the text lines after width alignment are spliced together in a vertical, horizontal or combined vertical and horizontal manner to form a pseudo-paragraph image in the form of a paragraph, and the pixels of the pseudo-paragraph image are adjusted to 512×512 to adapt to the 512-dimensional encoding vector of the prototype encoder.
[0075] Perform step 2.
[0076] Specifically, step 2 includes the following specific steps:
[0077] Step 201: Select a batch containing data from several writers with a batch size of [missing information]. Given a set of handwriting prototypes, select a specific handwriting prototype of a specific writer from the set, and use the other handwriting prototypes of that writer as the positive sample set, denoted as . The handwriting prototypes of other different writers are used as the negative sample set, denoted as... ;
[0078] Step 202: Utilize the positive sample set and the negative sample set The ProtoNCE loss function is designed to obtain mutual information between handwriting prototypes with the highest similarity to the same writer, thereby obtaining more discriminative handwriting prototypes. ;
[0079] The ProtoNCE loss function combines the ideas of contrastive learning and clustering. It improves the InfoNCE loss by dynamically estimating the concentration of feature distributions around each handwriting prototype. This loss function encourages the sample embeddings of the same writer to be closer to the corresponding handwriting prototype, while being farther away from the handwriting prototypes of other writers. This enables a comprehensive learning of the writer's overall style and local style, thereby guiding the generation of more distinctive handwriting prototypes.
[0080] Specifically, the steps of step 201 are as follows:
[0081] Step 20101: First, process the data containing information from several writers and in batches of a certain size. The set of handwritten handwriting prototypes is denoted as Each handwriting prototype corresponds to a writer, and the same writer can correspond to multiple handwriting prototypes. This represents the index of the handwritten handwriting prototype described in the set. Denotes the set of indices; wherein, index This indicates that it is different from Other indices are used to exclude the specified handwriting prototype itself in order to improve the model's recognition ability and avoid overfitting of the recognition results;
[0082] Step 20102: Next, specify a writer within the set of handwriting prototypes. A prototype of a certain handwritten handwriting Then, other handwriting prototypes of the writer are used as the positive sample set. , represented as And using handwriting prototypes from other different writers as negative sample sets. , represented as ;
[0083] For ease of understanding, the following is an exemplary example. The indices of the handwritten handwriting prototypes are respectively This includes both from the writer The handwriting prototypes also include handwriting prototypes from other writers, presumably from the writer. The prototype indices of all handwritten strokes are {1, 2, 3, 4}, while the prototype indices of handwritten strokes from other writers are {5, 6, 7, ...}. Specify a place belonging to the writer Handwriting prototype If its index is 2, then the positive sample set The negative sample set is indexed as {1, 3, 4}. The index is {5, 6, 7, ...,}
[0084] Specifically, the steps of step 202 are as follows:
[0085] Design a prototype contrastive learning loss function, ProtoNCE loss, denoted as... Specifically, it is expressed as:
[0086]
[0087] in, It's a temperature parameter. for any element, This indicates that a prototype of the handwritten handwriting is specified. This indicates the similarity between a specified handwriting prototype and a positive sample. This indicates the similarity between a specified handwriting prototype and any element within the set of handwriting prototypes. This refers to a multilayer perceptron (MLP) used to project the handwritten prototype onto an application. of In the metric space;
[0088] By employing a ProtoNCE loss training optimization method, the similarity between a given handwriting prototype and positive samples is significantly greater than its similarity with negative samples. Simultaneously, the similarity between the given handwriting prototype and negative samples is minimized. When the ProtoNCE loss value approaches the ideal value, a more discriminative handwriting prototype is calculated. .
[0089] Perform step 3.
[0090] Specifically, step 3 includes the following steps:
[0091] Step 301: Transform the more distinctive handwriting prototype As anchor points, a total of several different writers were selected. The system was trained using a set of more discriminative handwriting prototype samples, in which writers were selected. Another random sample was processed by the feature encoder Processing yields positive sample handwritten features Select different writers -1 random samples are processed by the feature encoder respectively Processing yields negative sample handwritten features ;
[0092] In other words, by the writer Handwriting prototype As anchor points, a total of several writers from different authors were selected. A set of prototype samples of handwritten handwriting, wherein the set contains a writer. Another random sample, while random samples from other writers were selected. -1 item;
[0093] Next, this Each handwritten handwriting prototype sample was processed by a feature encoder. The processing yields handwriting features, including the writer's... Another random sample was processed to obtain positive sample handwritten features. Other random samples were processed to obtain negative sample handwritten features. ;
[0094] At the same time, to prevent overfitting of the obtained handwritten features, the set does not include the writer. Anchor point handwriting prototype ;
[0095] Step 302: Design the contrastive learning loss function GuideNCE loss, denoted as... Specifically, it is expressed as:
[0096]
[0097] in, It's a temperature parameter. Indicates anchor point Similarity between handwritten features and positive samples Indicates anchor point Similarity between handwritten features and negative samples To be consistent with the above Multilayer perceptrons (MLPs) have the same structure. express -1 index of handwritten features from negative samples, This represents the size of the set of prototype samples of handwritten handwriting.
[0098] Step 303: Guide the feature encoder using the contrastive learning loss function GuideNCE loss. This approach makes handwriting features more similar among writers of the same type and more dissimilar among writers of different types, thereby training the feature encoder to learn more representative handwriting features, and ultimately achieving the desired result. Prototype of handwriting Alignment.
[0099] Perform step 4 (refer to Figure 2).
[0100] Specifically, step 4 includes the following steps:
[0101] Step 401: Given the handwritten handwriting to be queried and n real handwritten samples from the specified writer ;
[0102] Step 402: Transfer the handwritten handwriting Input into the trained feature encoder In the process, the handwritten features to be queried are obtained. ;
[0103] Step 403: Transfer the real handwritten sample The inputs are respectively fed into the trained feature encoder. In the process, n real handwritten features are obtained. Then, average the values to obtain the average characteristics. ;
[0104] Step 404: Calculate the handwritten features to be queried and average characteristics The cosine distance between them is denoted as The formula is:
[0105]
[0106] in, express Norm;
[0107] Step 405: Given a predefined threshold t, if the cosine distance Then the handwritten handwriting is determined. It must be the genuine handwriting of the designated writer; otherwise, it must be determined that it is not the genuine handwriting of the designated writer.
[0108] For example, for a predefined threshold t=0.2, if Since 0.1 < 0.2, the handwriting is determined to be handwritten. It must be the actual handwriting of the designated writer; otherwise... Since 0.3 > 0.2, the handwriting is determined to be handwritten. It is not the actual handwriting of the designated writer.
[0109] The technical principle of this invention is as follows: First, pseudo-paragraphs are constructed from handwritten text samples. Then, a prototype encoder and a prototype contrastive learning loss function (ProtoNCE loss) are designed to extract handwritten handwriting prototypes that simultaneously possess the writer's overall style and local style from the pseudo-paragraphs. Next, a feature encoder and a guided contrastive learning loss function (GuideNCE loss) are designed to extract more discriminative handwritten handwriting features from isolated samples. This handwritten handwriting prototype is used as information supervision, and the unidirectional guided feature encoder achieves effective individual feature extraction. Finally, the handwritten features to be queried are calculated. and average characteristics The cosine distance between the two points is used to determine the handwriting style of the query. Whether it is the writer's authentic handwriting.
[0110] This invention employs a learning strategy combining ProtoNCE loss and GuideNCE loss to effectively extract handwriting features that possess both the writer's overall and local style, further improving the accuracy and comprehensiveness of handwriting recognition. Specifically, ProtoNCE loss guides the prototype encoder to extract handwriting prototypes from pseudo-paragraphs, while GuideNCE loss guides the feature encoder to extract highly discriminative handwriting features from these prototypes, thus effectively improving handwriting verification performance and enabling the accurate identification of a writer's identity using given text samples.
[0111] In this invention, the prototype encoder and feature encoder Both are implemented using the standard ResNet18 architecture, trained for 200 epochs on a single RTX 4090 GPU using the RMSProp optimizer, with a batch size of 64, a base learning rate of 0.005, linear warm-up for the first 10 epochs, and then cosine decay to 0.
[0112] The technical features or steps of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features or steps in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0113] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
Claims
1. A method for extracting handwriting features based on pseudo-paragraph handwriting prototypes, characterized in that, Includes the following steps: Step 1: Collect multiple handwritten text samples from multiple writers; For a single writer, several handwritten text samples are randomly selected and combined into pseudo-paragraphs, and then processed by a prototype encoder to obtain a handwritten handwriting prototype; the handwritten text sample is a single text image; Step 2: For the handwritten handwriting prototype, a positive sample set and a negative sample set are constructed and a prototype contrastive learning loss function ProtoNCE loss is designed to obtain mutual information between handwritten handwriting prototypes with the highest similarity to the same writer, thereby obtaining a more discriminative handwritten handwriting prototype; Step 3: Using the more discriminative handwriting prototype as an anchor point, the feature encoder selects positive and negative handwriting features and designs a Guided Contrast Learning loss function (GuideNCE loss) to guide the training of the feature encoder to obtain handwriting features that represent the writer's characteristics. Step 4: In the query phase, multiple real handwriting samples of the specified writer and the handwriting to be queried are processed by the trained feature encoder to obtain the handwriting features to be queried and the real handwriting features. The average feature of the real handwriting features is calculated, and then the cosine distance between the handwriting features to be queried and the average feature is calculated. The cosine distance is compared with a predefined threshold to determine whether the handwriting belongs to the real handwriting of the specified writer. Step 2 includes the following steps: Step 201: Selecting a batch of writers with a batch size of [number missing]. Given a set of handwriting prototypes, select a specific handwriting prototype of a specific writer from the set, and use the other handwriting prototypes of that writer as the positive sample set, denoted as . The handwriting prototypes of other different writers are used as the negative sample set, denoted as... Step 202: Utilize the positive sample set and the negative sample set The ProtoNCE loss function is designed to obtain mutual information between handwriting prototypes with the highest similarity to the same writer, thereby obtaining more discriminative handwriting prototypes. Step 202 includes the following steps: designing a prototype contrastive learning loss function, ProtoNCE loss, denoted as... Specifically, it is expressed as: ;in, It's a temperature parameter. This represents the size of the set of handwritten handwriting prototypes. This represents the index of the handwritten handwriting prototype described in the set. Represents the set of indices, indexes This indicates that it is different from Other indexes, for any element, This indicates that a prototype of the handwritten handwriting is specified. Represents any element in the set of handwriting prototypes. This indicates the similarity between a specified handwriting prototype and a positive sample. This indicates the similarity between a specified handwriting prototype and any element within the set of handwriting prototypes. This represents a multilayer perceptron (MLP); step 3 includes the following steps: Step 301: [The text abruptly ends here, likely due to an incomplete sentence or a formatting error.] As anchor points, a total of several different writers were selected. The system was trained using a set of more discriminative handwriting prototype samples, in which writers were selected. Another random sample was processed by the feature encoder Processing yields positive sample handwritten features Select different writers Each random sample is processed by a feature encoder. Processing yields negative sample handwritten features Step 302: Design the contrastive learning loss function GuideNCE loss, denoted as... Specifically, it is expressed as: ;in, It's a temperature parameter. Indicates anchor point Similarity between handwritten features and positive samples Indicates anchor point Similarity between handwritten features and negative samples To be consistent with the above Multilayer perceptrons (MLPs) have the same structure. express Index of handwritten features from negative samples, Indicates the size of the prototype sample set of handwritten handwriting; Step 303: Use the contrastive learning loss function GuideNCE loss to guide the training of the feature encoder. 。 2. The handwriting feature extraction method based on pseudo-paragraph handwriting prototype guidance according to claim 1, characterized in that, Step 1 includes the following steps: Step 101: Collect several independent individual handwritten text samples from multiple writers; Step 102: For a certain writer, randomly select m handwritten text samples and combine them into a pseudo-paragraph. Step 103: The pseudo-paragraph After the prototype encoder Processing to obtain the prototype of the handwritten handwriting Step 104: For different writers, repeat steps 102 to 103 above to obtain multiple pseudo-paragraphs corresponding to each writer and generated randomly. and multiple handwriting prototypes. 。 3. The handwriting feature extraction method based on pseudo-paragraph handwriting prototype guidance according to claim 2, characterized in that, Step 102 includes the following steps: Step 10201: Randomly divide m handwritten text samples of a certain writer into several subsets, each subset containing several handwritten text samples, and randomly combine them into text lines; Step 10202: Select the shortest text line as a reference, and trim the remaining text lines to uniformly match the width, so that the widths of each text line are aligned with each other; Step 10203: Concatenate each text line to form the pseudo-paragraph and adapt it to the prototype encoder.
4. The handwriting feature extraction method based on pseudo-paragraph handwriting prototype guidance according to claim 1, characterized in that, Step 4 includes the following steps: Step 401: Given the handwritten handwriting to be queried and n real handwritten samples from the specified writer Step 402: Transfer the handwritten handwriting Input into the trained feature encoder In the process, the handwritten features to be queried are obtained. Step 403: Transfer the real handwritten sample The inputs are respectively fed into the trained feature encoder. In the process, n real handwritten features are obtained. Then, average the values to obtain the average characteristics. Step 404: Calculate the handwritten features to be queried and average characteristics The cosine distance between them is denoted as The formula is: ;in, express Norm; Step 405: Given a predefined threshold t, if the cosine distance Then the handwritten handwriting is determined. It must be the authentic handwriting of the designated writer; otherwise, it must be determined that it is not the authentic handwriting of the designated writer.
Citation Information
Patent Citations
Remote sensing image change detection method based on axial displacement feature interaction and prototype guidance penalty constraint
CN118608948A
Independent processing style and content feature combined Chinese handwritten font migration method
CN119692305A