A relic fragment fine classification method, system, medium, device and terminal

By combining an extended neighborhood attention mechanism and a recursive gated convolutional self-adjusting network, the problems of accuracy and computational efficiency in the classification of cultural relic fragments are solved, achieving efficient and detailed classification of cultural relic fragments and improving the accuracy and efficiency of cultural relic restoration.

CN116051907BActive Publication Date: 2026-04-10NORTHWEST UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies lack a large-scale database of artifact fragments, leading to inaccurate classification and a high risk of misclassification. Furthermore, neural network-based artifact classification has low accuracy, high computational cost, and is vulnerable to adversarial attacks.

Method used

A recursive gated convolutional self-adjusting network based on an extended neighborhood attention mechanism is adopted, and data augmentation is performed through a generative adversarial network to construct a database of Qin terracotta warrior fragments. An extended neighborhood attention mechanism is designed in the feature extraction layer, combined with recursive gated convolution for high-order spatial interaction, to achieve fine classification of cultural relic fragments.

Benefits of technology

A high-quality database of cultural relic fragments has been constructed, which has improved classification accuracy, reduced computational costs, enhanced the ability to jointly interpret cultural and physical characteristics, solved the problems of misclassification and omission, and improved the efficiency and accuracy of cultural relic restoration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116051907B_ABST
    Figure CN116051907B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of image processing in computer vision, and discloses a kind of relic fragment fine classification method, system, medium, equipment and terminal, through the data enhancement of existing Qin figurine fragment dataset based on style generative adversarial network;Recursive gated convolution self-adjusting network model is constructed, and extended neighborhood attention mechanism is designed in the feature extraction layer of model, and the local attention enhancement of the physical features such as contour line, thickness and curvature of Qin figurine fragment and the cultural features such as color and texture is carried out;Recursive gated convolution is designed in convolution layer, and the joint learning of physical features and cultural features of fragment is carried out through high-order space interaction, and then the fine classification of relic fragment is realized.The fine classification method of relic fragment provided by the application can effectively extract the complex visual appearance features of relic fragment, realize joint interpretation with partial feature missing, so as to carry out fine classification, and provide effective way and means for digital protection and restoration of relics.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of image processing in computer vision, and particularly relates to a fine classification method and system for cultural relic fragments, a medium, equipment and a terminal. BACKGROUND

[0002] At present, historical and cultural heritage is an important carrier of the bloodline genes of the Chinese nation, born in ancient times, not only belonging to the present generation, but also to the future generation. Protecting historical relics well is to keep the root of the unbroken national spirit. The terracotta warriors and horses are the treasures of civilization and valuable heritage that sustain the national spirit. However, after thousands of years of underground and aboveground destruction, a large number of exquisite and precious cultural relics can only be presented in the form of fragments. In order to restore the original appearance of the cultural relics, it is necessary to repair and protect them, and an important step in the repair is classification. By dividing the cultural relic fragments into subsets according to characteristic information such as color, texture, thickness, curvature, and fracture surface, the complexity of splicing is reduced and the success rate of splicing is improved. The commonly used digital classification method for cultural relic fragments is the traditional ceramic fragment classification method: using an artificial feature extractor to extract features such as color histogram, gray level co-occurrence matrix, gabor filter, LBP, etc. to extract color, texture and shape features of the fragments, and then using traditional classification algorithms such as K-means, KNN, BP, etc. for classification.

[0003] Due to the complexity and ambiguity of cultural relic data, and with the continuous development of deep learning, the traditional classification algorithm has been difficult to meet expectations in data classification. Scholars have therefore turned their attention to convolutional neural networks, and image classification is performed using convolutional neural networks. At present, the technology of cultural relic classification based on neural networks is still in the development stage, and the following problems need to be studied and solved:

[0004] 1. There is a lack of open large-scale database of fragments for research. Some scholars use fragment data from the Forbidden City Museum and other local museums, and some scholars use scanned images from related books and fragment pictures provided by related professional websites. However, either the amount of cultural relic data is small and cannot achieve accurate classification, or data noise is introduced, causing misclassification problems. Therefore, it is necessary to create a large-scale and standard cultural relic database.

[0005] 2. The basic network represented by AlexNet, VGGNet and ResNet has low accuracy and poor robustness in network classification, and the computational cost is high. Therefore, it is necessary to adjust the network structure to improve the feature extraction capability of the convolutional network, and at the same time reduce the parameter redundancy to realize the dual improvement of precision and speed.

[0006] Through the above analysis, the problems and defects of the prior art are:

[0007] (1) Current neural network-based cultural relic classification technology lacks a publicly available large-scale database of fragments, and due to the small amount of cultural relic data or the presence of data noise, accurate classification cannot be achieved or misclassification problems occur.

[0008] (2) In the current neural network-based cultural relic classification technology, the base network represented by AlexNet, VGGNet and ResNet has low accuracy and weak robustness in network classification, and has high computational overhead.

[0009] (3) High computational cost: current image classification methods usually require a large amount of computational resources for training and evaluation, which may be a barrier in resource-limited environments.

[0010] (4) Robustness to adversarial attacks: modern deep learning models are vulnerable to adversarial attacks, and small, imperceptible changes to images can cause the model to misclassify them. SUMMARY

[0011] In view of the problems existing in the prior art, the present application provides a cultural relic fragment fine classification method, system, medium, equipment and terminal, especially a cultural relic fragment fine classification method, system, medium, equipment and terminal based on an extended neighborhood attention mechanism and a recursive gate convolution self-adjusting network.

[0012] The present application is implemented in the following way: a cultural relic fragment fine classification method, the cultural relic fragment fine classification method comprising: data augmentation of an existing Qin figurine fragment dataset by a style-based generative adversarial network; constructing a recursive gate convolution self-adjusting network model as a backbone network, designing an extended neighborhood attention mechanism in the feature extraction layer of the model, and enhancing the local attention of the physical features of the Qin figurine fragments, such as contour lines, thickness and curvature, and the cultural features of color and texture; designing a recursive gate convolution in the convolution layer, jointly learning the physical features and cultural features of the fragments through high-order spatial interaction, enhancing the ability of the classification network to jointly interpret cultural features and physical features, and thus realizing fine classification of cultural relic fragments.

[0013] Further, the cultural relic fragment fine classification method further comprises:

[0014] Digitizing the cultural relic fragments and constructing a dataset; constructing a DiNAT-g nThe Conv-RegNet classification network is initialized; input training data, set the initial iteration number K=0; respectively, network output value and error calculation, and judge whether the error meets the requirements; if the error does not meet the requirements, calculate the error gradient of the activation function error value, calculate the error gradient and adjust the network weight, let K=k+1, return to the network output value and error calculation step; rejudge whether the error meets the requirements, if it meets the requirements, DiNAT-g n The Conv-RegNet classification network parameters are obtained, and the cultural relic classification result is obtained.

[0015] Further, the fine classification method of cultural relic fragments comprises the following steps:

[0016] Step one, digital processing and data enhancement of the broken cultural relic fragments, and construction of a sample database;

[0017] Step two, construction of a recursive gate convolution self-adjusting network based on an extended neighborhood attention mechanism;

[0018] Step three, down-sampling: down-sampling the input to one fourth of the original spatial resolution and extracting and sending feature information through a DiNATransformer encoder;

[0019] Step four, the feature map is down-sampled to half of its spatial size and doubled in the channel between levels to obtain more global context;

[0020] Step five, threshold calculation: attention calculation according to the obtained weight and feature vector;

[0021] Step six, gate convolution g n Conv realizes first-order spatial interaction and high-order spatial interaction;

[0022] Step seven, feature information is transmitted to the RegHead output layer composed of global average pooling, random inactive neuron function and fully connected layer to obtain the classification result of the cultural relic fragments.

[0023] Further, in step one, StyleGAN adds noise in the manner of AdaIN mechanism, and the formula is as follows:

[0024]

[0025] In the formula, x i is the content feature, y represents the style feature, and μ and σ respectively represent the mean difference and standard deviation of the input feature map x i After applying instance normalization to the input feature map, StyleGAN performs scaling and adds bias to each normalized spatial feature map using style information.

[0026] An intermediate variable w of the data is determined, a truncation trick is used for w, distances of all other points to w are calculated; each distance is compressed according to a uniform standard, and the data points are gathered to control the spatial distribution of the intermediate vector to be approximately normally distributed, while the distance relationship between the points is not changed, and the formula is as follows:

[0027]

[0028] In the formula, w is the output of the mapping network mapping, is the mean of the intermediate vector w generated by training, w' is the input of the generation network, and ψ is the truncation coefficient. The larger the coefficient, the greater the density of the latent space W; the smaller the latent vector space, the faster the system finds the optimal intermediate vector w'. By using different ψ for each level, the model controls the difference between the feature value of each level and the average feature value.

[0029] The training method uses a progressive training step, and the progressive training mode of the generator and the discriminator makes the generator learn the features of different scales; through the StyleGAN implementation, the original Qin figurine fragment data set is expanded according to a 1:10 ratio to obtain an image data set containing Qin figurine fragments.

[0030] The digital processing of cultural relics fragments is to extract features from the broken body fragments and convert them into a data format that can be processed by a computer. The feature extraction process includes fragment shooting, data preprocessing and data enhancement steps; after digital processing, classification is performed according to visual appearance features, and corresponding labels are labeled to construct a cultural relic sample database; data preprocessing includes normalization processing and cropping processing; data enhancement uses StyleGAN to realize multi-feature fusion of fragment style.

[0031] Further, in step two, the extended neighborhood attention mechanism is integrated into the RegNet network, and the local attention of the Qin figurine fragments is enhanced by the physical and cultural characteristics, so as to realize the classification of feature significant fragments.

[0032] Further, in step three, the input image is extracted through a series of convolutional layers to extract feature maps. Then the DiNA mechanism is applied to the feature map to calculate the importance of each pixel in the image.

[0033] Further, in step five, for input X∈R n×d , given the inflation value δ, the neighborhood attention weight of the i-th token with a neighborhood size of k is defined as where Q, K, and V are linear projections of X, then:

[0034]

[0035]

[0036] In the formula, B i,j It is the relative positional deviation between any two tokens i and j. The q of the i-th token is multiplied by the k nearest neighbor tokens k, where... Let B be the j-th nearest neighbor token of token i, satisfying j mod δ = i mod δ. i,j It is added to each attention weight and extended to all pixels (i,j), thus forming the form of local attention.

[0037] The neighborhood attention output of the i-th token with a neighborhood size of k is defined as:

[0038]

[0039] In the formula, DiNA is the extended neighborhood attention, and d is the embedding dimension. is the scaling parameter; softmax is the normalized exponential function used to normalize the attention weights. The layer inflation value δ∈[1,[n / k]], where n is the number of tokens and k is the neighborhood size.

[0040] DiNAT creates an expanded neighborhood around each pixel in the feature map. This neighborhood is defined by a dilation rate, which determines its size. The attention mechanism then measures the importance of each neighboring pixel based on its similarity to other pixels.

[0041] Furthermore, in step six, let the input features be... The output of gated convolution is:

[0042]

[0043]

[0044] In the formula, φ in , φ out is a linear projection operation used to complete the information exchange along the channel dimension; f is a channel-wise convolution; Where Ω i It is a local window of the channel-wise convolution, with center coordinate i and w being the weights of the channel-wise convolution.

[0045] The output expression of gated convolution is and surrounding features The first-order interaction.

[0046] When achieving higher-order spatial interaction, through φ in A series of projection features p0 and

[0047]

[0048] After the low-level features are extracted from the input image using small kernel size in the convolution layer, these features are transmitted through the recurrent gated convolution layer to capture high-order spatial interactions:

[0049] p k+1 =f k (q k )⊙g k (p k ) / αk=0,1,...,n-1;

[0050] In the formula, each recursion is stabilized by dividing by α, and {f k} is a series of channel-wise convolution operations, and {g k} is the number of channels matching the features in the process of each recursion.

[0051] The recurrent gated convolution layer g n Conv is composed of several recurrent sub-blocks. Each sub-block is composed of two convolution layers followed by a gating mechanism. The first convolution layer is used to extract features from the input, and the second convolution layer is used to combine these features with the output of the previous recurrent sub-block.

[0052] When calculating the gated convolution, the combined features are directly completed by channel-wise convolution;

[0053]

[0054] The output q n of the last recursion is input to the projection layer φ in to obtain the result of g n Conv. The implementation of g n Conv realizes the n-order interaction of a certain feature and the surrounding features, and the joint learning of physical and cultural features is realized through the high-order interaction ability of recurrent gated convolution.

[0055] The channel dimension of each order is set in the form of exponential decrease:

[0056]

[0057] Further, in step seven, the RegStage in the RegNet network structure is replaced with the gated convolution g n Conv, and two deep convolutions, 7x7 Convolution and global filter GF, are used to realize g n Conv to capture long-term interactions and jointly interpret physical and cultural features.

[0058] Among them, the GF layer is an improved version, half of the channels are processed using a global filter, and the other half is processed using a 3x3 deep convolution, and only the GF layer is used in the later stage to retain more local details.

[0059] Another object of the present application is to provide a cultural relic fragment fine classification system applying the cultural relic fragment fine classification method.

[0060] The data enhancement module is configured to digitize the Qin figurine fragments, perform data enhancement on an existing Qin figurine fragment dataset based on a style-based generative adversarial network, and construct a sample database.

[0061] The model construction module is configured to construct a recursive gated convolution self-adjusting network model, design an extended neighborhood attention mechanism in a feature extraction layer of the model, and perform local attention enhancement on physical features such as contour lines, thickness, and curvature of the Qin figurine fragments and cultural features such as color and texture.

[0062] The cultural relic fragment fine classification module is configured to design a recursive gated convolution in a convolution layer, jointly learn physical features and cultural features of the fragments through high-order spatial interaction, and realize fine classification of the cultural relic fragments.

[0063] Another object of the present application is to provide a computer device comprising a memory and a processor, the memory storing a computer program, and the computer program being executed by the processor to enable the processor to perform the steps of the cultural relic fragment fine classification method.

[0064] Another object of the present application is to provide a computer readable storage medium storing a computer program, and the computer program being executed by the processor to enable the processor to perform the steps of the cultural relic fragment fine classification method.

[0065] Another object of the present application is to provide an information data processing terminal for implementing the cultural relic fragment fine classification system.

[0066] In combination with the above technical solutions and the technical problems solved, the technical solutions to be protected by the present application have the following advantages and positive effects:

[0067] First, in view of the technical problems existing in the above-mentioned prior art and the difficulty in solving the problems, the technical solutions to be protected by the present application are closely combined with the results and data obtained during the research and development process, and the technical problems solved by the technical solutions are analyzed in detail and deeply.

[0068] The application enhances the existing Qin figurine fragment data set based on a style-based generative adversarial network (StyleGAN), meets the training scale of the RegNet network, and improves the model classification effect; secondly, in view of the weak feature extraction of the RegNet network model, an extended neighborhood attention mechanism (DiNAT) is designed in the feature extraction layer of the model, the local attention of the physical features such as the contour line, thickness and curvature of the Qin figurine fragments and the cultural features such as color and texture is enhanced, the local fine features are improved, and the rapid classification of fragments with significant features is realized; at the same time, a recursive gate convolution (g n Conv) is designed in the convolution layer, the physical features and cultural features of the fragments are jointly learned through high-order space interaction, the joint interpretation ability of the DiNAT-g n Conv-RegNet model is improved, and the missing, misclassification and misclassification problems of fragments with missing significant features such as color fading, texture wear and the like are effectively solved. The fine classification method of the cultural relic fragments of the application can effectively extract the complex visual appearance features of the cultural relic fragments, realize joint interpretation with partial feature missing, and thus realize fine classification, thereby providing an effective way and means for digital protection and restoration of cultural relics.

[0069] Compared with the existing classification technology, the application also has the following technical effects:

[0070] 1. A high-quality large-scale cultural relic fragment data sample library is constructed, which provides a good foundation and support for the training of subsequent data classification models and improves the classification accuracy of the model.

[0071] 2. The core idea of the RegNet network parameterization used can be expressed as: the width and depth of a good network can be explained by a quantized linear function, and RegNet provides a simple and fast network that can work well in various token systems.

[0072] 3. The extended neighborhood attention mechanism (DiNAT) is added to the RegNet network, which is a simple, flexible and powerful sparse global attention mode that allows the receptive field to grow exponentially and capture more distant context features without any additional computational cost. The application optimizes the expansion of the receptive field by using a gradual inflation change in the model without expanding to a larger window size. By enhancing the local attention of the physical features such as the contour line, thickness and curvature of the Qin figurine fragments and the cultural features such as color and texture, the local fine features are improved, which is beneficial to enhance the feature extraction capability of the cultural relic fragments and realize the rapid classification of fragments with significant features.

[0073] 4. The introduced gate recursive convolution module g nConv performs high-order spatial interactions through gated convolution and recursion design, the new operation has high flexibility and customizability, realizes joint learning of physical features and cultural features of the fragments, and improves DiNAT-g n The joint interpretation capability of the Conv-RegNet model effectively solves the missing, misclassification and error classification problems of the fragments caused by the missing of part of the significant features such as color blur, discoloration and texture wear.

[0074] 5. The relic fragment fine classification method provided by the application can effectively extract the complex visual appearance features of the relic fragments and the joint interpretation of the partial feature loss, thereby performing fine classification, being beneficial to subsequent relic splicing and repairing work, greatly saving the time cost of repairing, improving the splicing and repairing accuracy, providing technical support on effective classification for the relic splicing and repairing, and promoting the protection and inheritance of cultural heritage.

[0075] Secondly, from the perspective of the product or as a whole, the technical effect and advantages of the technical solution to be protected by the application are described as follows:

[0076] To solve the problems in the prior art, the application provides a recursive gated convolution self-adjusting network (DiNAT-g n Conv-RegNet) based on an extended neighborhood attention mechanism, a method for fine classification of relic fragments, improves the classification accuracy of the relic fragments, and improves the efficiency and accuracy of relic repair.

[0077] The application uses the adaptive network RegNet as the backbone network, increases the network depth and width, so that the network can learn complex features and generalize well to new data.

[0078] In the feature extraction layer, the application designs an attention mechanism based on an extended neighborhood (DiNAT), applies the DiNAT mechanism to the feature map, creates an extended neighborhood around each pixel in the image, the neighborhood is defined by the inflation rate, and the inflation rate determines the size of the neighborhood. The importance of each pixel in the image is calculated according to the similarity of each pixel and other pixels in the neighborhood using the attention mechanism. DiNAT allows the model to selectively focus on different parts of the image according to the context of the task. By focusing on the most relevant features, noise is reduced and the accuracy of the model is improved. At the same time, the model is designed to be computationally efficient and very suitable for practical applications that require fast inference time.

[0079] Meanwhile, the recursive gating convolution is designed in the convolution layer, and after the input feature map is convolved with the learnable filter, the result is multiplied by the output of the previous recursive gate. Through high-order spatial interaction, the physical features and cultural features of the fragments are jointly learned, and the classification network's ability to jointly interpret cultural features and physical features is enhanced, without the need for a large number of parameters. This makes it more computationally efficient than other models that use larger kernels or more complex architectures, thereby achieving fine classification of cultural fragments.

[0080] Third, as the creative evidence of the invention's claim, it is also reflected in the following important aspects:

[0081] (1) The expected income and commercial value of the technical solution of the present application after transformation are:

[0082] After the completion of the technical transformation, the present application has extremely high commercial value and use value for the classification of cultural fragment images. First, the present application has been proven by experiments to achieve fine classification effect in the classification of Qin figurine fragments. At the same time, it plays an active role in the laboratory's related cultural projects, such as porcelain chips, Qin opera face masks, and Qin opera costumes, and a series of classification researches have good transplantability and wide applicability. Whether it is a fan of opera, a collector of cultural relics, or a researcher of cultural relics, they can achieve their different purposes of use through the present application. After the completion of the transformation, the present application has the following advantages: simple operation, easy to use, and can be used by different users in a short time; compared with other classification models based on convolutional neural networks, the present application has a smaller size and occupies less memory, while improving the classification accuracy and reducing the waiting time for classification; similarly, in the current background, the protection of traditional cultural relics has become a trend, and the present application conforms to the trend of the times. Based on the above points, it can be said that the present application has extremely high commercial value after transformation.

[0083] (2) The technical solution of the present application solves the technical problems that people have been eager to solve but have failed to succeed:

[0084] The previous traditional classification method relies on artificial experience judgment or classification based on the setting label mode, although the success rate of the classification result can be guaranteed, but it is time-consuming and laborious, and the process is complicated;After introducing deep learning for classification, although the convolutional neural network greatly shortens the classification time, the CNN is not sufficient for feature information extraction, and is easy to fall into overfitting, which causes the error representation of the classification result, and affects the subsequent splicing process;Therefore, how to improve the classification accuracy on the basis of reducing the time complexity of the traditional cultural relics has always been a technical problem that is eager to be solved, the application uses the adaptive network RegNet as the backbone network, increases the network depth and width, so that it can learn complex features and generalize well to new data;Secondly, RegNet uses network channel grouping scaling to reduce the number of parameters and improve the calculation efficiency.

[0085] In the feature extraction layer, the application designs a DiNAT based on an extended neighborhood attention mechanism, and calculates the importance of each pixel in the image according to the similarity of each pixel in the neighborhood with other pixels. The model is designed to be high in calculation efficiency, and is very suitable for practical applications that require fast inference time.

[0086] Meanwhile, a recursive gated convolution is designed in the convolution layer, which jointly learns the physical features and cultural features of the fragments through high-order spatial interaction, enhances the ability of the classification network to jointly interpret cultural features and physical features, and realizes fine classification of cultural relic fragments.

[0087] The application effectively solves the dual contradiction between classification time complexity and classification accuracy by the above method, has higher classification accuracy, less time consumption, and has very high use value and popularization value. BRIEF DESCRIPTION OF DRAWINGS

[0088] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments of the application. Obviously, the drawings described below are only some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0089] Figure 1 is a fine classification method flow chart of cultural relic fragments provided by the embodiments of the application;

[0090] Figure 2 is a fine classification method principle diagram of cultural relic fragments provided by the embodiments of the application;

[0091] Figure 3 is a Qin figurine fragment data set sample schematic diagram provided by the embodiments of the application;

[0092] Figure 4is a cultural relic fragment data set graph after data enhancement using a StyleGAN network provided by an embodiment of the application;

[0093] Figure 5A is an extended neighborhood attention mechanism architecture diagram provided by an embodiment of the application;

[0094] Figure 5B is a DiNAT block diagram provided by an embodiment of the application;

[0095] Figure 6 is a gated recurrent convolution module diagram provided by an embodiment of the application;

[0096] Figure 7 is a DiNAT-g provided by an embodiment of the application n a network architecture diagram of Conv-RegNet;

[0097] Figure 8A is a classification effect diagram of RegNet on a broken Qin figure upper body provided by an embodiment of the application;

[0098] Figure 8B is a DiNAT-g provided by an embodiment of the application n a classification effect diagram of Conv-RegNet on a broken Qin figure upper body;

[0099] Figure 8C is a classification effect diagram of RegNet on a broken Qin figure skirt provided by an embodiment of the application;

[0100] Figure 8D is a DiNAT-g provided by an embodiment of the application n a classification effect diagram of Conv-RegNet on a broken Qin figure skirt;

[0101] Figure 8E is a classification effect diagram of RegNet on a broken Qin figure chest provided by an embodiment of the application;

[0102] Figure 8F is a DiNAT-g provided by an embodiment of the application n a classification effect diagram of Conv-RegNet on a broken Qin figure chest;

[0103] Figure 9A is a training accuracy rate curve comparison diagram provided by an embodiment of the application;

[0104] Figure 9B is a training loss curve comparison diagram provided by an embodiment of the application;

[0105] Figure 10A is a figurine head schematic diagram provided by an embodiment of the application;

[0106] Figure 10B is a figurine arm schematic diagram provided by an embodiment of the present application;

[0107] Figure 10C is a figurine left leg schematic diagram provided by an embodiment of the present application;

[0108] Figure 10D is a figurine right leg schematic diagram provided by an embodiment of the present application;

[0109] Figure 10E is a figurine upper body schematic diagram provided by an embodiment of the present application;

[0110] Figure 10F is a figurine skirt schematic diagram provided by an embodiment of the present application;

[0111] Figure 10G is a broken figurine restoration diagram provided by an embodiment of the present application. DETAILED DESCRIPTION

[0112] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0113] In view of the problems existing in the prior art, the present application provides a cultural relic fragment fine classification method, system, medium, equipment and terminal, which will be described in detail below in combination with the drawings.

[0114] As shown in Figure 1 , the cultural relic fragment fine classification method provided by the embodiment of the present application comprises the following steps:

[0115] S101, digitizing the Qin figurine fragments, performing data enhancement on the existing Qin figurine fragment dataset based on a style-based generative adversarial network, and constructing a sample database;

[0116] S102, constructing a recursive gate convolution self-adjusting network model based on an extended neighborhood attention mechanism;

[0117] S103, designing an extended neighborhood attention mechanism in the model feature extraction layer, and performing local attention enhancement on the physical features of the contour line, thickness and curvature of the Qin figurine fragments, and the cultural features of color and texture;

[0118] S104, designing a recursive gate convolution in the convolution layer, performing joint learning on the physical features and cultural features of the fragments through high-order spatial interaction, and then realizing fine classification of cultural relic fragments.

[0119] As a preferred embodiment, as shown in Figure 2 , the cultural relic fragment fine classification method provided by the embodiment of the present application specifically comprises the following steps:

[0120] Step 1: Digitize and data enhance the broken body fragments to construct a sample database;

[0121] StyleGAN adds noise in a way similar to the adaptive instance normalization (AdaIN) mechanism, as follows:

[0122]

[0123] where x i is the content feature, and y represents the style feature. In this process, first, instance normalization is applied to the input feature map. Then, StyleGAN uses style information to perform scaling on each normalized spatial feature map, adding a bias (μ and σ represent the mean difference and standard deviation of the input feature map x i , respectively).

[0124] In terms of data distribution, data with low probability density has weak expression ability in the network, and the frequency of affecting network gradient is small, so the network's ability to learn its image features is correspondingly weakened. Therefore, we need to find the intermediate variable w of the data, use the truncation trick on w, calculate the distance from all other points to w, and compress each distance according to a uniform standard to gather data points, so that the spatial distribution of the intermediate vector is controlled in a space that is approximately normally distributed, while not changing the distance relationship between points. The process is as follows:

[0125]

[0126] where w is the output of the mapping network, is the mean of the intermediate vector w generated by training, w' is the input of the generation network, and ψ is the truncation coefficient. The larger the coefficient, the greater the density of the latent space W. This is very important for finding the intermediate vector that accurately matches the depth map. The smaller the latent vector space, the faster the system finds the best intermediate vector w'. By using different ψ for each level, the model can control the difference between the feature value of each level and the average feature value.

[0127] The progressive training step is used in the training mode, and the mode of progressive training of the generator and the discriminator makes the generator learn the characteristics of different scales more easily, so that the characteristics of the output image are gradually limited to the characteristics of the original training data set. The traditional style transfer method corresponds to one style of network, and the AdaIN-based method can quickly realize the conversion of any image style. And through the truncation skill, different kinds of features can be fused to generate pictures with new special features. For example: for the Qin figurine fragment image, different degrees of damage features can be transplanted to the well-preserved fragments to obtain enough training samples, covering the sample range of the test set, so as to ensure the applicability of the model to the test set. This has a good effect on the subsequent classification of cultural relics fragments.

[0128] Through StyleGAN, the original Qin figurine fragment data set is expanded by 1:10 to obtain a data set containing 16000 Qin figurine fragment images, so that the expanded Qin figurine fragment data set can meet the data size requirements of the subsequent deep learning classification model.

[0129] In step 1 provided by the embodiment of the application, the digital processing of the cultural relic fragments is to convert the feature extraction of the broken figurine fragments into a data format that can be processed by a computer, the feature extraction process includes fragment shooting, data preprocessing, data enhancement and the like, after the digital processing is completed, the fragments are classified according to the visual appearance features and labeled with corresponding labels to construct a cultural relic sample database; the data preprocessing includes normalization processing and cropping processing; the data enhancement is realized by StyleGAN through multi-feature fusion of the fragment style.

[0130] In step 2, a recursive gate convolution self-adjusting network based on an extended neighborhood attention mechanism is constructed.

[0131] In step 2 provided by the embodiment of the application, the extended neighborhood attention mechanism (DiNAT) is integrated into the RegNet network, and the local attention enhancement is used to improve the extraction of physical and cultural features by the network.

[0132] In step 3, down-sampling: first, the input is down-sampled to one fourth of the original spatial resolution and the feature information is extracted and sent through the DiNATransformer encoder.

[0133] In step 4, the feature map is down-sampled to half of its spatial size and doubled in the channel between levels to obtain more global context.

[0134] In step 5, the threshold is calculated: according to the obtained weight and feature vector, attention calculation is performed.

[0135] For input X∈R n×d, given an inflation value δ, the neighborhood attention weight of the i-th token with neighborhood size k is defined as where Q, K, V are linear projections of X, then we have formula (3) and (4):

[0136]

[0137]

[0138] where B i,j is the relative position deviation between any two tokens i and j, and q of the i-th token is matrix multiplied with k of its k nearest neighbors, where denotes the j-th nearest neighbor of token i, satisfying j mod δ = i mod δ. B i,j is added to each attention weight according to the relative position and is extended to all pixels (i, j), thus forming a form of local attention.

[0139] The neighborhood attention output of the i-th token with neighborhood size k is defined as formula (5):

[0140]

[0141] where DiNA is the extended neighborhood attention, d is the embedding dimension, is a scaling parameter, δ is the inflation value defined in the foregoing, and softmax is a normalized exponential function to normalize the attention weight.

[0142] The layer inflation value δ ∈ [1, [n / k]], where n is the number of tokens and k is the neighborhood size. Since the inflation value is variable, a flexible receptive field is provided to extract the cultural features and physical features of the Qin fragments.

[0143] Step 6, the gated convolution g n Conv realizes first-order spatial interaction and high-order spatial interaction.

[0144] Let the input feature be The output of the gated convolution is:

[0145]

[0146]

[0147] In the formula, φ in , φ out is a linear projection operation to complete the information exchange of the channel dimension, and f is a depth-wise convolution. where Ω iIt is a local window of the channel-wise convolution, with center coordinate i and w as the weights of the channel-wise convolution. Equation (6) is and its surrounding features The first-order interaction.

[0148] To achieve higher-order spatial interaction, it is necessary to first use φ in A series of projection features p0 and

[0149]

[0150] Then perform gated convolution recursively:

[0151] p k+1 =f k (q k )⊙g k (p k ) / αk=0,1,...,n-1 (8)

[0152] In the formula, each recursion is stabilized by dividing by α, {f k} is a series of channel-wise convolution operations, {g k In each recursive process, the number of channels of the matched features is calculated. When calculating equation (8), the combined features are directly used. This is accomplished through a channel-wise convolution, which improves efficiency.

[0153]

[0154] The output q of the last recursion n Input to projection layer φ in Get g n The result of Conv. g n Conv enables n-order interactions between a given feature and its surrounding features. In this classification method, the high-order interaction capabilities of recursively gated convolutions are used to jointly learn the physical and cultural features of fragments, improving DiNAT-g. n The joint interpretation capability of the Conv-RegNet model solves the problems of missed classification, misclassification, and incorrect classification that are difficult to avoid in traditional RegNet networks due to feature loss.

[0155] To avoid excessive computational overhead from higher-order interactions, the channel dimension for each order is set to decrease exponentially:

[0156]

[0157] In step 6 of this embodiment of the invention, the extended neighborhood attention mechanism (DiNAT) is integrated into the RegNet network. By enhancing the local attention of the physical and cultural features of the Qin terracotta warrior fragments, the local refined features are improved, and the rapid classification of fragments with significant features is achieved.

[0158] Step 7: The feature information is fed into the RegHead output layer, which consists of Global Average Pooling (GAP), Dropout, and a fully connected layer (FC), to classify the artifact fragments.

[0159] In step 7 of the embodiment of the present invention, gated convolution g is used. n Conv replaces RegStage in the RegNet network structure, while employing two depthwise convolutions: 7×7 Convolution and a global filter (GF). This achieves g n Conv captures long-term interactions, performs joint interpretation of physical and cultural features, and improves classification accuracy. The GF layer is an improved version, in which half of the channels are processed by a global filter and the other half by a 3×3 depthwise convolution, and the GF layer is only used in the later stages to preserve more local details.

[0160] The cultural relic fragment fine classification system provided in this embodiment of the invention includes:

[0161] The data augmentation module is used to digitize the fragments of the Qin terracotta warriors. It uses a style-based generative adversarial network to augment the existing dataset of Qin terracotta warrior fragments and build a sample database.

[0162] The model building module is used to build a recursive gated convolutional self-adjusting network model. An extended neighborhood attention mechanism is designed in the feature extraction layer of the model to enhance local attention to the physical features of the Qin terracotta warrior fragments, such as the outline, thickness, and curvature, as well as the cultural features of color and texture.

[0163] The module for fine classification of cultural relic fragments is used to design recursive gated convolutions in the convolutional layer. Through high-order spatial interaction, it jointly learns the physical and cultural characteristics of the fragments to achieve fine classification of cultural relic fragments.

[0164] As a preferred embodiment, such as Figure 2 As shown, the method for fine classification of cultural relic fragments based on a recursive gated convolutional self-adjusting network with an extended neighborhood attention mechanism provided in this embodiment of the invention specifically includes the following steps:

[0165] Step 1 involves digitally processing the artifact fragments. This includes three steps: data acquisition, data preprocessing, and data augmentation.

[0166] Among them, the data collection is to collect the existing cultural relic fragments of the visualization research. First, make good preliminary work, save the image photographed by the Sony camera as an RGB color image in JPG format, the original image size is (4224x3168), and the horizontal and vertical resolutions are both 350 dpi.

[0167] The data preprocessing process is to analyze and screen all the cultural relic fragment images collected, classify the collected fragment data according to the visual appearance characteristics such as color and texture, and manually label the samples; normalize all the fragments, and the size of the normalized fragments becomes 128x128, and the effect is as shown in Figure 3 .

[0168] Step 2, build a cultural relic sample database. Due to the limitation of external conditions and the wear of cultural relic fragments, the number of collected cultural relic fragments is limited, so the present application adopts the StyleGAN network to convert different style features such as rotation angle, brightness and position of Qin pottery fragments, and adds noise to the data set for data enhancement. Figure 4 The cultural relic fragment after data enhancement is shown in formula (1); after the digital processing operation of the cultural relic fragment in step 1, each cultural relic data corresponds to a digital label, and a cultural relic sample database with a certain scale is constructed.

[0169] StyleGAN adds noise in a manner similar to the AdaIN mechanism, and the formula is as follows:

[0170]

[0171] Among them, x i is the content feature, and y represents the style feature. In this process, first, apply instance normalization to the input feature map. Then, StyleGAN uses style information to perform scaling on each normalized spatial feature map, adds bias (mu and sigma represent the mean difference and standard deviation of the input feature map x i ).

[0172] From the data distribution, the data with low probability density has weak expression ability in the network, the frequency of affecting the network gradient is small, and the ability of the network to learn its image features is correspondingly weakened, so it is necessary to find the intermediate variable w of the data, use the truncation technique to calculate the distance from w to all other points, compress each distance according to a unified standard, and gather the data points, so that the spatial distribution of the intermediate vector is controlled in a space close to the normal distribution, while not changing the distance relationship between points, the process is as follows:

[0173]

[0174] where w is the output of the mapping network mapping, is the mean of the training generated intermediate vectors w, w' is the input of the generation network, and ψ is the truncation coefficient. The larger the coefficient, the greater the latent space W density. This is very important for finding an intermediate vector that accurately matches the depth map. The smaller the latent vector space, the faster the system finds the best intermediate vector w'. By using different ψ for each level, the model can control the amount of difference between the feature value of each level and the average feature value.

[0175] The training method uses a progressive training step, and the mode of progressive training of both the generator and the discriminator makes it easier for the generator to learn the features of different scales, gradually making the features of the output image not limited to the original training data set features. The traditional style transfer method corresponds to only one style of network, and based on AdaIN, the conversion of any image style can be quickly realized. And through the truncation technique, different kinds of features can be fused to generate pictures with new special features. For example: for the image of the Qin figurine fragments, different degrees of damage features can be transplanted to the well-preserved fragments to obtain enough training samples, covering the sample range of the test set, so as to ensure the applicability of the model to the test set. This has a good effect on the subsequent classification of cultural relics fragments.

[0176] Through StyleGAN, the original Qin figurine fragment data set is expanded according to a 1:10 ratio, and a data set containing 16000 Qin figurine fragment images is obtained, so that the Qin figurine fragment data set of the application can meet the data size requirements of the subsequent deep learning classification model.

[0177] Step 3, down-sampling: down-sample the input to one-fourth of the original spatial resolution; extract and send feature information through the DiNA Transformer encoder, Figure 5A is a schematic diagram of the DiNAT architecture; wherein the DiNAT alternately uses local NA and global DiNA, as Figure 5B shown.

[0178] Step 4, the feature map is down-sampled to half its spatial size and doubled in channels between levels to capture more global context.

[0179] Step 5, calculate the threshold: according to the obtained weight and feature vector, attention calculation is performed.

[0180] For input X∈R n×d , given an inflation value δ, the neighborhood attention weight of the i-th token with a neighborhood size of k is defined as where Q, K, and V are linear projections of X, then formulas (3) and (4) are obtained:

[0181]

[0182]

[0183] where B i,j is the relative position deviation between any two tokens i and j, and q is the matrix multiplication of the i-th token with its k nearest neighbors, where denotes the j-th nearest neighbor of token i, satisfying j mod δ = i mod δ. B i,j is added to each attention weight and extended to all pixels (i, j), forming a form of local attention.

[0184] The neighborhood attention output of the i-th token with neighborhood size k is defined as formula (5):

[0185]

[0186] where DiNA is the extended neighborhood attention, d is the embedding dimension, is a scaling parameter, and softmax is a normalized exponential function to normalize the attention weight.

[0187] The layer dilation value δ ∈ [1, [n / k]], where n is the number of tokens and k is the neighborhood size. Since the dilation value is variable, a flexible receptive field is provided to extract the cultural and physical features of the Qin fragments.

[0188] Step 6, gated convolution g n Conv realizes first-order spatial interaction and high-order spatial interaction.

[0189] Let the input feature be The output of the gated convolution is:

[0190]

[0191]

[0192] where φ in , φ out is a linear projection operation that completes the information exchange of channel dimensions, and f is a depth-wise convolution. where Ω i is the local window of the depth-wise convolution, the center coordinate is i, and w is the weight of the depth-wise convolution. Formula (6) is the first-order interaction of the Qin fragment and its surrounding features .

[0193] To realize high-order spatial interaction, first pass φ ina series of projection features p0and

[0194]

[0195] The gated convolution is performed recursively again:

[0196] p k+1 = f k (q k )⊙g k (p k ) / αk=0,1,...,n-1 (8)

[0197] where each recursion is stabilized by dividing by α, and {f k} is a series of channel-wise convolution operations, and {g k} matches the channel number of the features at each recursion. When computing (8), the combined features are directly convolved by a channel-wise convolution to improve efficiency.

[0198]

[0199] Finally, the output q n of the last recursion is input into the projection layer φ in to obtain the result g n Conv. g n Conv can realize n-order interaction between a feature and its surrounding features. In this classification method, the high-order interaction capability of the recursive gated convolution is used to jointly learn the physical features and cultural features of the fragments, thereby improving the joint interpretation capability of the DiNAT-g n Conv-RegNet model, so as to solve the problems of missed classification, misclassification and wrong classification caused by the feature missing of the traditional RegNet network, Figure 6 for the g n Conv convolution module.

[0200] At the same time, in order to avoid too much calculation overhead introduced by high-order interaction, the channel dimension of each order is set to be exponentially decreasing:

[0201]

[0202] Step 7: The feature information is transmitted into the RegHead output layer composed of a global average pooling (GAP), a random deactivation neuron function (Dropout) and a fully connected layer (FC) to classify the cultural fragments.

[0203] II. In order to prove the creativity and technical value of the technical solutions of the present application, this part is the specific product or related technology application embodiment of the technical solutions of the claims.

[0204] The present application designs a fine classification method for cultural relic fragments, which has achieved high-precision classification effect on the image data set of Qin figurine fragments, and can accurately classify the parts of the Qin figurine fragments, such as legs, chests, hands, etc., laying a foundation for subsequent splicing; similarly, the cultural relics porcelain chips collected in this research have good classification effect, which can accurately distinguish the image cultural characteristics and physical characteristics of the porcelain chips, and through the joint interpretation of the two, the different categories to which the porcelain chips belong are finely divided, such as blue and white porcelain, Xing kiln white porcelain, Longquan celadon, etc.; secondly, the present application also has good classification performance in studying traditional Qin opera, and after learning and training, it can achieve fine classification effect in Qin opera face, action modeling, clothing and other categories, thereby having good application prospect in traditional cultural relic protection, and being competent in different research contents, and realizing fine classification.

[0205] As shown in Figure 7 , a fine classification model of cultural relic fragments of the recursive gate convolution self-adjusting network based on the extended neighborhood attention mechanism is constructed by the above method; Figure 8A-Figure 8F The classification effects of the traditional method and the present method on the upper body, chest and skirt of the broken figurine.

[0206] As shown in Figure 8A-Figure 8B , the fragments in the framed position of the upper body of the Qin figurine are difficult for RegNet to effectively and fully extract the physical characteristics and cultural characteristics of the fragments due to the lack of significant surface features, resulting in missed classification; while DiNAT-g n The Conv-RegNet model switches between local NA and sparse global DiNA every other layer by adding an attention mechanism based on extended neighborhood (DiNAT), improves the depth extraction of fragment features by expanding the receptive field, can obtain more fine features hidden in the fragments, and thus avoids the occurrence of missed classification. From Figure 8B It can be seen that the use of DiNAT-g n The upper body after classification by Conv-RegNet is smoother and the missing parts are completed.

[0207] Figure 8C-Figure 8D The framed part shown is difficult for the RegNet network to distinguish between the two due to the similar curvature characteristics of the fragments and the skirt fragments caused by wear or other reasons, resulting in misclassification; while DiNAT-g nConv-RegNet because of the design based on extended neighborhood attention mechanism (DiNAT), using gradual inflation changes can extract the physical characteristics of the Qin Dynasty pottery fragments outside the cultural characteristics of the Qin Dynasty pottery fragments, and the recursive gate convolution (g n Conv) by setting the channel dimension of each order to the form of exponential decrease avoids the generation of redundant parameters, so that the originally similar curvature characteristics can be calculated more accurately, and the difference between the two is obtained, and good matching effect is obtained.

[0208] In Figure 8E-Figure 8F , Figure 8E is classified according to the matching effect of the RegNet network, and the fragments originally belonging to the arm class are misclassified to the chest, thereby causing confusion in subsequent splicing; and DiNAT-g n Conv-RegNet through the design of recursive gate convolution (g n Conv) with high-order spatial interaction ability, through the first-order adaptive interaction with the input of the gate convolution, the effect of the attention mechanism is reduced due to the different picture sizes, and the joint interpretation of the cultural characteristics and physical characteristics of the Qin Dynasty pottery fragments is realized through high-order spatial interaction, thereby reducing the risk of model overfitting and improving the accuracy of the classification result.

[0209] Figure 9A And Figure 9B is the training result accuracy and loss curve. From the figure, it can be seen that whether the classification accuracy or the error rate, DiNAT-g n Conv-RegNet is obviously better than the classification effect of using only the RegNet network. In Figure 9A , the classification accuracy of DiNAT-g n Conv-RegNet is close to 1 and fluctuates around it, while the classification accuracy of RegNet is only around 0.8; and in Figure 9B , the classification loss of DiNAT-g n Conv-RegNet is much lower than that of RegNet, and the fluctuation range of RegNet is large, from 0.6 to 1, and the effect is poor.

[0210] Figure 10A-Figure 10G is the DiNAT-g n Conv-RegNet classification method provided by the embodiment of the application, which realizes the restoration of the broken fragments after precise classification.

[0211] It should be noted that embodiments of the present application can be realized by hardware, software, or a combination of software and hardware. The hardware portion can be realized by a special logic; the software portion can be stored in a memory and executed by a proper instruction execution system, such as a microprocessor or a specially designed hardware. A person of ordinary skill in the art can understand that the above-mentioned apparatus and method can be realized by computer executable instructions and / or included in processor control codes, such as a carrier medium, such as a magnetic disk, CD or DVD-ROM, a programmable memory, such as a read-only memory (firmware), or a data carrier, such as an optical or electronic signal carrier. The apparatus of the present application and its modules can be realized by a hardware circuit, such as a very large scale integrated circuit or a gate array, a semiconductor, such as a logic chip, a transistor, or a programmable hardware device, such as a field programmable gate array, a programmable logic device, or the like, by software executed by various types of processors, or by a combination of the above-mentioned hardware circuit and software, such as firmware.

[0212] The above description is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any modification, equivalent replacement, and improvement within the technical range disclosed by the present application, and within the spirit and principle of the present application, should be included in the protection scope of the present application.

Claims

1. A method for fine classification of an archaeological fragment, characterized by, The fine classification method of cultural relics fragments comprises the following steps: Step one, digital processing and data augmentation of the broken pottery fragments, and construction of a sample database; Step two, construction of a recursive gate convolution self-adjusting network based on an extended neighborhood attention mechanism; Step three, down-sampling: down-sampling the input to one-fourth of the original spatial resolution and extracting and sending feature information through a DiNA Transformer encoder; Step four, the feature map is down-sampled to half its spatial size and doubled in channels between levels to obtain more global context; Step five, threshold calculation: attention calculation according to the obtained weight and feature vector; Step seven, the feature information is transmitted to the RegHead output layer composed of global average pooling, random inactive neuron function and full connection layer for classification of the cultural relics fragments; Step six, gated convolution g n Conv implements first-order spatial interactions and high-order spatial interactions; In step one, StyleGAN adds noise using the AdaIN mechanism, as follows: Determine the intermediate variable w of the data, use the truncation trick on w, calculate the distance from all other points to w; compress each distance according to a uniform standard to gather the data points, control the spatial distribution of the intermediate vector in the approximate normal distribution space, and at the same time, do not change the distance relationship between the points, as follows: In the formula, x i is a content feature, y represents a style feature, μ and σ respectively represent the mean difference and standard deviation of the input feature map x i ; after applying instance normalization to the input feature map, StyleGAN uses style information to perform scaling and add bias to each normalized spatial feature map; The training method uses a progressive training step, and the progressive training mode of the generator and the discriminator makes the generator learn the features of different scales; through StyleGAN, the original Qin pottery fragment dataset is augmented and expanded according to a 1:10 ratio to obtain an image dataset containing Qin pottery fragments; where w is the output of the mapping network, is the mean of the generated intermediate vectors w, w' is the input of the generation network, and ψ is the truncation coefficient; the larger the coefficient, the greater the latent space W density; the smaller the latent vector space, the faster the system finds the best intermediate vector w'; by using different ψ for each level, the model controls the amount of difference in eigenvalues from the average eigenvalue at each level; The digital processing of the cultural relics fragments is to convert the broken pottery fragments into a data format that can be processed by a computer after feature extraction; the feature extraction process includes fragment shooting, data preprocessing and data augmentation steps; after digital processing, the fragments are classified according to visual appearance features and labeled with corresponding labels to construct a cultural relics sample database; data preprocessing includes normalization and cropping; data augmentation uses StyleGAN to realize multi-feature fusion of the fragment style; In step two, the extended neighborhood attention mechanism is integrated into the RegNet network to enhance the local attention of the physical and cultural features of the Qin pottery fragments and realize feature salient fragment classification; In step three, the input image is extracted through a series of convolution layers to obtain a feature map, and then the DiNA mechanism is applied to the feature map to calculate the importance of each pixel in the image. ​ 2. The method for fine classification of an artifact fragment according to claim 1, wherein The fine classification method of cultural relic fragments further includes: The cultural relic fragments are digitally processed to construct a dataset; DiNAT-g n The Conv-RegNet classification network is initialized; training data is input, and the initial iteration number K is set to 0; the network output value and error are calculated, and it is judged whether the error meets the requirements; if the error does not meet the requirements, the error gradient of the activation function is calculated, the error gradient is calculated, the network weight is adjusted, K is set to k+1, and the network output value and error calculation step are returned; it is judged again whether the error meets the requirements, and if the requirements are met, DiNAT-g n The Conv-RegNet classification network parameters are obtained, and the cultural relic classification result is obtained.

3. The method of claim 1, wherein the step of classifying the fragment of the cultural property is performed by using a neural network. In step five, for input X ∈ R n ×d , given an inflation value δ, the neighborhood attention weight of the i-th token with neighborhood size k is defined as where Q, K, V are linear projections of X, then: where B i,j is the relative positional deviation between any two tokens i and j, and q is the k matrix multiplication of the q of the ith token with its k nearest neighbor tokens, where denotes the jth nearest neighbor of token i, satisfying j mod δ = i mod δ; According to the relative position, B i,j is added to each attention weight and extended to all pixels (i,j), forming the form of local attention; The neighborhood attention output of the i-th token with a neighborhood size of k is defined as: where DiNA is an extended neighborhood attention, d is the embedding dimension, is a scaling parameter; The softmax is a normalized exponential function used to normalize the attention weight; the layer dilation value δ∈[1,[n / k]], where n is the number of tokens and k is the neighborhood size; the DiNAT creates an expanded neighborhood around each pixel of the feature map, and the neighborhood is defined by the dilation rate, which determines the size of the neighborhood; then, the attention mechanism measures the importance of each pixel in the neighborhood according to the similarity between each pixel and other pixels.

4. The method for fine classification of an artifact fragment according to claim 1, wherein In step six, let the input feature be The output of the gated convolution is: where φ in , φ out are linear projection operations for accomplishing information exchange in the channel dimension; f is a channel-wise convolution; where Ω i is a local window of the channel-wise convolution centered at i, w is a weight of the channel-wise convolution; The output expression of the gated convolution is and peripheral features 1st order interactions; When implementing high-order spatial interaction, through φ in A series of projection features p0 and After the convolutional layer extracts low-level features from the input image using a small kernel size, the features are transmitted through the recursive gated convolutional layer to capture high-order spatial interactions: p k+1 = f k (q k )⊙g k (p k ) / αk=0,1,...,n-1; where each recursion is stabilized by dividing by a, {f k} is a series of channel-wise convolution operations, {g k} is the number of channels of the matching features at each recursion. Recursive gated convolutional layer g n Conv consists of several recursive sub-blocks, each of which consists of two convolutional layers followed by a gating mechanism; the first convolutional layer is used to extract features from the input, while the second convolutional layer is used to combine these features with the output of the previous recursive sub-block; When computing the gated convolution, the combined features are directly convolved through the channel-wise The output q of the last recursion is input to the projection layer φ n in g is obtained n The result of Conv; g is utilized n Conv realizes the n-order interaction of certain features and peripheral features, and the high-order interaction ability of the recursive gated convolution realizes the joint learning of the physical features and cultural features of the fragments;​ The channel dimension of each order is set in an exponentially decreasing form: In step seven, the gating convolution g n Conv replaces RegStage in the RegNet network structure, while g n Conv captures long-term interactions and performs joint interpretation of physical and cultural features; The GF layer is an improved version, with half of the channels processed using a global filter and the other half processed using a 3×3 deep convolution, and only the GF layer is used in the later stage to preserve more local details.

5. An antique fragment fine classification system using the antique fragment fine classification method according to any one of claims 1 to 4, characterized by The fine classification system of cultural relic fragments includes: A data augmentation module for digitizing the Qin figurine fragments, enhancing the existing Qin figurine fragment dataset based on style-based generative adversarial networks, and constructing a sample database; A model construction module for constructing a recursive gated convolutional self-adjusting network model, designing an extended neighborhood attention mechanism in the feature extraction layer of the model, and enhancing the local attention of the physical features such as contour lines, thickness, and curvature of the Qin figurine fragments, as well as the cultural features such as color and texture; A fine classification module of cultural relic fragments for designing recursive gated convolution in the convolutional layer, jointly learning the physical and cultural features of the fragments through high-order spatial interaction, and realizing fine classification of cultural relic fragments.

6. A computer device, comprising: The computer device includes a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the fine classification method of cultural relic fragments as claimed in any one of claims 1-4.

7. A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to execute the steps of the fine classification method of cultural relic fragments as claimed in any one of claims 1-4.

8. An information data processing terminal, characterized by An information data processing terminal is used to realize the fine classification system of cultural relic fragments as claimed in claim 5.

Citation Information

Patent Citations

  • Image recognition method and system based on double-pooling channel attention and dilated convolution

    CN115546506A