Oracle bone character classification and identification method, system, equipment and medium
The improved Dynamic GridMask and Mosaic methods processed the oracle font pictures, which solved the problem of insufficient detection ability of the oracle font classification model in the absence of recognition and achieved higher recognition accuracy and robustness.
Patent Information
- Application Number
- CN202510700761.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-29
AI Technical Summary
The existing oracle bone character classification recognition model lacks effective OOD detection capabilities when facing the unrecognized oracle bone character, resulting in poor classification recognition effect. Especially in the case of incomplete oracle bone fragments caused by geological changes and corrosion, the scarcity of training data is serious.
The improved Dynamic GridMask image enhancement method is used to divide the oracle bone characters into S×S operation blocks, and the deletion of the rectangular area is controlled through a single hyperparameter d. The Mosaic method is combined with the stitching and fusion of multiple pictures of the same category is enhanced to enhance the multi-scale information of the model and optimize the OOD detection capability of the classification recognition model.
Through the data augmentation method, the OOD detection capability of the model is improved, the accuracy of the recognition of broken oracle bone characters is enhanced, and the overall effect of the classification recognition of oracle bone characters is improved, especially the robustness of detection and recognition of broken and heterogeneous characters.
Smart Images

Figure CN120564205A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of character classification, and in particular to an oracle bone inscription classification and recognition method, system, equipment and medium. Background Art
[0002] Oracle-bone script, a form of ancient Chinese writing from the Shang Dynasty to the Western Zhou Dynasty, is China's earliest systematic writing system. Due to its complex morphology and diverse structure, its classification and recognition has always been a challenging task. Of the over 5,000 known oracle-bone characters, approximately 1,500 have been correctly recognized, leaving the remaining 3,500 as unidentified.
[0003] Correctly distinguishing between recognized and unrecognized oracle bone characters is the first hurdle for all oracle bone character classification and recognition algorithms before they can be applied in real-world scenarios. Existing oracle bone character classification and recognition research is based on datasets of recognized oracle bone characters and does not include unrecognized examples. Improving the existing oracle bone character classification and recognition models' out-of-distribution (OOD) detection capabilities without compromising their ID classification capabilities is crucial for their application.
[0004] In recent years, many scholars have conducted research in the field of Object-Oriented Design (OOD). A broad definition of OOD has been proposed, which categorizes the problem of distinguishing between recognized and unrecognized oracle bone characters as the third type of Open Set Recognition (OSR) problem within OOD. However, oracle bones, buried underground for thousands of years and subject to long-term geological changes and corrosion, often break apart due to factors such as soil pressure and humidity fluctuations when unearthed. This results in a large number of incomplete oracle bone characters, resulting in very few samples available for training. This leads to poor OOD detection capabilities and, in turn, affects classification and recognition results. Summary of the Invention
[0005] The purpose of the present invention is to provide a method, system, device and medium for classifying and recognizing oracle bone characters in order to solve the problems in the prior art.
[0006] The present invention specifically provides the following technical solutions:
[0007] A method for classifying and recognizing oracle bone characters comprises the following steps:
[0008] Obtain historical oracle bone inscriptions images;
[0009] An improved Dynamic GridMask image enhancement method is used to divide the historical oracle bone inscription images into S×S operation blocks. Each operation block is traversed and rectangular areas are deleted in the operation block. The improved Dynamic GridMask image enhancement method is specifically as follows: the hyperparameter in the GridMask image enhancement method is set to a single hyperparameter, and the rectangular area to be deleted is controlled by the single hyperparameter d. The aspect ratio range of the operation block is restricted according to the aspect ratio of the historical oracle bone inscriptions.
[0010] Multiple historical oracle bone inscription images of the same category that have been deleted in the rectangular area are spliced and fused to obtain oracle bone inscription images with multi-scale information. The classification and recognition model is optimized using the oracle bone inscription images with multi-scale information to obtain a classification and recognition model with OOD detection for oracle bone inscription images.
[0011] The oracle bone inscription images to be detected are input into a classification recognition model with OOD detection for oracle bone inscription images for detection, and recognition results of different categories of oracle bone inscriptions are obtained.
[0012] Preferably, when the rectangular area to be deleted is controlled by a single hyperparameter d, the method further includes:
[0013] Set the information retention ratio of the historical oracle bone inscription images and use the information retention ratio as the information for subsequent division. The specific expression of the information retention ratio K is:
[0014] K=1-(deta_x*deta_y / d*(r+deta_x));
[0015] Among them, dela_x, deta_y = random (0, d-1) is the deleted rectangular area.
[0016] Preferably, when the multiple historical oracle bone inscription pictures of the same category that have been deleted from the rectangular area are spliced and fused, a Mosaic method is used to perform intra-category fusion on the multiple historical oracle bone inscription pictures of the same category.
[0017] The present invention provides an oracle bone inscription classification and recognition system, comprising:
[0018] The acquisition module is used to obtain historical oracle bone inscription images;
[0019] An image processing module is used to divide the historical oracle bone inscription image into S×S operation blocks using an improved Dynamic GridMask image enhancement method, traverse each operation block, and delete rectangular areas within the operation block. The improved Dynamic GridMask image enhancement method specifically includes: setting the hyperparameter in the GridMask image enhancement method to a single hyperparameter, controlling the rectangular area to be deleted by the single hyperparameter d, and limiting the aspect ratio range of the operation block based on the aspect ratio of the historical oracle bone inscription;
[0020] The model training module is used to splice and fuse multiple historical oracle bone inscription images of the same category after the rectangular area is deleted to obtain oracle bone inscription images with multi-scale information. The classification and recognition model is optimized using the oracle bone inscription images with multi-scale information to obtain a classification and recognition model with OOD detection of oracle bone inscription images;
[0021] The classification module is used to input the oracle bone character image to be detected into the classification recognition model with oracle bone character image OOD detection for detection, and obtain the recognition results of different categories of oracle bone characters.
[0022] The present invention provides a computer device, comprising a memory and a processor, wherein a program is stored in the memory, and when the program is executed by the processor, the processor executes the steps of the above-mentioned oracle bone character classification and recognition method.
[0023] The present invention provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned oracle bone inscription classification and recognition method are realized.
[0024] Compared with the prior art, the present invention has the following significant advantages:
[0025] The present invention is based on the OOD detection model and adopts an improved Dynamic GridMask method. Through a single-parameter dynamic adjustment mechanism, the complexity of hyperparameter tuning is reduced compared with the traditional GridMask four-parameter setting. By dividing the historical oracle bone character pictures into blocks and deleting the rectangular areas of the blocks, and splicing multiple historical oracle bone character pictures of the same category, oracle bone character pictures with multi-scale information are obtained. Through the above-mentioned method, data augmentation is achieved, the number of training sets is increased, and the problem of scarcity of oracle bone character training data is effectively solved, thereby enhancing the OOD detection capability of the model, and then ensuring the accuracy of the data during the classification and recognition of oracle bone characters, and improving the classification and recognition effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 The tortoise shell bone fragments and rubbings provided in the embodiment of the present invention; wherein, Figure 1 (a) is a tortoise shell fragment, Figure 1 (b) is rubbing 1, Figure 1 (c) is rubbing 2;
[0027] Figure 2 This is a typical oracle bone rubbing diagram of the present invention;
[0028] Figure 3 1 is an example of an incomplete character of the present invention; wherein (a1), (a2), (a3), (a4) and (a5) are incomplete characters caused by different oracle bone fractures and cracks, (b) is an incomplete character caused by missing oracle bones, and (c1), (c2), (c3), (c4) and (c5) are incomplete characters caused by the texture of the oracle bone characters themselves;
[0029] Figure 4 It is the original image data in the picture partitioning diagram of the present invention without any modification or processing;
[0030] Figure 5 Randomly delete a square area from the entire image in the image partitioning diagram of the present invention;
[0031] Figure 6 Randomly delete a rectangular area from the entire image in the image partitioning diagram of the present invention;
[0032] Figure 7 In the picture partition diagram of the present invention, the picture is divided into S×S sub-blocks; Figure 7 (a) and Figure 7 (b) shows two different partitioning graphs;
[0033] Figure 8 Generating a structured mask in the image partitioning diagram of the present invention, and then deleting the mask image information diagram;
[0034] Figure 9 An overall flow chart of an oracle bone inscription classification and recognition method provided by the present invention;
[0035] Figure 10 Graph showing the Beta density distribution for different alpha values in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following is a clear and complete description of the technical solutions of the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0037] Since there were no suitable writing tools in ancient times, the ancients of the Shang Dynasty used sharp tools to engrave characters on tortoise shells and animal bones. Among them, tortoise shells were also called divination shells, and they were mostly made of the plastron of the tortoise (such as Figure 1 Animal bones are also called oracle bones, mostly scapulae and leg bones of cattle, but also sheep, pig and tiger bones. Divination shells and oracle bones are collectively called oracle bones.
[0038] Due to historical reasons, approximately 27,000 oracle bones are now found in 12 countries, including the United States, Japan, the United Kingdom, and Canada. Due to their rarity and preciousness, existing research relies solely on images of these rubbings. In 2019, the "Yin Qi Wen Yuan," the world's largest oracle bone inscription big data platform, was released to the public free of charge. It has become the leading data source for oracle bone research and can be accessed at http: / / jgw.aynu.edu.cn / .
[0039] Buried underground for thousands of years, oracle bone fragments have endured long-term geological changes and corrosion. When unearthed, they often break apart due to factors such as soil pressure and humidity fluctuations, resulting in a large number of incomplete oracle bone inscriptions. This is one of the greatest difficulties in oracle bone inscription detection and recognition. Although some algorithms use data augmentation to process oracle bone inscriptions, these methods are based on recognized oracle bone inscriptions and are not effective for unrecognized oracle bone inscriptions.
[0040] Because the oracle bones were buried underground for more than 2,000 years and were affected by weathering and time, they were easily broken when unearthed. Moreover, the oracle bone characters were very similar to the natural texture of the surrounding oracle bones, making detection and identification extremely difficult. Figure 2 This is a relatively complete oracle bone rubbing image. Affected by cracks, weathered texture, blur and other factors, several representative incomplete characters were selected from it to form Figure 3 . Figure 3 (a1), (a2), (a3), (a4), and (a5) show incomplete characters caused by fractures and cracks in the oracle bones. All of these characters are penetrated or corroded by the cracks, but the degree of damage varies. For example, the first character in the first row is the most severely affected; it can only be identified as a single word, without any other valid information. Figure 3 (b) shows an incomplete character due to a missing oracle bone. The typical feature is that the missing part of the oracle bone was affected by the ink during the rubbing process, and the inside turned directly into pure black. Figure 3 (c1)~ Figure 3 (c5) shows an incomplete text due to the texture of the oracle bone characters themselves. Under the influence of long-term weathering, the surface of the oracle bone is uneven, making it difficult to distinguish the scratches and texture of the oracle bone.
[0041] OOD detection of oracle bone characters is of great significance to the downstream tasks of oracle bone characters. Among the existing 5,000-plus oracle bone character systems, only 1,500 are correctly classified and identified, and the rest are unrecognized oracle bone characters. The recognition rate is only about 30%, which greatly limits the promotion and application of oracle bone characters. For existing models, how to quickly distinguish between recognized oracle bone characters and unrecognized oracle bone characters directly affects all subsequent oracle bone character recognition and application operations, and is the first hurdle for oracle bone character models to move towards real open scenarios. The OOD detection of oracle bone characters in real scenarios faces the problem of semantic shift, that is, OOD samples come from different classes. The detection of semantic distribution shift (for example, due to the emergence of new classes) is the focus of the OOD detection task, where the label space Y of ID and OOD data is different.
[0042] In the context of deep learning models, enhancing the model's out-of-distribution detection capabilities is crucial for downstream tasks such as oracle bone inscription recognition and its applications. This paper introduces OOD detection into the field of oracle bone inscription classification and employs two data augmentation methods, mosaic and grid mask, to enhance the model's OOD detection capabilities. Experiments demonstrate the effectiveness of this improved method, achieving a 2.62% accuracy improvement on a benchmark dataset.
[0043] like Figure 9 As shown, the present invention provides a method for classifying and recognizing oracle bone characters, which specifically includes the following steps:
[0044] Step S1: Obtain historical oracle bone inscription images.
[0045] Oracle bone tablets are affected by factors such as weathering, edge breakage, and bone cracks, which often result in incomplete characters or strokes in some oracle bone rubbings. It is common sense that as long as the main features of the oracle bone characters are retained, even partial damage will not affect their correct recognition. Based on this, a grid mask is used to simulate the phenomenon of oracle bone character damage. At the same time, controlling the proportion of deleted information, that is, retaining the main features of the characters, can enhance the detection ability of the model. The original grid mask has 4 hyperparameters, which is relatively troublesome to train. The present invention transforms the original grid mask and changes the hyperparameter to 1, that is, the height of a deleted block, which is equivalent to the original hyperparameter design and reduces the difficulty of training operation.
[0046] The problem of OOD detection is how to detect out-of-distribution samples while maintaining the accuracy of in-distribution classification. For example, X represents the input space, Y represents the label space, and the data distribution can be viewed as a joint probability distribution P(X, Y). OOD detection aims to identify OOD data while maintaining the accuracy of in-distribution data classification, that is, P(Y) ≠ P(Y).
[0047] The term "out-of-distribution detection" first appeared in 2017 and has since garnered increasing attention. Most existing deep learning models are trained based on the closed domain assumption, where the test data is assumed to be from the same distribution as the training data, known as in-distribution (ID). However, when models are deployed in open environments in real-world applications, test samples often contain out-of-distribution (OOD) data.
[0048] The main problem of OOD detection at present is how to solve the following two difficulties, which also correspond to the two stages of deep learning: training stage: how to better represent the model, that is, how to mine the information in the data that is useful for OOD, and how to extract better features (such as making ID and OOD stay away from each other in the feature space); testing stage: how to better utilize the data, that is, how to better utilize the mined information and features (such as widening the difference in the distribution of ID and OOD scores).
[0049] In image classification tasks, data augmentation (DA) refers to regularization techniques that artificially expand the dataset by applying various transformations or modifications to existing data samples, thereby enhancing the generalization capabilities of the trained model. In addition to the standard data augmentation methods for the ImageNet classification task, the nine most common data augmentation methods are categorized as follows: Optimizing policy-based AutoAugment and RandAugment; cropping methods such as Cutout, RandomErasing, Hide-and-Seek, and GridMask; and data mixing methods such as Mixup, CutMix, and Mosaic.
[0050] The background of this invention is to only discuss the enhancement of the OOD detection capability of oracle bone inscriptions, and the data augmentation method discussed is independent of the optimization strategy and the model. Then the remaining two common methods, cropping and data mixing, can be equivalent to single-image operations and multiple-image fusion operations, respectively.
[0051] Cutout, a single-image operation, is robust to noise. RandomErasing, similar to Cutout, also aims to address the poor generalization of trained models on occluded data. Unlike Cutout, in RandomErasing, the size and aspect ratio of the generated mask are randomly generated based on preset hyperparameters. For oracle bone inscription image data, the hyperparameters of RandomErasing are difficult to determine due to the multi-scale nature of text images. Hide-and-Seek can be considered an extension of RandomErasing. It divides the image into several patches and generates a mask with a certain probability for each patch. GridMask improves the problem of Hide-and-Seek, which either over-deletes or over-retains critical information. GridMask effectively balances the ratio of deleted and retained information, making it particularly suitable for text images, especially single-word images. Therefore, GridMask has become the preferred technology for image data augmentation.
[0052] Mixup in the fusion of multiple pictures is the first proposed image fusion and augmentation solution. Its principle is simple. It can fuse different pictures and corresponding labels, which is easy to implement. However, due to the particularity of text pictures, such as two single-word pictures A and B corresponding to two different text class labels ClassA and ClassB respectively, then the fused text picture C should be classified as ClassA or ClassB, or even a new text of ClassC. It is more likely to be nothing and has no practical significance. CutMix also faces the above problems in text and picture data fusion. Therefore, the picture data fusion and augmentation in the present invention is limited to the same type of text pictures. Mosaic is to splice multiple pictures by random scaling, random cropping, and random arrangement, which can effectively increase the multi-scale information of the picture. The present invention combines Rotate and Mosaic to further increase its spatial information.
[0053] Step S2: Use the improved Dynamic GridMask image enhancement method to divide the historical oracle bone inscription image into S×S operation blocks, traverse each operation block, and delete the rectangular area in the operation block; wherein, the improved Dynamic GridMask image enhancement method is specifically as follows: set the hyperparameter in the GridMask image enhancement method to a single, control the rectangular area for deletion by the single hyperparameter d, and limit the aspect ratio range of the operation block according to the aspect ratio of the historical oracle bone inscription.
[0054] like Figure 4 、 Figure 5 and Figure 6The figure shows the overall process of transforming the original image data into the deleted rectangular area. In Mosaic, the image data fusion augmentation when adding multi-scale information of the image is limited to the same type of text images.
[0055] Set the hyperparameter in GridMask to single, and use GridMask to divide the oracle bone inscription image into S×S sub-blocks, including:
[0056] In GridMask, set the hyperparameter d, where d represents the height of a vertical operation block.
[0057] The deletion area is controlled by the hyperparameter d, and the aspect ratio range of the operation block is limited according to the aspect ratio characteristics of oracle bone inscriptions.
[0058] When the deletion area is controlled by the hyperparameter d, it also includes:
[0059] Set the information retention ratio of the historical oracle bone inscription images and use the information retention ratio as the information for subsequent division. The specific expression of the information retention ratio K is:
[0060] K=1-(deta_x*deta_y / d*(r+deta_x));
[0061] Among them, dela_x, deta_y = random (0, d-1) is the deleted rectangular area.
[0062] Step S3: Multiple historical oracle bone inscription pictures of the same category that have been deleted in the rectangular area are spliced and fused to obtain oracle bone inscription pictures with multi-scale information. The classification and recognition model is optimized using the oracle bone inscription pictures with multi-scale information to obtain a classification and recognition model with OOD detection of oracle bone inscription pictures.
[0063] By randomly scaling, cropping, and arranging the images for stitching, we can increase the multi-scale information of the images and enhance the ODD capability of the model.
[0064] Generally speaking, when using Mosaic to fuse multiple oracle bone inscription images, intra-class and inter-class fusion are used to fuse the multiple oracle bone inscription images. However, in the present invention, when splicing and fusing multiple historical oracle bone inscription images of the same category after the rectangular area is deleted, the Mosaic method is used to perform intra-class fusion on the multiple historical oracle bone inscription images of the same category.
[0065] In the embodiment:
[0066] Hide-and-Seek divides an image into S×S blocks and then randomly arranges them. This method can severely damage the text structure, generating meaningless text blocks. Subsequent experiments also verified this, showing that it does not help improve OOD capabilities.
[0067] Cutout randomly deletes a square area from the entire image; RandomErasing randomly deletes a rectangular area from the entire image. This can be seen as an extension of Cutout, removing the aspect ratio restriction. Hide-and-Seek divides the image into S×S sub-blocks, traversing each of them with a certain probability to determine whether to delete the current sub-block. GridMask generates a structured mask and then deletes the masked image information. From another perspective, GridMask divides the image into S×S sub-blocks, traverses each sub-block, and deletes the rectangular area within each sub-block.
[0068] Cutout can be seen as a special case of GridMask with S=1 and an aspect ratio of 1:1; RandomErasing is a special case of GridMask with S=1; if each mask block on GridMask is allowed to function with a certain probability, then Hide-and-Seek is a special case of full masking on GridMask. This shows that as long as the probability is applied to the mask block of GridMask and the aspect ratio of the mask block is not restricted, the above four common single image data augmentation methods can be unified. It is hoped that the deleted blocks can wander within the area and appear with a certain probability, so as to better simulate the incompleteness of oracle bone inscriptions; by setting each small probability to control the proportion of the retained image, the final effect can be adjusted.
[0069] Inspired by the idea of dividing the image into several operation blocks, it's natural to set a probability for each operation block to determine whether the current operation block contains a deletion block. In the RandomGridMask variant, a deletion probability pu is set. Experimental results show that when R is fixed, the probability pu has little effect on improving accuracy, and may even be detrimental. Experiments will verify whether setting the dispersion probability p can improve accuracy and the model's OOD detection capabilities.
[0070] A major challenge in oracle bone inscription recognition is how to simulate the presence of partially incomplete characters, the high noise content, and the incomplete characters in experiments, thereby improving the robustness and accuracy of the model's detection and recognition of incomplete characters and variant forms. GridMask strikes a balance between removing and preserving information, effectively simulating both scenarios.
[0071] A GridMask is used to generate a mask with the same resolution as the original image. A GridMask corresponds to four key hyperparameters: (δx, δy, r, d). These four parameters determine a specific set of masks. Multiplying this mask with the original image yields a GridMask-enhanced image. Figure 7 , Figure 8 The value of the medium gray area is 1, and the value of the black area is 0. By multiplying the Mask and the original image, information dropping in specific areas is achieved, and the image enhanced by GridMask is used as the image of each sub-block; essentially, it can be understood as a method to achieve regularization. The more complex the classification task, the better the effect with an appropriately larger r.
[0072] A specific mask is determined by 4 parameters, including:
[0073] Define the retention ratio k of image information, and indirectly define r through k; the specific expression is:
[0074]
[0075] k = 1 - (1 - r) 2 = 2r - r 2 ;
[0076] Among them, H and W are the height and width of the original image respectively, M is the number of pixels retained, and the definition of r is calculated through the conversion of k.
[0077] Among them, the specific expressions of δx, δy and d are:
[0078] δ x (δ y ) = random(0, d - 1);
[0079] d = random(d min , d max );
[0080] [[ID=4,]]Among them, random is a random function.
[0081] Common methods for data augmentation of multiple images include Mosaic, mixup, and cutmix. Mosaic is to put several images together, mixup is to fuse two images, and cutmix is to cut a part of one image into another image. Different from the types of images in object detection and recognition, there is an embarrassing situation where there is no corresponding font after the fusion of multi-font label images in text images.
[0082] Use mixup for image fusion. The first row shows the fusion effect of two different forms of images of the oracle bone character 'big'. Since these two images have the same font label 'big', the fused image is classified as the font 'big'. The second row shows the image fusion of the oracle bone characters 'big' and 'niu'. These two images have different font labels. Should the fused image be classified as the font 'big' or 'niu'? Most likely, there is no corresponding oracle bone character and it has no practical meaning.
[0083] Mixup combines two images and their labels. This is beneficial for natural scene images, but can have disastrous consequences for text images. There are two types of mixups: intra-class and inter-class.
[0084] The first case is when different images of the same character are fused together, and the labels themselves are the same, so there is no label fusion problem. The second case is when different images of different characters are fused together, and the labels are different, so there is a label fusion problem.
[0085] CutMix faces the same challenges as Mixup: intra-class fusion and inter-class fusion. The fusion results show that each approach interferes with the other, as demonstrated by experimental results. This not only fails to improve the final OOD capability, but actually reduces it. Therefore, Mixup and CutMix were excluded.
[0086] Table 1 Fusion results
[0087]
[0088] The Mosaic method conducted experiments using both intra-class and inter-class fusion. Intra-class fusion improved model accuracy and OOD detection capabilities. Inter-class fusion produced the opposite result, decreasing model accuracy while significantly reducing the model's OOD detection capabilities. The Mixup and CutMix methods also conducted experiments using both intra-class and inter-class fusion, and obtained similar results to the Mosaic method: intra-class fusion improved all metrics, while inter-class fusion reduced both accuracy and the model's OOD detection capabilities.
[0089] In order to further observe the impact of inter-class fusion on the improvement of model capabilities, different distribution parameters are set for image fusion in the mixup and cutmix methods for verification. Let x∈RW×H×C and ydenote a training image and its label, respectively. The fusion result (x, y) consists of two image samples (xA, yA) and (xB, yB). The images are fused according to the mixup and cutmix methods respectively, and the labels are fused according to the formula
[0090]
[0091] whereλ~Beta(α,α), forα∈(0,∞), setλ to {0.5,1.0,2.0}, which respectively represent that the fused label tends to y i or y j, tends to be uniformly distributed, tends to y i and y j There are three cases of intermediate values. When the distribution tends to the two ends, that is, the label tends to y i or y j , then the corresponding classification probability also tends to y i or y j .like Figure 7 The third column on the right, the first one in the third column indicates that the current label tends to cattle (i.e. y j ), the second one in the third column indicates that the current label tends to be big (ie y i ). Figure 7 The fourth column indicates that the current label tends to y i and y j The middle value of y is relatively difficult to classify for text images, and the fusion result may not even belong to y i or y j When y i and y j When the number of intermediate values increases, it is beneficial to improving the OOD detection ability of the model, and the results in Table 1 also confirm this.
[0092] In the context of inter-class image fusion, as the lamda value increases (i.e., the fusion result label value tends to the middle value), the model accuracy decreases, and the OOD detection metric decreases in Mixup, but first increases and then decreases in CutMix. In the context of intra-class image fusion, as the lamda value increases, the model accuracy is relatively stable, while the OOD detection metric first increases and then decreases in Mixup, but is more chaotic in CutMix (energy and GEN increase, max_logi decreases, and max_prob and shannon_EN first increase and then decrease).
[0093] The above analysis shows that inter-class fusion is not a good choice for text images. Furthermore, considering that the purpose of this invention is to enhance the model's OOD detection capabilities without compromising the original model's capabilities, intra-class image fusion is a natural choice. In subsequent experiments, the default settings for Mixup and CutMix are α = 1.0 and α = 2.0, respectively, in order to achieve better results.
[0094] Mosaic leverages the spatial and local region capabilities of CutMix and the advantages of single-image data augmentation, making it particularly suitable for intra-class data augmentation based on oracle bone inscription labels. In practice, a four-image combination was used. The simplest method is to scale the four images to 1 / 4 of their original size and then combine them.
[0095] The original image size is 224×224, and the sizes of 56 and 168 pixels were chosen for the following reasons.
[0096] Why 56? A pixel in a feature map has a receptive field of 56×56 before being scaled down by a factor of 8 and subjected to three 3×3 convolutions. This means that the smallest tile in the original image must be at least 56×56 to preserve its information. If the smallest tile is 56×56, the input image size is 224×224, which means it can be divided into 4×4 = 16 regions.
[0097] Why 168? The scaling ratio in feature maps is always even. If we want to increase the scaling ratio to odd numbers to provide richer multi-scale fusion information, we can only use 3×3 blocks among the current 4×4 feature blocks, and the other block on the diagonal can only be 1×1. From the perspective of diagonal symmetry, this 3×3 block has the same effect whether placed in the upper left, upper right, lower left, or lower right. For intuitiveness and ease of use, we place it in the lower right corner, which is the current 168×168. The current partitioned area is as follows.
[0098] Experiments show that under the same redundancy rate and the same number of redundant images, the acc differences between Mosaic-6 and Mosaic-4 are -0.00006 and +0.0026 respectively, which is not a big difference.
[0099] At the same time, the writing habits of oracle bone inscriptions and modern Chinese characters are similar, and they tend to have a golden aspect ratio of 1:1.6, because the characters written in this way are the most aesthetically pleasing. The statistics of the aspect ratios of the label annotation boxes in the OBC detection data set also prove this. Through intuitive observation, it can be seen that the aspect ratio of the text image is within [3:1, 1 / 3], that is, within 3 times of horizontal stretching or 3 times of vertical stretching. For single-character rubbing images, it does not affect the recognition of the text, and its font structure characteristics are basically unchanged. The aspect ratios of the text image are 3:1 and 1:3, which just correspond to the horizontal 3:1 aspect ratio and the vertical 1:3 aspect ratio of Mosaic-4. Therefore, the present invention adopts the augmentation scheme of Mosaic-4.
[0100] Other data augmentation methods:
[0101] Geometric transformation: Geometric transformation is the most common and basic data enhancement method, mainly including:
[0102] Scaling: Changes the size of an image. Translation: Moves the image in the image plane. Rotation: Rotates the image around a central point by a certain angle. Affine transformation: A combination of rotation, scaling, translation, and skewing. Flip: Flips the image horizontally or vertically.
[0103] Geometric transformation methods are now rarely used alone and usually act in combination with other methods. For example, the Mosaic method introduced in the previous section uses scaling and rotation, which can enrich the scale and spatial information of text images. Flipping is basically not considered for text images because it will cause semantic migration.
[0104] ① Flipping:
[0105] Flipping is not applicable to oracle bone rubbings. The primary reason is that all oracle bone dataset oracle bone rubbing samples are in the form of vertically arranged characters from top to bottom. If vertical flipping is adopted, it will destroy the original inherent semantic relationship between characters and also the upper and lower structural relationship of the characters themselves. Secondly, if horizontal flipping is adopted, in addition to destroying the left and right structural relationship of the characters themselves, more importantly, it will seriously disrupt variant oracle bone characters.
[0106] Existing models default to detecting and recognizing oracle bone rubbings in the order from top to bottom of oracle bone characters, which can preserve the inherent context structure semantic information of oracle bone characters as much as possible. If vertical flipping is adopted, it will destroy its inherent upper and lower order semantic structure, which is无益且有害 to downstream tasks. Vertical flipping will also cause confusion of characters. As shown in the following table, for oracle bone characters with upper and lower symmetric structures, once vertical flipping is performed, the characters will correspond to completely different meanings, which will cause mislabeling of class labels from the perspective of dataset categories, and进而严重影响 the recognition and detection capabilities of the model.
[0107] If horizontal flipping is adopted (as shown on the far right of the above figure), it can be seen that the left and right structural space of the characters has changed. More importantly, it will cause misjudgment of oracle bone character categories and confusion of variant characters. As shown in the following table, among oracle bone characters, there are characters with symmetric left and right structures but different meanings; there are also characters with almost the same left and right structures but different meanings; there are also cases where the left and right structures have slight differences but represent the same character. But there are also oracle bone characters with symmetric left and right structures and representing the same character, such as the character "多" (human) "辛" (hard) The single character "今" (today) "入" (enter) and other two situations. How to correctly handle horizontal flipping is a major problem for current oracle bone characters (whether a small database can be constructed and a paper can be published, which should be feasible), which is not within the scope of discussion of this invention, but can be used as a direction for subsequent optimization and improvement. From a simple and practical perspective, this invention does not adopt horizontal flipping as a means of data augmentation for the time.
[0108] ② Rotation:
[0109] It should be noted that some Chinese expressions in the original text seem to be incomplete or have incorrect grammar in the English translation part. It is recommended to check and correct the original text for a more accurate translation.Rotation is a simple and effective data augmentation method that can enrich the spatial structure of an image and is used in oracle bone character recognition. Given the characteristics of oracle bone characters, the rotation of oracle bone rubbings is subject to certain restrictions without affecting detection and recognition.
[0110] Considering that all oracle bone rubbings are arranged sequentially from top to bottom, and only the writing material affects the angle of the writing, experiments have verified that the angle offset range is 50 to 80 degrees, with the horizontal axis at 0 degrees. If the vertical axis is used as the starting point, it can be concluded that the left-right rotation of all oracle bone rubbings in the experiment should be controlled within 10 to 40 degrees.
[0111] Color space transformation: Color space transformation mainly includes:
[0112] Contrast Adjustment: Changes the contrast of an image. Color Dithering: Randomly changes the saturation, brightness, and contrast of an image. Noise Addition: Adds random noise to the image, such as Gaussian noise, salt and pepper noise, etc.
[0113] Since the current mainstream oracle bone datasets are all grayscale images obtained from rubbings, they do not contain color information. With the development of time and technology, color and even 3D oracle bone datasets and images will surely increase in the future, and color space transformation will inevitably play a greater role in that time. At present, research and discussion of color-related transformation data enhancement based on existing datasets is of little significance and is not the focus of this research.
[0114] Noise is particularly significant for oracle bone data. Oracle bone rubbings contain significant noise, including imaging noise, natural texture noise, and imaging noise caused by damage to the bone. These noises significantly interfere with the accuracy of oracle bone inscription detection, with the latter two types of noise being particularly disruptive to detection and recognition.
[0115] The image surface of oracle bone rubbings suffers from serious degradation and contamination problems, which are mainly manifested in the following aspects: (1) The surface of oracle bone rubbings contains a large amount of irregular noise. This noise is densely distributed on the surface of the rubbings, which not only interferes with the recognition of character features but also increases the risk of model overfitting. (2) The surface of oracle bone rubbings is interfered by various types of cracks. These cracks have different scales and shapes and are very similar in appearance to oracle bone characters, which seriously interferes with the classification and recognition of oracle bone characters.
[0116] Step S4: input the oracle bone character image to be detected into a classification recognition model with oracle bone character image OOD detection for detection, and obtain recognition results of different categories of oracle bone characters.
[0117] The experiments were conducted on the Oracle-MNIST dataset, which contains 30,222 images representing 10 different oracle-bone inscription categories. For better comparison, we treated six categories as IDs and the remaining four as OODs, but the first six categories were randomly selected in this experiment. The dataset can be downloaded from: https: / / github.com / wm-bupt / oracle-mnist. The download path provides two sets of image data in different sizes: 28×28 and 224×224. This paper uses the 224×224 size.
[0118] Accuracy is a common evaluation indicator, which is calculated as follows:
[0119] accuracy=(TP+TN) / N.
[0120] Here, TP (True Positive) represents the number of samples correctly predicted as positive, TN (True Negative) represents the number of samples correctly predicted as negative, and N represents the total number of samples. This is easy to understand: it is simply the number of correctly classified samples divided by the total number of samples. Generally speaking, the higher the accuracy, the better the classifier. In oracle bone inscriptions OOD, we hope that data augmentation methods will not only benefit OOD but also improve accuracy, so accuracy is a key evaluation metric.
[0121] AUROC Maximum Softmax Probability: It refers to using the maximum probability of the model output (usually the predicted probability of a certain category) as the decision threshold to calculate AUROC. For multi-classification problems, the category with the highest predicted probability is selected as the prediction result, and then AUROC is calculated based on these probabilities.
[0122] AUROC max_logit: Logit is usually the original output of the model, which refers to the value before passing through the sigmoid or softmax function. Using the maximum logit value as the decision threshold to calculate AUROC is to evaluate the impact of the model's original output before probability conversion on classification performance.
[0123] The energy-based method maps the input to an energy score, which has lower energy for observed data (i.e., data in the training set, or ID data) and higher energy for unobserved data (i.e., data outside the training set, or OOD data). The core of this method is that the energy score is theoretically consistent with the probability density of the input and is less sensitive to the overconfidence problem. This effectively solves the serious problem of softmax confidence scores that can reach arbitrarily high values for outlier examples, and achieves better OOD detection performance than the traditional softmax confidence score.
[0124] 2. Application of Energy in AUROC:
[0125] Improve the accuracy of OOD detection:
[0126] By calculating the energy score of the input data, we can more accurately distinguish between ID data and OOD data. In practical applications, we can set an energy threshold and judge inputs with energy above the threshold as OOD data, thereby preventing the model from making overconfident predictions about unknown inputs.
[0127] Optimize the AUROC indicator:
[0128] AUROC is an important metric for measuring classifier performance, reflecting the average performance of the classifier at different thresholds. In the OOD detection task, AUROC can measure the model's ability to distinguish between ID data and OOD data. Using the energy score for OOD detection can significantly improve the AUROC metric, indicating that the model has better performance in distinguishing between ID and OOD data.
[0129] Enhance the robustness of the model:
[0130] The energy-based method not only improves the accuracy of OOD detection, but also enhances the robustness of the model. When faced with unknown inputs, the model can make more robust judgments and avoid uncontrollable prediction results.
[0131] Compared to traditional methods using softmax scores, energy scores can better distinguish between in-distribution and out-of-distribution samples. Energy scores outperform softmax-based scores and generative model-based methods. Compared to softmax-based confidence score methods, energy scores are less susceptible to overfitting of neural networks in the sample space. Compared to generative model-based methods, energy scores do not require explicit density estimation.
[0132] GEN is a simple but effective entropy-based scoring function that can be applied to any pre-trained softmax-based classifier. The GEN method improves the output of the softmax function by utilizing additional information, making it more sensitive to the difference between the input data and the training distribution.
[0133] Shannon entropy is a method for measuring the uncertainty of a random variable. In the context of machine learning, it is used to measure the uncertainty of predictions. If a model outputs a probability distribution for each example, then the Shannon entropy of this distribution can be calculated and used as a factor in calculating the AUROC. This can provide a measure of how well the model performs on uncertain examples.
[0134] The main purpose of this paper is to verify which data augmentation method is beneficial for improving the classification and recognition of open-set oracle bone characters. The model serves to verify the effectiveness of the data augmentation method. This paper selects the simple and universal RestNet18 model for experimental verification.
[0135] ResNet is widely used in detection, segmentation, recognition, and other fields. It uses a connection method called "shortcut connection". As the name suggests, shortcut means "taking a shortcut". This paper adopts the standard ResNet18.
[0136] A GridMask experiment was conducted on a single image of an oracle bone rubbing. Taking the number of blocks removed in a row as an example, we cropped the image horizontally using blocks [2, 3, 4, 5, 6, 7, 8, 9] in sequence. We found that as the number of blocks increased, the obscured content became increasingly detailed. The figure below also clearly demonstrates that overly large blocks obstruct the effective expression of text, while overly small blocks, even if used in greater numbers, only obscure text details and have a minimal impact on the overall textual expression. The core parameter of the modified GridMask is the block height d. By finding the optimal d, we achieve a balance between removing and retaining information.
[0137] According to the characteristics of the oracle database, the updated parameters are:
[0138] 1) dela_x, deta_y = random(7, d). This controls the minimum size of the cut block to 7×7 pixels. This is because RestNet18 resizes a 224×224 input image to 28×28, corresponding to an 8:1 ratio. Furthermore, RestNet18 has three 3×3 convolutions before the skip connection, meaning that the receptive field of a pixel in the feature map is 7×7. Setting the minimum size to >7 balances these two considerations.
[0139] 2) Since dela_x >= 7, r > 0, r + deta_x = random[d / 3, 3*d], it follows that 7 <= r + deta_x = random[d / 3, 3*d] <= 224, and further infer that 21 < d, that is, the value range of d is updated to (21, 224].
[0140] Mosaic implementation:
[0141] Mosaic in yolov4 randomly scales and randomly crops 4 images and then splices and fuses them. The Mosaic of the present invention adds some restrictions according to the data characteristics, and the schematic diagram of the fusion process is shown in the following figure. The present invention combines Rotate and Mosaic, and before fusing 4 images, each image is set to be rotated with a probability of 0.5.
[0142] Rotation is a simple and effective data augmentation method that can enrich the spatial structure information of images. For the characteristics of oracle bone characters, the rotation of oracle bone rubbings is restricted under the premise of not affecting detection and recognition. The specific restrictions are shown in Table 2 below. From the restrictive conditions, it can be obtained that if the rotation exceeds 45 degrees, the current character will be transformed into another character, that is, the phenomenon of semantic cross-classification occurs. To avoid this situation, the rotation is limited within 45 degrees.
[0143] Dynamic Grid Mask:
[0144] 1) Based on the original gridmask, through a hyperparameter strategy, the deletion areas deta_x and deta_y of each operation block are randomly approximately uniformly distributed in the entire area. Second, the proportional relationship is not directly limited. For example, if extreme cases such as long strips appear in deta_x or deta_y, it can instead simulate the "irregular strip" noise in oracle bones, which is beneficial to improving the anti-interference ability of the model.
[0145] Corresponding to the first item: [Grid Mask randomly discards some image areas by superimposing a grid-like mask on the training image. This method not only avoids the model relying too much on the information of certain specific areas, but also prompts the model to learn to extract useful features from a wider range of image content.]
[0146] 2) Calculation shows that: the side length of the operation block is d and random[3 / d,3*d]), so the area of the operation block ranges to d*[3 / d,3*d] = [d^2 / 3,3*d^2]. The distribution range of det_x and deta_y is [8,d], and their product range is [16,d^2]. The distribution range of d is [10,224]. Therefore, the range length of the operation block area distribution is [upper limit - lower limit] = 150498, and the range length of the deleted area distribution is 50160. The ratio of the two is 0.333, which means that the probability of deleting the area is 0.33, which means that the average proportion of the image retained under ideal conditions is 67%.
[0147] In the oracle-minist dataset, oracle bone inscriptions only occupy part of the image, and the proportion of the effective text area retained is close to the experimental results.
[0148] Corresponding to the second point [Grid Mask controls the density and size of the deleted areas, statistically better balancing the deleted and retained information, thereby improving the generalization performance of the model.]
[0149] The experimental results of Dynamic GridMask are shown in Table 2. The baseline is the experimental result without data augmentation. The CIFAR10 dataset used in the comparison document and the Oracle-MNIST dataset of this invention are similar, both being small classification datasets with 10 categories. This invention directly uses the results of GridMask with the optimal hyperparameters on CIFAR10 for comparison, where d is [96,224] and r = 0.4.
[0150] In terms of standard recognition accuracy and AUROC, both GridMask and Dynamic GridMask are higher than the baseline, and Dynamic GridMask is higher than GridMask, which proves the effectiveness of the improved algorithm Dynamic GridMask proposed in this invention in improving accuracy.
[0151] Hyperparameter r. In the first step, Dynamic GridMask only adds the random walk factor, and the results are shown in the third row of Table 2. Compared with GridMask, accuracy increased by 0.39% and the average AUROC increased by 0.52%, indicating that increasing the random walk factor can simultaneously improve the model's accuracy and OOD capability. In the second step, the hyperparameter r is removed. As shown in the fourth row of Table 2, compared with GridMask, accuracy increased by 0.35% and the average AUROC increased by 0.69%. Compared with the baseline, accuracy increased by 0.59% and the average AUROC increased by 3.46%, significantly improving the model's OOD capability. This shows that removing the hyperparameter r and increasing the random walk factor are beneficial to improving various model capabilities while reducing the number of hyperparameters.
[0152] Hyperparameter d. Dynamic GridMask only has hyperparameter d. This paper verifies three different value combinations and finds that [96,224] can achieve the best results.
[0153] Probability P. This method decomposes the original GridMask probability of the entire image into the deletion probability of each operation block. Results were verified for probabilities of 0.8, 0.9, and 1.0. Dynamic GridMask outperformed GridMask in accuracy, achieving the best result at an AUROC of 0.9.
[0154] Table 2 Dynamic GridMask experimental results
[0155]
[0156] Delete block shape. The width deta_x and height deta_y of the deleted block are randomly generated by the operation block length d. A paper and OBC306 respectively counted the aspect ratios of characters in the OBCD and OBC306 data sets, and found that the aspect ratios tend to be between 1 and 2. In order to reflect the aspect ratio characteristics of oracle bone characters, the present invention keeps deta_y unchanged and restricts deta_x. The random area restrictions of deta_x are shown in the deta_x column of the table. After restricting deta_x, its expected ratio to deta_y is 1:1, 4:3, 1:3, and 1:2, respectively. Among them, the result of 4:3 is the best.
[0157] During training, to reduce the overhead of regenerating masks for each batch within an epoch, the present invention pre-generates 10,000 masks and randomly extracts them from each batch to perform the Mixup operation. Based on the hardware and computational requirements of the present invention, this pre-generation method reduces the computation time per epoch from 37 seconds to 21 seconds, a reduction of 16 seconds, significantly improving training efficiency.
[0158] We performed intra-class and inter-class Mixup on the dataset presented in this paper. The experimental results are shown in Table 5. The experiment demonstrates the effectiveness of the Mixup method in improving the accuracy of oracle bone inscription character recognition. The results in the Accuracy column show that the oracle bone inscription character recognition accuracy after data augmentation using Mixup is higher than the baseline. All AUROC values for Intra-Mixup are higher than those for Baseline, while all AUROC values for Inter-Mixup are lower than those for Baseline. These experimental results demonstrate the effectiveness of Intra-Mixup in improving the model's OOD capabilities.
[0159] The hyperparameter \lambda determines the fusion ratio of two images and corresponding labels. This paper observes the experimental results of different fusion ratios by letting \lambda follow the Beta distribution. The Beta density distribution curve of different \alpha values is shown in the figure below. Figure 10 As shown. When \alpha is smaller, the density at both ends is higher, that is, the fusion result tends to one of the two pictures. When \alpha is larger, the density in the middle is higher, that is, the fusion result tends to be evenly fused. When alpha = 1.0, the two pictures are completely evenly fused. From the experimental results of Intra-Mixup in the table, it can be seen that as \alpha increases, that is, when the two pictures tend to be evenly fused, the measurement indicators show a trend of first increasing and then decreasing. The best accuracy is achieved when \alpha = 0.1, and the best AUROC indicators are achieved when \alpha = 0.005. In order to maximize the OOD ability of the model, the present invention uses the Int ra-Mixup method for data enhancement in subsequent experiments, and the Beta distribution parameter of the hyperparameter lambda is set to 0.005 by default.
[0160] Table 3 Intra-class and inter-class Mixup experimental results
[0161]
[0162] CutMix was used for intra-class and inter-class fusion. The lambda hyperparameter for the fusion of the two images conforms to the Beta distribution. The following conclusions were drawn from the experimental results in Table 4:
[0163] In terms of classification accuracy, intra-class fusion improves oracle bone inscription character classification accuracy, while inter-class fusion degrades it. Intra-class fusion accuracy is higher than the baseline under different beta distribution parameters. Intra-class fusion achieves higher AUROC performance than the baseline, while inter-class fusion falls far short of the baseline. Intra-class fusion reaches its highest value when alpha is 0.1.
[0164] Probability P. This paper also verified the probability of CutMixing an image, achieving a maximum AUROC at p = 0.9. Experiments confirmed the effectiveness of intra-class CutMix on both oracle bone character classification accuracy and AUROC. In subsequent experiments, this paper used CutMix as a method for augmenting oracle bone character data. To reduce overhead, similar to Mixup, this paper pre-generates the image fusion mask and label fusion coefficients.
[0165] Table 4 Intra-Cutmix experimental results
[0166]
[0167] Based on the above method, the present invention provides an oracle bone inscription classification and recognition system, which includes: an acquisition module, an image processing module, a model training module and a classification module.
[0168] Among them, the acquisition module is used to obtain historical oracle bone inscription pictures; the picture processing module is used to use the improved DynamicGridMask image enhancement method to divide the historical oracle bone inscription pictures into S×S operation blocks, and traverse each operation block to delete the rectangular area in the operation block; among them, the improved DynamicGridMask image enhancement method is specifically: the hyperparameter in the GridMask image enhancement method is set to a single, the rectangular area for deletion is controlled by a single hyperparameter d, and the aspect ratio range of the operation block is limited according to the aspect ratio of the historical oracle bone inscription; the model training module is used to splice and fuse multiple historical oracle bone inscription pictures of the same category that have been deleted in the rectangular area to obtain oracle bone inscription pictures with multi-scale information, and the classification recognition model is optimized by the oracle bone inscription pictures with multi-scale information to obtain a classification recognition model with OOD detection of oracle bone inscription pictures; the classification module is used to input the oracle bone inscription pictures to be detected into the classification recognition model with OOD detection of oracle bone inscription pictures for detection to obtain recognition results of oracle bone inscriptions of different categories.
[0169] The present invention also provides a computer device, comprising a memory and a processor. The memory stores a program, and when the program is executed by the processor, the processor executes the steps of an oracle bone character classification and recognition method.
[0170] According to the disclosed embodiments, a computing device may communicate with one or more external devices (e.g., a keyboard, a pointing device, Bluetooth communications, etc.), or with any device that enables a computing device to communicate with one or more other computing devices (e.g., a router, a modem, etc.).
[0171] The present invention also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of a method for classifying and recognizing oracle bone characters are realized.
[0172] According to the disclosed embodiments, the storage medium may be a non-volatile computer-readable storage medium, such as, but not limited to, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0173] The above content is a further detailed description of the present invention in combination with specific preferred embodiments. For those skilled in the art to which the present invention belongs, several simple deductions or replacements can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.
Claims
1. A method for classifying and recognizing oracle bone characters, characterized in that: include: Obtain historical oracle bone inscriptions images; An improved Dynamic GridMask image enhancement method is used to divide the historical oracle bone inscription images into S×S operation blocks. Each operation block is traversed and rectangular areas are deleted in the operation block. The improved Dynamic GridMask image enhancement method is specifically as follows: the hyperparameter in the GridMask image enhancement method is set to a single hyperparameter, and the rectangular area to be deleted is controlled by the single hyperparameter d. The aspect ratio range of the operation block is restricted according to the aspect ratio of the historical oracle bone inscriptions. Multiple historical oracle bone inscription images of the same category that have been deleted in the rectangular area are spliced and fused to obtain oracle bone inscription images with multi-scale information. The classification and recognition model is optimized using the oracle bone inscription images with multi-scale information to obtain a classification and recognition model with OOD detection for oracle bone inscription images. The oracle bone inscription images to be detected are input into a classification recognition model with OOD detection for oracle bone inscription images for detection, and recognition results of different categories of oracle bone inscriptions are obtained.
2. The oracle bone inscription classification and recognition method according to claim 1, wherein: When the rectangular area to be deleted is controlled by a single hyperparameter d, the method further includes: Set the information retention ratio of the historical oracle bone inscription images and use the information retention ratio as the information for subsequent division. The specific expression of the information retention ratio K is: K=1-(deta_x*deta_y / d*(r+deta_x)); Among them, dela_x, deta_y = random (0, d-1) is the deleted rectangular area.
3. The oracle bone inscription classification and recognition method according to claim 1, wherein: When the plurality of historical oracle bone inscription pictures of the same category that have been deleted from the rectangular area are spliced and fused, the Mosai c method is used to perform intra-category fusion on the plurality of historical oracle bone inscription pictures of the same category.
4. A classification and recognition system for oracle bone characters, characterized in that: include: The acquisition module is used to obtain historical oracle bone inscription images; An image processing module is used to divide the historical oracle bone inscription image into S×S operation blocks using an improved Dynamic GridMask image enhancement method, traverse each operation block, and delete rectangular areas within the operation block. The improved Dynamic GridMask image enhancement method specifically includes: setting the hyperparameter in the GridMask image enhancement method to a single hyperparameter, controlling the rectangular area to be deleted by the single hyperparameter d, and limiting the aspect ratio range of the operation block based on the aspect ratio of the historical oracle bone inscription; The model training module is used to splice and fuse multiple historical oracle bone inscription images of the same category after the rectangular area is deleted to obtain oracle bone inscription images with multi-scale information. The classification and recognition model is optimized using the oracle bone inscription images with multi-scale information to obtain a classification and recognition model with OOD detection of oracle bone inscription images; The classification module is used to input the oracle bone character image to be detected into the classification recognition model with oracle bone character image OOD detection for detection, and obtain the recognition results of different categories of oracle bone characters.
5. A computer device, characterized in that: The method comprises a memory and a processor, wherein a program is stored in the memory, and when the program is executed by the processor, the processor executes the steps of the oracle bone character classification and recognition method as claimed in any one of claims 1 to 3.
6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the oracle bone inscription classification and recognition method according to any one of claims 1 to 3 are implemented.