Oracle bone image restoration method and device

By using sparse Transformer blocks, feature compensators and CLIP text encoders in Oracle image restoration technology, combined with image complexity evaluation and frequency band mixing modules, the problem of insufficient generalization ability of Oracle image restoration model in the existing technology is solved, and higher quality Oracle image restoration is achieved, which is suitable for the digital protection of cultural heritage.

CN119741236AActive Publication Date: 2025-04-01XIAMEN UNIV OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510246464.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-04-01
Estimated Expiration
2045-03-04

AI Technical Summary

Technical Problem

The existing oracle image repair technology has insufficient generalization capabilities, especially when processing unseen and more severely damaged oracle images, its performance has significantly decreased. At the same time, the lack of in-depth understanding of oracle's unique structure and texture, resulting in insufficient maintenance of the restored images in maintaining original features and details.

Method used

The sparse Transformer block, feature compensator and CLIP text encoder are used to construct an Oracle image repair model, and combined with the image complexity evaluation module and the frequency band mixing module, the Oracle image with complex noise characteristics and relatively simple noise characteristics is generated through the Fourier transform and mask generation network, and the model is trained and updated until the output image meets the preset standard.

Benefits of technology

It improves the generalization and robustness of the Oracle image restoration model, enhances the understanding and retention of Oracle's unique structures and textures, and significantly improves the restored image quality, making it more suitable for the digital protection of cultural heritage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741236A_ABST
    Figure CN119741236A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for repairing an oracle image, and relates to the technical field of image processing. According to the method, different features are mixed in a frequency domain to generate a challenging new image, and the generalization ability of a model is enhanced; the method comprises the steps of training an initial repair model, designing a frequency band mixing module and a mask generation network, mixing an oracle image and a repair version thereof to generate a new image, and training and updating the model according to the new image. According to the method, the quality of oracle image restoration can be effectively improved, text details are reserved, and the model robustness is enhanced; the method aims at solving the problem that the model generalization ability is insufficient due to oracle bone image data scarcity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an oracle bone inscription image restoration method and device. Background Art

[0002] In the process of exploring ancient Chinese civilization, oracle bone inscriptions, as the earliest mature writing system, play a vital role. These characters engraved on tortoise shells and animal bones record historical, cultural and religious information from the Shang Dynasty and earlier periods, and are of great value for understanding the origin and development of Chinese civilization. However, due to long-term natural weathering and human destruction, many oracle bone images have become blurred, and some have even been damaged to the point of being unrecognizable, which has seriously hindered scholars' research and interpretation of these precious cultural heritages.

[0003] Although existing image processing technologies provide new tools and methods for the restoration and enhancement of oracle bone images, these technologies still face many challenges in practical applications. Especially in the field of oracle bone images, the relatively small available datasets have led to obvious deficiencies in the generalization ability of existing image restoration models. These models often perform well on the training set, but their performance will drop significantly when processing unseen and more severely damaged oracle bone images.

[0004] In addition, most existing image restoration techniques focus on image denoising and enhancement, but lack a deep understanding of the unique structure and texture of oracle bone inscriptions. This means that although the restored images are visually improved, they are still insufficient in maintaining the original features and details of oracle bone inscriptions.

[0005] In view of this, this application is filed. Summary of the invention

[0006] The present invention provides an oracle bone image restoration method and device, which can at least partially improve the above-mentioned problem.

[0007] To achieve the above object, the present invention adopts the following technical solutions: A method for repairing an oracle bone image, comprising: Creating an oracle image restoration model, and inputting the acquired oracle image into the oracle image restoration model to generate a preliminary restoration image, wherein the oracle image restoration model includes a sparse Transformer block, a feature compensator, and a CLIP text encoder; The image complexity evaluation module is used to evaluate the oracle bone image and obtain the complexity evaluation index X; Use the preset frequency band mixing module to perform Fourier transform and splicing on the oracle bone image and the preliminary restoration image to obtain 12-channel input features; Preprocessing the input features of 12 channels using the mask generation network of the frequency band mixing module to generate a mask tensor, adjusting the strength of the mask tensor according to the complexity evaluation index X, and mixing the mask tensor, the oracle bone image and the preliminary repaired image to generate an oracle bone image with complex noise features and an oracle bone image with relatively simple noise features; Acquire a clean oracle image, train an oracle image restoration model based on the clean oracle image and an oracle image with complex noise features, and use the oracle image with complex noise features and the oracle image with relatively simple noise features to update the mask generation network of the frequency band mixing module during the training process until the output image reaches a preset standard, thereby obtaining a trained oracle image restoration model; An oracle bone script image to be restored is obtained, and the oracle bone script image to be restored is input into an oracle bone script image restoration model, and a restored oracle bone script image is output.

[0008] The present invention also provides an oracle image restoration device, which comprises: A model creation unit, used for creating an oracle image restoration model, and inputting the acquired oracle image into the oracle image restoration model to generate a preliminary restoration image, wherein the oracle image restoration model includes a sparse Transformer block, a feature compensator and a CLIP text encoder; A complexity evaluation unit, used for evaluating the oracle bone image using the image complexity evaluation module to obtain a complexity evaluation index X; A Fourier transform unit is used to perform Fourier transform and splicing processing on the oracle bone image and the preliminary restoration image using a preset frequency band mixing module to obtain 12-channel input features; A frequency band mixing unit, used for preprocessing the input features of 12 channels using the mask generation network of the frequency band mixing module to generate a mask tensor, adjusting the strength of the mask tensor according to the complexity evaluation index X, and mixing the mask tensor, the oracle bone image and the preliminary repaired image to generate an oracle bone image with complex noise features and an oracle bone image with relatively simple noise features; A training unit is used to obtain a clean oracle image, train an oracle image restoration model based on the clean oracle image and the oracle image with complex noise features, and use the oracle image with complex noise features and the oracle image with relatively simple noise features to update the mask generation network of the frequency band mixing module during the training process until the output image reaches a preset standard, thereby obtaining a trained oracle image restoration model; The restoration unit is used to obtain the oracle bone script image to be restored, input the oracle bone script image to be restored into the oracle bone script image restoration model, and output the restored oracle bone script image.

[0009] In summary, the oracle image restoration method first passes through the restoration model in each round of training, then inputs the result into the frequency band mixing module and mixes it with the frequency band mask to generate an oracle image that is more difficult to repair, and finally passes through the restoration model again, which effectively improves the generalization of the model. Compared with the prior art, the oracle image restoration method has the following advantages: 1. A sparse transformer block is proposed, which adopts the most k-relevant sparse attention mechanism, which can better focus on the globally relevant features during the feature extraction process and reduce the interference of irrelevant features; 2. A frequency band mixing module is proposed, so that the repair model needs to process additional I in each round of training. h with I e The joint processing capability of image, frequency domain and spatial domain enables it to better restore images when facing complex noise. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a schematic diagram of the process of the oracle bone image restoration method provided by an embodiment of the present invention; Figure 2 It is a general framework diagram of the training of the oracle bone image restoration method provided by an embodiment of the present invention; Figure 3 It is a framework diagram of an image restoration model of an oracle image restoration method provided by an embodiment of the present invention; Figure 4 It is a framework diagram of a sparse Transformer block of the oracle image restoration method provided by an embodiment of the present invention; Figure 5 It is a framework diagram of a frequency band mixing module of the oracle image restoration method provided by an embodiment of the present invention; Figure 6 is a schematic diagram of the inference results of the trained image restoration model of the oracle image restoration method provided by an embodiment of the present invention; Figure 7 It is a module schematic diagram of the oracle image restoration device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0011] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0012] refer to Figure 1 , Figure 2 As shown, the first embodiment of the present invention discloses an oracle image restoration method, which can be executed by an oracle image restoration device (hereinafter referred to as the restoration device), and in particular, by one or more processors in the restoration device to implement the following method: S1, creating an oracle image restoration model, and inputting the acquired oracle image into the oracle image restoration model to generate a preliminary restoration image, wherein the oracle image restoration model includes a sparse Transformer block, a feature compensator, and a CLIP text encoder; Specifically, step S1 includes: performing convolution processing on the oracle bone script image I, and extracting the image feature f of the oracle bone script image I through a feature compensator. I ; Get the prompt word input by the user, use CLIP text encoder to encode the prompt word, and generate text feature f t ; The sparse Transformer block includes a most k-relevant sparse attention mechanism and a mixed-scale feed-forward network; Based on the most k relevant sparse attention mechanism, the image feature f I With the text feature f t Perform the merging process to obtain the feature f c , for feature f c After calculation, multiple self-attention scores are obtained, and only the top k high-scoring self-attention scores are retained. The formula of the most k-related sparse attention mechanism is: ,in, Select the most k relevant operations, is the normalized exponential function, K is the key matrix, Q is the query matrix, V is the value matrix, k is a preset constant, is the scaling factor.

[0013] The image features corresponding to the top k high-scoring self-attention scores are expanded using the mixed-scale feedforward network, using Convolution expands the channel dimension; The expanded image features are input into two parallel branches, one of which uses Convolution performs convolution on the expanded image features to generate features , and the other branch uses Convolution performs convolution on the expanded image features to generate features ; Features and Features Perform channel splicing and use Convolution on the concatenated features Perform convolution processing to generate features ; use Convolution on the concatenated features Perform convolution processing to generate features ; For the characteristics and Features Perform channel splicing to obtain features and use Convolutional features Perform convolution processing to generate the final output features; The final output features and the initial input features Perform residual addition processing to generate the initial repair image I r , the residual addition calculation formula is: , initial restoration image I r The calculation formula is ,in, For the oracle image restoration model, is the feature obtained after the mixed-scale feedforward network, is a 1×1 convolutional layer. and A mixture of features, is the feature before inputting the mixed-scale feed-forward network.

[0014] See also Figure 3 , Figure 4 In this embodiment, the restoration model can effectively restore the damaged oracle bone image by combining the sparse Transformer block and the feature compensator. This process not only improves the image quality, but also preserves the unique features of the oracle bone, which is of great significance for the digital protection of cultural heritage. Figure 4 The symbol C in represents concat, which is an operation that combines features.

[0015] First, the acquired oracle image I is convolved to extract the key features of the image. This step is the basis of the entire restoration process, and it provides the necessary information for the subsequent attention mechanism and feature compensation. Through this preliminary feature extraction, our model is able to capture the basic structure and texture of the oracle image, laying a solid foundation for subsequent fine restoration. Next, the extracted image features are deeply calculated using the most k relevant sparse attention mechanism in the sparse Transformer block. This mechanism focuses on the most critical information in the image by calculating the self-attention score and retaining only the top k highest-scoring features. This selective attention not only improves the efficiency of the model, but also enhances the model's ability to identify important features, which is crucial for accurate restoration of oracle images.

[0016] And with the help of the mixed-scale feedforward network, these high-scoring features are further expanded. After 1 convolution expands the channel dimension, the features are input into two parallel branches. One branch uses 3 3 convolutions, and the other branch uses 5 5 convolutions to generate features respectively. This multi-scale processing method enables the model to capture local details and global structures at the same time, which is particularly important for the complex structure of oracle bone images. After channel splicing of these two features, convolution processing is used again to generate richer features. This step further integrates information at different scales and enhances the model's understanding and repair capabilities of the image. Finally, these features can be residually added to the initial input features to generate a preliminary repaired image I r This residual addition processing method not only retains the information of the original image, but also enhances the image quality by introducing new features, so that the restored image maintains the original style while significantly improving the clarity and integrity.

[0017] Among them, this method extracts the image feature f of the oracle bone image I I Based on the prompt word, the text feature f is extracted t , used to further improve the restoration level of oracle bone images.

[0018] S2, using the image complexity evaluation module to evaluate the oracle bone image and obtain the complexity evaluation index X; Specifically, step S2 includes: The image complexity evaluation module is used to calculate the oracle image and its corresponding clean oracle image, and the result value PSNR and the result value SSIM are calculated. The scalar X is dynamically generated based on these two result values, and the formula is: X=0.5+0.5 (α (PSNR I -PSNR min ) / (PSNR max -PSNR min )+β (SSIM I -SSIM min ) / (SSIM max -SSIM min )); Among them, PSNR I With SSIM I Both are expressed as the calculation results of image indicators, PSNR max PSNR min is the maximum and minimum value of the result PSNR, SSIM max With SSIM min It is the maximum and minimum value of the result SSIM, which is used to standardize the result value PSNR and the result value SSIM. α and β are the weight factors of PSNR and SSIM respectively to control their contribution to the complexity evaluation index X; Among them, the complexity evaluation index X is in the range of 0.5 to 1. When the image complexity is high, the value of the complexity evaluation index X approaches 0.5, otherwise it approaches 1.

[0019] In this embodiment, the complexity evaluation index X is used to evaluate the complexity of the original input oracle bone image I. The higher the complexity, the greater the difficulty of restoration. During the restoration process, the complexity of the image is further evaluated to assist in the restoration of the oracle bone image.

[0020] S3, using a preset frequency band mixing module to perform Fourier transform and splicing processing on the oracle bone image and the preliminary restoration image to obtain 12-channel input features; Specifically, step S3 includes: respectively processing the oracle bone script image I and the preliminary repair image I r Perform Fourier transform to obtain the frequency domain amplitude FFT(I) of the oracle bone image I and the preliminary repaired image I r Frequency domain amplitude FFT (Ir); In the channel dimension, the oracle bone image I and the preliminary repair image I r , frequency domain amplitude FFT (I) and frequency domain amplitude FFT (Ir) are concatenated into 12-channel input features.

[0021] See also Figure 5 ,In this embodiment, the oracle image and its preliminary restoration image are deeply processed using the ,band mixing module to enhance the model’s recognition capability of image details and noise ,features, thereby improving the restoration quality.

[0022] Specifically, the oracle bone image I and the preliminary repaired image I obtained in step S1 are first r Fourier transform is performed respectively. This step converts the image from the spatial domain to the frequency domain, obtaining their frequency domain magnitude FFT(I) and FFT(Ir). Fourier transform is a powerful mathematical tool that can reveal the frequency components of the image, which is crucial for subsequent band masking operations. Through this transform, we can capture the periodic patterns and noise characteristics in the image, providing rich information for accurate image restoration.

[0023] Next, the original oracle bone image I and the preliminary repaired image I r And their frequency domain amplitude FFT (I) and FFT (Ir) are spliced ​​in the channel dimension to form a 12-channel input feature. This splicing process not only retains the spatial information of the image, but also integrates its frequency information, providing a comprehensive perspective for the model to understand and process the image. This multi-channel feature representation enables the model to consider both the local details and the global structure of the image, thereby more effectively identifying and repairing damaged parts in the image. Figure 5 The symbol fq_I in the figure represents the image in the frequency domain converted from the original image I after fast Fourier transform. r Represented as the initial repair image I r After fast Fourier transform, the image is converted into the frequency domain. h =FFT(I) m+FFT(Ir) (1-m) means to multiply the image fq_I by the mask m element by element, so that the image fq_I r Multiply element-wise with (1-m) so that fq_I h In the part where the mask m takes a large value, more frequency components of the original image I can be retained (closer to the original image I); in the part where the mask m takes a small value, more frequency components of Ir are used (closer to the repaired image Ir). e =FFT(I) (1-m)+FFT(Ir) m means to multiply the image fq_I by (1-m) element by element, so that the image fq_I r The mask m is multiplied element by element, so that the part with a large value of mask m can retain more frequency components of the restored image Ir (closer to the restored image Ir), and where the mask m has a small value, the frequency components of the original image I are more used (closer to the original image I).

[0024] S4, using the mask generation network of the frequency band mixing module to preprocess the input features of the 12 channels to generate a mask tensor, adjusting the strength of the mask tensor according to the complexity evaluation index X, and mixing the mask tensor, the oracle bone image and the preliminary repaired image to generate an oracle bone image with complex noise features and an oracle bone image with relatively simple noise features; Specifically, step S4 includes: the frequency band mixing module includes a mask generation network , wherein the mask generation network Includes 3 groups Convolution, ReLU activation function, and pooling; The 12-channel input features are input into 3 groups Convolution is performed in the convolution to obtain the combined feature vector; The combined feature vector is processed using two fully connected layers and Softmax operations in sequence to generate weight values ​​for multiple frequency bands; Based on the weight value and complexity evaluation index X, a concentric circle mask in polar coordinates is constructed to obtain a mask tensor m, m= ([I,I r ,FFT(I),FFT(I r ),X]), where the smaller the value of the complexity evaluation index X is, the more complex the oracle image is, and the weaker the generated mask tensor is; the larger the value of the complexity evaluation index X is, the less noise the oracle image has, and the stronger the generated mask tensor is.

[0025] The mask tensor m is combined with the oracle image I and the preliminary repaired image I r Mixing is performed; Perform inverse Fourier transform on the mixed image to generate an oracle bone image with complex noise characteristics. h and the oracle bone image I with relatively simple noise features e ; Oracle bone image with complex noise characteristics I h The formula is: h =IFFT(FFT(I) m+FFT(Ir) (1-m)), oracle bone image I with relatively simple noise features e The formula is: e =IFFT(FFT(I) (1-m)+FFT(Ir) m), where IFFT is the inverse Fourier transform, is element-wise multiplication.

[0026] In this embodiment, the step uses the mask generation network in the frequency band mixing module to process the 12-channel input features. The mask generation network consists of 3 groups of convolutional layers, each group of convolutions is followed by a ReLU activation function and a pooling operation. Such a network structure design helps to extract the features of the image at different scales and enhance the model's ability to capture image details. The 12-channel input features are input into these convolutional layers, and after feature extraction and nonlinear transformation, a combined feature vector is obtained. Subsequently, two layers of fully connected layers are used to further process the feature vector to generate weight values ​​for multiple frequency bands. These weight values ​​reflect the importance of different frequency bands in the image and provide a basis for subsequent frequency band mask generation. Through the Softmax operation, these weight values ​​are converted into probability distributions to ensure that the sum of the weights of all frequency bands is 1, so that the model can pay more attention to important frequency band information.

[0027] Based on these weight values, concentric circle masks are constructed in polar coordinates to form a mask tensor m. This mask tensor m is obtained by comprehensively considering the original oracle bone image I, the preliminary repaired image I r And their frequency domain amplitude FFT (I) and FFT (Ir) to ensure that the mask tensor can accurately reflect the frequency information of the image. Then the mask tensor m is combined with the oracle image I and the preliminary repair image I r In this way, the mixing ratio of the original image and the repaired image can be controlled in the frequency domain to generate an oracle bone image with complex noise characteristics. h and the oracle bone image I with relatively simple noise features e This hybrid processing not only increases the diversity of model training, but also improves the model's adaptability to oracle images under different noise conditions.

[0028] Finally, the mixed image is subjected to inverse Fourier transform to obtain the final oracle bone image I h and I e Through this processing, images with different noise characteristics can be obtained in the spatial domain, providing rich data for subsequent model training and updating.

[0029] S5, obtaining a clean oracle image, training an oracle image restoration model based on the clean oracle image and the oracle image with complex noise features, and using the oracle image with complex noise features and the oracle image with relatively simple noise features to update the mask generation network of the frequency band mixing module during the training process, until the output image meets a preset standard, thereby obtaining a trained oracle image restoration model; Preferably, the mask generation network The loss function is: ,in, To calculate the peak signal-to-noise ratio operation of an image pair, The oracle bone image I has complex noise characteristics. h Oracle Image Inpainting Model The generated image, For a clean Oracle image, is the hyperparameter of the balanced loss, The oracle bone image I has relatively simple noise features. e Oracle Image Inpainting Model The resulting image.

[0030] Preferably, the oracle image restoration model The loss function is: ,in, is the L1 norm.

[0031] In this embodiment, clean oracle bone images are first obtained, which are used as reference standards in the training process to evaluate the performance of the restoration model. These clean oracle bone images and the oracle bone images with complex noise features generated in step S4 are used. h The oracle bone inscription image restoration model is trained. During the training process, the model learns how to restore clear and accurate oracle bone inscription images from noisy images. This training method enables the model to gradually adapt to and process complex noise features, improving its restoration capabilities.

[0032] During training, we use oracle bone images with complex noise characteristics. h and the oracle bone image I with relatively simple noise features e Update the mask generation network. This step is achieved by optimizing the loss function of the mask generation network. By minimizing this loss function, the mask generation network can generate more effective masks to improve the processing of noise features. In addition, the loss function of the oracle image inpainting model measures the difference between the inpainted image and the clean image. By minimizing this loss, the model can generate inpainting results that are closer to the clean oracle image.

[0033] Through this training and updating mechanism, the restoration model can not only improve the restoration quality of oracle bone images, but also enhance the model's robustness to complex noise. The application of this technology can not only promote the in-depth study of oracle bone inscriptions, but also provide strong technical support for the digital protection of cultural heritage. In addition, by continuously optimizing the mask generation network and the oracle bone image restoration model, the restoration model can be better generalized to different practical application scenarios, improving the practicality and reliability of the restoration results. Finally, when the output image reaches the preset standard, a trained oracle bone image restoration model is obtained, which can effectively repair damaged oracle bone images, providing a new technical means for the protection and research of oracle bones.

[0034] S6, obtaining an oracle bone script image to be repaired, inputting the oracle bone script image to be repaired into an oracle bone script image repair model, and outputting a repaired oracle bone script image.

[0035] In summary, the oracle bone image restoration method improves the generalization ability of the model for oracle bone images through the band masking technology. Among them, the restoration model contains a sparse Transformer block and a feature compensator, which can extract key image features and generate a preliminary restored image. The image features are further mixed using the band mixing module and the mask generation network to generate oracle bone images with different noise characteristics, thereby enhancing the robustness of the model. During training, the clean image and the noisy image are combined to optimize the model and the mask network to achieve high restoration quality. This method effectively improves the restoration effect of oracle bone images and provides strong technical support for the digital protection of cultural heritage. Among them, from Figure 6 It can be seen that the oracle bone image restoration method can repair the oracle bone image very well.

[0036] See also Figure 7 The second embodiment of the present invention provides an oracle image restoration device, which includes: The model creation unit 201 is used to create an oracle image restoration model, and input the acquired oracle image into the oracle image restoration model to generate a preliminary restoration image, wherein the oracle image restoration model includes a sparse Transformer block, a feature compensator and a CLIP text encoder; The complexity evaluation unit 202 is used to evaluate the oracle bone image using an image complexity evaluation module to obtain a complexity evaluation index X; The Fourier transform unit 203 is used to perform Fourier transform and splicing processing on the oracle bone script image and the preliminary restoration image using a preset frequency band mixing module to obtain 12-channel input features; The frequency band mixing unit 204 is used to pre-process the input features of the 12 channels using the mask generation network of the frequency band mixing module to generate a mask tensor, adjust the strength of the mask tensor according to the complexity evaluation index X, and mix the mask tensor, the oracle bone image and the preliminary restoration image to generate an oracle bone image with complex noise features and an oracle bone image with relatively simple noise features; The training unit 205 is used to obtain a clean oracle image, train the oracle image restoration model based on the clean oracle image and the oracle image with complex noise features, and use the oracle image with complex noise features and the oracle image with relatively simple noise features to update the mask generation network of the frequency band mixing module during the training process until the output image meets the preset standard, thereby obtaining a trained oracle image restoration model; The restoration unit 206 is used to obtain an oracle bone script image to be restored, input the oracle bone script image to be restored into an oracle bone script image restoration model, and output a restored oracle bone script image.

[0037] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for restoring an oracle bone image, characterized in that: include: Creating an oracle image restoration model, and inputting the acquired oracle image into the oracle image restoration model to generate a preliminary restoration image, wherein the oracle image restoration model includes a sparse Transformer block, a feature compensator, and a CLIP text encoder; The image complexity evaluation module is used to evaluate the oracle bone image and obtain the complexity evaluation index X; Use the preset frequency band mixing module to perform Fourier transform and splicing on the oracle bone image and the preliminary restoration image to obtain 12-channel input features; Preprocessing the input features of 12 channels using the mask generation network of the frequency band mixing module to generate a mask tensor, adjusting the strength of the mask tensor according to the complexity evaluation index X, and mixing the mask tensor, the oracle bone image and the preliminary repaired image to generate an oracle bone image with complex noise features and an oracle bone image with relatively simple noise features; Acquire a clean oracle image, train an oracle image restoration model based on the clean oracle image and an oracle image with complex noise features, and use the oracle image with complex noise features and the oracle image with relatively simple noise features to update the mask generation network of the frequency band mixing module during the training process until the output image reaches a preset standard, thereby obtaining a trained oracle image restoration model; An oracle bone script image to be restored is obtained, and the oracle bone script image to be restored is input into an oracle bone script image restoration model, and a restored oracle bone script image is output.

2. The oracle bone image restoration method according to claim 1, characterized in that: The acquired oracle bone script image is input into the oracle bone script image restoration model to generate a preliminary restoration image, specifically: The oracle bone script image I is convoluted, and the image feature f of the oracle bone script image I is extracted through a feature compensator. I ; Get the prompt word input by the user, use CLIP text encoder to encode the prompt word, and generate text feature f t ; The sparse Transformer block includes a most k-relevant sparse attention mechanism and a mixed-scale feed-forward network; Based on the most k relevant sparse attention mechanism, the image feature f I With the text feature f t Perform the merging process to obtain the feature f c , for feature f c After calculation, multiple self-attention scores are obtained, and only the top k high-scoring self-attention scores are retained. The formula of the most k-related sparse attention mechanism is: ,in, Select the most k relevant operations, is the normalized exponential function, K is the key matrix, Q is the query matrix, V is the value matrix, k is a preset constant, is the scaling factor.

3. The oracle bone image restoration method according to claim 2, characterized in that: Also includes: The image features corresponding to the top k high-scoring self-attention scores are expanded using the mixed-scale feedforward network, using Convolution expands the channel dimension; The expanded image features are input into two parallel branches, one of which uses Convolution performs convolution on the expanded image features to generate features , and the other branch uses Convolution performs convolution on the expanded image features to generate features ; Features and Features Perform channel splicing and use Convolution on the concatenated features Perform convolution processing to generate features ; use Convolution on the concatenated features Perform convolution processing to generate features ; For the characteristics and Features Perform channel splicing to obtain features and use Convolution on features Perform convolution processing to generate the final output features; The final output features and the initial input features Perform residual addition processing to generate the initial repair image I r , the residual addition calculation formula is: , initial restoration image I r The calculation formula is ,in, For the oracle image restoration model, is the feature obtained after the mixed-scale feedforward network, is a 1×1 convolutional layer. and A mixture of features, is the feature before inputting the mixed-scale feed-forward network.

4. The oracle bone image restoration method according to claim 1, characterized in that: The image complexity evaluation module is used to evaluate the oracle bone image and obtain the complexity evaluation index X, which is: The image complexity evaluation module is used to calculate the oracle image and its corresponding clean oracle image, and the result value PSNR and the result value SSIM are calculated. The scalar X is dynamically generated based on these two result values, and the formula is: X=0.5+0.5 (α (PSNR I -PSNR min ) / (PSNR max -PSNR min )+β (SSIM I -SSIM min ) / (SSIM max -SSIM min )); Among them, PSNR I With SSIM I Both are expressed as the calculation results of image indicators, PSNR max PSNR min is the maximum and minimum value of the result PSNR, SSIM max With SSIM min It is the maximum and minimum value of the result SSIM, which is used to standardize the result value PSNR and the result value SSIM. α and β are the weight factors of PSNR and SSIM respectively to control their contribution to the complexity evaluation index X. Among them, the complexity evaluation index X is in the range of 0.5 to 1. When the image complexity is high, the value of the complexity evaluation index X approaches 0.5, otherwise it approaches 1.

5. The oracle bone image restoration method according to claim 1, characterized in that: The oracle image and the preliminary repaired image are Fourier transformed and spliced ​​using the preset frequency band mixing module to obtain 12-channel input features, specifically: The oracle bone image I and the preliminary repair image I are respectively r Perform Fourier transform to obtain the frequency domain amplitude FFT(I) of the oracle bone image I and the preliminary repaired image I r Frequency domain amplitude FFT (Ir); In the channel dimension, the oracle bone image I and the preliminary repair image I r , frequency domain amplitude FFT (I) and frequency domain amplitude FFT (Ir) are concatenated into 12-channel input features.

6. The oracle bone image restoration method according to claim 5, characterized in that: The mask generation network of the frequency band mixing module is used to preprocess the input features of the 12 channels to generate a mask tensor, specifically: The frequency band mixing module contains a mask generation network , wherein the mask generation network Includes 3 groups Convolution, ReLU activation function, and pooling; The 12-channel input features are input into 3 groups Convolution is performed in the convolution to obtain the combined feature vector; The combined feature vector is processed using two fully connected layers and Softmax operations in sequence to generate weight values ​​for multiple frequency bands; Based on the weight value and complexity evaluation index X, a concentric circle mask in polar coordinates is constructed to obtain a mask tensor m, m= ([I,I r ,FFT(I),FFT(I r ),X]), where the smaller the value of the complexity evaluation index X is, the more complex the oracle image is, and the weaker the generated mask tensor is; the larger the value of the complexity evaluation index X is, the less noise the oracle image has, and the stronger the generated mask tensor is.

7. The oracle bone image restoration method according to claim 4, characterized in that: The mask tensor, the oracle bone image and the preliminary repaired image are mixed to generate an oracle bone image with complex noise features and an oracle bone image with relatively simple noise features, specifically: The mask tensor m is combined with the oracle image I and the preliminary repaired image I r Mixing is performed; Perform inverse Fourier transform on the mixed image to generate an oracle bone image with complex noise characteristics. h and the oracle bone image I with relatively simple noise features e ; Oracle bone image with complex noise characteristics I h The formula is: h =IFFT(FFT(I) m+FFT(Ir) (1-m)), oracle bone image I with relatively simple noise features e The formula is: e =IFFT(FFT(I) (1-m)+FFT(Ir) m), where IFFT is the inverse Fourier transform, is element-wise multiplication.

8. The oracle bone image restoration method according to claim 6, characterized in that: The mask generation network The loss function is: ,in, To calculate the peak signal-to-noise ratio operation for an image pair, The oracle bone image I has complex noise characteristics. h Oracle Image Inpainting Model The generated image, For a clean Oracle image, is the hyperparameter of the balanced loss, The oracle bone image I has relatively simple noise features. e Oracle Image Inpainting Model The generated image.

9. The oracle bone image restoration method according to claim 7, characterized in that: The Oracle Image Inpainting Model The loss function is: ,in, is the L1 norm.

10. An oracle bone image restoration device, characterized in that: include: A model creation unit, used for creating an oracle image restoration model, and inputting the acquired oracle image into the oracle image restoration model to generate a preliminary restoration image, wherein the oracle image restoration model includes a sparse Transformer block, a feature compensator and a CLIP text encoder; A complexity evaluation unit, used for evaluating the oracle bone image using the image complexity evaluation module to obtain a complexity evaluation index X; A Fourier transform unit is used to perform Fourier transform and splicing processing on the oracle bone image and the preliminary restoration image using a preset frequency band mixing module to obtain 12-channel input features; A frequency band mixing unit, used for preprocessing the input features of 12 channels using the mask generation network of the frequency band mixing module to generate a mask tensor, adjusting the strength of the mask tensor according to the complexity evaluation index X, and mixing the mask tensor, the oracle bone image and the preliminary repaired image to generate an oracle bone image with complex noise features and an oracle bone image with relatively simple noise features; A training unit is used to obtain a clean oracle image, train an oracle image restoration model based on the clean oracle image and the oracle image with complex noise features, and use the oracle image with complex noise features and the oracle image with relatively simple noise features to update the mask generation network of the frequency band mixing module during the training process until the output image reaches a preset standard, thereby obtaining a trained oracle image restoration model; The restoration unit is used to obtain the oracle bone script image to be restored, input the oracle bone script image to be restored into the oracle bone script image restoration model, and output the restored oracle bone script image.

Citation Information

Patent Citations

  • Text feature-introduced image restoration method

    CN117314778A

  • Image restoration method of enhanced conditional diffusion model based on dual-domain interactive Transform

    CN118537249A

  • Denoising network model based on diffusion model and oracle rubbing image restoration method

    CN119251088A

  • Method and device for denoising oracle based on channel attention and font aggregation, and medium

    CN119494791A

  • Generation method, system and apparatus capable of visual resolution enhancement, and storage medium

    WO2022242029A1