A method and system for ancient book character recognition based on big data
Through the method and system of ancient book text recognition based on big data, and the neural network and ancient book recognition model are used to solve the problems of cumbersome digitalization of traditional ancient books and the decline in paper quality, achieving high-precision ancient book recognition and multi-scale perception capabilities.
Patent Information
- Application Number
- CN202411826139.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-04
AI Technical Summary
The digitalization of traditional ancient books requires manual operation, requiring high and cumbersome skills for technical personnel, and multiple touches of ancient books will reduce the quality of paper.
The ancient book text recognition method and system based on big data is used to predict whether the data set contains modern text or images through neural networks, carefully classify ancient book images, and use ancient book recognition models to improve the recognition accuracy and perceive the multi-scale changes of the image.
It improves the accuracy of ancient book recognition and the ability to perceive multi-scale changes in images, reduces the need for manual operations, and protects the paper quality of ancient books.
Smart Images

Figure CN119763133A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ancient book character recognition, and more specifically, to an ancient book character recognition method and system based on big data. Background Art
[0002] The traditional digitization of ancient books usually requires manual operation, which places extremely high demands on technical personnel. At the same time, the identification of ancient books is also very cumbersome: it requires understanding the history, language, writing, paper, fonts, etc. of successive dynasties; secondly, repeated touching of ancient books will reduce the quality of the paper.
[0003] Therefore, the present invention provides an ancient book text recognition method and system based on big data, which improves the above-mentioned technical problems. Summary of the invention
[0004] The disclosed embodiments aim to address the deficiencies of the prior art and provide a method and system for ancient book text recognition based on big data. The present invention uses a neural network to predict whether a data set contains modern text or images, so as to facilitate detailed classification of ancient book images; and then uses an ancient book recognition model to improve the recognition accuracy of ancient books and the ability to perceive multi-scale changes in images.
[0005] The above technical objectives of the present invention are achieved through the following technical solutions: A method and system for ancient book character recognition based on big data, comprising the following steps: 1. A method for ancient book character recognition based on big data, characterized in that the method comprises the following steps:
[0006] S1, build an ancient book image dataset;
[0007] S2, preprocessing the data set based on neural network;
[0008] S3, building an ancient book recognition model to recognize the preprocessed data set;
[0009] S4. Build an evaluation model, calculate evaluation parameters, and verify the performance of the ancient book recognition model.
[0010] As a preferred technical solution of the present invention, the process of constructing the ancient book image dataset is:
[0011] Different ancient book images are collected to form a dataset, which consists of 4 categories: classics, history, philosophy, and collections; each category has 100 images; each image is set to a uniform size: 30x 30 pixels, a resolution of 300 dots per inch, and a color depth of 24 bits.
[0012] As a preferred technical solution of the present invention, the process of preprocessing a data set based on a neural network is: predicting whether the data set contains modern text or images through a neural network; the neural network includes two layers: a hidden layer and an output layer;
[0013] For each neuron j in the hidden layer, by With corresponding weight The weighted sum is calculated by summing the products of And add the bias term Hidden Neurons The output is activated by the sigmoid function Determine; as follows:
[0014]
[0015] As a preferred technical solution of the present invention, the activation of the hidden layer Used to calculate the weighted sum Z of the output neurons 2 ;
[0016] The hidden layer output and weight Add the products of Then, through the sigmoid activation function σ(Z 2 ) to get the final output As follows:
[0017]
[0018] As a preferred technical solution of the present invention, the process of constructing an ancient book recognition model and identifying the preprocessed data set is as follows:
[0019] The multi-branch structure shows that the identity block and 1×1Conv block are added to the network backbone of 3×3Conv, and the 4×512, 2×512, and 1×512 feature blocks are cascaded by SPP; through the l-layer 3×3 convolution, the obtained sample X=(x1,...,x n ) is expressed as:
[0020]
[0021] Among them, X (l) =γ (l) δ(X (l) )+b (l) is the feature output by layer l, and are the weight and bias of the hidden layer l of sample i; x i is the i-th sample, is the output of the l-1th layer of the i-th sample; n is the total number of samples; ξ(·) is the activation function; for the convolutional feature X = (x1, ..., x1) input to the layer l pool n ), and its output form is expressed as:
[0022] X (l) =γ (l) δ(X (l) )+b (l)
[0023] Where X (l) =γ (l) δ(X (l) )+b (l) is the weight coefficient of the pooling layer l, and δ(·) is the function of the maximum pooling.
[0024] As a preferred technical solution of the present invention, by introducing a multi-branch architecture and SPP, the ancient book recognition model is divided into two stages: the convolutional feature fusion stage and the recognition stage; the jump connection can transmit texture information from the bottom layer to the top layer, improving the gradient vanishing problem in the back propagation process; using identity blocks and 1×1 convolution branches, only one convolution layer is skipped to connect with the next layer; due to the different channels of the network, the identity block branches only appear in the last few layers of each convolution stage.
[0025] As a preferred technical solution of the present invention, the cascade and its subsequent convolutional layers can be reconstructed from two independent convolutional branches into an equivalent element-wise summation, expressed as:
[0026]
[0027] Wherein, W = Cat (W1, W2), b = b1 + b2;
[0028] Among them, AB is the input, W is the filter kernel, B is the bias, and Cat represents the cascade operation along the channel dimension. represents element summation, and * represents convolution operation.
[0029] As a preferred technical solution of the present invention, the process of constructing an evaluation model, calculating evaluation parameters, and verifying the performance of the ancient book recognition model is as follows:
[0030] Evaluation parameters include: accuracy, precision, recall, and F1 score;
[0031] Accuracy A refers to the proportion of correct predictions, and the calculation formula is:
[0032]
[0033] Precision P is the probability of actual positive samples among all predicted positive samples, and the calculation formula is:
[0034]
[0035] The recall rate R is the probability of being predicted as a positive sample in the actual positive sample, and the calculation formula is:
[0036]
[0037] The score F is the weighted average of precision and recall. The closer the value of F is to 1, the better the model effect is. The calculation formula is:
[0038]
[0039] Among them, TP indicates the actual positive sample and the model predicts it to be positive; TN indicates the actual negative sample and the model predicts it to be negative; FP indicates the actual negative sample; and FN indicates the actual positive sample.
[0040] An ancient book classification system based on machine learning, including:
[0041] Data collection module, used to collect and pre-process ancient book text data;
[0042] A feature extraction module is used to extract feature information for classification from ancient texts;
[0043] Classifier training module, used to train ancient book classification models;
[0044] Classification result output module, used to display classification results and receive user feedback
[0045] In summary, the present invention has the following beneficial effects: first, a neural network is used to predict whether a data set contains modern text or images, so as to facilitate detailed classification of ancient book images; then, the ancient book recognition model is used to fuse the underlying and advanced features of CNN through a multi-branch structure to enhance the network expression ability, and then the SPP is used to perform multi-scale de-dimensionality on the convolution features to increase the spatial scale invariance of CNN, improve the recognition accuracy of ancient books and the perception of multi-scale changes of images, and finally, the performance of the ancient book recognition model is verified by calculating the evaluation parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flowchart of an ancient book character recognition method based on big data provided by an embodiment of the present invention;
[0047] Figure 2 The architecture diagram of the ancient book character recognition model provided by the embodiment of the present invention;
[0048] Figure 3 A framework diagram of an ancient book character recognition system based on big data provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The present application is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements can also be made without departing from the concept of the present application. These all belong to the protection scope of the present application.
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. In addition, the words "first", "second", "third", etc. used herein do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0052] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0053] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0054] The disclosed embodiment aims to solve the problem that the traditional digitization of ancient books usually requires manual operation, which requires extremely high technical personnel and the recognition of ancient books is also cumbersome. In view of this, the disclosed embodiment proposes a machine learning-based ancient book classification method that first predicts whether the data set contains modern text or images through a neural network to facilitate detailed classification of ancient book images; then uses the ancient book recognition model to improve the recognition accuracy of ancient books and the perception of multi-scale changes in images.
[0055] Please refer to Figure 1 , Figure 1 The flowchart of a method for classifying ancient books based on machine learning according to an embodiment of the present disclosure is shown. The overall process mainly includes the following four steps:
[0056] Step 1: Build an ancient book image dataset.
[0057] Since there is no ancient book image dataset at present, it is necessary to build an ancient book image dataset;
[0058] The dataset is composed of different ancient book images collected from online databases on the Internet; the dataset consists of 4 categories: classics, history, philosophy, and collections; each category has 100 images. Therefore, the entire dataset consists of 400 images for subsequent analysis. For consistency and clarity, each image is set to a uniform size: 30x 30 pixels, a resolution of 300 dots per inch (dpi), and a color depth of 24 bits. This ensures a fair and comprehensive investigation of typographical features in different historical periods.
[0059] Step 2: Preprocess the dataset based on neural network.
[0060] Use neural networks to predict whether the data set contains modern text or images. The neural network consists of two layers: hidden layer and output layer. For each neuron j in the hidden layer, by With corresponding weight The weighted sum is calculated by summing the products of And add the bias term Hidden Neurons The output is activated by the sigmoid function Determine. As follows:
[0061]
[0062] Hidden layer activations Used to calculate the weighted sum Z of the output neurons 2 Specifically, the hidden layer output and weight Add the products of Then, through the sigmoid activation function σ(Z 2 ) to get the final output As follows:
[0063]
[0064] Neural networks are used to predict whether a data set contains modern text or images, so that ancient book images can be carefully classified.
[0065] Step 3: Build an ancient book recognition model to identify and classify the preprocessed data set.
[0066] like Figure 2As shown in FIG. 1 , the architecture of the ancient book character recognition model of the present invention shows the recognition process from left to right. Specifically, the multi-branch structure shows that the identity block and the 1×1Conv block are added to the network backbone of the 3×3Conv, and the 4×512, 2×512, and 1×512 feature blocks are cascaded by SPP. Through the l-layer 3×3 convolution, the obtained sample X=(x1, ..., x n ) is expressed as:
[0067]
[0068] Among them, X (l) =γ (l) δ(X (l) )+b (l) is the feature output by layer l, and are the weights and biases of the hidden layer l for sample i. i is the i-th sample, is the output of the l-1th layer of the i-th sample. n is the total number of samples. ξ(·) is the activation function. For the convolutional feature X=(x1,...,x1) input to the layer l pool n ), and its output form is expressed as:
[0069] X (l) =γ (l) δ(X (l) +b (l)
[0070] Where X (l) =γ (l) δ(X (l) )+ b(l) is the weight coefficient of the pooling layer l, and δ(·) is the function of the maximum pooling.
[0071] By introducing a multi-branch architecture and SPP, the ancient book recognition model is divided into two stages: the convolutional feature fusion stage and the recognition stage. The skip connection can transfer texture information from the bottom layer to the top layer, improving the gradient vanishing problem during back propagation. Using identity blocks and 1×1 convolution branches, only one convolution layer is skipped to connect to the next layer. Due to the different channels of the network, the identity block branch only appears in the last few layers of each convolution stage.
[0072] In addition, the ancient book recognition model of the present invention adopts element summation, which saves more parameters and calculations and is helpful for classification.
[0073] Specifically, the cascade and its subsequent convolutional layers can be reconstructed from two independent convolutional branches into an equivalent element-wise summation, expressed as:
[0074]
[0075] Wherein, W = Cat (W1, W2), b = b1 + b2;
[0076] Among them, AB is the input, W is the filter kernel, B is the bias, and Cat represents the cascade operation along the channel dimension. represents element summation, and * represents convolution operation.
[0077] Given a particular combination of W and b, it is easy to find a combination of W1, W2, b1, and b2 that implements exactly the same function.
[0078] On the basis of multiple branches, the ancient book recognition model of the present invention extracts the multi-scale features of ancient books through SPP, and normalizes and connects the multi-scale features as the input of the next layer. In order to achieve the optimal weight distribution of the model, the hidden layer modifies the weights of neurons by minimizing the cross entropy loss function in the back propagation process. The output layer uses the SoftMax function, and the number of neurons is the number of ancient book image classes; the output of the SoftMax layer is the probability of the ancient book image. When the output node is finally selected, the node with the largest probability (that is, the largest corresponding value) is selected as the prediction target of the ancient book image.
[0079] Step 4: Build an evaluation model, calculate evaluation parameters, and verify the performance of the ancient book recognition model. The evaluation parameters include: accuracy, precision, recall rate, and F1 score.
[0080] Accuracy A refers to the proportion of correct predictions, and the calculation formula is:
[0081]
[0082] Precision P is the probability of actual positive samples among all predicted positive samples, and the calculation formula is:
[0083]
[0084] The recall rate R is the probability of being predicted as a positive sample in the actual positive sample, and the calculation formula is:
[0085]
[0086] The score F is the weighted average of precision and recall. The closer the value of F is to 1, the better the model effect is. The calculation formula is:
[0087]
[0088] Among them, TP indicates the actual positive sample and the model predicts it to be positive; TN indicates the actual negative sample and the model predicts it to be negative; FP indicates the actual negative sample (the model predicts it to be positive); and FN indicates the actual positive sample (the model predicts it to be negative).
[0089] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for ancient book character recognition based on big data, characterized in that: The method comprises the following steps: S1, build an ancient book image dataset; S2, preprocessing the data set based on neural network; S3, building an ancient book recognition model to recognize the preprocessed data set; S4. Build an evaluation model, calculate evaluation parameters, and verify the performance of the ancient book recognition model.
2. According to the method and system for ancient book character recognition based on big data in claim 1, it is characterized in that: The process of constructing the ancient book image dataset is as follows: Different ancient book images are collected to form a dataset, which consists of 4 categories: classics, history, philosophy, and collections; each category has 100 images; each image is set to a uniform size: 30x 30 pixels, a resolution of 300 dots per inch, and a color depth of 24 bits.
3. According to the method and system for ancient book character recognition based on big data in claim 1, it is characterized in that: The process of preprocessing the data set based on the neural network is as follows: predict whether the data set contains modern text or images through the neural network; the neural network includes two layers: a hidden layer and an output layer; For each neuron j in the hidden layer, by With corresponding weight The weighted sum is calculated by summing the products of And add the bias term Hidden Neurons The output is activated by the sigmoid function Determine; as follows:
4. According to the method and system for ancient book character recognition based on big data as described in claim 1, it is characterized in that: Hidden layer activations Used to calculate the weighted sum Z of the output neurons 2 ; The hidden layer output and weight Add the products of Then, through the sigmoid activation function σ(Z 2 ) to get the final output As follows:
5. The ancient book character recognition method and system based on big data according to claim 1 is characterized in that: The process of building an ancient book recognition model and identifying the preprocessed data set is as follows: The multi-branch structure shows that the identity block and 1×1Conv block are added to the network backbone of 3×3Conv, and the 4×512, 2×512, and 1×512 feature blocks are cascaded by SPP; through the l-layer 3×3 convolution, the obtained sample X=(x1,...,x n ) is expressed as: Among them, X (l) =γ (l) δ(X (l) +b (l) is the feature output by layer l, and are the weight and bias of the hidden layer l of sample i; x i is the i-th sample, is the output of the l-1th layer of the i-th sample; n is the total number of samples; ξ(·) is the activation function; for the convolutional feature X = (x1, ..., x1) input to the layer l pool n ), and its output form is expressed as: X (l) =c (l) δ(X (l) )+b (l) Where X (l) =γ (l) δ(X (l) )+b (l) is the weight coefficient of the pooling layer l, and δ(·) is the function of the maximum pooling.
6. The ancient book character recognition method and system based on big data according to claim 5 is characterized in that: By introducing a multi-branch architecture and SPP, the ancient book recognition model is divided into two stages: the convolutional feature fusion stage and the recognition stage; the jump connection can transfer texture information from the bottom layer to the top layer, improving the gradient vanishing problem in the back propagation process; using identity blocks and 1×1 convolution branches, only one convolution layer is skipped to connect to the next layer; due to the different channels of the network, the identity block branch only appears in the last few layers of each convolution stage.
7. The ancient book character recognition method and system based on big data according to claim 5 is characterized in that: The cascade and its subsequent convolutional layers can be reconstructed from two independent convolutional branches as an equivalent element-wise summation, expressed as: Wherein, W = Cat (W1, W2), b = b1 + b2; Among them, AB is the input, W is the filter kernel, B is the bias, and Cat represents the cascade operation along the channel dimension. represents element summation, and * represents convolution operation.
8. The ancient book character recognition method and system based on big data according to claim 5 is characterized in that: The process of building an evaluation model, calculating evaluation parameters, and verifying the performance of the ancient book recognition model is as follows: Evaluation parameters include: accuracy, precision, recall, and F1 score; Accuracy A refers to the proportion of correct predictions, and the calculation formula is: Precision P is the probability of actual positive samples among all predicted positive samples, and the calculation formula is: The recall rate R is the probability of being predicted as a positive sample in the actual positive sample, and the calculation formula is: The score F is the weighted average of precision and recall. The closer the value of F is to 1, the better the model effect is. The calculation formula is: Among them, TP indicates the actual positive sample and the model predicts it to be positive; TN indicates the actual negative sample and the model predicts it to be negative; FP indicates the actual negative sample; and FN indicates the actual positive sample.
9. A machine learning-based ancient book classification system, used to implement the machine learning-based ancient book classification method according to any one of claims 1 to 8, characterized in that: include: Data collection module, used to collect and pre-process ancient book text data; A feature extraction module is used to extract feature information for classification from ancient texts; Classifier training module, used to train ancient book classification models; The classification result output module is used to display the classification results and receive user feedback.
Citation Information
Cited By
Chinese ancient book text repairing method and system based on big data
CN121747131A