A calligraphy scoring method with both form and spirit

By constructing a self-supervised classification model and feature fusion method, the problems of recognition accuracy and maintainability in calligraphy scoring are solved, realizing a calligraphy scoring system that combines form and spirit. It provides accurate calligraphy style recognition and scoring, helping users improve their calligraphy skills and charm.

CN117690151BActive Publication Date: 2026-06-26TONGJI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TONGJI UNIV
Filing Date
2023-12-26
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies for calligraphy scoring suffer from problems such as insufficient recognition accuracy, inability to identify calligraphy styles beyond the sample labels, low maintainability, and writing position deviation affecting the score, thus failing to provide comprehensive and detailed calligraphy education.

Method used

A self-supervised classification model is constructed, which combines low-dimensional character structure features and high-dimensional features. The model obtains the feature centers of calligraphy style through self-supervised learning, and uses tilt projection and grayscale matrix analysis to analyze the similarity and spirit of the characters. The model is then integrated with a scoring method to provide a scoring system that combines both form and spirit.

Benefits of technology

It achieves accurate identification and scoring of calligraphy styles, reduces the impact of writing position deviation, improves the maintainability of the system and the accuracy of scoring, and can provide timely scoring and guidance to help users improve their calligraphy skills and spirit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117690151B_ABST
    Figure CN117690151B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of computer vision, and proposes a calligraphy scoring method with both form and spirit, comprising the steps of: preparing a calligraphy sample library of stele and tablet; constructing and training a self-supervised classification model for calligraphy style, obtaining the standard'style feature center' of stele and tablet; performing form and spirit similar feature analysis on the user uploaded calligraphy picture; obtaining the total score after weighting the form and spirit similar scores, and completing the scoring of the user's calligraphy. The self-supervised classification model has the characteristic that the stele and tablet templates can be added; the present application proposes the idea of fusing the 'low-dimensional' character structure features that can be captured by human eyes and the hidden 'high-dimensional' features, which helps the model to more accurately capture the style information of calligraphy; the scoring method can score and point the user uploaded practice pictures in time, and can obtain intelligent scoring and rating, clearly understand one's own shortcomings, understand the charm and structure of calligraphy, and make progress faster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] It involves the field of computer vision. Background Technology

[0002] Calligraphy, as a typical representative of excellent traditional culture, is a unique visual art. Unlike other phonetic writing systems, Chinese characters are a combination of "form," "sound," and "meaning," possessing strong expressive power.

[0003] Society today is placing increasing emphasis on calligraphy education for primary and secondary school students, further elevating calligraphy's status within traditional aesthetic education. However, there is still a shortage of qualified teachers in this field, and the "one-to-many" teaching model cannot provide comprehensive and detailed guidance to each student, hindering calligraphy practitioners from learning and understanding the structure and spirit of calligraphy.

[0004] CN113128442A (titled "A Method for Recognizing and Scoring Chinese Calligraphy Styles Based on Convolutional Neural Networks") utilizes convolutional neural network technology to construct different models for different calligraphy styles through repeated iterations and verification of calligraphy samples, thereby achieving the effect of recognizing calligraphy styles. Its specific steps are as follows: First, acquire images of calligraphy works; then, preprocess the calligraphy work images to identify each individual character image; finally, input the individual character images into a deep convolutional neural network to obtain the calligraphy style recognition result for each individual character. The drawback of CN113128442A is that the calligraphy scoring using convolutional neural networks is not accurate enough. For the ever-changing styles of calligraphy, accurately identifying calligraphy styles is a major challenge. Convolutional neural networks are closed-set recognition systems, unable to recognize calligraphy characters beyond the sample labels, thus reducing recognition accuracy. Furthermore, whenever the dataset is expanded to include new styles, manual relabeling and model retraining are required, resulting in low maintainability.

[0005] CN112597876A (titled "A Method for Judging Calligraphy Characters Based on Feature Fusion") uses convolutional neural network technology to identify calligraphy characters, extract their skeletons, and calculate the distance between each inflection point and the center point as local feature evaluation. The skeleton is then divided into a nine-square grid, and Hu invariant moments are used to calculate the difference between the input character's skeleton and the skeleton of a reference character in the standard library, with each corresponding nine-square grid serving as the overall feature. Finally, the local and overall features are weighted to obtain the scoring result. The drawback of CN112597876A is that this method relies on nine-square grid segmentation, but calligraphy practitioners cannot accurately grasp the writing position during practice, while the reference character library is almost perfectly centered. This leads to the positional deviation of the calligraphy character within the grid affecting the scoring result. Furthermore, extracting the skeleton of the complete calligraphy character results in some loss of important information such as stroke order and ink usage. Summary of the Invention

[0006] This invention utilizes deep learning methods in computer vision to analyze the high and low dimensional features of font structure and style in calligraphy works, and constructs an intelligent calligraphy scoring system that combines form and spirit. This system alleviates the current shortage of calligraphy teachers, helps beginners improve their skills and understand the charm of calligraphy, and promotes the inheritance and development of calligraphy.

[0007] The technical solution of this invention is as follows:

[0008] A method for evaluating calligraphy that combines form and spirit includes the following steps:

[0009] Step 1: Prepare a library of calligraphy sample characters from rubbings and inscriptions;

[0010] Step 2: Construct a self-supervised classification model for calligraphy style. Train the self-supervised classification model based on the calligraphy character sample library of rubbings from Step 1, and obtain the standard "style feature center" of the rubbings.

[0011] Step 3: Perform shape resemblance analysis and spirit resemblance analysis on the calligraphy images uploaded by users;

[0012] Step 4: After weighting the similarity scores obtained in Step 3, obtain the total score and complete the scoring of the user's calligraphy.

[0013] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0014] (1) This invention proposes a self-supervised classification model oriented towards writing style. During training, there is no need to manually assign labels to the training set. The model can automatically form cluster centers for images within the same type of rubbings. Therefore, even for rubbings not included in the training set during model training, the model can be directly input into the sub-supervised classification model to calculate its standard "style feature center". That is, the trained model has the feature that rubbings can be added, and has better maintainability.

[0015] (2) This invention uses an image difference measurement algorithm based on tilt projection, feature point sets, and grayscale matrix to analyze the "form similarity" difference between the practice work and the reference character. While preserving the original character information as much as possible, it avoids the influence of writing position on the results. Practitioners can also use Xuan paper other than the rice-shaped grid to upload their work. In addition, this invention proposes the idea of ​​fusing the "low-dimensional" character structure features that can be captured by the human eye with the hidden "high-dimensional" features, which helps the model to more accurately capture the charm and style information of calligraphy characters at the "spiritual similarity" level.

[0016] (3) The scoring method designed in this invention can score and guide the user's uploaded practice pictures in a timely manner, and can obtain intelligent scores, clearly understand their own shortcomings, understand the charm and structure of calligraphy, and make progress faster. Attached Figure Description

[0017] Figure 1 is the flow chart of the method of the present invention.

[0018] Figure 2 is the implementation logic flow chart of the present invention.

[0019] Figure 3 is the schematic diagram for extracting five simple structural features including aspect ratio, center of gravity position, average stroke width, inclination angle of core strokes, and black-and-white ratio.

[0020] Figure 4 is the schematic diagram of the structure and training process of the self-supervised classification model for writing style proposed in the present invention.

[0021] Figure 5 is the schematic diagram of binarization, segmentation using pixel projection, and normalization of picture specifications in the preprocessing stage.

[0022] Figure 6 is the logarithmic-angle histogram plotted by chi-square difference metric. For the same calligraphy character "Si", the histogram similarity formed by point A and point A' is higher than that of point B.

[0023] Figure 7 is the schematic diagram of vertical projection at angles of 0°, 90°, 45°, and -45° respectively.

[0024] Figure 8 is the schematic diagram for extracting the outline and skeleton point set of the calligraphy character "Si".

[0025] Figure 9 is the schematic diagram of point set matching obtained after the skeleton and outline pass through the Hungarian algorithm. The yellow dots represent the input picture, and the blue triangle points represent the reference character picture.

[0026] Figure 10 is the schematic diagram of thin plate spline interpolation transformation for the input picture. Detailed implementation manners

[0027] The technical solution provided by the present application will be further described below in combination with specific embodiments and their accompanying drawings. The advantages and features of the present application will be clearer in combination with the following description.

[0028] As Figure 1 , Figure 2 shown, a calligraphy scoring method that combines form and spirit includes the following steps:

[0029] Step 1: Prepare a calligraphy character sample library of stele inscriptions.

[0030] A database of calligraphy samples from different rubbings of ancient inscriptions was collected. All images were preprocessed, including grayscale conversion, binarization, and segmentation into individual characters (white background with black text). The size of each character image was then normalized, and the images were categorized by set of rubbings. As an example and not a limitation, the normalized character image size is 256*256 pixels.

[0031] For a specific calligraphy image in a set of rubbings, the image of the calligraphy and the image obtained by data augmentation are denoted as positive samples, while images of the same calligraphy in other rubbings in the rubbings sample library are denoted as negative samples. This forms a large number of "positive-negative sample" comparison pairs. The generated comparison pairs are then divided, with 80% used as the training set and 20% as the test set.

[0032] Step 2: Construct a self-supervised classification model for calligraphy style. Train the self-supervised classification model based on the calligraphy character sample library from Step 1 and obtain the standard "style feature center" of the rubbings.

[0033] The self-supervised classification model includes a feature extraction layer, a feature fusion layer, and a classifier. The feature extraction layer extracts high- and low-dimensional feature vectors, the feature fusion layer fuses these vectors to obtain the "writing style feature vector" of the calligraphy character, and the classifier predicts which set of calligraphic rubbings a given calligraphy character X belongs to. The model extracts and fuses high- and low-dimensional features through the feature extraction and feature fusion layers to obtain the writing style feature vector. Then, the classifier and loss function are used for prediction and gradient descent, respectively. Through iterative training, a self-supervised classification model is obtained, and the standard "style feature center" of each rubbing in the sample set collected in step 1 is determined, serving step 3.

[0034] The structure and training process of the self-supervised classification model are described in detail below:

[0035] 2.1 Feature Extraction Layer

[0036] 2.1.1 Low-dimensional features

[0037] From the perspective of the character structure in calligraphy, seal script, regular script, and cursive script are clearly different from each other, and different calligraphers also have their own unique habits. That is, the formation of style also depends on the low-dimensional basic character structure characteristics.

[0038] The low-dimensional basic glyph structural features will be represented by quantitative analysis of basic glyph structural features such as font center of gravity and stroke width.

[0039] Specifically, for the binarized and normalized calligraphy image P, its character structure features (such as...) Figure 3 The quantification is as follows.

[0040] Font center of gravity: =( ,

[0041] Stroke width: First, randomly and uniformly sample to obtain the discrete point set of the input character skeleton. .by Draw a circle centered at the input image, and take the maximum radius of the circle such that 95% of the points inside the circle are the foreground points of the original input image. Stroke width at the location , forming a set The average width of the strokes is recorded as a set. The mean; the maximum and minimum widths of the strokes are the set. The maximum and minimum values.

[0042] Aspect Ratio: Obtain the height and width of the smallest rectangle in P that is tangent to the four sides of the foreground text, and record its ratio.

[0043] Foreground / Background Pixel Ratio: Records the foreground and background pixel ratio within the rectangle obtained during the aspect ratio acquisition process.

[0044] Core stroke inclination angle: Extract the font skeleton, disconnect the inflection points of the skeleton image, obtain the resulting discrete lines, select the longest skeleton, fit it into a straight line, and use its slope to represent the inclination angle of the core stroke in the calligraphy.

[0045] For images of calligraphy characters, low-dimensional feature vectors, namely basic character structure feature vectors, are extracted manually.

[0046] 2.1.2 High-dimensional features

[0047] For images of calligraphy characters, a deep neural network is used to extract their high-dimensional feature vectors. Specifically, the high-dimensional features are obtained through a deep convolutional neural network, ResNet.

[0048] 2.2 Feature Fusion Layer

[0049] By combining low-dimensional glyph structural features with high-dimensional features, the effect of "high- and low-dimensional feature fusion" can be achieved during evaluation.

[0050] For calligraphy images, the high-dimensional feature vector extracted by a deep neural network is fused with the low-dimensional feature vector, i.e., the basic character structure feature vector, extracted manually, to obtain the "writing style feature vector" of the calligraphy.

[0051] 2.3 Classifier Design

[0052] Classifiers during model training, such as Figure 4 As shown. Figure 4 It is assumed that there are four sets of rubbings in the training set, so there are four feature centers c1, c2, c3, and c4 in the classifier.

[0053] The input to the classifier consists of two parts:

[0054] The first part is the "writing style feature vector" of all calligraphic characters, which is obtained from all calligraphic characters in all rubbings of inscriptions in the training set obtained in step 1 through the feature fusion layer in step 2.2;

[0055] The second part is the "writing style feature vector" of a certain calligraphy character X, which is obtained from a certain calligraphy character X in the training set obtained in step 1 through the feature fusion layer in step 2.2.

[0056] The output of the classifier is the classifier's prediction of which set of inscriptions X belongs to.

[0057] The specific workflow of the classifier is as follows:

[0058] First, the average value of the input "writing style feature vector" is calculated for each set of calligraphic works, thus obtaining the "style feature center" of each set of calligraphic works in the training set at the current training stage. Figure 4 (Assuming there are only 4 sets of rubbings in the training set).

[0059] Next, calculate the Euclidean distance between the "writing style feature vector" of each input calligraphy character X and the "style feature center" of each stele in the current training stage. The classifier will assign the calligraphy character X to the stele corresponding to the "style feature center" with the smallest Euclidean distance between it and the "writing style feature vector", which is the output of the classifier.

[0060] 2.4 Training and Loss Function Design of Self-Supervised Classification Model

[0061] Since each set of rubbings can be considered to have a consistent style, this invention uses a complete set of rubbings as the unit for training and style extraction.

[0062] This method employs the Minibatch approach, using the training set obtained in step 1 to train the self-supervised classification model. The following loss function is used to evaluate the model's prediction results:

[0063]

[0064] in Indicates a training set Except Other samples . express Positive samples in the dataset. This represents the "writing style feature vector" of sample j obtained from the feature fusion layer in step 2.2 during the current training phase. It is a multilayer perceptron composed of multiple fully connected layers, used to project features into an L2-normalized feature space. This represents a slight perturbation caused by random noise, used to increase the robustness and diversity of the model. This is the regularization parameter. Let be the i-th column of the weight matrix W of the deep convolutional network, which is a vector. Let W represent the sum of all numbers in the i-th column of the weight matrix W of a deep convolutional network; it is a numerical value.

[0065] Figure 4 The input for training is illustrated by a calligraphic character X from the training set: images from the training set are input into the model and iterated continuously, thereby updating the weights of the deep convolutional neural network in the feature extraction layer. During each training round, the "style feature centers" of all calligraphic works are updated due to the changes in the weights of the deep convolutional neural network. As the number of training rounds increases, the obtained "style feature centers" can increasingly accurately represent the spirit and style of each set of calligraphic works in the training set. Every certain number of rounds, the classification performance of the current model on the test set is evaluated.

[0066] This method uses the AUC (Area Under Curve) metric to evaluate the model's classification results on the test set. During model training, an ROC (Receiver Operating Characteristic) curve is plotted using the classification performance of a series of positive and negative samples. The area under the ROC curve is the AUC value. A higher AUC value indicates better model classification performance and also represents better performance in extracting the "writing style feature vector" of calligraphic characters.

[0067] The model that achieves the highest AUC value on the test set will be the self-supervised classification model used subsequently.

[0068] 2.5 Obtain the standard "style feature center" for all rubbings and inscriptions in the calligraphy character sample library.

[0069] The calligraphy characters collected in step 1 are grouped into a set of calligraphic rubbings and input into a trained self-supervised classification model. Through feature extraction and fusion layers, the "writing style feature vectors" of all characters are obtained. The average of these vectors is then calculated using a classifier to obtain the "style feature center" for each set of rubbings. Since the model used performs optimally on the test set, the "style feature center" extracted in this step is considered to best represent the spirit and style of each rubbing in the calligraphy character sample library and is denoted as the standard "style feature center".

[0070] Step 3: Perform shape resemblance analysis and spirit resemblance analysis on user-uploaded images.

[0071] 3.1 Preprocessing uploaded images and recognition

[0072] like Figure 5As shown, when a user uploads an image, they first need to select the name of the calligraphy model they wish to practice. Secondly, if the uploaded image is a complete work, the system needs to preprocess it, including grayscale conversion, binarization, segmentation into individual characters, and image size normalization, to obtain the individual characters from the work for the user to select. Users can also directly upload images of individual characters. As an example, and not a limitation, the normalized image size for each character is 256*256 pixels.

[0073] After recognizing a single character image at this stage, this method can find the "scoring reference character" corresponding to that character in the relevant rubbings.

[0074] 3.2 Perform similarity feature analysis on the single-character images uploaded by users for evaluation.

[0075] This invention uses three methods—pixel projection histogram analysis, image difference based on feature point set, and matrix difference measurement based on grayscale image—to analyze and compare the distribution and positional relationship of pixel point sets in calligraphy characters, as an evaluation of the "similarity" of the input characters.

[0076] The user-uploaded image of a single character to be evaluated is considered the input character, and the corresponding "scoring reference character" is considered the reference character.

[0077] 3.2.1 Pixel Projection Analysis

[0078] The pixel distribution histogram is obtained by pixel projection. To improve the reliability of the results, this invention analyzes the input character and reference character (denoted as ) at different angles. and The final processed result is obtained by projecting the histogram. Evaluation results. Determined by two values—overlap ratio Correlation .

[0079]

[0080]

[0081] To enhance the reliability of the results, multi-angle experiments were conducted to calculate the average value (e.g., Figure 7 (Projections were performed at 0°, 90°, 45°, and 45° respectively), and finally, a weighted similarity was obtained. In the formula As a parameter, this method takes .

[0082]

[0083] 3.2.2 Image difference analysis based on feature point sets.

[0084] Obtain the skeleton and outline points of the input character and the reference character, and randomly select some points at equal intervals (e.g. Figure 8 Then, the obtained input character set and reference character set are processed. Calculate the logarithmic distance matrix and angle matrix of the point set using the following formulas:

[0085]

[0086] Where dist2 represents the Euclidean distance between two points; mean is the average distance between all pairs of points in the point set. Dividing by mean makes the data results insensitive to image size; taking the logarithm normalizes the results to avoid excessive data differences.

[0087] If given a point Based on the two matrices above, we can draw... The histogram of differences between the given point set and other points is constructed as follows: the horizontal axis represents angle, dividing the (0°, 360°) region into 12 equally spaced intervals; the vertical axis represents logarithmic distance, with five intervals defined by endpoints of 0, 0.125, 0.25, 0.5, 1.0, and 2.0. Intervals exceeding 2.0 are considered too far apart and are disregarded. By counting the number of points within each of the 60 regions in the histogram, the difference between the given point and other points can be obtained. The feature matrix. After normalization, the similarity matrix between two point sets can be obtained through chi-square statistics. The chi-square statistical variance can be obtained by dividing the weighted minimum loss value per row by the number of columns and the minimum loss value per column by the number of rows. .

[0088] Processing using the Hungarian algorithm By performing point set matching between two images, we can obtain the point set. Point correspondence in (e.g.) Figure 9 Then, the thin-plate spline interpolation function (TPS, spatial mapping algorithm) is introduced, which fits the input point set to the target point set by deforming and mapping the original two-dimensional image, such as... Figure 10 This results in total bending energy. The minimum is reached. Finally, the point set is obtained by linearly weighting the bending energy according to the empirical formula. Similarity between :

[0089]

[0090] 3.2.3 Image difference measurement based on grayscale matrix.

[0091] The input character and reference character images are directly converted to grayscale and then transformed into two matrices. (Assume all specifications are) Then merge the two matrices column-wise into a new matrix. .Bundle Each row is copied 2n times, meaning each data point is expanded to 2n parts. The sum between any two data points is calculated, and the coordinates in the resulting matrix are... represent The Middle row data and the first The distance between rows of data. Then adjust the Gaussian kernel function. The values ​​are used to transform the two matrices into the final kernel matrix. Finally, the kernel matrix is ​​divided into four parts, and the distance between the source domain data and the target domain data is calculated. The result is denoted as... .

[0092]

[0093] in In order to achieve expectations, For function set A function in which makes It has a maximum value.

[0094] 3.3 Analyze the similarity features of the single-character images uploaded by users for evaluation.

[0095] The user-uploaded image of the single character to be evaluated is input into the self-supervised classification model trained in step 2 of this method, which is oriented towards writing style, to obtain the "calligraphy style feature vector" of the character. This is compared with the standard "stylish characteristic center" of the calligraphic models being practiced. The Euclidean distance between characters is used to represent the similarity in style and spirit between the character and the model inscription being practiced. The specific formula is as follows:

[0096]

[0097] This is the score given for the "spiritual resemblance" of the calligraphy. .

[0098] Step 4: After weighting the similarity scores obtained in Step 3, obtain the total score and complete the scoring of the user's calligraphy Chinese characters.

[0099] The information obtained in step 3 above , , , The four results are treated as four features, and the final score is obtained through linear weighting. This is the system's score for the character. The weighted scoring formula is:

[0100]

[0101] The four coefficients in the formula This can be obtained through linear regression analysis, specifically:

[0102] First, a large dataset of calligraphy characters of various styles was collected, and experts were asked to score each character. The scoring range was as follows: This yields the scoring dataset.

[0103] Then, the score assigned by the experts is used as the value of the word. Then, through step 3, we obtain the calligraphy characters. Rating value.

[0104] Next, in the dataset of calligraphic characters The numerical values ​​are slightly perturbed and used as input. A linear regression is performed with the Score as the target value to finally obtain the result that best fits the Score dataset. The value of is used as the coefficient of the weighted scoring formula.

[0105] Since the scoring dataset collected in this stage covers a large number of calligraphic characters of different styles and qualities, it is believed that the calculated coefficients are universal, that is, the formula is applicable to any input character.

[0106] The method of this invention enables users to upload images of their practice works, select calligraphy characters, extract and evaluate high- and low-dimensional "form and spirit" features, and obtain a final score. Simultaneously, when evaluating the calligraphic works practiced by users, the system also includes simple style descriptions, such as Yan Zhenqing's Duobao Pagoda Stele – square and dignified, Liu Gongquan's Xuanmi Pagoda Stele – crisp and vigorous, and Zhao Mengfu's Danba Stele – graceful and elegant, etc., to help users gain a deeper understanding of their own practice works and make progress.

[0107] The above description is merely a description of preferred embodiments of this application and is not intended to limit the scope of this application in any way. Any changes or modifications made by those skilled in the art based on the above-disclosed technical content should be considered as equivalent and valid embodiments and fall within the scope of protection of the technical solution of this application.

Claims

1. A method for evaluating calligraphy that combines form and spirit, characterized in that, Including the following steps: Step 1: Prepare a library of calligraphy sample characters from rubbings and inscriptions; Step 2: Construct a self-supervised classification model for calligraphy style. Train the self-supervised classification model based on the calligraphy character sample library of rubbings from Step 1, and obtain the standard "style feature center" of the rubbings. Step 3: Perform shape resemblance analysis and spirit resemblance analysis on the calligraphy images uploaded by users; Step 4: After weighting the similarity scores obtained in Step 3, obtain the total score to complete the scoring of the user's calligraphy; Step 2: The self-supervised classification model includes a feature extraction layer, a feature fusion layer, and a classifier. The feature extraction layer is used to extract high-dimensional feature vectors and low-dimensional feature vectors. The feature fusion layer is used to fuse the high-dimensional and low-dimensional feature vectors to obtain the "writing style feature vector" of the calligraphy character. The classifier is used to predict which set of calligraphic rubbings a certain calligraphy character X belongs to. For a set of calligraphic images in a stele, the "writing style feature vector" of all the calligraphic characters is obtained through the feature extraction layer and the feature fusion layer. The average value of the "writing style feature vector" of all the characters in the same stele is calculated by the classifier and used as the "style feature center" of the stele. Training and loss function design of self-supervised classification models: Training and style extraction are conducted on a complete set of rubbings and inscriptions. For a specific calligraphy image in a set of rubbings, the image of the calligraphy and the image obtained by data augmentation are denoted as positive samples, while the images of the same calligraphy in other rubbings in the rubbings sample library are denoted as negative samples. This forms a large number of "positive-negative sample" comparison pairs. The generated comparison pairs are then divided, with 80% used as the training set and 20% as the test set. The model is trained using the Minibatch approach. Euclidean distance is used to quantitatively measure the difference between the writing style feature vectors of calligraphic characters in the training set and the "style feature centers" of all rubbings in the current training phase. The model with the smallest difference is selected as the rubbing attribution for that calligraphic character. The following loss function is then used to evaluate the model's prediction results: in Represent a Except Other samples ; express Positive samples in; This represents the "writing style feature vector" of sample j obtained through the feature fusion layer at the current training stage; It is a multilayer perceptron composed of multiple fully connected layers, used to project features into an L2-normalized feature space; This represents slight perturbations caused by random noise, used to increase the robustness and diversity of the model; For regularization parameters; Let be the i-th column of the weight matrix W of the deep convolutional network, which is a vector. The sum of all numbers in the i-th column of the weight matrix W of a deep convolutional network is a numerical value. Images from the training set are input into the model and iterated continuously, thereby updating the weights of the deep convolutional neural network in the feature extraction layer. During each training round, the "style feature centers" of all rubbings are updated due to the changes in the weights of the deep convolutional neural network. As the number of training rounds increases, the obtained "style feature centers" can more and more accurately represent the charm and style of each set of rubbings in the training set. Every certain number of rounds, the classification effect of the current model on the test set is tested. The AUC (Area Under Curve) metric is used to evaluate the model's classification performance on the test set. During model training, the ROC (Receiver Operating Characteristic) curve is plotted using the classification results of a series of positive and negative samples. The area under the ROC curve is the AUC value. A higher AUC value indicates a better classification performance and also represents a better performance of the model in extracting the "writing style feature vector" of calligraphy characters. The model that achieves the highest AUC value on the test set is the self-supervised classification model.

2. The method as described in claim 1, characterized in that, Step 1: We collected calligraphy character sample libraries from different rubbings of ancient inscriptions, preprocessed all images including grayscale conversion, binarization, segmentation into individual characters, normalized the size of individual character images, and classified them into categories based on a set of rubbings of ancient inscriptions.

3. The method as described in claim 1, characterized in that, Step 2, feature extraction, specifically involves: For calligraphy images, low-dimensional feature vectors, i.e., low-dimensional basic character structure feature vectors, are extracted manually, and high-dimensional feature vectors are extracted using deep neural networks. The low-dimensional basic glyph structural features will be represented by quantitative analysis of basic glyph structural features such as font center of gravity and stroke width; Specifically, for the binarized and normalized calligraphy image P, its character structure features are quantified as follows: Font center of gravity: =( , Stroke width: First, randomly and uniformly sample to obtain the discrete point set of the input character skeleton. ;by Draw a circle centered at the input image, and take the maximum radius of the circle such that 95% of the points inside the circle are the foreground points of the original input image. Stroke width at the location , forming a set The average width of the strokes is recorded as a set. The mean; the maximum and minimum widths of the strokes are the set. Maximum and minimum values; Aspect Ratio: Obtain the height and width of the smallest rectangle in P that is tangent to the four sides of the foreground text, and record its ratio; Foreground / Background Pixel Ratio: Records the foreground and background pixel ratio within the rectangle obtained during the aspect ratio acquisition process; Core stroke inclination angle: Extract the font skeleton, disconnect the inflection points of the skeleton image, obtain the resulting discrete lines, select the longest skeleton, fit it into a straight line, and use its slope to represent the inclination angle of the core stroke in the calligraphy.

4. The method as described in claim 1, characterized in that, Step 2, classifier design: The input to the classifier consists of two parts: The first part is the "writing style feature vector" of all calligraphic characters, which is obtained by passing all calligraphic characters from all rubbings in the training set obtained in step 1 through the feature fusion layer; The second part is the "writing style feature vector" of a certain calligraphy character X, which is obtained from a certain calligraphy character X in the training set obtained in step 1 through the feature fusion layer; The output of the classifier is the classifier's prediction of which set of inscriptions X belongs to; The specific workflow of the classifier is as follows: First, the average value of the input "writing style feature vector" is calculated in space for each set of calligraphic works, so as to obtain the "style feature center" of each set of calligraphic works in the training set at the current training stage. Then, calculate the Euclidean distance between the "writing style feature vector" of the input calligraphy character X and the "style feature center" of each stele in the current training stage. The classifier assigns the calligraphy character X to the calligraphy stele corresponding to the "style feature center" with the smallest Euclidean distance between it and the "writing style feature vector", which is the output of the classifier.

5. The method as described in claim 1, characterized in that, The calligraphy characters collected in step 1 are grouped into a set of calligraphic rubbings and input into the trained self-supervised classification model. After feature extraction and feature fusion layers, the "writing style feature vector" of all characters can be obtained. The classifier calculates the average of these vectors to obtain the standard "style feature center" of each set of calligraphic rubbings.

6. The method as described in claim 1, characterized in that, Step 3 includes: Step 3.1 Preprocessing uploaded images and recognition When users upload images, they first need to select the name of the calligraphy model they are practicing. Secondly, if the uploaded image is a complete work, the system needs to perform preprocessing, including grayscale conversion, binarization, segmentation into individual characters, and normalization of the image size, to obtain the individual characters from the work for the user to select. After recognizing a single character image, the corresponding "scoring reference character" is found in the relevant rubbings; Step 3.2 Perform similarity feature analysis on the single-character images uploaded by users for evaluation. The distribution and positional relationship of pixel sets in calligraphy characters are analyzed and compared using three methods: pixel projection histogram analysis, image difference based on feature point sets, and matrix difference measurement based on grayscale images, as an evaluation of the "similarity" of the input characters. The single-character image to be evaluated uploaded by the user is regarded as the input character, and the "scoring reference character" corresponding to that character is regarded as the reference character. Step 3.3 Analyze the similarity features of the single-character images uploaded by users for evaluation. Input the user-uploaded image of the character to be evaluated into the self-supervised classification model trained in step 2, which is oriented towards writing style, to obtain the "calligraphy style feature vector" of the character. This is compared with the standard "stylistic features" of the calligraphic models being practiced. The Euclidean distance between characters is used as a measure of their similarity in spirit and style to the model inscription being studied; the specific formula is as follows: This is the score given for the "spiritual resemblance" of the calligraphy. .

7. The method as described in claim 6, characterized in that, The shape resemblance feature analysis in step 3.2 includes: 3.2.1 Pixel Projection Analysis By analyzing input characters from different angles and reference words The final processing result is obtained by projecting the histogram, and the result is evaluated. Determined by two values—overlap ratio Correlation : To enhance the reliability of the results, multi-angle experiments were conducted to calculate the average value, and finally, a weighted similarity was obtained. In the formula For parameters: 3.2.2 Image Difference Analysis Based on Feature Point Sets The skeleton and outline points of the input character and reference character are obtained. A subset of points are randomly selected at equal intervals. Then, the obtained input character point set and reference character point set are analyzed. Calculate the logarithmic distance matrix and angle matrix of the point set using the following formulas: in, dist2 calculates the Euclidean distance between two points; mean is the average distance between all pairs of points in the set, and dividing by mean makes the data results insensitive to image size; taking the logarithm normalizes the results to avoid excessive data differences. If given a point Draw based on the two matrices above The histogram of differences between the given point set and other points is constructed as follows: the horizontal axis represents angle, dividing the (0°, 360°) region into 12 equally spaced intervals; the vertical axis represents logarithmic distance, with five intervals defined by endpoints of 0, 0.125, 0.25, 0.5, 1.0, and 2.

0. Intervals exceeding 2.0 are considered too far apart and are disregarded. The number of points within each of the 60 regions in the histogram is counted to obtain the difference for each given point. The feature matrix; after normalization, the similarity matrix between the two point sets is obtained through chi-square statistics. The chi-square statistical variance is obtained by dividing the weighted minimum loss value per row by the number of columns and the minimum loss value per column by the number of rows. : Processing using the Hungarian algorithm Perform point set matching between the two images to obtain the point set. The correspondence between points in the diagram; then, the thin plate spline interpolation function is introduced to improve the total bending energy. To reach the minimum; finally, the point set is obtained by linearly weighting the bending energy according to the empirical formula. similarity between : 3.2.3 Image Difference Measurement Based on Gray-Level Image Matrix The input character and reference character images are directly converted to grayscale and then transformed into two matrices. All specifications are Then merge the two matrices column-wise into a new matrix. ;Bundle Each row is copied 2n times, meaning each data point is expanded to 2n parts. The sum between any two data points is calculated, and the coordinates in the resulting matrix are... represent The Middle row data and the first The distance between rows of data; then adjust the Gaussian kernel function. The values ​​are used to transform the two matrices into the final kernel matrix; finally, the kernel matrix is ​​divided into four parts, and the distance between the source domain data and the target domain data is calculated. The result is denoted as... : in In order to achieve expectations, For function set A function in which makes It has a maximum value.

8. The method as described in claim 7, characterized in that, Step 4: The results obtained in step 3 , , , The four results are treated as four features, and the final score is obtained through linear weighting. This is the system's score for the character, and the weighted scoring formula is: The four coefficients in the formula The results were obtained through linear regression analysis: First, a large dataset of calligraphy characters of various styles was collected, and experts were asked to score each character. The scoring range was as follows: This yields the scoring dataset; Then, the score assigned by the experts is used as the value of the word. Then, through step 3, we obtain the calligraphy characters. Rating value; Next, in the dataset of calligraphic characters The numerical values ​​are slightly perturbed and used as input. A linear regression is performed with the Score as the target value to obtain the best-fit score dataset Score result. The value of is used as the coefficient of the weighted scoring formula.