Combinatorial optimization and multi-modal large model-based conjugates Dunhuang fragment screening method
By combining optimization solvers and multi-modal large models, the problem of splicing small Dunhuang fragments has been solved, efficient fragment matching and splicing has been achieved, labor costs have been reduced, splicing accuracy and efficiency have been improved, and the research on ancient linguistics has been provided. auxiliary tools.
Patent Information
- Application Number
- CN202410707617.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-03
AI Technical Summary
The existing technology is difficult to effectively process and splice small Dunhuang fragments, resulting in high manual joining costs and low efficiency, and it is difficult to restore the key information contained in the small fragments.
Using a method based on combinatorial optimization and multi-modal large models, through a combinatorial optimization solver composed of twin neural networks, optimal graph neural networks and multi-modal large language models, the outline features and text features of the fragments are used to construct an undirected graph. Match and splice fragments to reduce manual intervention and improve splicing efficiency.
It greatly reduces the manpower and time required for splicing small Dunhuang fragments, improves the accuracy and efficiency of splicing, provides an auxiliary tool for ancient linguistics and social research, and can effectively process key information in small fragments.
Smart Images

Figure CN118570540A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of cultural relics restoration, and in particular relates to a method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models. Background Art
[0002] In the field of culture and archaeology, restoring cultural relics fragments is a meaningful task. In China, the restoration of the Mogao Grottoes fragments in Dunhuang is a representative work. Current computer vision and deep learning methods can complete the splicing and restoration of large fragments, improving the work efficiency of archaeologists.
[0003] The current fragment restoration mainly focuses on large fragments. Small fragments are numerous, contain too few words, and have unclear features. Existing computer methods are basically unable to process them. In addition, the cost of manually splicing small fragments is too large and often fails. In the collection of fragments with a long history, the proportion of small fragments is often not negligible. For the Dunhuang fragment data set currently available at Zhejiang University, about 10% of the fragments are small fragments containing less than 10 complete words. Restoring these small fragments is of great significance for understanding some key information on spliced fragments, but there is currently no technology to solve this problem. Summary of the invention
[0004] The purpose of the present invention is to solve the problems existing in the prior art and to provide a method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models.
[0005] In order to achieve the above-mentioned invention object, the present invention specifically adopts the following technical solutions:
[0006] A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models, comprising the following steps:
[0007] S1. Obtain all possible fragment pairs that can be combined from the Dunhuang fragments to be screened, and perform mask extraction on the fragment pairs, where each fragment pair corresponds to a mask pair;
[0008] S2. Obtain a trained combinatorial optimization solver, the combinatorial optimization solver is composed of a twin neural network, an optimal graph neural network and a multimodal large language model, the optimal graph neural network is composed of a graph neural network and an optimal transmission layer cascaded in sequence; wherein, during training, the combinatorial optimization solver only updates the parameters of the twin neural network and the optimal graph neural network, the parameters of the multimodal large language model are fixed, and when the optimal transmission layer is updating its parameters, the first K maximum probabilities among the probabilities output by the optimal transmission layer are maximized, and the remaining probabilities output by the optimal transmission layer are minimized;
[0009] S3. Each time a mask pair is input into the twin neural network, a feature vector of the Dunhuang fragment corresponding to the mask pair and a matching degree score of each mask pair are obtained; wherein the twin neural network is composed of two sub-networks for feature extraction and a classification module;
[0010] S4. Take each feature vector obtained by the twin neural network as a vertex, add an edge between the fragment pairs whose matching degree scores are greater than the preset matching degree threshold, and use the corresponding matching degree scores as the weight of the edge. When all fragment pairs are traversed, an undirected graph is obtained;
[0011] S5. Input the undirected graph obtained in step S4 into the optimal graph neural network, first use the graph neural network to predict the initial probability of the Dunhuang fragments corresponding to each vertex in the undirected graph in the candidate splicing set, pass the initial probability through the optimal transmission layer to obtain the optimal probability, and select the top K Dunhuang fragments with the highest probability values in the optimal probability to form the candidate splicing set;
[0012] S6. After combining two Dunhuang fragments in the candidate splicing set into a candidate Dunhuang fragment pair, each candidate Dunhuang fragment pair and a pre-constructed prompt word are input into the multimodal large language model, and the multimodal large language model scores each candidate Dunhuang fragment pair, and outputs the scoring result of each candidate Dunhuang fragment pair; if the scoring result is less than a preset score threshold, the corresponding candidate Dunhuang fragment pair is added to the error small fragment subset;
[0013] S7. In the undirected graph obtained in step S4, all feature vector vertices corresponding to the erroneous small fragment subset and all edges connected to the feature vector vertices are removed to obtain a pruned undirected graph, and the pruned undirected graph is re-input into the optimal graph neural network to predict a new candidate splicing set containing K Dunhuang fragments for the splicing of the Dunhuang fragments.
[0014] Based on the above scheme, each step can be implemented in the following preferred specific manner.
[0015] Preferably, in the twin neural network, the first fragment mask in the i-th mask pair is input into the first sub-network to obtain the first feature vector of the Dunhuang fragment, and the second fragment mask in the i-th mask pair is input into the second sub-network to obtain the second feature vector of the Dunhuang fragment. After the first feature vector and the second feature vector are spliced, the spliced vector is input into the classification module to output the matching degree score of the i-th mask pair.
[0016] Preferably, the first sub-network and the second sub-network have the same structure, and the two sub-networks have the same weight.
[0017] Preferably, the classification module is formed by sequentially cascading a first linear layer, a ReLU activation function, a second linear layer and a Sigmoid activation function.
[0018] Preferably, the value of the matching degree score is between 0 and 1, wherein 0 indicates that the mask pair cannot be matched, and 1 indicates that the matching degree of the mask pair is the highest.
[0019] Preferably, the score threshold is set to 60.
[0020] Preferably, the matching degree threshold is 0.2.
[0021] Preferably, the multimodal large language model adopts the GPT-4V model.
[0022] Preferably, the graph neural network adopts a graph convolutional network GCN.
[0023] Preferably, when training the combinatorial optimization solver, the outline of the Dunhuang fragments is used as the segmentation line segment, and each complete Dunhuang fragment is torn into several small Dunhuang fragments. Adjacent small Dunhuang fragments are used as positive sample pairs that match each other, and non-adjacent small Dunhuang fragments are used as negative sample pairs that match each other. The constructed positive sample pairs and negative sample pairs are used as training data sets, and the training data set contains 40,000 pairs of positive sample pairs and 80,000 pairs of negative sample pairs.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] The present invention proposes a method for screening splicable Dunhuang fragments based on combinatorial optimization and multimodal large models. The combinatorial optimization solver utilizes the contour features of small fragments and solves the combinatorial explosion problem of multimodal large language models. The multimodal large language model utilizes the remaining features of small fragments and can be used as an auxiliary tool for archaeologists, greatly reducing the manpower and time spent on splicing small fragments. It can be applied to the splicing scenarios of Dunhuang small fragments, as well as the fields of ancient linguistics and social research, to improve the efficiency of research in the fields of ancient linguistics and social research. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a schematic diagram of the overall solution of the present invention;
[0027] Figure 2 It is a schematic diagram of mask extraction of Dunhuang fragments according to the present invention;
[0028] Figure 3 This is a diagram of the architecture of the twin neural network of the present invention;
[0029] Figure 4 Schematic diagram of the classification module of the twin neural network of the present invention;
[0030] Figure 5 A flow chart for constructing a simulated shredded data set for the present invention;
[0031] Figure 6 This is a diagram of the architecture of the graph convolutional network of the present invention;
[0032] Figure 7 A schematic diagram of a usage example of the multimodal large language model of the present invention;
[0033] Figure 8 It is a schematic diagram of some results obtained by the embodiments of the present invention. DETAILED DESCRIPTION
[0034] In order to make the above-mentioned purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation mode of the present invention is described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in each embodiment of the present invention can be combined accordingly without conflicting with each other.
[0035] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for the purpose of distinguishing descriptions, and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.
[0036] Considering the huge number of small fragments of Dunhuang manuscripts disclosed by various collection institutions, the size of the small fragments, the preservation status and the integrity of the text are different, and the total number of small fragments has reached more than 50,000 pieces. It is very difficult to manually piece them together, which is time-consuming and laborious. In view of the above problems, in a preferred embodiment of the present invention, a method for screening Dunhuang fragments that can be pieced together based on combinatorial optimization and multimodal large models is proposed. The method includes a twin neural network composed of a convolutional neural network and a combinatorial optimization solver composed of a graph neural network fused with an optimal transmission layer; the fragment pairs are input into it to obtain a candidate splicing set of fragments, and then the multimodal large language model is used to select and eliminate the wrong small fragment subsets, and the undirected graph is reconstructed and input into the graph neural network fused with the optimal transmission layer to obtain the final candidate fragment splicing set.
[0037] The existing technology mainly solves the splicing of large fragments, and the present invention mainly solves the splicing of small Dunhuang fragments. The "Dunhuang fragments" mentioned in the present invention refer to these small fragments. The small fragments contain less than 10 complete characters and the edge erosion is more serious, so the splicing method of larger fragments is no longer applicable. Among the Dunhuang fragments, about 10% of the Dunhuang fragments belong to the category of small fragments, and some of the small fragments also contain key text information, which is crucial for the complete splicing of the fragments.
[0038] like Figure 1 As shown, in a preferred implementation of the present invention, the above-mentioned method for selecting Dunhuang fragments that can be spliced based on combinatorial optimization and multimodal large model includes the following steps S1 to S7. The specific implementation process is described in detail below.
[0039] S1. Obtain all possible fragment pairs that can be combined from the Dunhuang fragments to be screened, and perform mask extraction on the fragment pairs, and obtain a mask pair for each fragment pair.
[0040] It should be noted that, in this embodiment, Figure 2 As shown, the present invention adopts the binarization and closing operation functions provided in the OpenCV library, first performs binarization processing, then performs processing by the closing operation function, and finally extracts the mask pair corresponding to the Dunhuang fragment pair.
[0041] S2. Obtain a trained combinatorial optimization solver, which is composed of a twin neural network, an optimal graph neural network, and a multimodal large language model. The optimal graph neural network is composed of a graph neural network (GNN) and an optimal transport layer (OT Layer) cascaded in sequence. During training, the combinatorial optimization solver only updates the parameters of the twin neural network and the optimal graph neural network, and the parameters of the multimodal large language model are fixed. When updating the parameters of the optimal transport layer, the first K maximum probabilities of the output of the optimal transport layer are maximized, and the remaining probabilities of the output of the optimal transport layer are minimized.
[0042] It should be noted that, in this embodiment, the first K maximum probabilities among the probabilities output by the optimal transmission layer are maximized, and the remaining probabilities output by the optimal transmission layer are minimized. The maximization and minimization here refer to the optimization of the Sinkhorn algorithm, so that the larger K of all the probabilities output by the optimal transmission layer are as close to the maximum value p_max as possible, and the remaining probabilities are as close to the minimum value p_min as possible. p_max and p_min are automatically calculated by the optimal transmission layer based on all the probabilities output by the graph neural network.
[0043] It should be noted that, in this embodiment, the above-mentioned combinatorial optimization solver includes a twin neural network, an optimal graph neural network, and a multimodal large language model. Among them, in the twin neural network, a variant of the convolutional neural network (CNN) ResNet18 is used as a subnetwork for feature extraction; in the optimal graph neural network, an optimal transport layer is integrated, which is composed of a graph neural network (GNN) and an optimal transport layer (OT Layer) cascaded in sequence.
[0044] S3. Each time a mask pair is input into the above-mentioned twin neural network, the feature vector of the Dunhuang fragment corresponding to the mask pair and the matching degree score of each mask pair are obtained; wherein the above-mentioned twin neural network is composed of two sub-networks for feature extraction and a classification module.
[0045] It should be noted that in the above-mentioned twin neural network, the first fragment mask in the i-th mask pair is input into the first sub-network to obtain the first feature vector of the Dunhuang fragment, and the second fragment mask in the i-th mask pair is input into the second sub-network to obtain the second feature vector of the Dunhuang fragment. After the first feature vector and the second feature vector are spliced, the spliced vector is input into the classification module to output the matching degree score of the i-th mask pair; wherein the first sub-network and the second sub-network have the same structure, and the two sub-networks have the same weights.
[0046] It should be noted that the above classification module is composed of a first linear layer, a ReLU activation function, a second linear layer and a Sigmoid activation function cascaded in sequence.
[0047] In this embodiment, in order to extract the contour information of the Dunhuang fragments and predict the matching degree between the Dunhuang fragment pairs, the present invention uses the variant of the convolutional neural network (CNN) ResNet18 as a subnetwork of the self-supervised twin neural network, and inputs a mask pair into the trained twin neural network each time. The twin neural network consists of two ResNet18 subnetworks with the same weights and structures. Figure 3As shown, the two sub-networks respectively extract the two input masks as feature vectors. This feature vector represents the contour information of the Dunhuang fragments. In the present embodiment, the feature vector size is a 512-dimensional vector. After obtaining the feature vector of the Dunhuang fragments corresponding to each mask, the feature vectors output by the two sub-networks are connected, and the connected feature vectors are input into a classification module. In the classification module, it first passes through a fully connected layer (i.e., the first linear layer and the second linear layer), and then the output of the fully connected layer is calculated using the Sigmoid activation function. The Sigmoid activation function is used to normalize the matching degree score of each input mask pair to indicate the matching degree between the original Dunhuang fragment images. The value of the above matching degree score is between 0 and 1, where 0 indicates that the mask pair cannot be matched and 1 indicates that the mask pair has the highest matching degree. Among them, the classification module structure and settings of the twin network are as follows: Figure 4 shown.
[0048] S4. Take each feature vector obtained by the twin neural network as a vertex, add an edge between the fragment pairs whose matching degree scores are greater than the preset matching degree threshold, and use the corresponding matching degree scores as the weight of the edge. When all fragment pairs are traversed, an undirected graph is obtained.
[0049] It should be noted that step S3 is to construct an undirected graph, with the feature vector of each Dunhuang fragment obtained by the twin neural network as a vertex, adding edges between all fragment pairs whose matching scores are greater than a preset matching threshold, and using the matching score as the weight of the edge.
[0050] In order to best adapt the extraction results of the twin neural network obtained in this embodiment, the matching degree threshold is set to 0.2 in this embodiment.
[0051] S5. Input the undirected graph obtained in step S4 into the above-mentioned optimal graph neural network. The graph neural network (GNN) first predicts the initial probability of the Dunhuang fragments corresponding to each vertex in the undirected graph in the candidate splicing set. The initial probability is passed through the above-mentioned optimal transmission layer (OT Layer) to obtain the optimal probability. The top K Dunhuang fragments with the highest probability values in the optimal probability are selected to form the candidate splicing set.
[0052] It should be noted that the embodiment of the present invention uses a graph convolutional network (GCN) as the architecture of a graph neural network (GNN), trains the optimal graph neural network to learn the feature vectors corresponding to the vertices in the undirected graph, the weights of the edges, and the relationship between the selected Dunhuang fragments and the candidate splicing set, and finally outputs a probability value distributed between 0 and 1 for each vertex in the undirected graph. The architecture of the graph convolutional network is shown in Figure 1. Figure 6 As shown, Figure 6 The normalized probability in is the initial probability.
[0053] S6. After combining the two Dunhuang fragments in the candidate splicing set into a candidate Dunhuang fragment pair, each candidate Dunhuang fragment pair and a pre-constructed prompt word (prompt) are input into the multimodal large language model, and the multimodal large language model scores each candidate Dunhuang fragment pair and outputs the scoring result of each candidate Dunhuang fragment pair; if the scoring result is less than the preset score threshold, the corresponding candidate Dunhuang fragment pair is added to the erroneous small fragment subset.
[0054] In the present invention, the score threshold may be set according to actual conditions. In this embodiment, the score threshold is set to 60.
[0055] It should be noted that the present invention mainly uses the method of API calling and the method of uploading images and prompt words on a web page to use the multimodal large language model, that is, remote calling is performed through the API programming interface, and manual interaction is performed through a web page with a UI interface. The prompt words used in the present invention are as follows: "Suppose you are an expert in solving jigsaw puzzles. Now please help me solve the problem of splicing ancient artifact fragments. I will provide you with a series of fragments, some of which can be spliced together and some cannot. When splicing, the following rules must be followed: (1) Ignore straight edges, which cannot be spliced together; (2) Use visual ability, do not use scripts to complete the task; (3) Give a score between 1 and 100 and judge the direction of the small fragments that can be spliced together."
[0056] In this embodiment, multiple multimodal large language models such as LLaVA, QwenVM, Erine, and GPT-4V were tried, and GPT-4V from OpenAI performed best. Therefore, GPT-4V is used as the multimodal large language model in this embodiment. An example of using a multimodal large language model on Top-4 is as follows: Figure 7 shown.
[0057] S7. In the undirected graph obtained in step S4, all feature vector vertices corresponding to the erroneous small fragment subset and all edges connected to the feature vector vertices are removed to obtain a pruned undirected graph, and the pruned undirected graph is re-input into the optimal graph neural network to predict a new candidate splicing set containing K Dunhuang fragments for the splicing of the Dunhuang fragments.
[0058] It should be noted that using a multimodal large language model alone will face the problem of combinatorial explosion. When the candidate concatenation set is passed to the multimodal large language model at one time, the multimodal large language model will not be able to make a correct judgment due to the excessive number of all possible combinations. After the preliminary results (candidate concatenation set) obtained by the combinatorial optimization solver are added to the multimodal large language model for judgment, the combinatorial explosion problem can be avoided and the information in the image can be more fully utilized.
[0059] It should also be noted that when training the combinatorial optimization solver, the parameters of the multimodal large language model are fixed and do not need to be updated. The present invention uses the following loss function as the loss function Loss of the combinatorial optimization solver:
[0060] Loss = αL siamese +βL gnn +γL co
[0061] Among them, L siamese is the loss function of the twin neural network, which is used to measure the misprediction of small fragment pairs; L gnn represents the binary cross entropy loss function when the optimal graph neural network selects K maximum probabilities; L co It is calculated by the probability transformation of the optimal transmission layer; α, β, and γ are three predefined hyperparameters, which can be set according to actual needs and are not limited in the present invention.
[0062] The following is a detailed introduction to the parameter settings of the twin neural network and the optimal graph neural network during training in the combinatorial optimization solver, as well as how to construct the training data set.
[0063] In the twin neural network training process, the present invention uses the binary cross entropy loss function as the loss function L of the twin neural network. siamese :
[0064] L siamese =-[ylogp t +(1-y)log(1-p t )]
[0065] Among them, p t It indicates the probability of whether the predicted input mask pair matches, and y indicates the true value of whether the mask pair matches. The parameter settings of the twin neural network during training are shown in Table 1:
[0066] Table 1. Twin neural network parameter settings
[0067]
[0068] In order to calculate the loss function of the optimal graph neural network on an undirected graph, the present invention inputs the probability distribution of the probability composition of the small fragments corresponding to each vertex predicted by the graph convolutional network into the optimal transmission layer (OT Layer), and uses the Gumbel-Softmax technique and the Sinkhorn approximation method to implement the optimal transmission layer (OT Layer).
[0069] Table 2. Graph convolutional network parameter settings
[0070]
[0071]
[0072] When training the combinatorial optimization solver, the outline of the Dunhuang fragments is used as the segmentation line segment, and each complete Dunhuang fragment is torn into several small Dunhuang fragments. Adjacent small Dunhuang fragments are used as pairwise matching positive sample pairs, and non-adjacent small Dunhuang fragments are used as pairwise matching negative sample pairs. The constructed positive sample pairs and negative sample pairs are used as training data sets, which contain 40,000 pairs of positive sample pairs and 80,000 pairs of negative sample pairs.
[0073] Specifically, since there are few real pairwise matching images of Dunhuang fragments, in order to train a well-performing twin neural network and an optimal graph neural network, the present invention uses a simulated shredded dataset. The method for constructing the dataset is as follows: Figure 5 shown.
[0074] In the process of constructing the simulated shredded dataset, the existing Dunhuang fragment outlines in the Dunhuang fragments are used as segmentation segments to tear a complete Dunhuang fragment into smaller fragments. Adjacent small fragments can be used as pairwise matching positive sample pairs, while non-adjacent small fragments are pairwise matching negative sample pairs. After selecting a group of mask fragments from the same torn mask, fragments from other masks are randomly added to form a set of small fragments to be screened that contains candidate subsets that can be spliced.
[0075] The present invention adjusts the composition of the training data, and conducts experiments for different total amounts of training data and different ratios of positive and negative samples. The composition of the experimental data set, the accuracy of the twin neural network recognition results, and the accuracy of the optimal graph neural network selection Top-K are shown in Table 3. It has been verified that when the total amount of training data is 120,000 pairs and the positive and negative sample ratio is 1:2, both the twin neural network and the optimal graph neural network can achieve the best results. Therefore, this embodiment uses this data set composition to train the combinatorial optimization solver to obtain all weight parameters in the twin neural network and the optimal graph neural network.
[0076] Table 3. Training data set used in the present invention
[0077]
[0078]
[0079] In order to better demonstrate the specific implementation and technical effects of the present invention, a method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models shown in steps S1 to S7 in the above preferred implementation method is applied to a specific example.
[0080] Example
[0081] In this embodiment, verification was carried out on a real data set, and the accuracy of screening using only the multimodal large language model GPT-4V, screening using the combinatorial optimization solver of the present invention, and screening using the method of the present invention was tested respectively, and the tests were carried out in several cases where the distribution of correct candidate fragments was 2×2, 3×3, and the size of the set to be screened was 10, 15, 20, and 25. The accuracy of the test was calculated and confirmed by archaeologists, and the accuracy obtained by the above methods is shown in Table 4.
[0082] Table 4. Accuracy on real datasets
[0083]
[0084] The candidate splicing set screened by this embodiment can be spliced into some complete small fragment splicing results. Some splicing results are as follows: Figure 8 shown.
[0085] In summary, the method of the present invention searches for all possible combinations of small fragments of Dunhuang to be screened, and inputs the mask pairs corresponding to all small fragments to be screened into a twin neural network with ResNet18 as a subnetwork, extracting the feature vector of each small fragment and the matching degree score of each pair of fragments. An undirected graph is formed using the feature vector of each small fragment and the fragment pairs with a matching degree score greater than a threshold, and a graph neural network fused with an optimal transmission layer is used to predict the probability of selection of the fragment corresponding to each vertex, and the K results with the highest probability are screened to form a candidate splicing set, and the fragments in the candidate splicing set are input into a multimodal large language model, and predefined prompt words are used to select the wrong results, and at the same time, the vertices and edges corresponding to the wrong results are eliminated in the undirected graph, and the undirected graph after elimination is input into the graph neural network fused with the optimal transmission layer again, and the final candidate splicing set consisting of K results is obtained.
[0086] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models, characterized in that: The following steps are involved: S1. Obtain all possible fragment pairs that can be combined from the Dunhuang fragments to be screened, and perform mask extraction on the fragment pairs, where each fragment pair corresponds to a mask pair; S2. Obtain a trained combinatorial optimization solver, the combinatorial optimization solver is composed of a twin neural network, an optimal graph neural network and a multimodal large language model, the optimal graph neural network is composed of a graph neural network and an optimal transmission layer cascaded in sequence; wherein, during training, the combinatorial optimization solver only updates the parameters of the twin neural network and the optimal graph neural network, the parameters of the multimodal large language model are fixed, and when the optimal transmission layer is updating its parameters, the first K maximum probabilities among the probabilities output by the optimal transmission layer are maximized, and the remaining probabilities output by the optimal transmission layer are minimized; S3. Each time a mask pair is input into the twin neural network, a feature vector of the Dunhuang fragment corresponding to the mask pair and a matching degree score of each mask pair are obtained; wherein the twin neural network is composed of two sub-networks for feature extraction and a classification module; S4. Take each feature vector obtained by the twin neural network as a vertex, add an edge between the fragment pairs whose matching degree scores are greater than the preset matching degree threshold, and use the corresponding matching degree scores as the weight of the edge. When all fragment pairs are traversed, an undirected graph is obtained; S5. Input the undirected graph obtained in step S4 into the optimal graph neural network, first use the graph neural network to predict the initial probability of the Dunhuang fragments corresponding to each vertex in the undirected graph in the candidate splicing set, pass the initial probability through the optimal transmission layer to obtain the optimal probability, and select the top K Dunhuang fragments with the highest probability values in the optimal probability to form the candidate splicing set; S6. After combining two Dunhuang fragments in the candidate splicing set into a candidate Dunhuang fragment pair, each candidate Dunhuang fragment pair and a pre-constructed prompt word are input into the multimodal large language model, and the multimodal large language model scores each candidate Dunhuang fragment pair, and outputs the scoring result of each candidate Dunhuang fragment pair; if the scoring result is less than a preset score threshold, the corresponding candidate Dunhuang fragment pair is added to the error small fragment subset; S7. In the undirected graph obtained in step S4, all feature vector vertices corresponding to the erroneous small fragment subset and all edges connected to the feature vector vertices are removed to obtain a pruned undirected graph, and the pruned undirected graph is re-input into the optimal graph neural network to predict a new candidate splicing set containing K Dunhuang fragments for the splicing of the Dunhuang fragments.
2. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models as claimed in claim 1, characterized in that: In the twin neural network, the first fragment mask in the i-th mask pair is input into the first sub-network to obtain the first feature vector of the Dunhuang fragment, and the second fragment mask in the i-th mask pair is input into the second sub-network to obtain the second feature vector of the Dunhuang fragment. After the first feature vector and the second feature vector are spliced, the spliced vector is input into the classification module to output the matching degree score of the i-th mask pair.
3. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models as claimed in claim 2, characterized in that: The first sub-network and the second sub-network have the same structure, and the two sub-networks have the same weight.
4. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models as claimed in claim 1, characterized in that: The classification module is formed by sequentially cascading a first linear layer, a ReLU activation function, a second linear layer and a Sigmoid activation function.
5. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models as claimed in claim 1, characterized in that: The value of the matching degree score is between 0 and 1, wherein 0 indicates that the mask pair cannot be matched, and 1 indicates that the matching degree of the mask pair is the highest.
6. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models as claimed in claim 1, characterized in that: The score threshold is set to 60.
7. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models as claimed in claim 1, characterized in that: The matching degree threshold is 0.
2.
8. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models as claimed in claim 1, characterized in that: The multimodal large language model adopts the GPT-4V model.
9. A method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large models as claimed in claim 1, characterized in that: The graph neural network adopts a graph convolutional network GCN.
10. The method for screening connectable Dunhuang fragments based on combinatorial optimization and multimodal large model as claimed in claim 1, characterized in that: When training the combinatorial optimization solver, the outline of the Dunhuang fragment is used as the segmentation line segment, and each complete Dunhuang fragment is torn into several small Dunhuang fragments. Adjacent small Dunhuang fragments are used as positive sample pairs that match each other, and non-adjacent small Dunhuang fragments are used as negative sample pairs that match each other. The constructed positive sample pairs and negative sample pairs are used as training data sets, which contain 40,000 pairs of positive sample pairs and 80,000 pairs of negative sample pairs.
Citation Information
Patent Citations
Dunhuang book fragment conjugation method based on multi-feature mining and cooperative constraint
CN116246280A
Multi-mode Dunhuang residual scroll conjugation method based on text matching and twin network
CN117953504A
Vision-based Dunhuang residual scroll conjugation data set construction and enhancement method
CN118037591A
Cited By
Three-dimensional virtual splicing method for point cloud cultural relic fragments based on twin network
CN114998103A
Multi-mode Dunhuang residual scroll conjugation method based on text matching and twin network
CN117953504A
Multimodal dunhuang manuscript binding method based on text matching and twin network
CN117953504B
