Ancient character deciphering method, device and equipment and storage medium
By constructing a visual dictionary of ancient characters and a feature encoder, synthetic images of ancient characters with various writing styles are generated, solving the problems of data scarcity and large variation in oracle bone script deciphering, and achieving efficient and accurate deciphering results.
Patent Information
- Application Number
- CN202610638146.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-11
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2046-05-11
AI Technical Summary
Existing technologies face challenges in deciphering oracle bone inscriptions, including data scarcity, large character variations, and difficulties in feature extraction, resulting in low accuracy and efficiency.
We construct a visual dictionary of ancient characters by generating synthetic images of ancient characters with various writing styles, extracting features using a feature encoder, and deciphering them using a feature retrieval mechanism.
It significantly improves the accuracy and automation efficiency of large-scale ancient script deciphering, provides visual evolutionary evidence at the morphological level, and has strong interpretability.
Smart Images

Figure CN122200691B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of ancient Chinese deciphering technology, and in particular to methods, apparatus, equipment and storage media for ancient Chinese deciphering. Background Technology
[0002] Ancient scripts, such as oracle bone script, are the earliest known systematic Chinese writing system. Currently, approximately 4,600 characters have been identified, but only about 1,500 have been successfully deciphered. Two major challenges exist when using computer-aided deciphering: first, labeled data is extremely scarce and unevenly distributed, making it difficult to support large-scale supervised learning; second, characters are generally fragmented and broken due to historical erosion, and their writing styles vary greatly across different periods, making feature extraction extremely difficult.
[0003] In related technologies, oracle bone script-assisted deciphering methods are mainly divided into two categories: the first is a multi-classification method that directly maps the input image to modern Chinese character labels; the second is a retrieval and matching method based on existing oracle bone script databases. However, due to the severe scarcity of existing deciphered character samples, both of these methods have extremely low accuracy when dealing with unknown character forms outside of known vocabularies or databases, often requiring extensive manual intervention. Consequently, the overall accuracy and efficiency of oracle bone script deciphering cannot meet practical needs. Summary of the Invention
[0004] The main objective of this application is to propose methods, apparatus, devices, and storage media for deciphering ancient characters, thereby improving the efficiency and accuracy of oracle bone script deciphering.
[0005] To achieve the above objectives, a first aspect of this application proposes a method for deciphering ancient scripts, comprising: Obtain an ancient character visualization dictionary consisting of multiple key-value pairs, where each key-value pair consists of a modern Chinese character image and a corresponding synthetic ancient character image, and the same modern Chinese character image corresponds to at least one synthetic ancient character image; The ancient character image features are obtained by using a feature encoder to extract features from each of the synthetic ancient character images in the ancient character visualization dictionary, and the ancient character image features constitute an ancient character feature library. Acquire the target ancient script image to be deciphered, and use the feature encoder to obtain the target image features corresponding to the target ancient script image; Calculate the similarity value between the target image features and each ancient character image feature in the ancient character feature library, and determine the deciphering result of the corresponding target ancient character image based on the similarity value.
[0006] In some embodiments, the synthesized ancient script image is generated through the following steps: The modern Chinese character image is input into a font style generator to generate at least one writing style variant image; Using the trained first-stage conditional diffusion model, and taking the image of the writing style variant as a condition, iterative denoising is performed starting from random noise to generate a preliminary draft image of ancient characters. The modern Chinese character image is ideographically encoded to obtain a description sequence, the description sequence is encoded into a one-hot vector, and the one-hot vector is converted into an ideographic feature vector through a learnable matrix; Using the trained second-stage conditional diffusion model, the ideographic feature vector and the preliminary draft image of the ancient characters are used as joint conditions for denoising to obtain the synthesized ancient character image.
[0007] In some embodiments, the first-stage conditional diffusion model is trained through the following steps: Standard Chinese character images are input into a font style generator to generate styles, resulting in at least one standard style variant image. The standard style variant image is then paired with the interpreted original ancient text image to form training samples. The first-stage diffusion model is trained using the training samples. In the forward process, Gaussian noise is gradually added to the original ancient text image to obtain a noisy image. In the backward process, the first-stage conditional diffusion model is trained using the standard style variant image as a condition to predict the Gaussian noise added in the forward process based on the noisy image, thus obtaining the trained first-stage conditional diffusion model.
[0008] In some embodiments, the step of extracting features from each of the synthetic ancient characters in the ancient character visualization dictionary using a feature encoder to obtain ancient character image features includes: Each of the synthesized ancient text images is subjected to multi-scale factor transformation and / or horizontal flip transformation to obtain multiple transformed images; The local feature vectors of each of the transformed images are extracted using the trained feature encoder. The local feature vectors of the multiple transformed images are averaged and normalized to obtain the ancient character image features. The feature encoder is trained using a triplet loss function to optimize the training so that the distance between two synthesized ancient character images from the same modern Chinese character image in the feature space is less than the distance between two synthesized ancient character images corresponding to different modern Chinese character images in the feature space.
[0009] In some embodiments, the same group of synthesized ancient character images corresponds to the same modern Chinese character tag, and determining the deciphering result of the corresponding target ancient character image based on the similarity value includes: After sorting the similarity values in descending order, a preset number of the ancient character image features are selected as candidate dictionary entries; The candidate dictionary entries are aggregated by voting according to their corresponding modern Chinese character tags, and the deciphering result of the corresponding target ancient character image is determined based on the aggregation result.
[0010] In some embodiments, the step of aggregating votes on the modern Chinese character tags in the candidate dictionary entries to determine the deciphering result corresponding to the target ancient script image includes: Obtain the modern Chinese character tag corresponding to each of the candidate dictionary entries; The candidate frequency of each modern Chinese character tag is counted, and the modern Chinese character tag with the highest candidate frequency is selected as the deciphering result.
[0011] In some embodiments, selecting the modern Chinese character tag with the highest candidate frequency as the deciphering result includes: The modern Chinese character tag with the highest candidate frequency is selected as the initial Chinese character tag; When there is more than one preliminary Chinese character tag, calculate the average similarity value of all candidate dictionary entries corresponding to each preliminary Chinese character tag; The modern Chinese character corresponding to the initially selected Chinese character label with the highest average similarity value is selected as the deciphering result.
[0012] To achieve the above objectives, a second aspect of this application provides an ancient script deciphering device, comprising: Dictionary construction module: used to obtain a visual dictionary of ancient characters consisting of multiple key-value pairs, each key-value pair consisting of a modern Chinese character image and a corresponding synthetic ancient character image, and the same modern Chinese character image corresponds to at least one synthetic ancient character image; Feature library construction module: used to extract features from each of the synthesized ancient characters in the ancient character visualization dictionary using a feature encoder to obtain ancient character image features, and the ancient character image features constitute an ancient character feature library; Encoding feature extraction module: used to acquire the target ancient script image to be deciphered, and to acquire the target image features corresponding to the target ancient script image using the feature encoder; Decipherment Result Determination Module: Used to calculate the similarity value between the target image features and each ancient character image feature in the ancient character feature library, and determine the decipherment result of the corresponding target ancient character image based on the similarity value.
[0013] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0014] To achieve the above objectives, a fourth aspect of the present application provides a storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0015] The ancient script deciphering method, apparatus, device, and storage medium proposed in this application acquire an ancient script visualization dictionary composed of multiple key-value pairs. Each key-value pair consists of a modern Chinese character image and a corresponding synthetic ancient script image, with the same modern Chinese character image corresponding to at least one synthetic ancient script image. A feature encoder is used to extract features from each synthetic ancient script image in the ancient script visualization dictionary to obtain ancient script image features, which constitute an ancient script feature library. A target ancient script image to be deciphered is acquired, and the feature encoder is used to obtain the target image features corresponding to the target ancient script image. The similarity value between the target image features and the ancient script image features in the ancient script feature library is calculated, and the deciphering result of the corresponding target ancient script image is determined based on the similarity value. The visualization dictionary constructed in this application, where the same modern Chinese character corresponds to at least one synthetic ancient script image, can generate large-scale, targeted retrieval samples covering multiple writing style variations. This not only overcomes the feature extraction difficulties caused by historical erosion and writing evolution of ancient scripts but also compensates for the small size of real ancient script databases, expanding the coverage of the retrieval benchmark. Based on this, a feature-based comparison mechanism is introduced, which can significantly improve the overall accuracy and automation efficiency of large-scale ancient script deciphering. At the same time, this similarity-matching-based decryption process can directly provide morphological evidence of visual evolution, which is highly interpretable. Attached Figure Description
[0016] Figure 1 This is a flowchart of the ancient script deciphering method provided in the embodiments of this application.
[0017] Figure 2 This is a flowchart illustrating the process of generating a synthetic ancient character image corresponding to a modern Chinese character image, as provided in the embodiments of this application.
[0018] Figure 3 This is a flowchart of the training process of the first-stage conditional diffusion model provided in the embodiments of this application.
[0019] Figure 4 This is a schematic diagram of the training process of the conditional diffusion model provided in the embodiments of this application.
[0020] Figure 5 This is a flowchart provided in this application embodiment for extracting features from each synthetic ancient character image in an ancient character visualization dictionary using a feature encoder to obtain the features of the ancient character image.
[0021] Figure 6This is a flowchart illustrating the process of determining the deciphering result of a corresponding target ancient character image based on a similarity value, as provided in an embodiment of this application.
[0022] Figure 7 This is a flowchart illustrating the process of obtaining deciphering results in the ancient script deciphering method provided in this application embodiment.
[0023] Figure 8 This is a flowchart illustrating the selection of the most frequently used modern Chinese character tags as the decoding result, as provided in the embodiments of this application.
[0024] Figure 9 This is an overall flowchart of the ancient script deciphering method provided in the embodiments of this application.
[0025] Figure 10 This is a schematic diagram illustrating the oracle bone script character generation effects of the four configuration schemes provided in this embodiment.
[0026] Figure 11 It is a two-dimensional embedding map of the feature vectors provided in the embodiments of this application.
[0027] Figure 12 A schematic diagram of the Turing test provided for an embodiment of this application.
[0028] Figure 13 This is a schematic diagram of the degradation test provided in the embodiments of this application.
[0029] Figure 14 This is a structural block diagram of an ancient script deciphering device provided in another embodiment of this application.
[0030] Figure 15 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0032] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0034] Ancient scripts, such as Oracle Bone Script (OBS), are divination inscriptions carved on tortoise shells and animal bones during the Shang Dynasty (c. 1250–1046 BC). They are the earliest known systematic Chinese writing system, dating back over 3,000 years. Archaeologists have excavated approximately 160,000 fragments of oracle bones, identifying about 4,600 different characters. However, after more than a century of research, scholars have only deciphered about 1,500 characters, leaving nearly two-thirds of the oracle bone script undeciphered. This significant knowledge gap severely hinders a deeper understanding of early Chinese civilization, its social governance structures, and cultural evolution.
[0035] The deciphering of oracle bone script faces three core technical challenges. First, there is the extreme scarcity and uneven distribution of data. Approximately 4,600 known oracle bone characters need to be mapped to the Unicode encoding of over 87,000 modern Chinese characters. Many modern Chinese characters have no corresponding forms in the oracle bone period, and the number of labeled samples of deciphered characters is extremely limited. This extreme class imbalance and data scarcity constitute a fundamental obstacle to supervised learning. Second, there is severe variation in character forms and archaeological deterioration. Oracle bone script was inscribed on tortoise shells and animal bones using primitive methods. After three thousand years of physical deterioration, the characters generally exhibit erosion, breakage, and incompleteness, and the same character shows significant stylistic differences between different scribes and at different times. Third, traditional manual methods are inefficient. Paleography scholars rely on manual character-by-character analysis, comparing strokes, components, and evolutionary patterns to deduce their corresponding modern Chinese characters. This process has a very high professional threshold and consumes a large amount of manpower, making it unsuitable for large-scale deciphering needs.
[0036] Among related technologies, existing automated oracle bone script deciphering techniques can be mainly divided into three categories, all of which have significant limitations. The first category is image-to-image conversion methods. These methods include generative adversarial network schemes such as Pix2Pix, CycleGAN, and DRIT++, as well as diffusion model schemes such as Palette and CDE, attempting to directly convert oracle bone script images into corresponding modern Chinese character images, and then obtain interpretation results through OCR recognition. Their drawback is that, under zero-sample (no character seen) testing conditions, most methods achieve a Top-1 accuracy of 0%, completely failing to generalize to characters outside the training set; furthermore, the end-to-end "black box" architecture provides no interpretable reasoning basis, failing to meet the basic requirement of traceable evidence in paleography research; moreover, the unidirectional mapping from the oracle bone script space (approximately 4600 categories) to the modern Chinese character space (over 87,000 categories) is mathematically incomplete. The second category is multi-classification methods. Classification methods, exemplified by the Conditional Diffusion Model (OracleBoneScriptDecipher, OBSD) optimized for oracle bone script deciphering, directly map oracle bone images to modern Chinese character category labels by training an end-to-end neural network classifier. However, this method achieves a Top-1 accuracy of less than 3% under zero-sample conditions, and the model cannot extrapolate to characters outside the training vocabulary; moreover, its performance growth curve rapidly saturates (only improving by about 20% from Top-1 to Top-100), indicating an inherent performance ceiling in the classification architecture; furthermore, this method only outputs discrete labels without providing morphological similarity evidence, thus lacking interpretability. The third category comprises retrieval methods based on existing oracle bone databases. These methods perform feature matching between unknown character shapes and existing oracle bone image databases. However, limited by the extremely small coverage of existing oracle bone databases (only about 1500 deciphered characters), this method cannot handle unknown characters outside the database; simultaneously, it requires extensive manual annotation to build and maintain the retrieval index, resulting in low efficiency; and the Top-100 accuracy is only 36.12%, far from meeting practical deciphering needs.
[0037] It is evident that the methods in the relevant technologies are all constrained by the scarcity of oracle bone data, unable to overcome the data bottleneck, resulting in the overall accuracy and efficiency of oracle bone deciphering failing to meet actual needs.
[0038] Based on this, embodiments of this application provide a method, apparatus, device, and storage medium for deciphering ancient characters. The constructed visual dictionary corresponds to at least one synthetic ancient character image for each modern Chinese character, enabling large-scale, targeted generation of retrieval samples covering multiple writing style variations. This not only overcomes the feature extraction challenges caused by historical erosion and writing evolution in ancient characters but also compensates for the small size of real ancient character databases, expanding the coverage of the retrieval benchmark. Furthermore, the introduction of a feature-based retrieval comparison mechanism significantly improves the overall accuracy and automation efficiency of large-scale ancient character deciphering. Simultaneously, this similarity-matching-based deciphering process directly provides morphological visual evolution evidence, exhibiting strong interpretability.
[0039] This application provides methods, apparatus, devices, and storage media for deciphering ancient characters, which are specifically described through the following embodiments. First, the method for deciphering ancient characters in this application is described.
[0040] This application's embodiments can acquire and process relevant data based on artificial intelligence (AI) technology. AI is the theory, methods, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can react in a way similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.
[0041] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0042] The ancient script deciphering method provided in this application relates to the field of ancient script deciphering technology. This method can be applied to a terminal, a server, or a computer program running on either the terminal or the server. For example, the computer program can be a native program or software module in an operating system; it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run, such as a client supporting ancient script deciphering, i.e., a program that only needs to be downloaded to a browser environment to run; it can also be a small program that can be embedded into any APP. In short, the above-mentioned computer program can be any form of application, module, or plugin. The terminal communicates with the server via a network. This ancient script deciphering method can be executed by the terminal or the server, or by the terminal and the server working together.
[0043] In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, or smartwatch, etc. The server can be a standalone server, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms; it can also be a service node in a blockchain system, where the service nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). The terminal and server can connect via Bluetooth, Universal Serial Bus (USB), or a network, etc., and this embodiment does not impose any limitations.
[0044] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0045] The following describes the ancient script deciphering method in the embodiments of this application. The ancient scripts include Shang and Zhou bronze inscriptions (bronze inscriptions), Han Dynasty bamboo slip manuscripts, Dunhuang silk documents, and other ancient writing systems that have not been deciphered or have been partially deciphered. The following description focuses on oracle bone script and does not represent a limitation on the ancient scripts.
[0046] Figure 1 This is an optional flowchart of the ancient script deciphering method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps 110 to 140. It is also understood that this embodiment... Figure 1 The order of steps 110 to 140 is not specifically limited. The order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0047] Step 110: Obtain a visual dictionary of ancient characters consisting of multiple key-value pairs.
[0048] In one embodiment, each key-value pair consists of a modern Chinese character image and a corresponding synthetic ancient character image, with the same modern Chinese character image corresponding to at least one synthetic ancient character image. (See also...) Figure 2 , Figure 2 This is a flowchart illustrating the process of generating a synthetic ancient character image corresponding to a modern Chinese character image, as provided in this application embodiment. The process specifically includes the following steps: Step 210: Input the image of modern Chinese characters into the font style generator to generate at least one image of a writing style variant.
[0049] In one embodiment, the modern Chinese character images corresponding to modern Chinese characters are input into a font style generator (StyleGenerator, SG) to generate at least one writing style variant image. Here, the font style generator can be an image style transfer network or a generative model module based on deep learning. Since there are great differences in visual form and writing methods between modern standard Chinese characters in a single font, such as standard regular script, and ancient Shang and Zhou characters, directly performing modal mapping is likely to cause breaks in the feature space. Therefore, in this embodiment, different font control information fs is first injected into the input modern Chinese character image c in standard regular script, and a font style generator is used to generate multiple writing style variant images with different writing characteristics. which is expressed as:
[0050] where s represents the sequence index of different writing styles. For example, if the input is the modern Chinese character image corresponding to the modern Chinese character "明" in standard regular script, the font style generator can output writing style variant images with multiple stroke changes or heterogeneous characteristics such as running script, cursive script, and small seal script based on a preset dictionary.
[0051] That is to say, in this embodiment, through the font style amplification mechanism, the input data is enriched, and the style changes caused by differences in engraving knife force and materials among ancient different writers are effectively simulated, thereby directly enhancing the diversity of the finally generated ancient character samples and overcoming the problem of scarce real annotation data.
[0052] Step 220: Using the trained first-stage conditional diffusion model, starting from random noise and iteratively denoising with the writing style variant image as the condition, to generate a preliminary draft image of ancient characters.
[0053] In one embodiment, a first-stage conditional diffusion model is pre-trained. Here, the first-stage conditional diffusion model can be a denoising U-Net backbone architecture with an attention mechanism. This stage can be called the Font-Augmented Diffusion (FAD) stage, and its purpose is to solve the problem of extremely scarce paired training data for ancient characters. By constructing the first-stage conditional diffusion model as a generative data pipeline, the deep learning model is enabled to have the ability to generate a preliminary draft of ancient characters from modern Chinese characters across modalities. Referring to Figure 3 , Figure 3 is the training process flowchart of the first-stage conditional diffusion model provided by the embodiment of the present application, which specifically includes the following steps: Step 310: Input the standard Chinese character image into the font style generator for style generation to obtain at least one standard style variant image, and pair the standard style variant image with the interpreted original ancient text image to form a training sample.
[0054] In one embodiment, the standard Chinese character image corresponding to the standard Chinese character is input into the aforementioned font style generator to generate a style, thereby obtaining at least one standard style variant image. Subsequently, these standard style variant images were compared with original ancient text images that have been definitively interpreted by the archaeological community. In other words, the training data consists of pairs of images of the actual oracle bone script characters. It is important to note that the number of standard Chinese characters is limited, consistent with the number of original ancient text images that have been deciphered. All standard style variants of the same standard Chinese character image correspond to the same original ancient text image. This embodiment leverages the diversity of style variants to significantly enhance the generalization and extrapolation capabilities of the subsequent conditional diffusion model for unknown glyphs.
[0055] Step 320: Train the first-stage diffusion model using training samples. In the forward process, Gaussian noise is gradually added to the original ancient text image to obtain a noisy image. In the backward process, the first-stage conditional diffusion model is trained using the standard style variant image as a condition to predict the Gaussian noise added in the forward process based on the noisy image, thus obtaining the trained first-stage conditional diffusion model.
[0056] In one embodiment, the first-stage conditional diffusion model is trained using first training samples. The training process includes two stages: forward denoising and backward denoising. During the forward denoising process, the original ancient text image with known interpretations is used... Gaussian noise is added step by step to obtain a noisy image. During noise addition, the first-stage conditional diffusion model constructs a Markov chain along time step t, injecting standard Gaussian noise into the image. The resulting image at any time step t is a noisy image. In the reverse process, images with standard style variants are used. As a condition, the first-stage conditional diffusion model is trained based on the noisy image. Predict the Gaussian noise added during the forward pass. Specifically, since the first-stage conditional diffusion model uses a denoising U-Net, which includes an encoder, decoder, and skip connections, the conditional tensor... Attention weights need to be calculated and fused using a cross-attention layer and spatial features from each layer of U-Net to ensure that the macroscopic structure of the corresponding standard Chinese character can effectively influence the denoising direction. The objective loss function optimized in this reverse process is expressed as:
[0057] in, This represents the noise component predicted by the U-Net denoising network. Represents the expected value. The first-stage conditional diffusion model continuously minimizes the bi-linear norm error between the predicted noise and the real added noise through the gradient descent method until the loss function converges, thereby obtaining the trained first-stage conditional diffusion model. In this embodiment, through forward noise addition and backward prediction, the first-stage conditional diffusion model accurately grasps the underlying texture and pixel distribution law of real ancient characters, and forcibly introduces the writing style variant image as a conditional guide, forcing the denoising network to learn the deterministic cross-modal mapping relationship from the modern Chinese character style outline to the visual form of ancient characters during the iteration of a large amount of data.
[0058] In one embodiment, the trained first-stage conditional diffusion model can stably generate a high-fidelity draft image of ancient characters with a realistic engraving texture only by pure noise and modern Chinese characters during the inference stage. Therefore, for any modern Chinese character image , which may not have a corresponding interpreted original ancient text image, taking its corresponding writing style variant image as a condition, using the first-stage conditional diffusion model to perform iterative denoising starting from random noise, the preliminary draft image of the ancient characters corresponding to the writing style variant image can be generated .
[0059] Step 230: Perform ideographic encoding on the modern Chinese character image to obtain a description sequence, encode the description sequence into a one-hot vector, and convert the one-hot vector into an ideographic feature vector through a learnable matrix.
[0060] In one embodiment, enter the Stroke Refinement (SR) stage. The modern Chinese character image corresponding modern Chinese character x is subjected to ideographic encoding to obtain a description sequence , where the ideographic encoding (Ideographic Description Sequence, IDS) is a standard encoding sequence that uses specific spatial relation symbols and radical components to structurally describe the internal topological arrangement of Chinese characters, expressed as: ,
[0061] Among them, m is the number of components. The ideographic encoding methods include but are not limited to: structure description based on radical decomposition, structure description based on stroke sequence, structure description based on skeleton extraction, structure expression based on contour description, etc. The core requirement is that the structure guiding information can effectively express the component composition and spatial layout relationship of Chinese characters. For example, for the modern Chinese character "休" with a left-right structure, its description sequence can represent the special control symbol "⿰" for the left-right position relationship and the two independent component identifiers "亻" and "木".
[0062] Furthermore, with the description sequence, the discrete characters in the description sequence can be converted into high-dimensional sparse one-hot vectors, that is, vector matrices that are only 1 at the current character index position and 0 in all other dimensions.
[0063] Subsequently, a set S is constructed from the one-hot vectors corresponding to all modern Chinese characters, and a learnable matrix is built using a fully connected neural network layer. Matrix multiplication is used to transform sparse one-hot vectors into ideographic character feature vectors. , is represented as: ,in, , l is the size of set S.
[0064] Step 240: Using the trained second-stage conditional diffusion model, denoising is performed using the ideographic feature vector and the preliminary draft image of the ancient characters as joint conditions to obtain a synthesized ancient character image.
[0065] In one embodiment, the second-stage conditional diffusion model has the same underlying architecture as the first-stage conditional diffusion model, which is also a denoising U-Net network. However, its training process employs a multimodal joint guidance mechanism. The training process of the second-stage conditional diffusion model is specifically described as follows: during the forward denoising process, Gaussian noise is progressively added to the original ancient text image to obtain a Chinese character noise image. The noise-adding process gradually disrupts the highly structured distribution of the initial draft image of ancient characters into a completely disordered Gaussian noise distribution, providing training samples with different noise intensities for the subsequent denoising network. In the reverse denoising process, a second-stage conditional diffusion model is trained to predict the Gaussian noise added during the forward process. This process requires obtaining the ideographic feature vectors corresponding to the standard Chinese characters. and corresponding draft ancient text images To represent feature vectors Corresponding draft ancient text image To perform joint conditional computation, the denoising part simultaneously receives ancient text sample draft images as spatial pixel-level guidance and semantic feature vectors as semantic structure-level guidance. These two are fused through methods such as channel concatenation, and then dynamically mapped to various feature resolution layers of U-Net using a cross-attention mechanism. This forces the feature maps to activate specific component regions. The resulting image after denoising is called the ancient text variant image. The objective loss function optimized by this reverse process is expressed as:
[0066] in, Indicates the given time step t and joint conditions ( The noise matrix predicted by the network. It represents the expected value of the training batch data. Iterate multiple times until the loss function converges to obtain a trained second-stage conditional diffusion model.
[0067] In one embodiment, the preliminary draft image of ancient characters is denoised using the trained second-stage conditional diffusion model, and then denoised with the ideographic character feature vector as the condition to obtain the synthetic ancient character image corresponding to the preliminary draft image of the ancient characters. . It can be understood that for the preliminary draft images of ancient characters with different writing styles corresponding to the same modern Chinese character can all obtain the corresponding synthetic ancient character images in this way. .
[0068] In one embodiment, referring to Figure 4 , Figure 4 is a schematic diagram of the training process of the conditional diffusion model provided by an embodiment of the present application. The first stage is the preliminary draft generation guided by font style. First, the input standard Chinese character image is obtained. Here, the character "Jing" is used as an example in the figure. This image is input into the font style generator to obtain multiple different forms of the character "Jing" shown within the dashed box in the figure as standard style variant images. One of the standard style variant images is selected as the guiding condition for the first stage. In the first-stage conditional diffusion model, Gaussian noise is gradually added to the original ancient text image with known interpretations to obtain a noisy image. Subsequently, through the U-Net denoising network with time step t, a denoising process guided by the standard style variant image as the condition is carried out. Under the condition constraint, the noise in the noisy image is gradually predicted and eliminated: After multiple rounds of iterative denoising, a draft ancient text image is output. At this time, the draft ancient text image initially has the visual style of oracle bone inscriptions, but the local stroke topology details may not be precise enough. Therefore, it is necessary to introduce a second-stage conditional diffusion model. For the same input standard Chinese character image, the character "Jing" in the figure is subjected to ideographic character encoding processing, disassembled into its basic topological features and radical combinations that make it up, forming a description sequence, such as "亠", "口", "小". Subsequently, this discrete description sequence is encoded and mapped into a continuous tensor to form the structural guiding condition for the second stage. In the second-stage conditional diffusion model, starting from a noisy state of the Chinese character noisy image, it enters the U-Net denoising network with time step t. Here, it is a multi-modal joint guiding mechanism, using the draft ancient text image output in the first stage to provide the inherent mottled texture and line thickness benchmark of ancient characters, and using the encoded ideographic feature vector to force the network to standardize the component arrangement and stroke trend during the generation process. Finally, under the dual condition constraints, the second-stage conditional diffusion model undergoes iterative denoising to output a high-fidelity ancient text variant image.
[0069] As can be seen, the two-stage conditional diffusion processing of this application embodiment can achieve technical decoupling and recombination of the visual style and local topological structure of the generated image, so that the final generated synthetic image not only conforms to the writing style of ancient Chinese, but also ensures the correctness of the ideographic character structure.
[0070] In one embodiment, the training dataset for the aforementioned two-stage training process can be determined as follows: First, high-fidelity oracle bone script rubbings are integrated from publicly available ancient script databases, such as standard datasets like HUST-OBS and EVOBC. In this embodiment, a total of 71,698 high-quality rubbing images were extracted, covering 1,590 different oracle bone script character categories that have been definitively deciphered by the archaeological community. Each oracle bone script rubbing image is rigorously mapped one-to-one with its corresponding modern Chinese character label through data pairing; the paired modern Chinese characters are used as standard modern Chinese characters. After obtaining the full dataset, the aforementioned 1,590 deciphered oracle bone script character categories are divided into a 9:1 ratio. 90% of the character categories and all their contained rubbing images are randomly selected to construct the training set, used for the forward and backward gradient optimization of the first-stage and second-stage diffusion models and the feature encoder. The remaining 10% of the character categories and all their contained rubbing images are used to construct the test set, ensuring that the training set and test set do not overlap in character categories.
[0071] It is understandable that the first-stage and second-stage conditional diffusion models described above can be replaced with other generative model architectures, including but not limited to: other types of diffusion models, generative adversarial networks and their variants, variational autoencoders and their variants, flow-matching-based generative models, etc. The core requirement is that the generative model can generate synthetic images that conform to the morphological features of oracle bone script, using modern Chinese characters as conditions.
[0072] Following the above process, we obtain a modern Chinese character image, at least one image of a writing style variant, and a corresponding synthetic ancient script image for each writing style variant image. The modern Chinese character is used as a label for the corresponding ancient script image, and a visual dictionary of ancient scripts is constructed based on this. This visual dictionary is a relational database composed of multiple key-value pairs. In each key-value pair, the key is the modern Chinese character image, which serves as the logical index for retrieval and the final deciphering result; the value is the synthetic ancient script image. It can be understood that the same modern Chinese character image corresponds to at least one synthetic ancient script image; for a modern Chinese character x, it corresponds to at least one synthetic ancient script image. It and each synthesized ancient text image form a key-value pair (x: ).
[0073] By performing the above operations on all modern Chinese characters, a complete visual dictionary of ancient characters can be constructed. , is represented as:
[0074] in, Let be the i-th modern Chinese character, k be the total number of modern Chinese characters (this value can be set according to actual needs), and n be the number of variant images of the writing style generated for each modern Chinese character. The image is the synthesized ancient script image corresponding to the s-th writing style variant image.
[0075] This demonstrates that for the same modern Chinese character, there is a one-to-many dictionary structure. This is because ancient characters in actual archaeological excavations exhibit significant morphological fluctuations. Therefore, by generating multiple synthetic ancient character images for the same modern Chinese character label, the dictionary can form a feature cluster around that modern character in the feature space, covering all possible style variations, effectively compensating for the lack of style continuity in real ancient character annotation data. In the subsequent deciphering stage, when the target ancient character image to be deciphered suffers from deterioration resulting in missing strokes, feature comparison with synthetic ancient character images covering multiple style variations in the ancient character visualization dictionary is more likely to find the closest variant in the feature space, thereby improving the matching hit rate.
[0076] In one embodiment, after constructing the initial ancient character visualization dictionary, multiple rounds of synthesis iterations can be performed. During each iteration's generation process: firstly, no network parameters of the first-stage and second-stage conditional diffusion models are updated. Secondly, by simply resetting or changing the random noise distribution in the forward propagation process of the diffusion model, new synthetic ancient character images are generated again using the existing modern Chinese character images and ideographic character description sequence conditions. Then, the synthetic ancient character images generated in each round undergo quality filtering, retaining and accumulating high-quality synthetic variants from each round, continuously supplementing them to the existing ancient character visualization dictionary, thereby achieving a gradual bootstrapping expansion of the dictionary's entry size.
[0077] Step 120: Use a feature encoder to extract features from each synthetic ancient character image in the ancient character visualization dictionary to obtain the ancient character image features.
[0078] In one embodiment, the image features of ancient characters constitute an ancient character feature library. (See reference...) Figure 5 , Figure 5 This application provides a flowchart for extracting features from each synthetic ancient character image in an ancient character visualization dictionary using a feature encoder, specifically including the following steps: Step 510: Perform multi-scale factor transformation and / or horizontal flip transformation on each synthesized ancient character image to obtain multiple transformed images.
[0079] In one embodiment, by applying multi-scale and horizontal flip transformations, the physical representation of a single synthesized ancient character image is expanded before feature extraction. This ensures that the subsequently extracted features naturally possess scale invariance and mirror invariance, thereby enhancing the robustness against highly damaged and morphologically varied oracle bone inscriptions. Specifically, the scale factor transformation refers to interpolating and scaling the synthesized ancient character image using multiple preset scaling ratios to simulate the character size fluctuations caused by varying sizes of writing fragments in real archaeological excavations. The horizontal flip transformation refers to mirror flipping along the vertical central axis of the synthesized ancient character image. This is because Shang Dynasty oracle bone inscriptions exhibit symmetrical characteristics during inscription, meaning the same character often appears alternately in a left-right mirror image.
[0080] Step 520: Use the trained feature encoder to extract the local feature vectors of each transformed image, average the local feature vectors of multiple transformed images and normalize them to obtain the ancient character image features.
[0081] In one embodiment, a trained feature encoder is used. Local feature vectors are extracted from each transformed image. The feature encoder here can be ConvNeXt or other image feature extraction architectures, including but not limited to ResNet, VisionTransformer, SwinTransformer, and EfficientNet. The core requirement is that the feature encoder can learn morphologically invariant and robust embedding representations to changes in writing style. Specifically, for each transformed image of the synthesized ancient text image, the feature encoder outputs a high-dimensional local feature vector. Then, average pooling is used to sum and average these local feature vectors. To eliminate differences in the absolute numerical scale of different local feature vectors, they are normalized using the L2 norm. The normalized vector is then used as the feature of the ancient text image.
[0082] The feature encoder employs a triplet loss function for optimization training. The triplet data includes anchor samples, positive samples, and negative samples. Anchor samples are synthetic ancient character images corresponding to a specific modern Chinese character; positive samples are another synthetic ancient character image from the same modern Chinese character but with different writing style variations; and negative samples are synthetic ancient character images from different modern Chinese characters. Through this specific optimization training using the triplet loss function, the distance between two synthetic ancient character images from the same modern Chinese character image in the feature space is reduced to the distance between two synthetic ancient character images corresponding to different modern Chinese character images. The resulting feature encoder possesses intra-class aggregation and inter-class repulsion learning capabilities. Even if the same modern Chinese character had extremely diverse and visually varied writing forms in ancient times, this feature encoder can map them into a compact cluster within a high-dimensional feature space, while also rigorously distinguishing visually similar but semantically different variant characters.
[0083] Step 130: Obtain the target ancient script image to be deciphered, and use a feature encoder to obtain the target image features corresponding to the target ancient script image.
[0084] In one embodiment, the target ancient script image to be deciphered This refers to a local image region containing a single character to be identified, extracted from oracle bone rubbings, photographs, or scans using target detection algorithms or manual assistance. A feature encoder is used to extract features from the target character image, resulting in a high-dimensional feature vector that serves as the target image feature. At this point, even if some strokes of the target image to be deciphered are missing, the encoder has already learned a stable structural representation through the triplet loss function during the training phase, and it can still extract target features sufficient to characterize the core identity of the text.
[0085] Step 140: Calculate the similarity value between the target image features and the features of each ancient character image in the ancient character feature database, and determine the deciphering result of the corresponding target ancient character image based on the similarity value.
[0086] In one embodiment, target image features are calculated. The similarity between the image and the ancient character features in the ancient character feature database is used to obtain the corresponding similarity value, which is expressed as:
[0087] in, Let represent the image features of the s-th ancient Chinese character corresponding to the i-th modern Chinese character, and sim represent the similarity value calculation. It is understandable that the similarity value here can be cosine similarity, Euclidean distance, Manhattan distance, etc.
[0088] In one embodiment, reference is made to Figure 6 , Figure 6 This is a flowchart for determining the deciphering result of the corresponding target ancient Chinese character image according to the similarity value provided by an embodiment of this application, which specifically includes the following steps: Step 610: After arranging the similarity values in descending order, select a preset number of ancient Chinese character image features as candidate dictionary entries.
[0089] In one embodiment, after arranging the similarity values in descending order, select a preset number of Top-N ancient Chinese character image features as candidate dictionary entries. The specific value of the preset number can be dynamically adjusted according to the total scale of the ancient Chinese character visualization dictionary and computing power limitations, etc.
[0090] Step 620: Vote and aggregate the candidate dictionary entries according to the corresponding modern Chinese character labels, and determine the deciphering result of the corresponding target ancient Chinese character image according to the aggregation result.
[0091] In one embodiment, the vote aggregation of the modern Chinese character labels in the candidate dictionary entries here is specifically to obtain the modern Chinese character labels corresponding to each candidate dictionary entry, count the candidate frequencies of each modern Chinese character label, select the modern Chinese character label with the highest candidate frequency as the deciphering result, and the calculation process is expressed as: <*
[0092] Among them, represents represents the modern Chinese character label with the highest candidate frequency, represents the set of a preset number of candidate dictionary entries, represents representing in the set of candidate dictionary entries any modern Chinese character label traversed in, is a frequency statistics function, is an optimization operator, which means to find and return one or more modern Chinese character labels with the highest candidate frequency among all possible modern Chinese character labels.
[0093] For example, among the selected Top-50 candidate dictionary entries, the modern Chinese character label "明" appears 25 times, "月" appears 15 times, and the remaining modern Chinese character labels appear 10 times in total. Then directly take "明" as the final deciphering output. It can be understood that the vote aggregation here can also be replaced with weighted voting, probability aggregation or other ranking aggregation algorithms according to the actual situation, and its purpose is to obtain the modern Chinese character label with the highest candidate frequency.
[0094] In one embodiment, refer to Figure 7 , Figure 7It is a schematic flowchart of obtaining a deciphering result in the ancient character deciphering method provided by an embodiment of the present application. As shown in the figure, an ancient character visualization dictionary composed of multiple key-value pairs is pre-constructed. Among them, modern Chinese character images, such as "出", "典", "咸", etc. in the figure, are used as keys, and the corresponding synthetic ancient character images generated by using a conditional diffusion model are used as values. Then, each synthetic ancient character image in the ancient character visualization dictionary is input into a feature encoder, and the feature encoder extracts high-dimensional ancient character image features. Here, the high-dimensional features include global features, spatial features, and channel features. After these features are normalized, they form a unified ancient character feature library, providing a comparison benchmark for subsequent retrieval. Next, a real target ancient character image to be deciphered that may be broken or incomplete, such as the unknown ancient character form shown in the figure, is input into the feature encoder to obtain the target image features corresponding to the target ancient character image. Then, it enters the similarity calculation and voting aggregation decision-making stage. First, the cosine distance between the target image features and each ancient character image feature in the ancient character feature library is calculated in the feature space as the similarity value, and all the calculated similarity values are recorded in a similarity matrix. Then, all the similarity values are sorted in descending order, and the preset number Top-N of candidate dictionary entries with the highest similarity are extracted according to the sorting result. The candidate dictionary entry indexes are shown in the figure. After entering the voting aggregation link, the Top-N matching synthetic ancient character images and their corresponding modern Chinese character labels are extracted. In the example shown in the figure, the modern Chinese character labels corresponding to the 5 matching variant images are respectively: "出", "出", "咸", "典", "咸". Then, the candidate frequencies of each modern Chinese character label are counted, and the modern Chinese character label corresponding to the highest candidate frequency is selected as the deciphering result of the target ancient character image.
[0095] In one embodiment, if there are multiple modern Chinese character labels with the same candidate frequency, a further judgment process is performed. Refer to Figure 8 , Figure 8 is a flowchart of selecting the modern Chinese character label with the highest candidate frequency as the deciphering result provided by an embodiment of the present application, which specifically includes the following steps: Step 810: Select the modern Chinese character label with the highest candidate frequency as the primary selected Chinese character label.
[0096] Step 820: When there is more than one primary selected Chinese character label, calculate the average similarity value of all candidate dictionary entries corresponding to each primary selected Chinese character label respectively.
[0097] Step 830: Select the modern Chinese character corresponding to the primary selected Chinese character label with the highest average similarity value as the deciphering result.
[0098] In one embodiment, the primary selected Chinese character label refers to the modern Chinese character label that ranks first after counting the candidate frequencies for modern Chinese character labels. Usually, only one unique primary selected Chinese character label will be generated. At this time, this primary selected Chinese character label can be directly used as the final deciphered result. However, if more than one primary selected Chinese character label appears, for example, both the modern Chinese character label "明" and the modern Chinese character label "月" appear with the highest frequency of 15 times, then both are used as primary selected Chinese character labels. In this case, it is necessary to further calculate the average similarity values of all candidate dictionary entries corresponding to each primary selected Chinese character label respectively, and then select the modern Chinese character corresponding to the primary selected Chinese character label with the highest average similarity value as the deciphered result. The purpose of doing this is that when the number of votes is the same, it is determined which variant feature cluster of a modern Chinese character the target image feature is closer to in the feature space in terms of the overall average distance, so that the finally output deciphered result can achieve an optimal configuration both in terms of mathematical probability and visual features, improving the accuracy and stability of the deciphering. It can be understood that in addition to using the modern Chinese character as the deciphered result, the candidate dictionary entry and its corresponding modern Chinese character label can also be returned together to support experts for visual verification and decision traceability.
[0099] In one embodiment, referring to Figure 9 , Figure 9 is the overall flowchart of the ancient Chinese character deciphering method provided by the embodiments of the present application. The system architecture of this embodiment is divided into a synthetic dictionary offline construction stage and a target ancient Chinese character online deciphering stage.
[0100] First, the synthetic dictionary offline construction stage based on the two-stage diffusion model is described. First, modern Chinese character images are obtained. Taking the character "册" as an example in the figure, and through a font style generator, it is transformed into a writing style variant image with different strokes. Subsequently, using the trained first-stage conditional diffusion model, starting from random noise and iteratively denoising with the writing style variant image as the condition, this stage is mainly responsible for the cross-modal transfer of visual styles and outputs a preliminary draft image of ancient Chinese characters with a real engraving texture. Secondly, the description sequence of the ideographic characters corresponding to the modern Chinese characters is extracted synchronously and encoded into an ideographic character feature vector. Using the trained second-stage conditional diffusion model, denoising is performed with the ideographic character feature vector and the preliminary draft image of ancient Chinese characters as the joint condition to obtain synthetic ancient Chinese character images. These synthetic ancient Chinese character images and the corresponding modern Chinese character labels are combined to jointly form an ancient Chinese character visualization dictionary.
[0101] Next is the online deciphering stage of the target ancient Chinese characters, which is divided into three stages. In the first stage, the visualized dictionary of ancient Chinese characters constructed offline and the received target ancient Chinese character image to be deciphered are input into the trained feature encoder to convert each synthetic ancient Chinese character image in the visualized dictionary of ancient Chinese characters into ancient Chinese character image features, constructing an ancient Chinese character feature library. At the same time, the target ancient Chinese character image is converted into target image features in a unified vector space. Then comes the second stage. In the high-dimensional feature space, the similarity between the target image features and the ancient Chinese character image features in the ancient Chinese character feature library is calculated, and the calculation results are filled into the matrix recording the similarity values, thus transforming the image comparison into a mathematical distance metric. The third stage is voting aggregation and output. According to the recorded similarity matrix, the top-N candidate dictionary entries with the highest similarity are extracted. Subsequently, the modern Chinese character labels behind these candidate entries are extracted, such as "册 / Book", "驶 / Ride", "栗 / Nut", "农 / Farmer" shown in the figure. On this basis, voting aggregation is carried out to count the candidate frequencies of each modern Chinese character label. In this figure, assuming that the local features of the target ancient Chinese character image highly coincide with the multiple variant features of the character "册", making the character "册" obtain the highest top-1 candidate frequency, so finally the interference items are excluded, such as the misspelled characters with similar local features like "驶" and "栗", and the modern Chinese character "册" is output as the deciphering result of this target ancient Chinese character.
[0102] In one embodiment, in order to obtain the performance evaluation results under the zero-shot test conditions of this embodiment, the indispensability of each core technology in this embodiment and its independent contribution to the deciphering accuracy are specifically demonstrated through ablation experiments. Four different system configurations are constructed in this embodiment for comparative testing. Configuration 1 includes Font Augmentation Diffusion (FAD) in the first stage and Stroke Refinement (SR) in the second stage, and the second stage includes Ideographic Description Sequence (IDS) guidance, denoted as FAD+SR, which is the complete solution of this embodiment. Configuration 2 removes the Ideographic Description Sequence guidance condition in the second stage based on the complete solution, denoted as FAD+SRw / oIDS. Configuration 3 only includes the Font Augmentation Diffusion model in the first stage and completely removes the Stroke Refinement module in the second stage, denoted as FAD. Configuration 4 further removes the Font Augmentation (FA) mechanism based on Configuration 3, denoted as FADw / oFA, which is its basic image generation model.
[0103] Then, under the zero-shot test conditions, the top-K retrieval accuracies of the above four configurations are compared, and the cases of K = 1, 10, 20, 50, 100 are selected for illustration. Table 1 below shows the specific numerical values of the evaluation indicators under the zero-shot test conditions.
[0104] Table 1 is a schematic table of evaluation indicators for zero-sample testing conditions.
[0105] As shown in Table 1, the FAD+SR scheme achieved the best performance, with a Top-1 accuracy of 21.2%, a Top-10 accuracy of 54.3%, a Top-50 accuracy of 86.2%, and a Top-100 accuracy as high as 96.9%. Comparing the FAD scheme with the FADw / oFA scheme, removing the font enhancement mechanism causes the Top-1 accuracy to plummet from 16.5% to 12.9%, a relative decrease of approximately 39.4%. This demonstrates that the ancient script deciphering method of this embodiment, by introducing variant amplification in the first stage, plays a decisive role in compensating for differences in oracle bone script morphology and improving the model's cross-modal generalization ability. Furthermore, comparing the FAD+SR scheme with the FAD scheme, the lack of the second-stage refinement results in a 4.7% loss in Top-1 accuracy, decreasing from 21.2% to 16.5%, demonstrating the superiority of the two-stage decoupled architecture in improving absolute matching accuracy. A comparison of the FAD+SR scheme and the FAD+SRw / oIDS scheme shows that, in the second stage, removing the hard constraints on the topological structure of Chinese characters reduces the Top-1 accuracy to 18.2%, and the Top-100 accuracy also shows a significant drop, falling to 93.3%.
[0106] At the same time, refer to Figure 10 , Figure 10 This is a schematic diagram illustrating the oracle bone script character generation effects of the four configuration schemes provided in this embodiment. The topological errors caused by the absence of each module can be clearly observed. Compared to real images, when relying solely on the basic model or lacking the SR module, the generated ancient character images are prone to stroke illusions, exhibiting severe stroke loss, adhesion, or misalignment of radicals. Furthermore, even when the IDS guidance is removed, although the image possesses the texture of ancient characters, its internal component arrangement often violates the rules of philology. In contrast, the complete FAD+SR scheme outputs a synthesized image that achieves high fidelity in both visual appearance and semantic structure.
[0107] As can be seen from the above, the ablation experiment and iterative test data of this embodiment fully demonstrate that the two core modules, font enhancement diffusion and stroke refinement guided by IDS, respectively solve the problems of visual domain offset and structural illusion at the underlying logic level. Under the stringent condition of zero samples, they achieve an improvement in the accuracy of automated deciphering of oracle bone inscriptions, which can meet the engineering needs of the archaeological community for large-scale and high-efficiency decoding of ancient characters.
[0108] In one embodiment, to quantitatively verify the effectiveness of the ancient script deciphering method in practical applications, a controlled experiment involving 12 participants was conducted. The participant sample included 4 researchers with expertise in oracle bone script and 8 non-professional users without relevant backgrounds. The experiment employed a group-controlled method: participants were divided into an experimental group and a control group. The experimental group was allowed to use the ancient script deciphering method provided in this embodiment for interpretation, while the control group independently performed interpretations based solely on their prior knowledge and traditional tools without any system assistance. The experiment required each participant to independently complete the deciphering task of the same set of 50 target oracle bone script images.
[0109] Statistical analysis of the experimental results showed that the deciphering accuracy of the experimental group reached 67.2%±18.4%, while that of the control group was only 23.4%±12.8%. This means that the overall accuracy was significantly improved by 43.8 percentage points after using the ancient character deciphering method provided in this embodiment. Furthermore, the average response time for the experimental group to complete the interpretation of a single character was 0.85±0.25 minutes / character, while the control group took as long as 1.40±0.46 minutes / character. Using the ancient character deciphering method provided in this embodiment reduced the deciphering time by 39.3%. Therefore, the ancient character deciphering method in this embodiment, through parallel retrieval of high-dimensional features, eliminates a massive number of invalid character shapes, directly focusing attention on a very small pool of candidates with high confidence, thereby improving the success rate and efficiency of ancient character recognition. In addition, in the subjective confidence index assessment, a 7-point scale was used. The subjective confidence index of the experimental group was as high as 5.4±1.3 points, far exceeding the 3.2±1.1 points of the control group. In other words, in the calculation process of obtaining the deciphering results in this embodiment, the user no longer blindly accepts the algorithm label, but compares the topological structure of the target ancient character image with the ancient character image features by eye. It has a clear and traceable morphological evolution link and has strong interpretability.
[0110] In one embodiment, since real ancient writing carriers, such as tortoise shells and animal bones, generally suffer from severe physical degradation, the images often contain random crack noise, uneven lighting, and low-contrast stroke marks. Therefore, in order to verify whether the synthesized ancient writing image retains the topological regularity of the real cultural relic in terms of deep features, it is necessary to perform two-dimensional embedding analysis of the feature space.
[0111] In one embodiment, reference is made to Figure 11 , Figure 11This is a two-dimensional embedding graph of the feature vectors provided in this embodiment. Fifteen representative oracle bone script character categories are randomly selected. Circles represent the feature vectors of the real oracle bone script images, and squares represent the feature vectors of the ancient text generated in this embodiment. The t-distributed random neighborhood embedding (t-SNE) algorithm is used to project and reduce the dimensionality of the two feature vectors to a two-dimensional visualization space. In this dimensionality reduction process, the perplexity of the algorithm's hyperparameter is set to 30, and the cosine distance is used as the metric function. According to the distribution results of the dimensionality-reduced embedding graph, the real oracle bone script images and the ancient text generated images are not separated in the feature space, but rather form highly overlapping compact clusters, with the centroids of each category highly coincident. In other words, the synthesized glyphs generated in this embodiment do not undergo semantic drift, but perfectly maintain and replicate the inherent manifold topology of the real oracle bone script.
[0112] Next, to measure the degree of consistency between the data distribution of the generated ancient text images and the real oracle bone inscription images, this embodiment introduces multi-dimensional quantitative indicators such as Fréchet distance (FID), structural similarity (SSIM), perceptual image patch similarity (LPIPS), and L1 loss for comparative testing. Image quality is measured under different generation conditions. Among these, FID, as the core indicator for measuring the difference between the generated image distribution and the real image distribution, indicates higher generation quality with a lower value. Using the reconstruction based on real oracle bone inscriptions as a benchmark, the reconstructed images obtained by related oracle bone inscription generation methods, the reconstructed images obtained by the synthetic ancient text image generation method of this embodiment, and the synthetic ancient text images from the ancient text visualization dictionary using 20 iterations of this embodiment are compared. Table 2 below shows the comparison test results.
[0113] Table 2 Comparison test results of different schemes
[0114] Therefore, it can be seen that in the oracle bone script conditional generation scenario, the FID of the image generated in this embodiment is only 1.95; in contrast, the FID in the scenario of directly generating based on modern Chinese characters in related technologies is as high as 152.18, and the FID in the basic dictionary generation scenario of this embodiment is 27.48, and the FID after multiple iterations is 26.75. This intuitively shows that the synthetic image output by the two-stage diffusion model in this embodiment achieves a high degree of alignment with the real ancient character image in terms of pixel texture and underlying data distribution.
[0115] In one embodiment, to evaluate the realism of the synthesized image output by the two-stage diffusion model in actual human visual perception, this embodiment designs a visual Turing test for oracle bone inscription images. (Refer to...) Figure 12 , Figure 12This is a schematic diagram of the Turing test provided for an embodiment of this application. The experiment recruited 12 participants, divided into a professional group (4 Oracle researchers) and a non-professional group (8 ordinary users). The test set included 50 real Oracle images and 50 synthesized Oracle images as described in this embodiment. Each participant was required to make a binary judgment of "real or synthesized" for the randomly presented images. A total of 1200 individual judgment data were collected throughout the experiment.
[0116] Test results show that the overall accuracy rate of non-professional users was only 52.3%, extremely close to the 50% probability of random guessing. Even for professionally trained oracle bone researchers, the accuracy rate was only 61.5%. This test result fully demonstrates that the oracle bone images synthesized by the method in this embodiment have completely reached a level of visual realism that is indistinguishable from the real thing in terms of carving texture, stroke style, and simulation of carrier degradation. They are sufficient to serve as high-quality and reliable prior data and can be directly applied to actual ancient script retrieval and automated deciphering projects.
[0117] In one embodiment, to verify whether the ancient script deciphering method provided in this application possesses sufficient robustness and practical application capability when facing physical damage and image degradation of cultural relics commonly encountered in real archaeological excavations, a degradation test is conducted. (Refer to...) Figure 13 , Figure 13 This is a schematic diagram of the degradation test provided in the embodiments of this application. Figure 13 The image shows that authentic oracle bone inscriptions, buried underground for three thousand years, generally exhibit severe physical erosion, fracture, and surface stains. To scientifically quantify this interference in the computational system, this embodiment introduces four synthetic degradation operators to process the authentic ancient character images during the testing phase: erosion, occlusion, noise, and blurring. Erosion simulates the thinning of inscription strokes and edge damage caused by long-term weathering; occlusion simulates large-area missing strokes due to physical fracture of tortoise shells / animal bones; noise simulates high-frequency background interference such as soil spots and bone texture on the rubbing surface; and blurring simulates wear over time or defocusing during digital scanning. Furthermore, three progressive degradation intensity levels, from Level 1 to Level 3, are set for each degradation operator, corresponding to mild, moderate, and severe degradation, respectively, thus constructing a robust test set covering all dimensions of interference. The degraded target images are then input into the FAD+SR scheme, the FAD+SRw / oIDS scheme, and the FAD scheme for deciphering and recognition.
[0118] As shown in the figure, which includes a 95% confidence interval, the complete FAD+SR scheme in this embodiment consistently and consistently outperforms all ablation models in both Top-1 and Top-20 accuracy metrics, regardless of the type of degradation or the level of degradation intensity. Particularly in extremely challenging tasks like occlusion and erosion, which directly disrupt character topology, especially at Level 3 intensity, the FAD+SR w / o IDS scheme experiences a precipitous drop in performance due to the lack of IDS guidance. In contrast, the complete FAD+SR scheme in this embodiment, leveraging the powerful prior structural knowledge provided by Ideographic Character Description Sequences (IDS), can still construct reasonable stroke trends using macroscopic structural principles, maintaining a very high recognition limit even with severely missing image pixels. Therefore, the dual-stage generation combined with multimodal joint guidance architecture constructed in this embodiment not only performs excellently on clean datasets, but its introduced hard topological constraints also endow the model with strong anti-interference and fault tolerance capabilities. It can directly interface with real archaeological fragment images that have not undergone deep manual cleaning, meeting the resistance requirements of complex noise environments in actual cultural relic deciphering work.
[0119] As described above, the ancient script deciphering method of this application transforms the forward multi-classification task in related technologies into a reverse generation and dictionary retrieval task, fundamentally overcoming the problem of extremely scarce real-world annotation data for ancient scripts. Under stringent zero-sample testing conditions, the Top-10 accuracy reaches 54.3%, and the Top-50 accuracy reaches 86.6%, greatly improving the generalization ability when facing unknown oracle bone script. Secondly, the proposed two-stage diffusion generation pipeline, combined with font enhancement diffusion and an original ideographic character description sequence structure, successfully decouples appearance and structural features, eliminating the stroke illusion common in generation models, and enabling the synthesized image to achieve extremely high fidelity that is indistinguishable from reality. It also possesses strong scalability; through a multi-round iterative dictionary bootstrapping expansion mechanism, the Top-1 absolute accuracy can jump to 47.5% without updating model parameters. Finally, unlike the black-box model of deep learning in related technologies, this embodiment simultaneously returns the sorted candidate modern Chinese character tags and corresponding synthesized ancient character images during the retrieval and deciphering process. This provides experts with intuitive visual evidence of morphological evolution, enhances the interpretability of the results, transforms artificial intelligence into an efficient archaeological productivity tool, and provides revolutionary technical support for the exploration of early civilizations and the digitization of ancient books.
[0120] The ancient script deciphering method of this application has extremely high industrial practical value and scalability. It can be packaged and derived into various specific products and services according to actual industrialization needs. For example, the ancient script deciphering method can be packaged into an AI-assisted ancient script deciphering professional software platform. This platform provides a graphical interactive interface, supports researchers to import unknown ancient script rubbings images, such as oracle bone script and bronze script, in high concurrency and batch processing, and outputs a complete deciphering report containing the target image, candidate Chinese character labels, multi-round synthetic variant images, and similarity confidence intervals in a very short response time. It can be used in archaeological research institutions, large museum artifact restoration departments, and university ancient script research centers to solve the engineering pain point of severe manpower shortage in the process of interpreting massive amounts of unearthed documents. It can also be used to synthesize a large-scale ancient script visualization dictionary database. Using the first and second stage conditional diffusion models, multiple rounds of parameter-free iterative amplification are continuously performed for thousands or even tens of thousands of known modern Chinese characters to generate a massive amount of high-fidelity ancient script variant images covering different eras, materials, and degrees of degradation. By structurally storing these images along with their mapping labels, a large-scale ancient script visualization dictionary can be constructed. This ancient script visualization dictionary can function independently of the deciphering system, serving as a separate data asset and digitized ancient script resource product. It can be directly licensed or sold to other cultural heritage digitization projects, filling the critical gap in structured samples needed for multimodal training of large-scale ancient text models. It also provides an intelligent ancient script digitization retrieval SaaS service. Leveraging public cloud computing power, the deciphering capabilities are packaged into standardized cloud computing APIs or SaaS subscription platforms. Users do not need to deploy expensive GPU servers; they only need to upload images via a network interface to obtain real-time cloud-based ancient script interpretation services. Specifically suitable for small and medium-sized cultural heritage systems, local archaeological teams, and third-party cultural application developers, it provides a lightweight, plug-and-play intelligent retrieval solution.
[0121] The technical solution provided in this application involves acquiring a visual dictionary of ancient characters composed of multiple key-value pairs. Each key-value pair consists of a modern Chinese character image and a corresponding synthetic ancient character image, with the same modern Chinese character image corresponding to at least one synthetic ancient character image. A feature encoder is used to extract features from each synthetic ancient character image in the visual dictionary, resulting in ancient character image features that constitute an ancient character feature library. A target ancient character image to be deciphered is acquired, and the feature encoder is used to obtain the target image features corresponding to the target ancient character image. The similarity value between the target image features and the features of each ancient character image in the ancient character feature library is calculated, and the deciphering result of the corresponding target ancient character image is determined based on the similarity value. The visual dictionary constructed in this application, where the same modern Chinese character corresponds to at least one synthetic ancient character image, can generate large-scale, targeted retrieval samples covering multiple writing style variations. This not only overcomes the feature extraction difficulties caused by historical erosion and writing evolution of ancient characters but also compensates for the small size of real ancient character databases, expanding the coverage of the retrieval benchmark. Furthermore, the introduction of a feature-based retrieval comparison mechanism significantly improves the overall accuracy and automation efficiency of large-scale ancient character deciphering. At the same time, this similarity-matching-based decryption process can directly provide morphological evidence of visual evolution, which is highly interpretable.
[0122] This application also provides an ancient script deciphering device that can implement the above-described ancient script deciphering method, as described above. Figure 14 The device includes: Dictionary building module 1410: Used to obtain a visual dictionary of ancient characters consisting of multiple key-value pairs. Each key-value pair consists of a modern Chinese character image and a corresponding synthetic ancient character image. The same modern Chinese character image corresponds to at least one synthetic ancient character image.
[0123] Feature library construction module 1420: Used to extract features from each synthetic ancient character image in the ancient character visualization dictionary using a feature encoder to obtain ancient character image features, which constitute the ancient character feature library.
[0124] Encoding feature extraction module 1430: used to acquire the target ancient character image to be deciphered, and to acquire the target image features corresponding to the target ancient character image using a feature encoder.
[0125] Decipherment Result Determination Module 1440: This module calculates the similarity value between the features of the target image and the features of each ancient character image in the ancient character feature library, and determines the decipherment result of the corresponding target ancient character image based on the similarity value.
[0126] The specific implementation of the ancient script deciphering device in this embodiment is basically the same as the specific implementation of the ancient script deciphering method described above, and will not be repeated here.
[0127] This application also provides an electronic device, including: At least one memory; At least one processor; At least one program; The program is stored in a memory, and the processor executes the at least one program to implement the ancient script deciphering method described above. The electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.
[0128] Please see Figure 15 , Figure 15 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1501 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 1502 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1502 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1502 and is called and executed by the processor 1501 using the ancient script deciphering method of the embodiments of this application. The input / output interface 1503 is used to implement information input and output; The communication interface 1504 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1505 transmits information between various components of the device (e.g., processor 1501, memory 1502, input / output interface 1503, and communication interface 1504); The processor 1501, memory 1502, input / output interface 1503 and communication interface 1504 are connected to each other within the device via bus 1505.
[0129] This application also provides a storage medium storing a computer program that, when executed by a processor, implements the above-described method for deciphering ancient characters.
[0130] Memory, as a non-transitory storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor 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.
[0131] The ancient script deciphering method, apparatus, device, and storage medium proposed in this application acquire an ancient script visualization dictionary composed of multiple key-value pairs. Each key-value pair consists of a modern Chinese character image and a corresponding synthetic ancient script image, with the same modern Chinese character image corresponding to at least one synthetic ancient script image. A feature encoder is used to extract features from each synthetic ancient script image in the ancient script visualization dictionary to obtain ancient script image features, which constitute an ancient script feature library. A target ancient script image to be deciphered is acquired, and the feature encoder is used to obtain the target image features corresponding to the target ancient script image. The similarity value between the target image features and the ancient script image features in the ancient script feature library is calculated, and the deciphering result of the corresponding target ancient script image is determined based on the similarity value. The visualization dictionary constructed in this application, where the same modern Chinese character corresponds to at least one synthetic ancient script image, can generate large-scale, targeted retrieval samples covering multiple writing style variations. This not only overcomes the feature extraction difficulties caused by historical erosion and writing evolution of ancient scripts but also compensates for the small size of real ancient script databases, expanding the coverage of the retrieval benchmark. Based on this, a feature-based comparison mechanism is introduced, which can significantly improve the overall accuracy and automation efficiency of large-scale ancient script deciphering. At the same time, this similarity-matching-based decryption process can directly provide morphological evidence of visual evolution, which is highly interpretable.
[0132] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0133] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0134] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0135] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0136] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0137] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0138] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0139] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0140] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0141] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0142] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for deciphering ancient scripts, characterized in that, include: Obtain an ancient character visualization dictionary consisting of multiple key-value pairs, each key-value pair consisting of a modern Chinese character image and a corresponding synthetic ancient character image, and the same modern Chinese character image corresponds to at least one synthetic ancient character image; The ancient character image features are obtained by using a feature encoder to extract features from each of the synthetic ancient character images in the ancient character visualization dictionary, and the ancient character image features constitute an ancient character feature library. Acquire the target ancient script image to be deciphered, and use the feature encoder to obtain the target image features corresponding to the target ancient script image; Calculate the similarity value between the target image features and each ancient character image feature in the ancient character feature library, and determine the deciphering result of the corresponding target ancient character image based on the similarity value; The synthesized ancient character image is generated through the following steps: inputting the modern Chinese character image into a font style generator to generate at least one writing style variant image; using a trained first-stage conditional diffusion model, iteratively denoising from random noise with the writing style variant image as a condition to generate a preliminary draft image of the ancient character; encoding the modern Chinese character image into ideographic characters to obtain a description sequence; encoding the description sequence into a one-hot vector; converting the one-hot vector into an ideographic character feature vector using a learnable matrix; and using a trained second-stage conditional diffusion model, denoising with the ideographic character feature vector and the preliminary draft image of the ancient character as joint conditions to obtain the synthesized ancient character image. The first-stage conditional diffusion model is trained through the following steps: a standard Chinese character image is input into a font style generator to generate a style, resulting in at least one standard style variant image; the standard style variant image is paired with the interpreted original ancient text image to form training samples; the first-stage diffusion model is trained using the training samples; during the forward pass, Gaussian noise is gradually added to the original ancient text image to obtain a noise image; during the backward pass, the first-stage conditional diffusion model is trained using the standard style variant image as a condition to predict the Gaussian noise added during the forward pass based on the noise image, thus obtaining the trained first-stage conditional diffusion model.
2. The method for deciphering ancient characters according to claim 1, characterized in that, The step of extracting features from each of the synthesized ancient characters in the ancient character visualization dictionary using a feature encoder to obtain ancient character image features includes: Each of the synthesized ancient text images is subjected to multi-scale factor transformation and / or horizontal flip transformation to obtain multiple transformed images; The local feature vectors of each of the transformed images are extracted using the trained feature encoder. The local feature vectors of the multiple transformed images are averaged and normalized to obtain the ancient character image features. The feature encoder is trained using a triplet loss function to optimize the training so that the distance between two synthesized ancient character images from the same modern Chinese character image in the feature space is less than the distance between two synthesized ancient character images corresponding to different modern Chinese character images in the feature space.
3. The method for deciphering ancient characters according to claim 1, characterized in that, The same set of synthesized ancient character images corresponds to the same modern Chinese character tag. Determining the deciphering result of the corresponding target ancient character image based on the similarity value includes: After sorting the similarity values in descending order, a preset number of the ancient character image features are selected as candidate dictionary entries; The candidate dictionary entries are aggregated by voting according to their corresponding modern Chinese character tags, and the deciphering result of the corresponding target ancient character image is determined based on the aggregation result.
4. The method for deciphering ancient characters according to claim 3, characterized in that, The step of aggregating votes on the modern Chinese character tags in the candidate dictionary entries to determine the deciphering result corresponding to the target ancient script image includes: Obtain the modern Chinese character tag corresponding to each of the candidate dictionary entries; The candidate frequency of each modern Chinese character tag is counted, and the modern Chinese character tag with the highest candidate frequency is selected as the deciphering result.
5. The method for deciphering ancient characters according to claim 4, characterized in that, The step of selecting the modern Chinese character tag with the highest candidate frequency as the deciphering result includes: The modern Chinese character tag with the highest candidate frequency is selected as the initial Chinese character tag; When there is more than one preliminary Chinese character tag, calculate the average similarity value of all candidate dictionary entries corresponding to each preliminary Chinese character tag; The modern Chinese character corresponding to the initially selected Chinese character label with the highest average similarity value is selected as the deciphering result.
6. An ancient script deciphering device, characterized in that, include: Dictionary construction module: used to obtain a visual dictionary of ancient characters consisting of multiple key-value pairs, each key-value pair consisting of a modern Chinese character image and a corresponding synthetic ancient character image, and the same modern Chinese character image corresponds to at least one synthetic ancient character image; Feature library construction module: used to extract features from each of the synthesized ancient characters in the ancient character visualization dictionary using a feature encoder to obtain ancient character image features, and the ancient character image features constitute an ancient character feature library; Encoding feature extraction module: used to acquire the target ancient script image to be deciphered, and to acquire the target image features corresponding to the target ancient script image using the feature encoder; Decipherment result determination module: used to calculate the similarity value between the target image features and each ancient character image feature in the ancient character feature library, and determine the decipherment result of the corresponding target ancient character image based on the similarity value; The synthesized ancient character image is generated through the following steps: inputting the modern Chinese character image into a font style generator to generate at least one writing style variant image; using a trained first-stage conditional diffusion model, iteratively denoising from random noise with the writing style variant image as a condition to generate a preliminary draft image of the ancient character; encoding the modern Chinese character image into ideographic characters to obtain a description sequence; encoding the description sequence into a one-hot vector; converting the one-hot vector into an ideographic character feature vector using a learnable matrix; and using a trained second-stage conditional diffusion model, denoising with the ideographic character feature vector and the preliminary draft image of the ancient character as joint conditions to obtain the synthesized ancient character image. The first-stage conditional diffusion model is trained through the following steps: a standard Chinese character image is input into a font style generator to generate a style, resulting in at least one standard style variant image; the standard style variant image is paired with the interpreted original ancient text image to form training samples; the first-stage diffusion model is trained using the training samples; during the forward pass, Gaussian noise is gradually added to the original ancient text image to obtain a noise image; during the backward pass, the first-stage conditional diffusion model is trained using the standard style variant image as a condition to predict the Gaussian noise added during the forward pass based on the noise image, thus obtaining the trained first-stage conditional diffusion model.
7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the ancient script deciphering method according to any one of claims 1 to 5.
8. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the ancient script deciphering method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Verification method for corresponding between keyword in characters and picture or video
CN104144052A
Text semantic analysis method, text semantic analysis terminal and storage medium
CN107704453A
