An ancient character unrolling detection method based on a repeated feature pyramid network

CN122990723APending Publication Date: 2026-10-27EAST CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611181469.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0010]本发明的目的是针对现有技术的不足而设计的一种基于重复特征金字塔网络的古文字拓片检测方法,通过改进特征提取网络使检测模型具有较强的特征提取能力和特征融合能力,该方法在DarkNet-53基础上增加第六个卷积模块,并引入SE通道注意力模块和空间金字塔池化层,构建DarkNet-70特征提取网络和非对称双路结构的重复特征金字塔网络dual-FPN,通过带权重的融合操作对P3b、P4b、P5b、P6b四个尺度的特征图进行充分融合,利用ANMS非极大值抑制算法,在交并比筛选基础上增加重叠面积与候选框面积的比值作为筛选条件,构建包含CIoU损失和ANMS-Loss的联合损失函数,有效解决了古文字拓片检测中存在的背景噪声大导致检测精度低、小文字检测困难、重叠检测问题严重等技术问题

Benefits of technology

[0046]本发明与现有技术相比具有以下有益的技术效果和显著的技术进步:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990723A_ABST
    Figure CN122990723A_ABST
Patent Text Reader

Abstract

The application discloses an ancient character rubbing detection method based on a repeated feature pyramid network, and has the characteristics that the method comprises the following steps: a sixth convolution module is added on the basis of DarkNet-53, and an SE channel attention module and a spatial pyramid pooling layer are introduced to construct a DarkNet-70 feature extraction network; a repeated feature pyramid network dual-FPN with an asymmetric dual-path structure is constructed, and feature maps are fused through a weighted fusion operation; an ANMS non-maximum suppression algorithm is used, and the ratio of the overlapping area to the area of a candidate frame is added as a screening condition on the basis of the intersection-over-union ratio screening; and a combined loss function comprising a CIoU loss and an ANMS-Loss is constructed. Compared with the prior art, the application has the advantages of high detection speed and high precision, effectively solves the problems of large background noise, small character detection difficulty and overlapping detection in ancient character rubbing detection, and verification proves that the detection speed reaches the millisecond level, so that the application can be widely applied to the fields of archaeological excavation and ancient character digitization, and has a wide market application prospect and important social and cultural value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and target detection technology, specifically to a method for detecting ancient Chinese rubbings based on a repeating feature pyramid network. Background Technology

[0002] In recent years, object detection technology has emerged, with deep neural networks (DNNs) demonstrating outstanding performance in this task. DNNs can extract features from different targets, enabling accurate and rapid detection. Object detection algorithms have already achieved significant results in areas such as face detection, vehicle recognition, and autonomous driving. With the rapid development of deep learning, some researchers have proposed methods for highly accurate detection of modern text, applying deep learning to this field. Compared to modern text, ancient texts are more complex, exhibiting variations in character size, writing direction, and character categories, all of which increase the difficulty of ancient text detection and recognition. Current research primarily focuses on single-character recognition; there is limited literature on the detection and recognition of ancient text rubbings.

[0003] Common feature extraction networks include ResNet, VGG, and DarkNet, among which DarkNet-53 is widely used in YOLO series object detection models due to its strong feature extraction capabilities. Object detection algorithms are mainly divided into two-stage and single-stage detection models. Two-stage detection models, represented by Faster R-CNN, first generate candidate regions and then perform classification and regression, achieving high detection accuracy but slow speed. Single-stage detection models, represented by YOLO and SSD, directly obtain detection results through convolution calculations, offering fast detection speed but relatively low accuracy. To address the multi-scale object detection problem, Lin et al. proposed the Feature Pyramid Network (FPN), which achieves multi-scale detection by fusing feature maps of different scales. Subsequently, Liu et al. proposed the Path Aggregation Network (PANet), adding top-down channels to FPN to enhance feature fusion capabilities. Tan et al. proposed BiFPN (Bi-Directional Feature Pyramid Network), introducing a weighted feature fusion method, allowing the contribution of different feature maps to be learned as parameters.

[0004] However, when the existing target detection technology is directly applied to the detection of ancient script rubbings, the following problems and drawbacks exist:

[0005] 1) Ancient inscription rubbings, after hundreds or even thousands of years of underground corrosion and wear, have extremely high background noise, making it difficult to distinguish the text from the background. The characters in the rubbings vary in size, with many small characters, especially in rubbings of stone inscriptions from the Wei, Jin, and Northern and Southern Dynasties, where the small character phenomenon is severe, greatly increasing the difficulty of character detection. Existing detection models struggle to accurately extract character features, easily misidentifying background as text, text as background, or missing text during the detection process, resulting in low detection accuracy.

[0006] 2) Significant differences in character size are found in ancient rubbings, with a large number of small characters, especially in rubbings of stone inscriptions from the Wei, Jin, and Northern and Southern Dynasties. The phenomenon of small characters is extremely serious, and for some structurally complex characters, it is very easy to misdetect a part of it as an independent character. The multi-scale feature fusion capability of existing feature pyramid networks is insufficient to effectively detect such small characters, resulting in a large number of missed detections.

[0007] 3) For ancient characters with complex structures, different parts (such as radicals) are easily misdetected as independent characters, resulting in overlapping detection problems. Existing non-maximum suppression (NMS) algorithms cannot correctly preserve large prediction boxes and suppress small prediction boxes when processing such overlapping boxes. Even adjusting the suppression threshold is difficult to completely solve this problem.

[0008] 4) The loss function of existing target detection models is mainly designed for general targets and lacks a special loss term for the overlap problem in ancient script detection. This makes it impossible to effectively punish the error caused by overlap detection, which affects the further improvement of detection accuracy.

[0009] In summary, existing technologies for detecting ancient Chinese character rubbings suffer from several technical problems, including high background noise leading to low detection accuracy, difficulty in detecting small characters, and severe overlap detection issues. Therefore, there is an urgent need for an ancient Chinese character detection method that is tailored to the characteristics of ancient Chinese character rubbings, possesses stronger feature extraction and fusion capabilities, and can effectively solve the overlap detection problem. Summary of the Invention

[0010] The purpose of this invention is to address the shortcomings of existing technologies by designing a method for detecting ancient Chinese rubbings based on a repeating feature pyramid network. This method improves the feature extraction network, giving the detection model stronger feature extraction and fusion capabilities. It adds a sixth convolutional module to DarkNet-53, introduces an SE channel attention module and a spatial pyramid pooling layer, constructs a DarkNet-70 feature extraction network and an asymmetric dual-path repeating feature pyramid network (dual-FPN), and uses weighted fusion operations to optimize the P... 3b P 4b P5b P 6b Feature maps at four scales are fully fused, and the ANMS non-maximum suppression algorithm is used. Based on the intersection-union ratio (CIU) filtering, the ratio of overlapping area to candidate box area is added as a filtering condition. A joint loss function including CIoU loss and ANMS-Loss is constructed, effectively solving technical problems in ancient character rubbing detection such as low detection accuracy due to high background noise, difficulty in detecting small characters, and serious overlap detection issues. This invention features fast detection speed and high accuracy, with broad market application prospects and significant socio-cultural value. It is particularly suitable for the automatic detection and localization of characters in ancient historical materials such as Shang and Zhou bronze inscriptions and Wei, Jin, and Northern and Southern Dynasties stone inscriptions. It can assist ancient character researchers in quickly completing the annotation of rubbings. On the Shang and Zhou bronze inscriptions and Wei, Jin, and Northern and Southern Dynasties stone inscription rubbing datasets, the mAP@0.5:0.95 reaches 62.8%, with a detection speed in milliseconds. It can be widely applied in archaeological excavation, ancient character digitization, and other fields.

[0011] The specific technical solution to achieve the purpose of this invention is: a method for detecting ancient character rubbings based on a repeating feature pyramid network, characterized by employing a feature extraction network and a repeating feature pyramid network, utilizing a dual-screening non-maximum suppression algorithm and non-maximum suppression loss to achieve the detection of ancient character rubbings. The specific steps include:

[0012] Step 1: Construct a feature extraction network

[0013] A DarkNet-70 feature extraction network was constructed by adding a sixth convolutional module to the DarkNet-53 feature extraction network and adding an SE network module after each convolutional module. The sixth convolutional module contains a spatial pyramid pooling layer.

[0014] Step 2: Construct a repeating feature pyramid network

[0015] Based on the PANet and BiFPN network structures, a dual-FPN repeating feature pyramid network with an asymmetric dual-path feature fusion structure is constructed. Feature maps of four scales are extracted from the six convolutional modules of the Dark Net-70 feature extraction network. Multi-scale feature fusion is performed through weighted fusion operations to generate three detection heads that output feature maps of three scales.

[0016] Step 3: Construct a dual-screening nonmaximum suppression algorithm

[0017] A method is proposed to filter candidate boxes by using the intersection-union ratio between two candidate boxes and adding the ratio of the overlap area to the area of ​​the candidate box as a filtering condition. This method constructs a double-filtering nonmaximum suppression algorithm (ANMS) to double-filter candidate boxes and retain the correct large predicted boxes.

[0018] Step 4: Construction of the joint loss function

[0019] Construct a joint loss function L that includes the complete intersection-union ratio (CIoU) loss and the non-maximum suppression loss (ANMS-Loss), where the non-maximum suppression loss (ANMS-Loss) calculates the loss value based on the ratio of the overlap area between the target box and the predicted box.

[0020] Step 5: Output of test results

[0021] The ancient characters rubbing images to be detected are input into a detection model constructed by DarkNet-70 feature extraction network and dual-FPN repeating feature pyramid network. The model calculates and filters the data using the ANMS algorithm, and outputs the detection results of the ancient characters' positions on the rubbings.

[0022] The sixth convolutional module in step one includes, in sequence: a 3×3 convolutional layer with a stride of 2, a spatial pyramid pooling layer, a 1×1 convolutional layer, four sets of residual structures, and an SE layer. Each set of residual structures is composed of a 1×1 convolutional layer and a 3×3 convolutional layer connected in sequence.

[0023] The spatial pyramid pooling layer in step one is composed of parallel maximum pooling layers with three convolutional kernel sizes of 5×5, 9×9, and 13×13, and includes skip connections.

[0024] The SE network module in step one includes a compression operation and an activation operation. The compression operation transforms each feature map into a scalar with a global receptive field. The activation operation weights each compressed scalar and multiplies the weights output by the activation operation with the input feature map, thereby suppressing feature maps with lower weights.

[0025] The DarkNet-70 feature extraction network in step one includes, in sequence, the first to the sixth convolutional modules, undergoing a total of six downsampling operations; the input image size of the DarkNet-70 feature extraction network is 832×832 pixels; the output feature map sizes of the DarkNet-70 feature extraction network are, in sequence, 832×832, 416×416, 208×208, 104×104, 52×52, 26×26, and 13×13.

[0026] The asymmetric dual-path feature fusion structure in step two is as follows: the left structure starts from P 6b We begin using upsampling for bottom-up feature transfer; the right-hand structure starts from P. 5b We begin using upsampling for bottom-up feature propagation, with the left-side structure starting at one more P position than the right-side structure. 6b The convolutional module.

[0027] In step two, the three detection heads output feature maps of three different scales, which are calculated by the following formulas:

[0028] y1 = P3 = W 3b × P 3b + W 3l × P 3l + W 3r × P 3r ;

[0029] y2 = P4 = W 4b × P 4b + W 4l × P 4l + W 4r × P 4r + W P3 × P3;

[0030] y3 = P5 = W 5b × P 5b + W 5l × P 5l + W P4 × P4 .

[0031] Where y1, y2, and y3 are three detection heads; W is a learnable weight parameter; P 3b P 4b P 5b P 6b These are the four scale feature maps output by DarkNet-70; P 3l P 4l P 5l This is the feature map at the corresponding scale after the left-side structure is fused; P 3r P 4r This is the feature map at the corresponding scale after the right-side structure is fused.

[0032] The specific process for constructing the dual-screening nonmaximum suppression algorithm ANMS in step three is as follows:

[0033] 3-1: Input candidate box set B={b1,…,b N Candidate box score set S={s1,…,s N Non-maximum suppression threshold N t and the overlap area suppression threshold N S ;

[0034] 3-2: Initialize the result set D to be an empty set;

[0035] 3-3: Select the highest score m from the candidate box score set S, and select the candidate box b corresponding to m.m Add b to result set D and remove b from candidate box set B. m ;

[0036] 3-4: Calculate the current highest-scoring candidate box b m Compared with other candidate boxes b in candidate box set B i The intersection-union ratio between iou(b) m , b i ), delete intersection-union ratios greater than or equal to the threshold N. t The candidate box;

[0037] 3-5: Calculate the current highest-scoring candidate box b m Compared with other candidate boxes b in candidate box set B i The overlapping area between inter(b) m , b i ) and candidate box b i Area S i The ratio inter(b) m , b i ) / S i Delete the value whose ratio is greater than or equal to the given threshold N. S The candidate box;

[0038] 3-6: Repeat steps 3-3 to 3-5 until the candidate box set B is empty;

[0039] 3-7: Output result set D and corresponding candidate box score set S.

[0040] The calculation logic for the non-maximum suppression loss (ANMS-Loss) in step four is as follows: when the target box b t With prediction box b i The overlapping area inter(b) t , b i ) and the area S of the target box t The ratio inter(b) t , b i ) / S t Greater than or equal to a given threshold N S At that time, ANMS-Loss is 0;

[0041] When inter(b) t , b i ) / S t Less than threshold N S , and inter(b t , b i ) / S i Less than or equal to threshold N S At that time, ANMS-Loss is 0;

[0042] When inter(b) t , b i ) / S t Less than threshold N S , and inter(b t , b i ) / S i When the value is greater than the threshold N_S, the ANMS-Loss is inter(b t , b i ) / S i - N S .

[0043] The joint loss function L in step four is expressed by the following formula:

[0044] L = L_CIoU + L_ANMS.

[0045] Where L_CIoU is the CIoU loss function; L_ANMS is the ANMS-Loss nonmaximum suppression loss function.

[0046] Compared with the prior art, the present invention has the following beneficial technical effects and significant technical progress:

[0047] 1) Significantly Enhanced Feature Extraction Capability: This invention constructs the DarkNet-70 feature extraction network, adding a sixth convolutional module and introducing a spatial pyramid pooling layer and an SE channel attention module to the original DarkNet-53, significantly enhancing the network's feature extraction capability. The spatial pyramid pooling layer extracts multi-scale features through parallel pooling kernels of three different scales: 5×5, 9×9, and 13×13. The SE module suppresses useless features through a channel attention mechanism, effectively addressing the problem of high background noise and difficulty in distinguishing text from background in ancient rubbings, thus reducing false positive and false negative rates.

[0048] 2) Effectively solves the problem of small character detection: The Dual-FPN network proposed in this invention adopts an asymmetric dual-path feature fusion structure. Through weighted fusion operations, it fully combines feature map information of different scales. The left structure passes upward from P6 and the right structure passes upward from P5, so that shallow position information and deep semantic information are fully integrated, which effectively improves the detection capability of small characters and solves the problem of difficult detection of small characters in ancient rubbings.

[0049] 3) Effectively solves the overlap detection problem: The ANMS nonmaximum suppression algorithm proposed in this invention innovatively adds the ratio of the overlap area to the candidate box area as a screening condition in addition to the traditional cross-union ratio screening condition. It can correctly retain the complete large prediction box and suppress the erroneous small prediction box, effectively solving the overlap detection problem in ancient script detection where structurally complex characters are split into multiple independent targets.

[0050] 4) Further improve detection accuracy: The ANMS-Loss non-maximum suppression loss term proposed in this invention applies an additional position loss to the erroneous predicted boxes that are not suppressed by NMS during the training process, so that the gradient decreases in the expected direction. Combined with CIoU loss, it further improves the accuracy and robustness of the detection model.

[0051] 5) Fast detection speed and strong practicality: On the datasets of Shang and Zhou bronze inscriptions and Wei, Jin and Northern and Southern Dynasties stone inscriptions, the detection model of this invention achieves an mAP@0.5:0.95 index of 62.8% and an mAP@0.5 index of 96.1%, which are significantly improved compared with the existing YOLOv3 model. Moreover, the detection speed reaches the millisecond level, which can effectively improve the efficiency and accuracy of ancient script research and has important practical application value.

[0052] 6) Broad Industrial Application Prospects: The ancient character rubbing detection method provided by this invention can be widely applied in fields such as archaeological excavation, digitization of historical documents, and construction of ancient character databases. In the field of archaeological research, it can assist archaeologists in quickly completing the sorting and annotation of unearthed text materials, greatly improving work efficiency; in the field of ancient character digitization, it can provide technical support for the digital preservation and retrieval of ancient characters such as bronze inscriptions, stone inscriptions, and oracle bone inscriptions.

[0053] In the field of cultural relic protection, it can provide a reference for the restoration of text on damaged rubbings; in the field of history education, it can provide automated tools for the development and display of ancient script teaching resources.

[0054] 7) This invention has fast detection speed and high accuracy, and has broad market application prospects and important social and cultural value. Attached Figure Description

[0055] Figure 1 This is a schematic diagram of the detection model structure constructed in this invention;

[0056] Figure 2 This is a schematic diagram of the structure of a spatial pyramid pooling layer;

[0057] Figure 3 This is a schematic diagram of the SE network module.

[0058] Figure 4 This is a schematic diagram of a pyramid network structure with repeating features. Detailed Implementation

[0059] The present invention specifically includes the following steps:

[0060] Step 1: Construct the feature extraction network DarkNet-70

[0061] Based on the DarkNet-53 feature extraction network, a spatial pyramid pooling layer is constructed. The structure of the DarkNet-53 feature extraction network is detailed in Table 1 below.

[0062] Table 1 DarkNet-70 Network Structure

[0063]

[0064] The DarkNet-70 feature extraction network of this invention also adds a spatial pyramid pooling layer.

[0065] See Figure 1 The DarkNet-70 feature extraction network of this invention also adds a Spatial Pyramid Pooling (SPP) layer. This SPP layer consists of three max-pooling layers with kernel sizes of 5×5, 9×9, and 13×13, along with a skip connection. In the max-pooling operation used by the SPP layer, the largest kernel size is 13×13. Extensive experimental studies have shown that the SPP layer performs best when the feature map size is also 13×13 or close to it, allowing the network to better fuse different features. Since the image size becomes 1 / 64 after six downsampling passes, the input image size should be 832×832.

[0066] See Figure 2 This invention adds an SE (Squeeze-and-Excitation) network module to the DarkNet-70 network structure. This SE network module is mainly used to learn the correlation between feature maps and suppress useless features in the feature maps.

[0067] The SE network module's structure mainly consists of two operations: compression and excitation. Compression and excitation are two consecutive operations, with excitation built upon compression. Compression transforms each feature map into a scalar, which to some extent possesses a global receptive field. Excitation weights each compressed scalar, representing the importance of the feature map. The weights output by excitation are multiplied by the input feature map, thereby suppressing feature maps with lower weights. The SE network module belongs to the category of channel attention mechanisms. In the DarkNet-70 network, there are six SE modules, located after each convolutional module and before each downsampling operation.

[0068] Step 2: Construct a Dual-FPN network for repeating feature pyramids

[0069] Based on the PANet and BiFPN network structures, a dual-Feature Pyramid Network (dual-FPN) is proposed to address the issues of small characters and false detections in ancient character detection, and to better integrate positional information from shallow feature maps.

[0070] See Figure 3 The feature extraction network provides feature maps after six downsampling (Up), and dual-FPN pulls P... 3b P 4b P 5b P 6b The feature maps of the four convolutional modules are fused. In the diagram, the green arrows from top to bottom represent the feature extraction process; the blue arrows from bottom to top represent the upward propagation of the feature maps, during which weighted fusion operations are used to continuously fuse feature map information of the same scale in the feature extraction network; the red arrows from top to bottom represent the downward propagation of the feature maps, during which the feature map information flowing from the blue and green arrows is continuously fused.

[0071] The left and right structures of the repeating feature pyramid network are asymmetrical. In the left structure, the blue arrows indicate that upsampling is used for upward propagation starting from P6. In the right structure, the blue arrows indicate that upsampling starts from P5. The left structure starts with an additional convolutional module P6 compared to the right. If the right structure also starts from P6, then the left and right structures are symmetrical. In this case, the feature maps on both sides will undergo the same convolutional calculations, but the parameters in the symmetrical convolutional modules will be different. Figure 4 As shown, the detection network head has y1, y2, and y3, which are used to detect three sets of feature maps at different scales. The feature map fed into the detection head network is obtained by weighted addition of the feature maps on the left and right sides, as shown in the following formula (1):

[0072] y1 = P3 = W 3b × P 3b + W 3l × P 3l + W 3r × P 3r ;

[0073] y2 = P4 = W 4b × P 4b + W 4l × P 4l + W4r × P 4r + W P3 × P3; (1)

[0074] y3 = P5 = W 5b × P 5b + W 5l × P 5l + W P4 × P4.

[0075] Here, y1, y2, and y3 are three detection heads, W represents the learnable weight parameters, and y1, y2, and y3 correspond to the feature maps after the fusion of the three scales P3, P4, and P5 on the left and right sides, respectively.

[0076] Step 3: Construct the dual-screening nonmaximum suppression algorithm ANMS

[0077] An improved version of the existing non-maximum suppression algorithm, the Ancient Non-Maximum Suppression (ANMS) algorithm, is constructed to provide a dual-screening solution suitable for detecting ancient Chinese rubbings. The pseudocode of the ANMS algorithm is shown in Table 2 below.

[0078] Table 2. Pseudocode for the Double Screening Nonmaximum Suppression Algorithm

[0079]

[0080] The improved ANMS, in addition to using the intersection-union ratio (IUU) between two candidate boxes to filter them, also adds the overlap area of ​​the two candidate boxes and... area The ratio is used as a candidate box filtering criterion to retain the correct large predicted boxes.

[0081] Step 4: Construct an improved loss function

[0082] Construct a joint loss function that includes CIoU loss and ANMS-Loss, wherein the ANMS-Loss loss function is defined as follows (2):

[0083] (2).

[0084] in, Represents the target box. Indicates the prediction box. Represents the target box With prediction box The overlapping area between them This represents the area of ​​the target bounding box. This represents the area of ​​the prediction box. It is the given ANMS-Loss threshold.

[0085] The calculation logic is shown in equation (3) below:

[0086] (3).

[0087] Where, IoU is the intersection-union ratio of the predicted bounding box and the target bounding box, which is the ratio of the intersection area to the union area of ​​the two bounding boxes, and its value ranges from [0, 1]; b is the center point coordinate of the predicted bounding box (usually represented as (x, y); bgt is the center point coordinate of the target bounding box (usually represented as (xgt, ygt)); ρ2(b, bgt) is the square of the Euclidean distance between the center point bb of the predicted bounding box and the center point bgt of the target bounding box; c is the diagonal length of the smallest bounding rectangle that can simultaneously contain the predicted bounding box and the target bounding box; α is a weighting coefficient used to balance the influence of the overlap area term and the aspect ratio consistency term, and is a non-negative value; ν is the aspect ratio consistency parameter used to measure the degree of difference between the predicted bounding box and the target bounding box in terms of aspect ratio; wgt is the width of the target bounding box (unit: pixels); hgt is the height of the target bounding box (unit: pixels); w is the width of the predicted bounding box (unit: pixels); h is the height of the predicted bounding box (unit: pixels).

[0088] The CIoU loss is added to the ANMS-Loss to form the total loss function, which is shown in equation (4) below:

[0089] (4).

[0090] Step 5: Detection of Ancient Character Rubbings

[0091] See Figure 4 The ancient character rubbing image to be detected is input into the detection model constructed by the DarkNet-70 feature extraction network described in step one and the dual-FPN repeating feature pyramid network described in step two. The model calculates and outputs a set of candidate boxes and corresponding scores. Then, the ANMS algorithm described in step three is used to filter the candidate boxes, and finally the position detection result of the ancient character on the rubbing is output.

[0092] The present invention will be further described in detail below with reference to embodiments, but the implementation of the present invention is not limited thereto.

[0093] Example 1

[0094] This embodiment describes the specific construction method of the DarkNet-70 feature extraction network as follows:

[0095] The input image size of DarkNet-70 is 832×832 pixels. As shown in Table 1 above, the first convolutional module of DarkNet-70 is a convolutional layer (32 filters, 3×3 convolutional kernels), which outputs a feature map of 832×832.

[0096] The second convolutional module consists of a convolutional layer (64 filters, 3×3 kernels, stride 2) that outputs a 416×416 feature map; then it is connected in sequence to a convolutional layer (32 filters, 1×1 kernel), a convolutional layer (64 filters, 3×3 kernels), a residual layer, and an SE layer (64 filters).

[0097] The third convolutional module consists of a convolutional layer (128 filters, 3×3 kernels, stride 2) that outputs a 208×208 feature map. Then, the following operations are repeated twice: a convolutional layer (64 filters, 1×1 kernel) and a convolutional layer (128 filters, 3×3 kernels). Finally, the residual layer and the SE layer (128 filters) are connected.

[0098] The fourth convolutional module consists of a convolutional layer (256 filters, 3×3 kernels, stride 2) that outputs a 104×104 feature map. Then, the following operations are repeated 8 times: convolutional layer (128 filters, 1×1 kernel), convolutional layer (256 filters, 3×3 kernels); then, the residual layer and the SE layer (256 filters) are connected.

[0099] The fifth convolutional module consists of a convolutional layer (filter 512, kernel 3×3, stride 2) that outputs a 52×52 feature map. Then, the following operations are repeated 8 times: convolutional layer (filter 256, kernel 1×1), convolutional layer (filter 512, kernel 3×3); then, the residual layer and the SE layer (filter 512) are connected.

[0100] The sixth convolutional module consists of a convolutional layer (1024 filters, 3×3 kernels, stride 2), outputting a 26×26 feature map; then repeating the following operations 8 times: convolutional layer (512 filters, 1×1 kernel), convolutional layer (1024 filters, 3×3 kernels); followed by a residual layer and an SE layer (1024 filters); then convolutional layer (1024 filters, 3×3 kernels, stride 2), outputting a 13×13 feature map; spatial pyramid pooling layers (1024 filters, 5×5, 9×9, 13×13 pooling kernels); convolutional layer (512 filters, 1×1 kernel); repeating the following operations 4 times: convolutional layer (1024 filters, 3×3 kernels); residual layer; SE layer (1024 filters).

[0101] By adding a sixth convolutional module and introducing an SE module and a spatial pyramid pooling layer to the DarkNet-53, the DarkNet-70 feature extraction network was constructed. The number of network layers increased to 70, the number of parameters increased moderately, but the feature extraction capability was significantly enhanced and improved.

[0102] Example 2

[0103] This embodiment demonstrates feature fusion using the Dual-FPN (Dual Feature Pyramid Network). The specific steps are as follows:

[0104] Step S1: Pull P from the six convolutional modules of the DarkNet-70 feature extraction network 3b (104×104), P 4b (52×52), P 5b (26×26), P 6b (13×13) Feature maps at four scales;

[0105] Step S2: The left-side structure from P 6b Initially, the 13×13 feature map was upsampled to 26×26, and compared with P... 5b Perform weighted addition and fusion to obtain P. 5l Continue upsampling to 52×52, and compare with P 4b Perform weighted addition and fusion to obtain P. 4l Continue upsampling to 104×104, and compare with P 3b Perform weighted addition and fusion to obtain P. 3l ;

[0106] Step S3: The right-side structure from P 5b Initially, the 26×26 feature map was upsampled to 52×52, and compared with P... 4b and P 4l Perform weighted addition and fusion to obtain P. 4r Continue upsampling to 104×104, and compare with P 3b P 3l

[0107] Perform weighted addition and fusion to obtain P. 3r ;

[0108] Step S4: The top-down transfer channel from P 3r It begins to pass information downwards, fusing high-level semantic information downwards;

[0109] Step S5: Finally, the three detection heads y1, y2, and y3 output feature maps at three scales as follows:

[0110] y1 = W 3b ×P3b + W 3l ×P 3l + W 3r ×P 3r ;

[0111] y2 = W 4b ×P 4b + W 4l ×P 4l + W 4r ×P 4r + W P3 ×P3;

[0112] y3 = W 5b ×P 5b + W 5l ×P 5l + W P4 ×P4.

[0113] Through the aforementioned asymmetric dual-path fusion structure, feature information at different scales is fully fused, and the positional information of small characters is effectively preserved.

[0114] Example 3

[0115] This embodiment demonstrates the application of the ANMS non-maximum suppression algorithm in the post-processing of ancient character detection. Assume that after prediction by the detection model, N candidate boxes and their corresponding confidence scores are obtained, and a non-maximum suppression threshold N is set. t =0.5, and the improved overlap area suppression threshold N_S=0.7.

[0116] The specific execution of the ANMS nonmaximum suppression algorithm is as follows:

[0117] 1) Select the highest score m from the candidate box score set, and set the corresponding candidate box b. m Add to the result set;

[0118] 2) For the remaining candidate box b i Calculate b m With b i The intersection and union ratio of iou(b) m , b i If IoU ≥ 0.5, then delete b. i ;

[0119] 3) For candidate boxes b that were not eliminated due to the intersection and union criteria i Calculate b m With b i The overlapping area and b i The ratio of areas; if the ratio is ≥0.7, then delete b. i ;

[0120] 4) Repeat the above process until all candidate boxes have been processed.

[0121] By using the above dual screening conditions, the problem that the traditional NMS algorithm cannot correctly retain large prediction boxes in ancient character detection can be effectively solved.

[0122] Example 4

[0123] This example demonstrates the specific application of the ANMS-Loss loss function in the model training process. During the training phase, the ANMS-Loss threshold N_S is set to 0.7 for each target box b. t and prediction box b i The specific applications of the ANMS-Loss loss function in training are as follows:

[0124] Scenario 1: If inter(b) t , b i ) / S t ≥ 0.7 indicates that the target box is mostly covered by the predicted box, and ANMS-Loss=0;

[0125] Scenario 2: If inter(b) t , b i ) / S t < 0.7, and inter(b t , b i ) / S i ≤ 0.7 indicates that although the predicted bounding box partially covers the target, there is no serious overlap, and ANMS-Loss=0;

[0126] Scenario 3: If inter(b) t , b i ) / S t < 0.7, and inter(b t , b i ) / S i A value > 0.7 indicates that the predicted bounding box and the target bounding box have significant overlap, but the target is not effectively covered. ANMS-Loss = inter(b t , b i ) / S i - 0.7.

[0127] The total loss function L = L_CIoU + L_ANMS optimizes the network parameters through backpropagation, enabling the model to actively reduce the occurrence of overlapping detections during training.

[0128] Example 5

[0129] The specific process for detecting ancient script rubbings using this invention is as follows in this embodiment:

[0130] 1) Input the 832×832 pixel ancient character rubbing image into the DarkNet-70 feature extraction network. After six convolutional modules, convolution, residual, SE attention, spatial pyramid pooling and other operations are performed to output multi-scale feature maps.

[0131] 2) P output from DarkNet-70 3b P 4b P 5b P 6b The feature maps are input into the Dual-FPN network, and after asymmetric dual-path fusion, the three detector heads y1, y2, and y3 output feature maps of three different scales, respectively.

[0132] 3) Merge the outputs of the three detectors to obtain the candidate box set B and the corresponding score set S;

[0133] 4) The candidate boxes are double-filtered using the ANMS algorithm to obtain the final detection results;

[0134] 5) Output the position coordinates and confidence score of each detected character to complete the automatic detection of ancient character rubbings.

[0135] Through the above process, ancient script researchers only need to input the rubbing image into the system to obtain the location information of all characters in milliseconds, without having to manually annotate each character.

[0136] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting ancient Chinese rubbings based on a repeating feature pyramid network, characterized in that, Features include: The method involves extracting a network and a repeating feature pyramid network, and using a dual-screening non-maximum suppression algorithm and non-maximum suppression loss to detect ancient Chinese rubbings. The specific steps include: Step 1: Construct a feature extraction network A DarkNet-70 feature extraction network is constructed by adding a sixth convolutional module to the DarkNet-53 feature extraction network and adding an SE network module after each convolutional module. The sixth convolutional module contains a spatial pyramid pooling layer. Step 2: Construct a repeating feature pyramid network Based on the PANet and BiFPN network structures, a dual-FPN repeating feature pyramid network with an asymmetric dual-path feature fusion structure is constructed. Feature maps of four scales are extracted from the six convolutional modules of the Dark Net-70 feature extraction network. Multi-scale feature fusion is performed through weighted fusion operations to generate three detection heads that output feature maps of three different scales. Step 3: Construct a dual-screening nonmaximum suppression algorithm A method is proposed to filter candidate boxes by using the intersection-union ratio between two candidate boxes and adding the ratio of the overlap area to the area of ​​the candidate box as a filtering condition. This method constructs a double-filtering non-maximum suppression algorithm (ANMS) to double-filter candidate boxes and retain the correct large predicted boxes. Step 4: Construction of the joint loss function Construct a joint loss function L that includes the complete intersection-union ratio (CIoU) loss and the non-maximum suppression loss (ANMS-Loss), where the non-maximum suppression loss (ANMS-Loss) calculates the loss value based on the ratio of the overlap area between the target box and the predicted box. Step 5: Output of test results The ancient characters rubbing images to be detected are input into a detection model constructed by DarkNet-70 feature extraction network and dual-FPN repeating feature pyramid network. The model calculates and filters the data using the ANMS algorithm, and outputs the detection results of the ancient characters' positions on the rubbings.

2. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, The sixth convolutional module in step one includes, in sequence: a 3×3 convolutional layer with a stride of 2, a spatial pyramid pooling layer, a 1×1 convolutional layer, four sets of residual structures, and an SE layer. Each set of residual structures is composed of a 1×1 convolutional layer and a 3×3 convolutional layer connected in sequence.

3. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, The spatial pyramid pooling layer in step one is composed of parallel maximum pooling layers with three convolutional kernel sizes of 5×5, 9×9, and 13×13, and includes skip connections.

4. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, The SE network module in step one includes a compression operation and an activation operation. The compression operation transforms each feature map into a scalar with a global receptive field. The activation operation weights each compressed scalar and multiplies the weights output by the activation operation with the input feature map, thereby suppressing feature maps with lower weights.

5. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, The DarkNet-70 feature extraction network in step one includes, in sequence, the first to the sixth convolutional modules, undergoing a total of six downsampling operations; the input image size of the DarkNet-70 feature extraction network is 832×832 pixels; the output feature map sizes of the DarkNet-70 feature extraction network are, in sequence, 832×832, 416×416, 208×208, 104×104, 52×52, 26×26, and 13×13.

6. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, The asymmetric dual-path feature fusion structure in step two is as follows: the left structure starts from P 6b We begin using upsampling for bottom-up feature transfer; the right-hand structure starts from P. 5b We begin using upsampling for bottom-up feature propagation, with the left-side structure starting at one more P position than the right-side structure. 6b The convolutional module.

7. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, In step two, the three detection heads output feature maps of three different scales, which are calculated by the following formulas: y1 = P3 = W 3b × P 3b + In 3l × P 3l + In 3r × P 3r ; y2 = P4 = W 4b × P 4b + W 4l × P 4l + W 4r × P 4r + W P3 × P3 ; y3 = P5 = W 5b × P 5b + In 5l × P 5l + In P4 × P4; Where y1, y2, and y3 are three detection heads; W is a learnable weight parameter; P 3b P 4b P 5b P 6b These are the four scale feature maps output by DarkNet-70; P 3l P 4l P 5l This is the feature map at the corresponding scale after the left-side structure is fused; P 3r P 4r This is the feature map at the corresponding scale after the right-side structure is fused.

8. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, The specific process for constructing the dual-screening nonmaximum suppression algorithm ANMS in step three is as follows: 3-1: Input candidate box set B={b1,…,b N Candidate box score set S={s1,…,s N Non-maximum suppression threshold N t and the overlap area suppression threshold N S ; 3-2: Initialize the result set D to be an empty set; 3-3: Select the highest score m from the candidate box score set S, and select the candidate box b corresponding to m. m Add b to result set D and remove b from candidate box set B. m ; 3-4: Calculate the current highest-scoring candidate box b m Compared with other candidate boxes b in candidate box set B i The intersection-union ratio between iou(b) m ,b i ), delete intersection-union ratios greater than or equal to the threshold N. t The candidate box; 3-5: Calculate the current highest-scoring candidate box b m Compared with other candidate boxes b in candidate box set B i The overlapping area between inter(b) m , b i ) and candidate box b i Area S i The ratio inter(b) m , b i ) / S i Delete the value whose ratio is greater than or equal to the given threshold N. S The candidate box; 3-6: Repeat steps 3-3 to 3-5 until the candidate box set B is empty; 3-7: Output result set D and corresponding candidate box score set S.

9. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, The calculation logic for the non-maximum suppression loss (ANMS-Loss) in step four is as follows: when the target box b t With prediction box b i The overlapping area inter(b) t , b i ) and the area S of the target box t The ratio inter(b) t , b i ) / S t Greater than or equal to a given threshold N S At that time, ANMS-Loss is 0; When inter(b) t , b i ) / S t Less than threshold N S , and inter(b t , b i ) / S i Less than or equal to threshold N S At that time, ANMS-Loss is 0; When inter(b) t , b i ) / S t Less than threshold N S , and inter(b t , b i ) / S i When the value is greater than the threshold N_S, the ANMS-Loss is inter(b t , b i ) / S i - N S .

10. The method for detecting ancient Chinese rubbings based on a repeating feature pyramid network according to claim 1, characterized in that, The joint loss function L in step four is expressed by the following formula: L = L_CIoU + L_ANMS; Where L_CIoU is the CIoU loss function; L_ANMS is the ANMS-Loss nonmaximum suppression loss function.