Method for conjugating bamboo strips based on twin network

Through the CGF-Siam network model based on twin networks, the problem of low accuracy and low efficiency in bamboo slip conjugation is solved, efficient and accurate bamboo slip conjugation is achieved, and the difficulty of conjugation is reduced, and technical support is provided for bamboo slip protection and historical and cultural research.

CN119516550APending Publication Date: 2025-02-25NORTHWEST NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411575741.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing bamboo slip conjugation methods have problems such as low conjugation accuracy and low efficiency, making it difficult to efficiently and accurately complete bamboo slip conjugation, reducing the difficulty of conjugation.

Method used

The CGF-Siam network model based on twin network is adopted, and the CGF module, the backbone feature extraction network and the similarity score SS module are integrated through curve gradients to build a bamboo slip conjugation data set and train a model to realize the automatic conjugation of bamboo slip baffle mouths.

Benefits of technology

It significantly improves the processing speed and efficiency of bamboo slip conjugation, ensures the accuracy of the conjugation, and reduces the difficulty of conjugation, allowing more researchers to participate in bamboo slip protection and research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516550A_ABST
    Figure CN119516550A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of intelligent network models, and particularly relates to a twin network-based bamboo strip conjugation method, which comprises the following steps of S1, constructing a twin network-based CGF-Siam network model; the CGF-Siam network model comprises a curve gradient fusion CGF module, a trunk feature extraction network and a similarity scoring SS module; the SS module is used for evaluating the similarity between the edge contour curves of the bamboo slag ports on the two input images based on the output of the trunk feature network; s2, based on the conjugated edge profile curve of the bamboo strips containing the upper profile curve and the lower profile curve, constructing a data set of conjugation of the bamboo strips; s3, training a CGF-Siam network model by using the bamboo strip conjugate data set; and S4, the trained CGF-Siam network model is used for carrying out actual conjugation on the bamboo strip slag openings. According to the method, the bamboo strips can be efficiently and accurately conjugated, and the conjugation difficulty is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent network models, and in particular relates to a bamboo slip splicing method based on twin networks. Background Art

[0002] Bamboo slips are a general term for bamboo slips and wooden pieces used for writing in ancient China, including bamboo slips, wooden slips, bamboo slips and wooden slips. Before the invention and popularization of paper, bamboo slips, as one of the most important carriers of Chinese culture, carried all aspects of the ancient people's food, clothing, housing and transportation, and had a profound impact on the book system of later generations. These precious cultural heritages reveal the style of ancient society and are important materials for studying ancient history, culture and language.

[0003] However, most of the unearthed bamboo slips are incomplete, broken or fragmented due to various reasons. The preservation of bamboo slips is closely related to the environment in which they are located. Once unearthed and exposed to the air, they are very likely to break and deform. At the same time, human and natural factors, such as insect bites and corrosion caused by years of underground burial, also make the bamboo slips worn and incomplete before they are unearthed. Therefore, in order to use bamboo slips to study ancient language and history, the unearthed bamboo slips must first be spliced ​​together. The splicing of bamboo slips is itself an important part of the collation of unearthed documents. It can reassemble the broken bamboo slips and restore their original form, thereby expanding the amount of information and function of the bamboo slips. After the splicing of the bamboo slips, the fragments that were originally unusable can be transformed into a sentence or a paragraph of valuable information, providing valuable information support for the research in the fields of history, archaeology, bamboo slips and silk studies, and philology.

[0004] However, in the actual splicing process, the traditional splicing of bamboo slips is highly dependent on manual operations. Researchers of bamboo slip splicing not only need to have certain basic knowledge of history, archaeology, bamboo slips and silk manuscripts, and philology, but also need to use this knowledge in a comprehensive way to serve the splicing of bamboo slips. This places extremely high demands on the researchers' professional knowledge reserves and interdisciplinary application capabilities. In addition, due to the huge number of unearthed bamboo slips, researchers need to have super memory and associative ability to splice the fragmented bamboo slips into complete documents. This mechanical and cumbersome splicing method consumes a lot of researchers' time and energy, making the splicing work particularly arduous.

[0005] With the continuous development of artificial intelligence technology, people have begun to try to use computer vision and deep learning technology to solve the problem of bamboo slips splicing. However, the existing bamboo slips splicing methods still have some shortcomings, such as low splicing accuracy and low efficiency.

[0006] Therefore, how to efficiently and accurately complete the splicing of bamboo slips and effectively reduce the difficulty of splicing has become the problem that needs to be solved at present. Summary of the invention

[0007] In view of the above-mentioned deficiencies in the prior art, the present invention provides a bamboo slips splicing method based on twin networks, which can efficiently and accurately complete the bamboo slips splicing and effectively reduce the difficulty of splicing.

[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0009] A method for combining bamboo slips based on twin networks comprises the following steps:

[0010] S1. Construct a CGF-Siam network model based on a twin network; the CGF-Siam network model includes a curve gradient fusion CGF module, a backbone feature extraction network and a similarity scoring SS module;

[0011] The CGF module includes a main branch, a fusion module and two identical residual branches; the main branch is used to extract multi-directional gradient information from the two input images and splice them; the two residual branches extract the features of one of the input images respectively; the fusion module is used to weightedly fuse the features output by the main branch and the two residual branches to obtain the final comprehensive feature representation;

[0012] The backbone feature extraction network is used to extract key information from the comprehensive feature representation obtained by the CGF module to improve the ability to express the similarity features of the input image;

[0013] The SS module is used to evaluate the similarity between the edge contour curves of the bamboo slips on the two input images based on the output of the backbone feature network;

[0014] S2, constructing a bamboo slip splicing dataset based on the spliced ​​bamboo slip edge contour curves including the upper contour curve and the lower contour curve;

[0015] S3, use the bamboo slips concatenation dataset to train the CGF-Siam network model;

[0016] S4. Use the trained CGF-Siam network model to perform actual splicing of bamboo slips;

[0017] Among them, S1 and S2 can be swapped in order.

[0018] Compared with the prior art, the present invention has the following beneficial effects:

[0019] 1. This method can effectively improve the processing speed and efficiency of bamboo slip splicing. By constructing a CGF-Siam network model based on a twin network, this method takes advantage of the high efficiency of deep learning models in processing complex image matching tasks. The curve gradient fusion CGF module in the model can effectively fuse multi-directional gradient information and image features, and the backbone feature extraction network further extracts key information. These designs enable the model to quickly and accurately evaluate the similarity between input images. Compared with traditional manual splicing or algorithms based on simple feature matching, this deep learning-based method greatly improves processing speed and efficiency.

[0020] 2. This method can ensure the accuracy of bamboo slip splicing. The similarity scoring SS module in the CGF-Siam network model is specially designed to evaluate the similarity between the edge contour curves of the bamboo slips, which directly targets the core difficulty of the bamboo slip splicing task. By optimizing the model parameters through the training data set, the model can learn more accurate feature representation and similarity evaluation methods, thereby significantly improving the accuracy of splicing. This not only reduces the cases of misjudgment and missed judgment, but also makes the splicing results more reliable and accurate.

[0021] 3. This method can reduce the difficulty of splicing. Since this method realizes the automated and intelligent splicing process of bamboo slips, users do not need to have deep professional knowledge and experience, and only need to input the images of the bamboo slips to be spliced ​​to obtain high-quality splicing results. This greatly reduces the technical threshold and operational difficulty of bamboo slip splicing, allowing more researchers, scholars and cultural relics workers to participate in the protection and research of bamboo slips.

[0022] Experiments show that on the benchmark dataset, the average accuracy of the CGF-Siam network reached 90.2%, providing an effective research method and idea for artificial intelligence-assisted bamboo slips splicing.

[0023] In summary, this method aims to solve the problems of low splicing precision and low efficiency in the existing bamboo slip splicing methods. By introducing deep learning technology and twin network models, this method achieves efficient and accurate splicing of bamboo slips, effectively reduces the difficulty of splicing, and provides strong technical support for the protection of bamboo slips and historical and cultural research. This method can efficiently and accurately complete the splicing of bamboo slips, effectively reducing the difficulty of splicing.

[0024] Preferably, the expression of the CGF module processing process is:

[0025]

[0026] in:

[0027] M1=ECA(F1([G(x1),G(x2)]));

[0028] M2=ECA(F2(x1));

[0029] M3=ECA(F3(x2));

[0030] Where M represents the comprehensive feature representation map of the CGF module processing output; M1, M2, and M3 are three feature maps of the main branch and the two residual branches respectively; x1 and x2 are two input images respectively, F1(@), F2(@), and F3(@) all represent depthwise separable convolution operations, ECA(·) represents effective channel attention operation, G(@) represents gradient operation module operation, and [@] represents concat operation; μ represents weighting factor, Represents the addition operation.

[0031] Such a setting can, 1. enhance the ability to express features. Multi-directional gradient information can capture the different directional changes of detail features such as edges and textures in images, which are crucial for image matching and recognition. By extracting multi-directional gradient information through the GradientOperator module and splicing them, a richer and more comprehensive feature representation can be generated. This feature representation can more accurately describe the key information in the image, thereby improving the accuracy of image matching and recognition.

[0032] 2. It can also improve robustness. In practical applications, images may be affected by factors such as lighting changes and noise interference, resulting in a decrease in image quality. Multi-directional gradient information has a certain robustness to lighting and noise because it relies more on edge and texture features in the image rather than the pixel value itself. Therefore, by extracting and splicing multi-directional gradient information, the model's adaptability to image changes can be enhanced and the model's robustness can be improved.

[0033] Preferably, in the process of extracting multi-directional gradient information from the two input images, the Gradient Operator module applies the Sobel operator to calculate the gradient information of the input images in the horizontal, vertical, 45 degree and 135 degree directions to enhance the edge feature representation.

[0034] With this setting, the application of the Sobel operator in four directions (horizontal, vertical, 45 degrees and 135 degrees) enables the Gradient Operator module to extract more comprehensive multi-directional gradient information. This information not only includes the location of the edge in the image, but also the direction and intensity of the edge, providing richer features for subsequent image processing.

[0035] In addition, the enhancement of edge features and the extraction of multi-directional gradient information make image processing algorithms more accurate in tasks such as recognition, matching and segmentation. At the same time, since the Sobel operator has a certain smoothing effect on noise, this technology can also improve the robustness of image processing and reduce the impact of noise on image processing results.

[0036] Preferably, after the main branch splices the gradient information of the two input images, it also strengthens the feature expression through the depthwise separable convolution and ECA module.

[0037] Preferably, after the residual branch extracts the features of the input image, the feature expression is further enhanced through the depthwise separable convolution and ECA modules.

[0038] This setting, by using depthwise separable convolution and ECA modules, can further enhance feature expression and improve the computational efficiency and accuracy of the model. This combination enables the model to learn rich feature representations while maintaining low computational complexity, thus performing well in various image processing tasks. In complex image processing tasks such as bamboo slip splicing, the application of this technical content will help improve the accuracy and efficiency of splicing.

[0039] Preferably, the process of evaluating similarity by the SS module includes:

[0040] First, the features processed by adaptive average pooling are input into a fully connected layer;

[0041] Subsequently, nonlinear processing is added through the ReLU activation function, and the model passes through the Dropout layer to prevent overfitting. The Dropout layer is used to reduce overfitting, and the dropout rate is 0.5.

[0042] Finally, the sigmoid function is used to map the output to the [0,1] interval to obtain the similarity between the edge contour curves of the bamboo slips on the two input images.

[0043] With this setting, the SS module can achieve efficient and accurate evaluation of the similarity between the edge contour curves of the bamboo slips on two input images through steps such as feature fusion and dimensionality reduction, nonlinear processing capabilities, overfitting prevention, and similarity score mapping. This evaluation process not only improves the generalization ability of the model, but also makes the similarity score intuitively interpretable, providing strong support for image processing tasks such as bamboo slip splicing.

[0044] Preferably, the loss function of the CGF-Siam network model training is:

[0045]

[0046] Where B represents the number of samples in the batch; yi Represents the target label of the i-th sample, y when it is correctly matched i =1, wrong match y i =0; p i The model predicts the probability that the i-th sample is a positive class; the parameter α is the balance factor, which is used to adjust the imbalance between positive and negative samples; γ is the adjustment factor, which is used to reduce the weight of easy-to-classify samples and increase the influence of difficult-to-classify samples.

[0047] With this setting, the loss function of the CGF-Siam network model training effectively improves the model performance by comprehensively considering sample matching accuracy, positive and negative sample balance, attention to difficult-to-classify samples, and optimizing the training process. This loss function design not only helps to improve the matching accuracy of the model, but also enhances the generalization ability and robustness of the model, providing strong support for similarity matching tasks in practical applications.

[0048] Preferably, the backbone feature extraction network is ResNet50.

[0049] Such a setting, using ResNet50 as the backbone feature extraction network, has shown remarkable results in terms of technical content in terms of feature extraction capability, solving the gradient vanishing problem, improving model accuracy, broad application prospects, and optimizing model structure and performance.

[0050] Preferably, in S2, when constructing the bamboo slip splicing data set, data augmentation is performed on the spliced ​​bamboo slip edge contour curves including the upper contour curve and the lower contour curve.

[0051] This setting can significantly increase the diversity of data, improve model performance, enhance model robustness, reduce the risk of overfitting, and promote the research and development of related algorithms by augmenting the edge contour curves of the already joined bamboo slips, including the upper contour curve and the lower contour curve. This is of great significance for building a high-quality bamboo slip joining dataset and improving the accuracy of the bamboo slip joining task.

[0052] Preferably, the data augmentation process includes:

[0053] First, the joined curve pairs are numbered; the curve pairs are the upper contour curve and the lower contour curve of a pair of joined bamboo slips;

[0054] Then, randomly select multiple non-repeating integers from the numbers to build a random index list;

[0055] Then, according to the numbering sequence in the index table, the curve pairs with corresponding numbers are retrieved one by one;

[0056] Then, the retrieved curve pairs are respectively intercepted at the middle position of the upper contour curve and the lower contour curve to obtain two sets of independent new concatenable curve segment pairs;

[0057] Finally, two groups of new connectable curve segment pairs are randomly selected, and the upper contour curve and the lower contour curve are connected respectively to obtain new connectable upper contour curve and lower contour curve as augmented curve pairs.

[0058] Such a setting can increase data diversity. By intercepting the already concatenated curve pairs from the middle position and recombining them into new concatenable curve pairs, this process can generate a large number of new samples that are different from the original data but maintain similar features. These new samples increase the diversity of the data and help the model learn richer feature representations. Data augmentation technology provides more possibilities for algorithm optimization. By constantly trying different interception and combination methods, more effective data augmentation strategies can be explored to further improve the performance of the algorithm. Through data augmentation, the existing concatenated curve pair data can be fully utilized to generate more new samples. This improves the utilization of data and enables limited original data to generate greater value. This helps to improve the accuracy and practicality of the bamboo slip concatenation algorithm and promote the development and application of related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:

[0060] Figure 1 A flowchart of the method is shown in FIG.

[0061] Figure 2 Schematic diagram of the network architecture of CGF-Siam in Example 1;

[0062] Figure 3 This is a schematic diagram of the data augmentation process in Example 1;

[0063] Figure 4 This is a performance comparison chart of the CGF-Siam model under different backbone networks in Example 2;

[0064] Figure 5 Schematic diagram of the accuracy of bamboo slips splicing under seven sizes of training sets for the triplet network, Siamese network, dual-channel method and CGF_Siam network in Example 2. DETAILED DESCRIPTION

[0065] The following is a further detailed description through specific implementation methods:

[0066] Example:

[0067] like Figure 1 As shown, this embodiment discloses a method for splicing bamboo slips based on twin networks, comprising the following steps:

[0068] S1. Construct a CGF-Siam network model based on twin networks; Figure 2 As shown in the figure, the CGF-Siam network model includes a curve gradient fusion CGF module, a backbone feature extraction network and a similarity scoring SS module.

[0069] The CGF module consists of a main branch, a fusion module, and two identical residual branches. The structure of the CGF module is as follows: Figure 2 As shown in (a) in .

[0070] The main branch is used to extract multi-directional gradient information from the two input images and stitch them together; the two residual branches extract the features of one of the input images respectively; the fusion module is used to weightedly fuse the features output by the main branch and the two residual branches to obtain the final comprehensive feature representation.

[0071] In the specific implementation, the main branch uses the Gradient Operator module to extract multi-directional gradient information from the two input images and splice them. In this way, the feature expression ability can be enhanced. Multi-directional gradient information can capture the different directional changes of detail features such as edges and textures in the image, which are crucial for image matching and recognition. By extracting multi-directional gradient information through the Gradient Operator module and splicing them, a richer and more comprehensive feature representation can be generated. This feature representation can more accurately describe the key information in the image, thereby improving the accuracy of image matching and recognition. It can also improve robustness. In practical applications, images may be affected by factors such as illumination changes and noise interference, resulting in a decrease in image quality. Multi-directional gradient information has a certain robustness to illumination and noise because they rely more on edge and texture features in the image rather than the pixel value itself. Therefore, by extracting multi-directional gradient information and splicing it, the adaptability of the model to image changes can be enhanced and the robustness of the model can be improved.

[0072] In the process of extracting multi-directional gradient information from the two input images, the Gradient Operator module applies the Sobel operator to calculate the gradient information of the input image in the horizontal, vertical, 45-degree and 135-degree directions to enhance the edge feature representation. In this way, the application of the Sobel operator in four directions (horizontal, vertical, 45-degree and 135-degree) enables the GradientOperator module to extract more comprehensive multi-directional gradient information. This information not only includes the position of the edge in the image, but also the direction and intensity of the edge, providing richer features for subsequent image processing. In addition, the enhancement of edge features and the extraction of multi-directional gradient information make the image processing algorithm more accurate in tasks such as recognition, matching and segmentation. At the same time, since the Sobel operator has a certain smoothing effect on noise, this technology can also improve the robustness of image processing and reduce the impact of noise on image processing results.

[0073] In specific implementation, after the main branch splices the gradient information of the two input images, it also strengthens the feature expression through the deep separable convolution and ECA modules. After the residual branch extracts the features of the input image, it also strengthens the feature expression through the deep separable convolution and ECA modules. In this way, by using the deep separable convolution and ECA modules, the feature expression can be further strengthened, and the computational efficiency and accuracy of the model can be improved. This combination enables the model to learn rich feature representations while maintaining low computational complexity, thereby performing well in various image processing tasks. In complex image processing tasks such as bamboo slip splicing, the application of this technical content will help improve the accuracy and efficiency of splicing.

[0074] like Figure 2 As shown in (b), ECA is a lightweight but effective attention mechanism that can adaptively capture cross-channel correlations without introducing any additional parameters. The introduction of ECA enables the network to better focus on important feature channels, thereby improving the efficiency and effect of feature extraction.

[0075] For ease of understanding, the CGF module can be expressed as:

[0076]

[0077] in:

[0078] M1=ECA(F1([G(x1),G(x2)]));

[0079] M2=ECA(F2(x1));

[0080] M3=ECA(F3(x2));

[0081] Where M represents the comprehensive feature representation map of the CGF module processing output; M1, M2, and M3 are the three feature maps of the main branch and the two residual branches respectively; x1 and x2 are the two input images respectively, F1(·), F2(·), and F3(·) all represent depthwise separable convolution operations, ECA(·) represents the effective channel attention operation, G(·) represents the gradient operation module operation, and [·] represents the concat operation; μ represents the weighting factor, Represents the addition operation.

[0082] The backbone feature extraction network is used to extract key information from the comprehensive feature representation obtained by the CGF module to improve the ability to express the similarity features of the input image.

[0083] In the specific implementation, the backbone feature extraction network is ResNet50. This setting, using ResNet50 as the backbone feature extraction network, has shown significant effects in terms of feature extraction capability, solving the gradient vanishing problem, improving model accuracy, broad application prospects, and optimizing model structure and performance.

[0084] The SS module is used to evaluate the similarity between the edge contour curves of the bamboo slips on the two input images based on the output of the backbone feature network. The structure of the SS module is as follows: Figure 2 As shown in (d)

[0085] In specific implementation, the process of SS module evaluating similarity includes:

[0086] First, the features processed by adaptive average pooling are input into a fully connected layer;

[0087] Subsequently, nonlinear processing is added through the ReLU activation function, and the model passes through the Dropout layer to prevent overfitting. The Dropout layer is used to reduce overfitting, and the dropout rate is 0.5.

[0088] Finally, the sigmoid function is used to map the output to the [0,1] interval to obtain the similarity between the edge contour curves of the bamboo slips on the two input images.

[0089] In this way, the features processed by adaptive average pooling are input to the fully connected layer, which realizes the fusion and dimensionality reduction of features. Adaptive average pooling can retain key spatial information while reducing the dimension of features, making subsequent processing more efficient. The fully connected layer further integrates this information and provides a comprehensive feature representation for similarity assessment. In addition, by adding nonlinear processing through the ReLU activation function, the model can learn more complex feature relationships. The ReLU function can introduce nonlinear characteristics to help the model better fit complex similarity assessment tasks. This nonlinear processing capability is one of the key factors for deep learning models to achieve excellent performance in image processing tasks.

[0090] In addition, the Dropout layer is used to alleviate overfitting. During the training process, the Dropout layer randomly discards some neuron outputs in the fully connected layer with a certain probability (here is 0.5), which prevents the model from over-relying on certain specific neurons during training, thereby improving the generalization ability of the model. This strategy helps prevent the model from performing too well on training data and performing poorly on unseen data. Finally, the sigmoid function is used to map the output to the [0,1] interval to obtain the similarity score between the edge contour curves of the bamboo slips on the two input images. The Sigmoid function can map any real number to the [0,1] interval, which makes the similarity score intuitively interpretable: the closer the score is to 1, the higher the similarity between the two images; the closer the score is to 0, the lower the similarity between the two images.

[0091] The SS module achieves efficient and accurate evaluation of the similarity between the edge contour curves of the bamboo slips on two input images through steps such as feature fusion and dimensionality reduction, nonlinear processing capabilities, overfitting prevention, and similarity score mapping. This evaluation process not only improves the generalization ability of the model, but also makes the similarity score intuitively interpretable, providing strong support for image processing tasks such as bamboo slips splicing.

[0092] In specific implementation, the loss function of CGF-Siam network model training is:

[0093]

[0094] Where B represents the number of samples in the batch; y i Represents the target label of the i-th sample, y when it is correctly matched i =1, wrong match y i =0; p i The model predicts the probability that the i-th sample is a positive class; the parameter α is the balance factor, which is used to adjust the imbalance between positive and negative samples; γ is the adjustment factor, which is used to reduce the weight of easy-to-classify samples and increase the influence of difficult-to-classify samples.

[0095] With this setting, the loss function of the CGF-Siam network model training effectively improves the model performance by comprehensively considering sample matching accuracy, positive and negative sample balance, attention to difficult-to-classify samples, and optimizing the training process. This loss function design not only helps to improve the matching accuracy of the model, but also enhances the generalization ability and robustness of the model, providing strong support for similarity matching tasks in practical applications.

[0096] S2. Construct a bamboo slip splicing dataset based on the spliced ​​bamboo slip edge contour curves including the upper contour curve and the lower contour curve.

[0097] Among them, when constructing the bamboo slips splicing dataset, data augmentation is performed on the spliced ​​bamboo slips edge contour curves including the upper contour curve and the lower contour curve.

[0098] In this way, data diversity can be increased. Data augmentation can generate a large number of new and diverse data samples by performing various transformations (such as flipping, rotating, scaling, etc.) on the original data. This is particularly important for the task of bamboo slips splicing, because the shapes, sizes, directions, etc. of bamboo slips may vary greatly. Data augmentation helps the model learn these differences, thereby improving its generalization ability. It can also improve model performance. By performing data augmentation on the edge contour curves of bamboo slips, more samples similar to the original data can be generated, which can be input into the model as training data. This helps the model learn more robust feature representations during training, thereby improving its performance in the task of bamboo slips splicing. It can also enhance model robustness. Data augmentation can simulate various possible data changes, including noise, illumination changes, deformation, etc. By learning and adapting to these changes, the model can show stronger robustness when facing complex situations in practical applications. This is particularly important for key links such as image matching and recognition in the task of bamboo slips splicing. Reduce the risk of overfitting. Overfitting is a common problem in deep learning models. Through data augmentation, the amount and diversity of training data can be increased, thereby reducing the risk of overfitting the model to the training data. This helps the model perform better on the test set and improves its practical value. It promotes algorithm research and development. As an effective data augmentation technology, the application of data augmentation in the bamboo slips splicing task helps promote the research and development of related algorithms. By continuously exploring new data augmentation methods and strategies, the performance and effect of the bamboo slips splicing algorithm can be further optimized.

[0099] In summary, data augmentation of the edge contour curves of the bamboo slips that have been spliced, including the upper contour curve and the lower contour curve, can significantly increase the diversity of data, improve model performance, enhance model robustness, reduce the risk of overfitting, and promote the research and development of related algorithms. This is of great significance for building a high-quality bamboo slip splicing dataset and improving the accuracy of the bamboo slip splicing task.

[0100] like Figure 3 As shown, in specific implementation, the process of data augmentation includes:

[0101] First, the joined curve pairs are numbered; the curve pairs are the upper contour curve and the lower contour curve of a pair of joined bamboo slips;

[0102] Then, randomly select multiple non-repeating integers from the numbers to build a random index list;

[0103] Then, according to the numbering sequence in the index table, the curve pairs with corresponding numbers are retrieved one by one;

[0104] Then, the retrieved curve pairs are respectively intercepted at the middle position of the upper contour curve and the lower contour curve to obtain two sets of independent new concatenable curve segment pairs;

[0105] Finally, two groups of new connectable curve segment pairs are randomly selected, and the upper contour curve and the lower contour curve are connected respectively to obtain new connectable upper contour curve and lower contour curve as augmented curve pairs.

[0106] Figure 3 In the figure, M represents M groups of bamboo slips edge contour curves that have been spliced ​​together; N represents N groups of bamboo slips edge contour curves that can be spliced ​​together that are finally generated.

[0107] Such a setting can increase data diversity. By intercepting the already concatenated curve pairs from the middle position and recombining them into new concatenable curve pairs, this process can generate a large number of new samples that are different from the original data but maintain similar features. These new samples increase the diversity of the data and help the model learn richer feature representations. Data augmentation technology provides more possibilities for algorithm optimization. By constantly trying different interception and combination methods, more effective data augmentation strategies can be explored to further improve the performance of the algorithm. Through data augmentation, the existing concatenated curve pair data can be fully utilized to generate more new samples. This improves the utilization of data and enables limited original data to generate greater value. This helps to improve the accuracy and practicality of the bamboo slip concatenation algorithm and promote the development and application of related technologies.

[0108] S3. Use the bamboo slips concatenation dataset to train the CGF-Siam network model.

[0109] S4. Use the trained CGF-Siam network model to perform actual splicing of bamboo slips.

[0110] Among them, S1 and S2 can be swapped in order.

[0111] This method can effectively improve the processing speed and efficiency of bamboo slip splicing. By constructing a CGF-Siam network model based on a twin network, this method utilizes the high efficiency of deep learning models in processing complex image matching tasks. The curve gradient fusion CGF module in the model can effectively fuse multi-directional gradient information and image features, and the backbone feature extraction network further extracts key information. These designs enable the model to quickly and accurately evaluate the similarity between input images. Compared with traditional manual splicing or algorithms based on simple feature matching, this deep learning-based method greatly improves the processing speed and efficiency. In addition, this method can ensure the accuracy of bamboo slip splicing. The similarity scoring SS module in the CGF-Siam network model is specially designed to evaluate the similarity between the edge contour curves of the bamboo slips, which directly targets the core difficulty of the bamboo slip splicing task. By optimizing the model parameters through the training data set, the model can learn more accurate feature representation and similarity evaluation methods, thereby significantly improving the accuracy of splicing. This not only reduces the cases of misjudgment and missed judgment, but also makes the splicing results more reliable and accurate. In addition, this method can reduce the difficulty of splicing. Since this method realizes the process of automatic and intelligent bamboo slip splicing, users do not need to have deep professional knowledge and experience, and can obtain high-quality splicing results by simply inputting the images of the bamboo slips to be spliced. This greatly reduces the technical threshold and operational difficulty of bamboo slip splicing, allowing more researchers, scholars and cultural relics workers to participate in the protection and research of bamboo slips.

[0112] In summary, this method aims to solve the problems of low splicing precision and low efficiency in existing bamboo slip splicing methods. By introducing deep learning technology and twin network models, this method achieves efficient and accurate splicing of bamboo slips, effectively reduces the difficulty of splicing, and provides strong technical support for bamboo slip protection and historical and cultural research. This method can efficiently and accurately complete the splicing of bamboo slips, effectively reducing the difficulty of splicing.

[0113] Embodiment 2

[0114] To better illustrate the effectiveness of this method, the following experimental verification is used to illustrate it. The experimental verification quantitatively analyzes this method based on the evaluation indicators on the self-made data set. The experiment is implemented using the Pytorch framework and Python programming language. The hardware configuration of the experimental platform is Nvidia RTX 4090 GPU with 128g memory and the CPU is Intel Xeon4210RSilver.

[0115] 1. About the choice of backbone network

[0116] On the benchmark dataset, the CGF-Siam model with ResNet50 as the backbone network showed the best performance. vvgg16, alexnet, ResNet50, mobilenetv2 and shufflenetv2 were used as the backbone feature extraction networks of CGF-Siam, and the bamboo slip splicing experiment was carried out on the BWS_Rejoin_Test test dataset. In order to comprehensively evaluate the performance of different backbone networks, Top-K accuracy, ROC curve and PR curve were selected as evaluation indicators. For bamboo slip splicing researchers, Top-20 is acceptable.

[0117] Figure 4 The performance comparison of different backbone networks in the CGF-Siam model is shown in Figure 2. Figure 4 (d). Figure 4 (a) shows the Top-K accuracy of each backbone feature extraction network on the test set. The experimental results show that when ResNet50 is used as the backbone feature extraction network, the CGF-Siam network has the highest average accuracy on the BWS_Rejoin_Test test dataset, reaching 79.8%. The test datasets are all real-world bamboo slips edge contour curves, so the performance of CGF-Siam under the test dataset is reliable. Figure 4 (b) shows the ROC curves of each backbone feature extraction network. The ROC curve represents the relationship between the true positive rate and the false positive rate. The closer the ROC curve is to the upper left corner, the better the model performance is. As can be seen from the figure, the overall position of the curve of ResNet50 is closest to the upper left corner, and it performs best. Figure 4 (c) shows the PR curves of different backbone feature extraction networks. The PR curve reflects the trade-off between the precision and recall of the model at different thresholds. The closer the PR curve is to the upper right corner, the higher the recall rate of the model while maintaining high precision. As can be seen from the figure, the PR curve of ResNet50 maintains a relatively high precision as a whole, and can maintain good performance even under high recall rates. Based on the above experimental results, ResNet50 is more suitable for the CGF-Siam network, so ResNet50 was selected as the backbone feature extraction network of the CGF-Siam network in subsequent experiments.

[0118] 2. Ablation Experiment Setup

[0119] In order to systematically evaluate the effectiveness of the CGF (feature fusion) module of this method, a series of ablation experiments were designed, including experiments on multi-directional gradient configuration and attention mechanism.

[0120] 2.1 Quantitative analysis of CGF module performance under multi-directional gradient configuration

[0121] The design of multi-directional gradient is aimed at coping with the corrosion and wear problem of the bamboo slips due to long-term burial. By applying the Sobel operator in the Gradient Operator, the gradient information of the input image in the horizontal, vertical, 45-degree and 135-degree directions is calculated to enhance the edge feature representation. The gradient information highlights relatively consistent local features, which facilitates the model to identify potential matching points. Multi-directional gradient calculation realizes multi-scale feature extraction, provides local and global matching information, and effectively copes with different degrees of bamboo slips wear.

[0122] This experiment compares CGF-Siam without Gradient (CGF-Siam_NoGrad), horizontal gradient (CGF-Siam with Horizontal Gradient, CGF-Siam_HorzGrad), vertical gradient (CGF-Siam with Vertical Gradient, CGF-Siam_VertGrad,), 45-degree gradient (CGF-Siam with 45-degree Gradient, CGF-Siam_45Grad), 135-degree gradient (CGF-Siamwith 135-degree Gradient, CGF-Siam_135Grad), horizontal and vertical dual gradients (CGF-Siam withHorizontal and Vertical Gradients, CGF-Siam_HorzVertGrad), diagonal dual gradients (CGF-Siam with 45-degree and 135-degree Gradients, CGF-Siam_45-135Grad) and four-direction gradients (CGF-Siam with The performance of the CGF module in the concatenation task under configurations such as Four-direction Gradients, CGF-Siam_4Grad). Table 1 shows the experimental results under different gradient configurations. From the results, it can be observed that with the increase in the number of gradient directions in the CGF module, the performance of the model shows a significant upward trend. First, under the gradient-free configuration, the feature fusion ability of the CGF module is limited, and the concatenation accuracy of the model is relatively low. Secondly, after introducing a single-directional gradient, the model can better capture the features of that direction, and the model performance is slightly improved. Thirdly, after introducing two-directional gradients, the CGF module can more effectively integrate image directional information, which significantly improves the model performance. Finally, the CGF module with four-directional gradients can capture richer local details and directional features, thereby further optimizing the final performance.

[0123] Table 1

[0124] The conjugation accuracy of CGF-Siam network under no gradient, horizontal gradient, vertical gradient, 45 degree gradient, 135 degree gradient, horizontal and vertical dual gradient, diagonal dual gradient and four-direction gradient (%)

[0125]

[0126] This series of experimental results show that multi-directional gradients have a positive impact on improving the performance of the CGF module, and verify that increasing direction-specific gradient information can improve the feature matching effect in the corresponding direction, thereby helping to improve the accuracy of bamboo slip splicing. These provide valuable empirical support for the design of the CGF module and also demonstrate the superiority of the module in handling feature fusion tasks.

[0127] 2.2 Impact of ECA attention mechanism on CGF module performance

[0128] Based on the above results, an ablation experiment of the attention mechanism was further set up to evaluate the role of the ECA attention mechanism in the CGF module. Specifically, under the four-directional gradient configuration, the performance of the CGF module in the bamboo slips splicing task under three configurations: no attention, channel attention, and ECA attention. Table 2 shows the experimental results.

[0129] Table 2 Concatenation accuracy of CGF-Siam network under different attention mechanism configurations (%)

[0130]

[0131] The experimental results show that in the non-attention configuration, the feature fusion ability of the CGF module is poor, and the splicing accuracy of the model is relatively low. After the introduction of SE attention, the CGF module can integrate the information of important feature channels, which slightly improves the model performance. The CGF module using the ECA attention mechanism is more accurate. In the process of bamboo slip splicing, the key is to judge the similarity of the input bamboo slip edge contour curve. It can be considered that ECA uses one-dimensional convolution to replace the fully connected layer in SE, which greatly reduces the number of parameters, reduces the risk of overfitting and computational complexity, and better captures the relationship between adjacent channels. Therefore, ECA attention is more advantageous in the process of bamboo slip splicing. The experimental results show that the ECA attention mechanism has a positive effect on improving the performance of the CGF module. Therefore, the subsequent experiments adopt a configuration combining four-directional gradient and ECA attention mechanism to further optimize the efficiency and accuracy of feature fusion.

[0132] 3. Performance analysis of curve reconstruction algorithm

[0133] According to quantitative analysis, the curve reconstruction algorithm can improve the reliability of the CGF-Siam network. Based on the benchmark training set samples, seven augmented datasets with different sample numbers were constructed using the curve reconstruction algorithm, named BWS_Rejoin-10000, BWS_Rejoin-20000, BWS_Rejoin-30000, BWS_Rejoin-40000, BWS_Rejoin-50000, BWS_Rejoin-60000 and BWS_Rejoin-70000. These augmented datasets are only used for training, and the test dataset is still the real bamboo slip edge contour curve. The CGF-Siam network was trained using the augmented dataset, and the bamboo slip splicing experiment was carried out on the BWS_Rejoin_Test test dataset. The experimental results show that with the increase in the number of samples, the splicing accuracy of the CGF-Siam network on the BWS_Rejoin_Test test dataset shows a continuous upward trend. Table 3 shows this trend in detail.

[0134] Table 3 Conjugation accuracy and recall of CGF-Siam network under different training sets (%)

[0135]

[0136] The results show that the CGF-Siam network using BWS_Rejoin-70000 as the training set achieved the highest conjugation accuracy. Specifically, in the top-10 accuracy evaluation, the CGF-Siam network achieved a conjugation accuracy of 95.4% on the BWS_Rejoin_Test test dataset, far exceeding the top-10 average conjugation accuracy of 78% on the BWS_Rejoin training set. In addition, the accuracy of the constructed training set of 70,000 samples is similar to that of the training set of 60,000 samples, so it can be considered that further augmenting the training samples will not significantly improve the conjugation accuracy.

[0137] 4. Comparative evaluation

[0138] Since the research on the problem of splicing bamboo slips is relatively new and there are no mature methods for direct comparison, three methods widely used in similarity detection were selected for comparative experiments, including triplet networks, Siamese networks, and dual-channel methods. All methods were trained on seven training sets of different sizes, including the BWS_Rejoin training set (containing only 272 training samples), BWS_Rejoin-10000, BWS_Rejoin-20000, BWS_Rejoin-30000, BWS_Rejoin-40000, BWS_Rejoin-50000, and BWS_Rejoin-60000 augmented datasets, and evaluated on the BWS_Rejoin_Test test dataset. Figure 5 As shown, Figure 5 (a)-(g) show the accuracy comparison of the triplet network, Siamese network, dual-channel method and CGF-Siam network on the BWS_Rejoin_Test test data set after training with different scale training sets. Among them, (a) Conjugation accuracy based on BWS_Rejoin training set. (b) Conjugation accuracy based on BWS_Rejoin-10000 training set. (c) Conjugation accuracy based on BWS_Rejoin-20000 training set. (d) Conjugation accuracy based on BWS_Rejoin-30000 training set. (e) Conjugation accuracy based on BWS_Rejoin-40000 training set. (f) Conjugation accuracy based on BWS_Rejoin-50000 training set. (g) Conjugation accuracy based on BWS_Rejoin-60000 training set. (h) Legend configuration.

[0139] Experimental results show that the CGF-Siam network proposed in this method performs better than other methods on the BWS_Rejoin_Test test dataset, verifying the effectiveness of the CGF-Siam network in the task of splicing bamboo slips.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.

Claims

1. A method for combining bamboo slips based on twin networks, characterized in that: The following steps are involved: S1. Construct a CGF-Siam network model based on a twin network; the CGF-Siam network model includes a curve gradient fusion CGF module, a backbone feature extraction network and a similarity scoring SS module; The CGF module includes a main branch, a fusion module, and two identical residual branches; the main branch is used to extract multi-directional gradient information from the two input images and splice them; the two residual branches extract the features of one of the input images respectively; the fusion module is used to weightedly fuse the features output by the main branch and the two residual branches to obtain the final comprehensive feature representation; The backbone feature extraction network is used to extract key information from the comprehensive feature representation obtained by the CGF module to improve the ability to express the similarity features of the input image; The SS module is used to evaluate the similarity between the edge contour curves of the bamboo slips on the two input images based on the output of the backbone feature network; S2, constructing a bamboo slip splicing dataset based on the spliced ​​bamboo slip edge contour curves including the upper contour curve and the lower contour curve; S3, use the bamboo slips concatenation dataset to train the CGF-Siam network model; S4. Use the trained CGF-Siam network model to perform actual splicing of bamboo slips; Among them, S1 and S2 can be swapped in order.

2. The method for combining bamboo slips based on twin networks as claimed in claim 1, characterized in that: The expression of the CGF module processing process is: in: M1=ECA(F1([G(x1),G(x2)])); M2=ECA(F2(x1)); M3=ECA(F3(x2)); Where M represents the comprehensive feature representation map of the CGF module processing output; M1, M2, and M3 are the three feature maps of the main branch and the two residual branches respectively; x1 and x2 are the two input images respectively, F1(·), F2(·), and F3(·) all represent depthwise separable convolution operations, ECA(·) represents the effective channel attention operation, G(·) represents the gradient operation module operation, and [·] represents the concat operation; μ represents the weighting factor, Represents the addition operation.

3. The method for combining bamboo slips based on twin networks as claimed in claim 2, characterized in that: In the process of extracting multi-directional gradient information from the two input images, the GradientOperator module applies the Sobel operator to calculate the gradient information of the input image in the horizontal, vertical, 45-degree and 135-degree directions to enhance the edge feature representation.

4. The method for combining bamboo slips based on twin networks as claimed in claim 1, characterized in that: After the main branch concatenates the gradient information of the two input images, it also enhances the feature expression through the depthwise separable convolution and ECA modules.

5. The method for combining bamboo slips based on twin networks as claimed in claim 4, characterized in that: After the residual branch extracts the features of the input image, it also enhances the feature expression through the depthwise separable convolution and ECA modules.

6. The method for combining bamboo slips based on twin networks as claimed in claim 1, characterized in that: The process of evaluating similarity in the SS module includes: First, the features processed by adaptive average pooling are input into a fully connected layer; Subsequently, nonlinear processing is added through the ReLU activation function and passed through the Dropout layer to prevent overfitting, where the Dropout layer is used to alleviate overfitting; Finally, the sigmoid function is used to map the output to the [0,1] interval to obtain the similarity between the edge contour curves of the bamboo slips on the two input images.

7. The method for combining bamboo slips based on twin networks as claimed in claim 1, characterized in that: The loss function of CGF-Siam network model training is: Where B represents the number of samples in the batch; y i Represents the target label of the i-th sample, y when it is correctly matched i =1, wrong match y i =0; p i The model predicts the probability that the i-th sample is a positive class; the parameter α is the balance factor, which is used to adjust the imbalance between positive and negative samples; γ is the adjustment factor, which is used to reduce the weight of easy-to-classify samples and increase the influence of difficult-to-classify samples.

8. The method for combining bamboo slips based on twin networks as claimed in claim 1, characterized in that: The backbone feature extraction network is ResNet50.

9. The method for combining bamboo slips based on twin networks as claimed in claim 1, characterized in that: In S2, when constructing the bamboo slip splicing dataset, data augmentation is performed on the spliced ​​bamboo slip edge contour curves including the upper contour curve and the lower contour curve.

10. The method for combining bamboo slips based on twin networks as claimed in claim 9, characterized in that: The data augmentation process includes: First, the joined curve pairs are numbered; the curve pairs are the upper contour curve and the lower contour curve of a pair of joined bamboo slips; Then, randomly select multiple non-repeating integers from the numbers to build a random index list; Then, according to the numbering sequence in the index table, the curve pairs with corresponding numbers are retrieved one by one; Then, the retrieved curve pairs are respectively intercepted at the middle position of the upper contour curve and the lower contour curve to obtain two sets of independent new concatenable curve segment pairs; Finally, two groups of new connectable curve segment pairs are randomly selected, and the upper contour curve and the lower contour curve are connected respectively to obtain new connectable upper contour curve and lower contour curve as augmented curve pairs.