Oracle bone plate intelligent retrieval method and device

By training the oracle bone script character detection model and performing environmental simulation processing, a feature database was established, which solved the problem of low accuracy in oracle bone script character matching and enabled efficient recognition and search in complex scenarios.

CN120976933BActive Publication Date: 2026-11-24HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510903050.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2025-06-17
Filing Date
2025-07-01
Publication Date
2026-11-24
Estimated Expiration
2045-07-01

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively identify and match oracle bone script characters, especially in the presence of noise, lighting differences, and rubbing noise, resulting in low character matching accuracy and a lack of robustness in existing methods.

Method used

By acquiring training samples with character segmentation and annotation, the character detection model is trained, the dataset is expanded and environmental simulation is performed, a feature database is established, the model's matching degree to different real-world scenarios is improved, and character search is performed using feature encoding.

Benefits of technology

It improves the accuracy of matching and recognizing oracle bone script characters, enabling the rapid and accurate acquisition of associated rubbings of user-input characters in complex scenarios, and supporting rapid comparative research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976933B_ABST
    Figure CN120976933B_ABST
Patent Text Reader

Abstract

This invention provides an intelligent retrieval method and apparatus for oracle bone rubbings, comprising: acquiring a first training sample with character segmentation and character annotation; training a character detection model based on the first training sample; performing character segmentation and character annotation on each character in the rubbing dataset based on the trained character detection model to obtain an expanded dataset; performing environmental simulation processing on the expanded dataset and the first training sample to obtain a second training sample; training a comparison model based on the second training sample to obtain a trained comparison model; associating the feature codes of each character in the second training sample with their own character annotations to establish a feature database for character search; and improving the applicability of the trained comparison model to more challenging scenarios by performing environmental simulation processing on the training samples, thereby improving the accuracy of the comparison model in matching and recognizing oracle bone rubbings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to an intelligent retrieval method and device for oracle bone inscription rubbings. Background Technology

[0002] Oracle bone script is the earliest known mature system of Chinese characters. Traditional work on oracle bone text processing relied on experts to meticulously copy, segment, and compare each character. A medium-sized rubbing often contains dozens to hundreds of characters, making manual location and retrieval extremely time-consuming. Homographs, incomplete characters, and rubbing noise further complicate large-scale digital processing. Over the past decade, the rise of deep convolutional networks and object detection frameworks has greatly advanced character detection and recognition in natural images. However, existing methods are mostly designed for street signs or printed text, assuming clean character boundaries, continuous strokes, and easily readable text. These methods are difficult to directly transfer to oracle bone images with their incised lines, cracks, and broken strokes. Most existing digital oracle bone script platforms manually annotate character boxes, and character matching using neural network models not only has low accuracy but also lacks robustness to significant noise, lighting, and rubbing differences, making accurate matching even more challenging.

[0003] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention

[0004] The technical problem this invention aims to solve is how to improve the accuracy of neural network models in matching and recognizing oracle bone script characters.

[0005] This invention provides an intelligent retrieval method for oracle bone inscription rubbings, comprising: Obtain the first training sample with character segmentation and character annotation, and train the character detection model based on the first training sample; Based on the trained character detection model, each character in the rubbing dataset is segmented and labeled to obtain an expanded dataset; The expanded dataset and the first training sample are subjected to environmental simulation processing to obtain a second training sample, so as to improve the matching degree of the second training sample with different real-world scenarios; Features are extracted and encoded for each character in the second training sample. The comparison model is then trained based on the second training sample with the encoded features to obtain the trained comparison model. The feature codes of each character in the second training sample are associated with their own character annotations to establish a feature database for character search.

[0006] Preferably, the step of obtaining a first training sample with character segmentation and character annotation, and training the character detection model based on the first training sample, specifically includes: The first training sample is preprocessed; Based on the character segmentation and character annotation of each character in the preprocessed first training sample, the border information and classification information of each character are obtained. The border information and classification information of each character are then encoded to obtain the ground value code of each character. In each round of iterative training, the character detection model obtains the predicted encoding of each character based on the preprocessed first training sample, obtains the loss function of the character detection model based on the ground value encoding and predicted encoding of each character, and updates the character detection model based on the loss function. When the number of iterations is greater than or equal to the preset maximum number of iterations, the updated character detection model in the last iteration is output as the trained character detection model.

[0007] Preferably, the preprocessing of the first training sample specifically includes: The preprocessing includes one or more of the following: loading border information for each character box in the first training sample, randomly scaling it according to a preset magnification, randomly cropping it, randomly adjusting the brightness within a preset brightness range, randomly adjusting the contrast within a preset contrast range, and randomly rotating it according to a preset angle range.

[0008] Preferably, the step of obtaining the loss function of the character detection model based on the truth encoding and predictive encoding of each character specifically includes: The correlation between the true value encoding and the predicted encoding of each character is obtained from the true value encoding and the predicted encoding of that character. The corresponding expression is: ; in, For matrix elements, This is the predicted classification vector in the predicted encoding of the corresponding character. This is the true classification vector in the truth value encoding of the corresponding character. The true border vector in the truth value encoding of the corresponding character. This refers to the predicted bounding box vector in the predictive encoding of the corresponding character. The generalized intersection-union ratio (CIU) is the ratio between the ground truth bounding box vector and the predicted bounding box vector. The norm loss is the difference between the ground truth bounding box vector and the predicted bounding box vector. , and All are weighted parameters; The loss function of the character detection model is obtained based on the correlation between the ground truth encoding and the predicted encoding of each character. The corresponding expression is: ; Where L is the loss function of the character detection model. For the loss of quality focus of classified information, To regress the loss, To compensate for the losses.

[0009] Preferably, the step of performing environmental simulation processing on the expanded dataset and the first training samples to obtain the second training samples, in order to improve the matching degree of the second training samples with different real-world scenarios, specifically includes: Obtain each segmented character frame and the corresponding differential sample from the augmented dataset and the first training sample; According to the first preset probability, one or more of the following are performed on each character frame and the differential sample corresponding to each character frame: noise processing, erosion and dilation processing, and blurring processing. All processed character frames and the differential samples corresponding to each character frame are used as the second training samples.

[0010] Preferably, each sample undergoes one or more of the following processing methods according to a first preset probability: noise reduction, erosion and dilation processing, and blurring processing, specifically including: Multiple small spots are randomly generated within all the divided character frames in the expanded dataset and the first training sample with a first preset probability to simulate environmental noise. With a first preset probability, the characters in all the divided character frames in the expanded dataset and the first training sample are subjected to stroke erosion or dilation operations using random floating-point numbers. With a first preset probability, each region within all the divided character frames in the expanded dataset and the first training sample is subjected to either focus-type blurring or jitter-type blurring with a second preset probability.

[0011] Preferably, the step of extracting and encoding features from each character in the second training sample, and training the comparison model based on the feature-encoded second training sample to obtain the trained comparison model specifically includes: The loss function expression for the comparison model is: ; Where N is the number of images in a single batch of input, τ is the temperature hyperparameter, and K is the total capacity of the negative sample queue. For the InfoNCE loss function, and Together as positive sample pairs The i-th image among the N images input in a single batch, where j is the j-th image in the historical k-vector queue. For the negative sample pair vector, exp( ) is an exponential function.

[0012] Preferably, the intelligent retrieval method for oracle bone rubbings further includes: The input rubbing is input into the trained character detection model, and the trained character detection model is used to segment the input rubbing into characters to obtain the input character frame of the input rubbing. The user inputs the required input character box into the trained comparison model, which extracts features from the input character box and obtains feature encoding. The feature code of the input character box is compared and identified with the feature codes of all characters in the feature database, and the feature codes of all matching characters in the feature database that match the input character box are selected. Based on the feature encoding of all matching characters, character labels for all matching characters are obtained. Based on the character labels of all matching characters, rubbings corresponding to the matching characters are obtained, as well as the positions of the matching characters in the rubbings.

[0013] Secondly, an intelligent retrieval device for oracle bone rubbings is provided, comprising at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor to perform the intelligent retrieval method for oracle bone rubbings.

[0014] Thirdly, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors to perform the method described in the first aspect.

[0015] Fourthly, a chip is provided, comprising: a processor and an interface for calling and running a computer program stored in memory, performing the method as described in the first aspect.

[0016] Fifthly, a computer program product containing instructions is provided that, when executed on a computer or processor, causes the computer or processor to perform the method as described in the first aspect.

[0017] Sixthly, a system for intelligent retrieval of oracle bone inscription rubbings is provided, including an intelligent retrieval device for oracle bone inscription rubbings as described in the second aspect, and using an intelligent retrieval method for oracle bone inscription rubbings as described in the first aspect.

[0018] This invention provides an intelligent retrieval method and apparatus for oracle bone rubbings, comprising: acquiring a first training sample with character segmentation and character annotation; training a character detection model based on the first training sample; performing character segmentation and character annotation on each character in the rubbing dataset based on the trained character detection model to obtain an expanded dataset; performing environmental simulation processing on the expanded dataset and the first training sample to obtain a second training sample; training a comparison model based on the second training sample to obtain a trained comparison model; associating the feature codes of each character in the second training sample with their own character annotations to establish a feature database for character search; and improving the applicability of the trained comparison model to more challenging scenarios by performing environmental simulation processing on the training samples, thereby improving the accuracy of the comparison model in matching and recognizing oracle bone rubbings. Furthermore, by establishing a feature database, we can quickly obtain related rubbings of the characters entered by the user for rapid comparative research. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0020] Figure 1 This is a flowchart of a method for intelligent retrieval of oracle bone inscription rubbings provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the segmentation, recognition, and retrieval of characters in a rubbing sample in an intelligent retrieval method for oracle bone inscriptions provided in an embodiment of the present invention. Figure 3 This invention provides a method for obtaining a character monitoring model in an intelligent retrieval method for oracle bone rubbings. Figure 4 This is a schematic diagram illustrating the segmentation, recognition, and retrieval of characters in a rubbing sample in an intelligent retrieval method for oracle bone inscriptions provided in an embodiment of the present invention. Figure 5 This is a flowchart of the environmental simulation processing method in an intelligent retrieval method for oracle bone rubbings provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the environmental simulation processing in an intelligent retrieval method for oracle bone inscription rubbings provided in an embodiment of the present invention; Figure 7 This is a flowchart of the environmental simulation processing method in another intelligent retrieval method for oracle bone rubbings provided in this embodiment of the invention; Figure 8This is a flowchart illustrating the character retrieval method in an intelligent retrieval method for oracle bone rubbings provided in this embodiment of the invention. Figure 9 This is a schematic diagram of the comparison model and the method flow for retrieving oracle bone rubbings in an intelligent retrieval method provided in an embodiment of the present invention; Figure 10 This is a schematic diagram of an intelligent retrieval device for oracle bone inscription rubbings provided in an embodiment of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0022] Unless the context otherwise requires, throughout the specification and claims, the term "comprising" is interpreted as openly inclusive, meaning "including, but not limited to." In the description of the specification, terms such as "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this disclosure. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics mentioned may be included in any suitable manner in any one or more embodiments or examples; that is, although they may be incorporated into embodiments or examples using the above terms for reasons such as order and position, it does not limit them to be incorporated in combination by a single embodiment or example.

[0023] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more. Furthermore, for example, the description may use the prefix "A" or "B" to describe the same type of nouns as two independent entities. In this case, the corresponding features defined with "A" and "B" are used only to distinguish between similar entities and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.

[0024] In describing some embodiments, the terms "coupled," "coupled," and "connected," and their derivative expressions, may be used. For example, the term "connected" may be used in describing some embodiments to indicate that two or more components have direct physical or electrical contact with each other. Similarly, the term "coupled" may be used in describing some embodiments to indicate that two or more components have direct physical or electrical contact. However, the terms "connected" or "coupled" may also refer to two or more components that do not have direct contact with each other but still cooperate or interact with each other, such as "optical coupling," "wireless connection," etc. The embodiments disclosed herein are not necessarily limited to the scope of this invention.

[0025] In the description of this invention, the expression “A and / or B” (where A and B are used to formally represent specific features) will be used. The corresponding expression includes the following three combinations: only A, only B, and a combination of A and B.

[0026] As used in this invention, “about,” “approximately,” or “approximately” includes the stated value and the average value within an acceptable range of deviation from a particular value, wherein the acceptable range of deviation is determined by a person skilled in the art taking into account the measurement under discussion and the error associated with the measurement of the particular quantity (i.e., the limitations of the measurement system).

[0027] This embodiment provides an intelligent retrieval method for oracle bone inscription rubbings, such as... Figure 1 As shown, the method flow includes: In step 101, a first training sample with character segmentation and character annotation is obtained, and the character detection model is trained based on the first training sample.

[0028] In this embodiment, the first training sample can be the Oracle Bone Inscriptions Multi-modal Dataset (OBIMD). The first training sample includes multiple rubbing samples, which refer to images of rubbings engraved with multiple oracle bone characters. Character segmentation refers to dividing different characters on the rubbing sample using character boxes according to their position and size, thereby locating the position of each character on the rubbing sample and clarifying the size range of each character to avoid mutual interference between different characters. Character annotation involves numbering each character on the rubbing sample and mapping each number to the corresponding character information to clarify the character information of each character on the rubbing.

[0029] In this embodiment, the character detection model is used to divide each character on the rubbing according to its position and size, and to identify and classify each character. Since each rubbing sample in the first training sample already has its own character division and character identifier, the first training sample already has correct values ​​for division and identification. After constructing the initial character detection model, the first training sample can be input into the character detection model. The character detection model outputs the predicted character division and the predicted character identifier. The predicted values ​​of character division and character identifier are compared with the correct values. Through multiple rounds of iteration, the predicted values ​​gradually converge to the correct values, thereby completing the training of the character detection model.

[0030] In step 102, each character in the rubbing dataset is segmented and labeled according to the trained character detection model to obtain the expanded dataset.

[0031] In this embodiment, considering that a comparison model needs to be trained subsequently, the sample size of the first training sample may be insufficient. Therefore, additional training samples need to be introduced. The rubbing dataset can be a large series of oracle bone inscriptions. Since each rubbing in the dataset does not have character segmentation and annotation, a trained character detection model is needed to segment and annotate the characters in the rubbing dataset to obtain the position and information of each character, ensuring that the rubbing dataset can serve as a training sample set for the comparison model.

[0032] In this embodiment, considering that the commonly used training samples, such as the Oracle Bone Multimodal Dataset and the Oracle Bone Rubbings Series, are all manually processed rubbing samples, these rubbing samples have clear pixel resolution, clear strokes of oracle bone characters, and minimal blemishes as noise interference after manual processing. Therefore, if these training samples are directly used to train the comparison model, the trained comparison model will only be suitable for clear rubbing samples with minimal noise interference. For rubbing samples with significant noise interference, such as newly unearthed oracle bone rubbings, the photos taken on-site may contain unclear images, high noise levels, and incomplete or dirty rubbings, making it difficult to output accurate prediction results when inputting these noisy rubbings into the comparison model. Therefore, this embodiment also involves the following steps to avoid the above problems: In step 103, the expanded dataset and the first training sample are subjected to environmental simulation processing to obtain a second training sample, so as to improve the matching degree of the second training sample with different real-world scenarios.

[0033] The environmental simulation processing involves randomly adding noise, randomly eroding, expanding, deforming strokes, or randomly adding dynamic blur to the expanded dataset and the rubbing samples in the first training sample to simulate the sample conditions obtained under relatively harsh scenarios. The second training sample after environmental simulation processing is then used to train the subsequent comparison model, thereby improving the applicable scenario range of the comparison model.

[0034] In step 104, features are extracted and encoded for each character in the second training sample. The comparison model is then trained based on the second training sample with the encoded features, resulting in the trained comparison model.

[0035] Furthermore, in this embodiment, the comparison model is used to identify a single character and compare it with sample characters stored in its own database to obtain the meaning and classification of the character. Therefore, the feature extraction involves extracting the strokes and styles of the character according to feature types and encoding them according to the feature types to obtain the feature codes, which are in vector form. The training of the comparison model involves inputting the feature codes of different characters and comparing the distances between the feature codes of different characters. Characters that are closer in distance are more likely to be considered the same character, while characters that are farther apart are more likely to be considered different characters. Through multiple rounds of iterative comparisons, the training of the comparison model is completed.

[0036] Furthermore, in this embodiment, considering that the study of oracle bone inscriptions often requires comparing the same character on different rubbings to study different ways of writing the same character or the meaning of the character on different rubbings, a function is needed that allows the user to retrieve all rubbings containing the corresponding character from a pre-set database after inputting the character, and to know the position of the character in each rubbing, to facilitate the user's comparative study of the character on different rubbings. Therefore, this embodiment also involves the following method steps: In step 105, the feature codes of each character in the second training sample are associated with their own character annotations to establish a feature database for character search.

[0037] In this embodiment, by associating feature codes with their own character annotations and storing them in the feature database, when a user inputs corresponding input characters, the comparison model extracts the features of the input characters to obtain their feature codes. It then finds all reference characters (i.e., characters that can be considered identical to the input characters) from the feature database and obtains the character annotations for all found reference characters. Based on these annotations, the model can obtain the rubbing containing the reference character and its position on the rubbing. This outputs all rubbings containing the reference character and the position of the reference character on the corresponding rubbing, facilitating user reading and research. Figure 2 The diagram shown is a schematic diagram of character segmentation, recognition, and retrieval in the rubbing sample in this embodiment.

[0038] Furthermore, in this embodiment, the training of the character detection model involves the following design: obtaining a first training sample with character segmentation and character annotation, and training the character detection model based on the first training sample, such as... Figure 3 and Figure 4 As shown, Figure 4 A flowchart for training the character detection model is provided, and the method includes: In step 201, the first training sample is preprocessed.

[0039] In this embodiment, the character detection model is initialized. The preprocessing involves inputting the first training sample into the character detection model and preprocessing the first training sample through the character detection model. The preprocessing includes one or more of the following: loading border information for each character box in the first training sample, randomly scaling it according to a preset magnification, randomly cropping it, randomly adjusting the brightness within a preset brightness range, randomly adjusting the contrast within a preset contrast range, and randomly rotating it according to a preset angle range.

[0040] In this embodiment, the preset magnification, preset brightness range, preset contrast range, and preset angle range are all set by those skilled in the art according to actual conditions. The preset magnification for random scaling can be 0.2x-5x, the preset contrast range can be ±0.4, and the preset angle range can be ±20 degrees. The probability of random rotation can be 0.5.

[0041] In step 202, the border information and classification information of each character are obtained based on the character segmentation and character annotation of each character in the preprocessed first training sample. The border information and classification information of each character are then encoded to obtain the ground truth code of each character.

[0042] In this embodiment, the border information includes the coordinates of the center point of the character box and the length and width of the character box, and the classification information is the character number of the corresponding character. The truth value encoding is the real information related to the character.

[0043] In step 203, in each round of iterative training, the character detection model obtains the predicted encoding of each character based on the preprocessed first training sample, obtains the loss function of the character detection model based on the ground truth encoding and predicted encoding of each character, and updates the character detection model based on the loss function.

[0044] In this embodiment, the preprocessed first training sample is input into the backbone network of the character detection model for convolutional feature extraction. The backbone network can adopt a deep residual network structure to convert the image in the input first training sample into feature maps with four different spatial resolutions. The feature maps are then processed by a lightweight channel mapping module to unify the number of channels and generate an additional fifth spatial scale to form a feature pyramid. The feature pyramid provides multi-resolution information for the subsequent encoder based on cross-scale dynamic attention.

[0045] In this embodiment, the encoder comprises a multi-layer Transformer structure based on dynamic deformable attention. Each Transformer layer in the encoder performs focused information aggregation on a small number of key locations, obtaining context through adaptive offset sampling on feature maps of different scales, greatly improving the representation capability of large and small characters. After the encoder output, the encoder enters the decoder stage. The decoder layer first performs query self-attention to facilitate information interaction between different queries, then aligns the queries with encoder features using cross-scale deformable attention, and finally completes feature updates through a feedforward network. The decoder iterates multiple times, generating a series of candidate boxes and classification scores.

[0046] In this embodiment, the prediction encoding includes predicted bounding box information and predicted classification information. The character detection model contains vectors for all classification types of characters. For the prediction of classification information of different characters, the classification information of each character in the first training sample can be extracted and encoded. The encoded classification information is compared with all classification types of all characters in the character detection model to obtain the multi-class confidence distribution of the encoded classification information relative to all classification types. Based on the multi-class confidence distribution, it can be determined which classification type the corresponding character's classification information is closer to.

[0047] The correlation between the true value encoding and the predicted encoding of each character is obtained from the true value encoding and the predicted encoding of that character. The corresponding expression is: ; in, For matrix elements, This is the predicted classification vector in the predicted encoding of the corresponding character. This is the true classification vector in the truth value encoding of the corresponding character. The true border vector in the truth value encoding of the corresponding character. This refers to the predicted bounding box vector in the predictive encoding of the corresponding character. The generalized intersection-over-union ratio (CIU) is the ratio of the true bounding box vector to the predicted bounding box vector, representing the geometric overlap. A larger overlap indicates a greater geometric overlap. The larger the value and the closer it is to 1, the smaller the overlapping area. The smaller; The norm loss between the true bounding box vector and the predicted bounding box vector is used to compare the coordinate differences of the bounding box centers. It can be 1, It can be 5. The value can be 2. The above formula is used to obtain the case where the distance between the predicted code and the ground truth code is minimized (i.e., the correlation is maximized), and the case where the distance between the predicted code and the ground truth code is minimized is used for subsequent calculation of the loss function.

[0048] The loss function of the character detection model is obtained based on the correlation between the ground truth encoding and the predicted encoding of each character. The corresponding expression is: ; In this embodiment, The quality focus loss for classification information is used to incentivize the model to give higher confidence scores on positive samples, while penalizing misclassifications. The regression loss measures the absolute error between the predicted bounding box information and the true bounding box information in terms of center coordinates and width and height. This is used to compensate for the collateral effects of regression when GIoU is low. , and All settings are controlled by hyperparameters.

[0049] After calculation, the system performs backpropagation on all trainable parameters and adjusts the network weights using the adaptive momentum and stochastic gradient descent (Adam+SGD) optimization algorithm. This process is iterated until the preset number of training rounds is completed, during which periodic validation can be inserted to monitor the model's performance on the test set.

[0050] During the inference phase, the system only needs to perform input loading and simple preprocessing, without loading ground truth bounding box annotations or performing data augmentation. The preprocessed image is fed into the same backbone, pyramid, encoder, decoder, and detector head, generating a batch of candidate bounding boxes and their corresponding classification scores. Non-maximum suppression (NMS) is then applied to all candidates to filter out highly overlapping boxes with low confidence. For each remaining box, its normalized coordinates are transformed back to the original image space, and the final output is selected based on a score threshold. The final result includes several bounding boxes and their corresponding class confidence scores, indicating which characters were detected and their locations in the image. If subsequent semantic retrieval or contrastive learning is needed, these bounding box regions can be cropped to obtain single-character images, which are then fed into the representation model to generate feature vectors for neighbor search. Thus, the end-to-end process seamlessly integrates supervised detection and unsupervised representation retrieval, achieving accurate finding and matching of single characters in the original rubbing.

[0051] In step 204, when the number of iterations to be updated is greater than or equal to the preset maximum number of iterations, the updated character detection model in the last iteration is output as the trained character detection model.

[0052] Furthermore, in this embodiment, before training the comparison model, it is necessary to perform environmental simulation processing on the first training sample. Therefore, this embodiment also involves the following design: The augmented dataset and the first training samples are processed using environmental simulation to obtain second training samples, thereby improving the matching degree of the second training samples with different real-world scenarios, such as... Figure 5 As shown, the method flow includes: In step 301, the expanded dataset and each segmented character frame in the first training sample, as well as the differential sample corresponding to each character frame, are obtained.

[0053] It is important to note that in this embodiment, the rubbing dataset and the first training samples undergo differential processing during image import. When processing each image subsequently, the corresponding differential samples also need to be processed. Therefore, each segmented character frame will also have a corresponding differential sample. The differential processing involves introducing differences between two views in the pixel dimension through random preprocessing, but semantically they both originate from the same original character image, forming a positive sample pair. One of these pairs is sent to the k-branch and subsequently encoded as a k-vector and entered into the queue, while the other is sent to the q-branch and encoded as a q-vector.

[0054] In step 302, one or more of the following are performed on each character frame and the differential sample corresponding to each character frame according to the first preset probability: noise processing, erosion and dilation processing, and blurring processing.

[0055] In this embodiment, the first preset probability is set by those skilled in the art based on actual circumstances. Specifically, the first preset probability can be 50%.

[0056] In step 303, all processed character frames and the differential samples corresponding to each character frame are used as the second training samples.

[0057] like Figure 6 The diagram shown is a schematic representation of the environmental simulation process in this embodiment.

[0058] Each sample undergoes one or more of the following processing methods according to a first preset probability: noise reduction, erosion and dilation processing, and blurring processing. Figure 7 As shown, it specifically includes: In step 401, multiple small spots are randomly generated within all the divided character frames in the expanded dataset and the first training sample with a first preset probability to simulate environmental noise.

[0059] In this embodiment, the environmental simulation processing is performed on the character frames after each character in the expanded dataset and the first training sample. It should be noted that before performing the environmental simulation processing, considering that oracle bone rubbings are often in single-channel grayscale form, it is necessary to first convert the grayscale character frames into 3×8-bit RGB images.

[0060] In this embodiment, custom-defined verification noise can be used to simulate small blank or excessively inked spots that appear on oracle bone rubbings during the rubbing, photographing, scanning, or transmission of ancient books, thus enriching the training sample distribution. This is achieved by randomly determining the number and position of white or black dots based on the image size and specified ratio. Specifically, at random coordinate positions in the image, the pixel value is set to 0 (i.e., black dot) or 255 (i.e., white dot).

[0061] In step 402, the characters in all the divided character frames in the expanded dataset and the first training sample are subjected to stroke erosion or dilation operations using random floating-point numbers with a first preset probability.

[0062] In this embodiment, the erosion and dilation process simulates the subtle breaks in the lines of characters on real oracle bone rubbings caused by long-term preservation or rubbing techniques, as well as the possible thickening of lines due to ink diffusion. During model training, incorporating erosion and dilation reduces the probability of misidentifying the same character as different views due to variations in stroke thickness or minor breaks during comparative learning. In this embodiment, the erosion and dilation process uses randomly generated floating-point numbers between 0 and 3 to distinguish between "erosion" and "dilation" operations, and randomly selects kernels of sizes 1 to 3 to implement the corresponding erosion and dilation operations.

[0063] In step 403, each region within all the divided character frames in the expanded dataset and the first training sample is subjected to either focus-type blurring or jitter-type blurring according to a first preset probability and a second preset probability.

[0064] In this embodiment, the blurring process is used to add random Gaussian blur with a 50% probability to the image of each character frame to simulate blurring caused by focusing or shaking during actual shooting or scanning. This helps to test the encoder's ability to capture global and local features, and at the same time, to prevent overfitting to high-frequency noise, it allows the model to encode the glyphs from a more macroscopic level. The blurring process can be implemented by setting the Gaussian kernel size k between 3 and 15 and randomly selecting an odd number, and the standard deviation σ being random within the range of 0.1 to 1.0, and then calling the Gaussian blur function to perform convolution blurring on the image of the character frame.

[0065] The aforementioned preprocessing steps aim to transform oracle bone rubbings into three-channel tensors suitable for comparative learning, providing a reliable feature foundation for unsupervised representation learning and subsequent retrieval tasks. First, the conversion from grayscale to RGB images ensures the compatibility of the model input, allowing the original single-channel brightness information to be smoothly integrated into the ResNet structure based on ImageNet pre-trained weights without introducing additional noise. Next, through custom noise processing and erosion / dilation operations, multi-source micro-deformations such as ink stains, paper stains, stroke breaks, and diffusion commonly encountered during rubbing, photography, and preservation are simulated. These semantically irrelevant perturbations force the encoder to focus on the global shape and texture of the bone-carved characters, thereby improving its ability to discriminate the essential structure of the characters. Furthermore, a random Gaussian blur with a 50% probability is added to simulate focal length drift and jitter noise. This step strengthens the model's robustness to different resolutions and low-frequency features while suppressing overfitting to high-frequency noise. Finally, the dual-view model generates positive sample pairs C×H×W tensors with rich differences in scale, position, rotation angle, and color style through a series of geometric and color enhancements. This design ensures that the InfoNCE loss in the momentum contrastive learning framework meets the dual discriminative requirements of "similarity of the same rubbing under varying conditions" and "distinguishability between different rubbings".

[0066] Furthermore, the process involves extracting and encoding features from each character in the second training sample, and then training the comparison model based on the feature-encoded second training sample to obtain the trained comparison model. The training process of the comparison model specifically includes: The generated positive sample pair C×H×W tensor is input into the encoder q / k branch, and the resulting positive sample pair vector is obtained after encoding. The q branch participates in reverse updates, while the k branch updates via momentum. They are incorporated into a circular negative sample queue, which stores historical k vectors. The negative sample vector is constructed, and then the InfoNCE function is used. The loss function expression of the contrastive model is: ; Where N is the number of images in a single batch, which is also the number of positive sample pairs in the corresponding batch, τ is the temperature hyperparameter, and K is the total capacity of the negative sample queue. For the InfoNCE loss function, and Together they form a positive sample pair. The i-th vector from branch k in the corresponding batch. This is the positive sample vector of the corresponding q branch, where i is the i-th positive sample from the N images input in the corresponding batch, and j is the j-th positive sample in the historical k-vector queue. For the negative sample pair vector, exp( The exponential function is used. The InfoNCE loss function increases the difference between positive samples and all negative samples, and reduces the difference between positive sample pairs. The loss function is backpropagated to update the weights in the q branch. In the subsequent rubbing retrieval process, the learned features can be used to construct an efficient feature vector index (such as k-NN-based nearest neighbor search) to achieve automatic matching of rubbings from the same source across batches and devices. This method not only improves the model's deep representation ability of oracle bone characters, but also provides a low-annotation, rapidly scalable intelligent retrieval solution for oracle bone databases and large AI models.

[0067] Furthermore, in this embodiment, after training the comparison model and the character detection model, the feature codes of all characters in the second training sample are associated with their own character annotations. This allows us to determine the location of the corresponding character on the rubbing once its feature code is obtained. The associated relationships, the feature codes of each character in the second training sample, and the character annotations are collectively used as the feature database. This feature database enables the search function for rubbings containing associated characters. The implementation method for this search function is as follows: like Figure 8 As shown, the intelligent retrieval method for oracle bone rubbings also includes: In step 501, the input rubbing is input into the trained character detection model, and the trained character detection model is used to segment the input rubbing into characters to obtain the input character frame of the input rubbing.

[0068] In step 502, the input character box required by the user is input into the trained comparison model, and the comparison model extracts features from the input character box and obtains feature encoding.

[0069] In step 503, the feature encoding of the input character box is compared and identified with the feature encoding of all characters in the feature database, and the feature encoding of all matching characters in the feature database that match the input character box is selected.

[0070] It should be noted that in this embodiment, the top three characters in the feature database with the highest similarity to the input character box can be selected as the matching characters.

[0071] In step 504, the character annotations of all matching characters are obtained according to the feature encodings of all matching characters, and the rubbings corresponding to the matching characters and the positions of the matching characters in the rubbings are obtained according to the character annotations of all matching characters.

[0072] As Figure 9 shows, it is a schematic flow chart of the comparison model and the oracle bone rubbing retrieval method.

[0073] To more intuitively reflect the above method flow, an example is given below: Select rubbing h3320 and identify the fourth oracle bone character in the first column. After loading the rubbing image, the character detection model will segment and sort the 7 oracle bone characters on the rubbing. After the user manually selects serial number 4, the comparison model will display the features of the oracle bone corresponding to serial number 4 for extraction, and correspond and infer the extracted features with modern Chinese characters. Through the comparison model, the characters in the input character box are compared with all characters in the feature database for cosine similarity, and the confidence ranking between the characters in the input character box and other characters is obtained. The character with the highest confidence is matched with the character in the character box. Assuming that the user selects the first confidence Chinese character "Fa" and clicks the "Rubbing Retrieval" text box, the system will automatically retrieve all rubbings that simultaneously contain the oracle bone character "Fa", such as h32175, h32045, etc.

[0074] Embodiment 2: As Figure 10 shows, it is a schematic diagram of the oracle bone rubbing intelligent retrieval device according to the embodiment of the present invention. The oracle bone rubbing intelligent retrieval device of this embodiment includes one or more processors 41 and a memory 42.

[0075] The processor 41 and the memory 42 may be connected by a bus or other means, Figure 10 as exemplified by bus connection in the figure.

[0076] As a non-volatile computer-readable storage medium, the memory 42 can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the oracle bone rubbing intelligent retrieval method in the above embodiments. The processor 41 executes the oracle bone rubbing intelligent retrieval method by running the non-volatile software programs and instructions stored in the memory 42.

[0077] Memory 42 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 42 may optionally include memory remotely located relative to processor 41, which can be connected to processor 41 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0078] The program instructions / modules are stored in the memory 42. When executed by one or more processors 41, they perform the intelligent retrieval method for oracle bone rubbings in the above embodiments, for example, by performing the steps shown in the flowcharts described above.

[0079] This invention also provides a computer storage medium storing computer program instructions; when these computer program instructions are executed by a processor, they implement the intelligent retrieval method for oracle bone rubbings provided in this invention.

[0080] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for intelligent retrieval of oracle bone inscription rubbings, characterized in that, include: Obtain the first training sample with character segmentation and character annotation, and train the character detection model based on the first training sample; The first training sample is preprocessed; Based on the character segmentation and character annotation of each character in the preprocessed first training sample, the border information and classification information of each character are obtained. The border information and classification information of each character are then encoded to obtain the ground value code of each character. In each round of iterative training, the character detection model obtains the predicted encoding of each character based on the preprocessed first training sample, obtains the loss function of the character detection model based on the ground value encoding and predicted encoding of each character, and updates the character detection model based on the loss function; when the number of update iterations is greater than or equal to the preset maximum number of iterations, the updated character detection model in the last iteration is output as the character detection model after training is completed. The correlation between the true value encoding and the predicted encoding of each character is obtained from the true value encoding and the predicted encoding of that character. The corresponding expression is: ; in, For matrix elements, This is the predicted classification vector in the predicted encoding of the corresponding character. This is the true classification vector in the truth value encoding of the corresponding character. The true border vector in the truth value encoding of the corresponding character. This refers to the predicted bounding box vector in the predictive encoding of the corresponding character. The generalized intersection-union ratio (CIU) is the ratio between the ground truth bounding box vector and the predicted bounding box vector. The norm loss is the difference between the ground truth bounding box vector and the predicted bounding box vector. , and All are weighted parameters; The loss function of the character detection model is obtained based on the correlation between the ground truth encoding and the predicted encoding of each character. The corresponding expression is: ; Where L is the loss function of the character detection model. For the loss of quality focus of classified information, To regress the loss, To compensate for the loss; Based on the trained character detection model, each character in the rubbing dataset is segmented and labeled to obtain an expanded dataset; The expanded dataset and the first training sample are subjected to environmental simulation processing to obtain a second training sample, so as to improve the matching degree of the second training sample with different real-world scenarios; Features are extracted and encoded for each character in the second training sample. The comparison model is then trained based on the second training sample with the encoded features to obtain the trained comparison model. The feature codes of each character in the second training sample are associated with their own character annotations to establish a feature database for character search.

2. The intelligent retrieval method for oracle bone inscription rubbings according to claim 1, characterized in that, The preprocessing of the first training sample specifically includes: The preprocessing includes one or more of the following: loading border information for each character box in the first training sample, randomly scaling it according to a preset magnification, randomly cropping it, randomly adjusting the brightness within a preset brightness range, randomly adjusting the contrast within a preset contrast range, and randomly rotating it according to a preset angle range.

3. The intelligent retrieval method for oracle bone inscription rubbings according to claim 1, characterized in that, The process of performing environmental simulation processing on the expanded dataset and the first training samples to obtain second training samples, in order to improve the matching degree of the second training samples with different real-world scenarios, specifically includes: Obtain each segmented character frame and the corresponding differential sample from the augmented dataset and the first training sample; According to the first preset probability, one or more of the following are performed on each character frame and the differential sample corresponding to each character frame: noise processing, erosion and dilation processing, and blurring processing. All processed character frames and the differential samples corresponding to each character frame are used as the second training samples.

4. The intelligent retrieval method for oracle bone inscription rubbings according to claim 3, characterized in that, Each sample undergoes one or more of the following processing methods according to a first preset probability: noise reduction, erosion and dilation, and blurring. Multiple small spots are randomly generated within all the divided character frames in the expanded dataset and the first training sample with a first preset probability to simulate environmental noise. With a first preset probability, the characters in all the divided character frames in the expanded dataset and the first training sample are subjected to stroke erosion or dilation operations using random floating-point numbers. With a first preset probability, each region within all the divided character frames in the expanded dataset and the first training sample is subjected to either focus-type blurring or jitter-type blurring with a second preset probability.

5. The intelligent retrieval method for oracle bone inscription rubbings according to claim 1, characterized in that, The process of extracting and encoding features from each character in the second training sample, and then training the comparison model based on the feature-encoded second training sample to obtain the trained comparison model, specifically includes: The loss function expression for the comparison model is: ; Where N is the number of images in a single batch of input, τ is the temperature hyperparameter, and K is the total capacity of the negative sample queue. For the InfoNCE loss function, and Together as positive sample pairs The i-th image among the N images input in a single batch, where j is the j-th image in the historical k-vector queue. For the negative sample pair vector, exp( ) is an exponential function.

6. The intelligent retrieval method for oracle bone inscription rubbings according to claim 1, characterized in that, The intelligent retrieval method for oracle bone inscription rubbings also includes: The input rubbing is input into the trained character detection model, and the trained character detection model is used to segment the input rubbing into characters to obtain the input character frame of the input rubbing. The user inputs the required input character box into the trained comparison model, which extracts features from the input character box and obtains feature encoding. The feature code of the input character box is compared and identified with the feature codes of all characters in the feature database, and the feature codes of all matching characters in the feature database that match the input character box are selected. Based on the feature encoding of all matching characters, character labels for all matching characters are obtained. Based on the character labels of all matching characters, rubbings corresponding to the matching characters are obtained, as well as the positions of the matching characters in the rubbings.

7. A smart retrieval device for oracle bone inscription rubbings, characterized in that, The method includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor for performing the intelligent retrieval method for oracle bone rubbings according to any one of claims 1-6.

8. A non-volatile computer storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by one or more processors, implement the intelligent retrieval method for oracle bone rubbings as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Rubbing oracle character image augmentation method, rubbing oracle character image augmentation system, computer equipment and medium

    CN111915540A

  • Oracle bone inscription identification method based on multiple image sources

    CN117975490A