Lightweight mural image target detection method based on fine-grained features
By introducing dynamic feature adaptation module and weight adaptation module into the target detection network, the problem of low target detection accuracy and real-time performance on the mural data set is solved, and efficient target detection on the mural data set is achieved, which improves detection performance and speed.
Patent Information
- Application Number
- CN202411371256.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-24
AI Technical Summary
The existing object detection methods show the problems of low accuracy and low real-time performance on the mural data set, making it difficult to perform effective object detection on the basis of taking into account both accuracy and speed.
By adopting a lightweight mural image object detection method based on fine-grained features, the network's mural data set is enhanced by constructing a dynamic feature adaptation module, an efficient weighted adaptive downsampling module and a dynamic fine-grained weight adaptive module. Adaptation ability and detection efficiency.
The accuracy and speed of the detection network are significantly improved on the mural data set, and can quickly perform accurate target detection and statistics in resource-constrained environments, improving detection performance.
Smart Images

Figure CN119180945A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of machine vision, and specifically designs a lightweight mural image target detection method based on fine-grained features. Background Art
[0002] Object detection is a very challenging task in the field of image processing, but many methods have achieved quite mature performance in conventional scenarios. Two-stage object detectors (such as RCNN, Fast RCNN, Faster RCNN) are known for their excellent accuracy. These models accurately locate and classify objects through two-step processing, which has a significant advantage in accuracy. In contrast, single-stage object detectors (SSD, FCOS, YOLO) are known for their efficient speed. They complete the location and classification of objects through a single process, which greatly improves the detection speed.
[0003] Both two-stage and single-stage target detection methods can demonstrate excellent detection performance in some common scenarios or datasets (such as COCO, VOC). However, when facing mural datasets, what we really face is degraded image features and complex and diverse background information. At the same time, when retrieving images in murals in real scenarios, we must consider not only the accuracy of the model but also the speed. From the above analysis, we know that the current target detection methods still have the problems of low accuracy and low real-time performance for mural datasets. Summary of the invention
[0004] In view of the problems of low accuracy and low real-time performance of current target detection methods for mural datasets, the present invention provides a lightweight mural image target detection method based on fine-grained features, which well balances the accuracy and speed of the detection network and is a method for efficient target detection for mural datasets.
[0005] The technical solution to achieve the purpose of the present invention is: a lightweight mural image target detection method based on fine-grained features, comprising the following steps:
[0006] S1. Collect mural datasets, perform data enhancement and segmentation;
[0007] S2. Construct a lightweight mural image object detection network based on fine-grained features:
[0008] S2.1 constructs a dynamic feature adaptation module to obtain local context information, including the following steps:
[0009] S2.1.1 The input features are subjected to two-dimensional average pooling through a convolution with a convolution kernel of 7:
[0010]
[0011] in, is a two-dimensional pooling operation, represents the input features, is the output feature of this stage;
[0012] S2.1.2 applies a convolution with a kernel of 1 to further refine the features; then adaptive global average pooling is performed on the processed features:
[0013]
[0014]
[0015] in, and represents adaptive global average pooling along the height and width directions, and It indicates the features obtained by verifying the adaptive global pooling in the vertical and horizontal directions;
[0016] S2.1.3 applies another convolution with a kernel of 1 to extract richer texture information, and generates an attention factor through a sigmoid function; finally, the attention factor is element-wise multiplied with the original feature map to scale the features according to their importance:
[0017]
[0018]
[0019] in, is the attention factor, represents element-by-element multiplication, is the final output;
[0020] S2.1.4 In order to capture key local information while learning broader contextual information, multi-scale feature extraction is performed on the original input features;
[0021] Use DWConv with a convolution kernel of 7 to obtain texture information:
[0022]
[0023] in, is the input feature of this stage, It is the feature map obtained after DWConv processing;
[0024] S2.1.5 The output features of DWConv are processed by two parallel convolutional layers with a convolution kernel of 1; the output features of one branch are activated by ReLU6 to enhance the nonlinear representation of the features, and then the features of the two branches are fused by element-by-element multiplication; finally, DWConv with a convolution kernel of 7 is applied again to capture multi-level context information;
[0025]
[0026] in, is the output feature map of the second stage;
[0027] S2.1.6 integrates the , And the original input features Combining multi-scale features:
[0028]
[0029] in, It is the feature map output after the dynamic feature adaptation module operates;
[0030] S2.2 constructs an efficient weighted adaptive downsampling module, including the following steps:
[0031] S2.2.1 Perform weight calculation and feature extraction on the input features at the same time: perform average pooling on the input tensor, and then use a standard convolution layer with a kernel size of 1 to generate a weight tensor; use a reordering operation to add a dimension of size 1 to ensure that each position in the feature map correctly receives the corresponding weight value. Next, use SoftMax for normalization to obtain the final weight factor:
[0032]
[0033] in, represents average pooling, represents a standard convolution with a kernel of 1, which is used to integrate information from different features; Represents a rearrangement operation used to increase the dimension;
[0034] S2.2.2 downsamples the input features, merges the information around each position into a more representative feature, and rearranges the dimensions to obtain:
[0035]
[0036]
[0037] in, represents a standard convolution operation with a kernel size of 3, is an intermediate variable used for feature extraction, Represents a reordering operation, Represents the optimized feature information;
[0038] S2.2.3 Weight information And the optimized features An element-wise multiplication is performed and then summed along the last dimension to obtain the final output of the EWAD stage:
[0039]
[0040] in, represents element-wise multiplication, is the final output, maintaining the same dimension as the input features;
[0041] S2.3 builds a dynamic fine-grained weight adaptation module to obtain global context information, including the following steps:
[0042] S2.3.1 uses convolution with a kernel of 1 to filter the input features, and divides the processed feature map into five parts according to the channel division; divides the surrounding information of the image target into three different levels: level 1, level 2, and level 3;
[0043] Among them, level 1 represents the fine-grained information in the image, level 3 represents the coarse-grained information, and level 2 is between level 1 and level 3; DWConv with kernel sizes of 3, 5, and 7 is applied to level 1, level 2, and level 3 respectively:
[0044]
[0045]
[0046] Among them, "split" refers to dividing the feature map along the channel dimension, and obtaining ( ) as the segmentation result, where ( ) correspond to the feature maps of level 1, level 2 and level 3 respectively;
[0047] S2.3.2 Use the efficient weighted adaptive downsampling module in step S2 to dynamically adjust the three fine-grained levels ( ) corresponding features The weights of ( ):
[0048]
[0049] S2.3.3 Calculation and , and , and The element-by-element product of , and then add the results to obtain the fine-grained weighting factor; the weighting factor and Perform element-by-element multiplication to generate the final result ;
[0050]
[0051] in, Represents element-wise multiplication;
[0052] S3. Perform pre-training on the public dataset MS COCO to obtain pre-training weights;
[0053] S4. Load the weights obtained on the mural dataset, input the image to be tested into the model to obtain the detection result, and generate the target detection image.
[0054] Furthermore, the step S3 includes the following sub-steps:
[0055] S3.1 uses the AdamW optimizer as the network optimizer, with an initial learning rate of 0.003, which increases linearly to 0.01 during training; the momentum parameter is set to 0.9, and the weight decay is set to 0.025; linear warm-up is performed in the first 5 epochs, and a total of 250 training epochs are performed;
[0056] The overall loss function used in S3.2 is:
[0057]
[0058] in, , Represent classification loss and regression loss respectively; A and B represent the proportion of different losses respectively;
[0059] S3.3 classification loss uses the BCE loss function, the specific formula is as follows:
[0060]
[0061] in, is the predicted probability value, is the actual label (0 or 1);
[0062] S3.4 Regression loss adopted and , the specific formula is as follows:
[0063]
[0064]
[0065]
[0066] Among them, y is the true value, It is the intersection-over-union ratio between the predicted box and the true box; is the prediction box With real box The Euclidean distance between the center points of It is the diagonal length of the minimum bounding box covering the predicted box and the true box; It is a measure of the consistency of aspect ratio; is a positive trade-off parameter.
[0067] Furthermore, the specific structure of the lightweight mural image object detection network based on fine-grained features is as follows:
[0068] 1) The backbone network uses a four-stage hierarchical structure. Each stage includes a Conv layer and a DFA module. The Conv layer consists of Conv2d, BatchNorm2d and SiLU, which are used to downsample the input features.
[0069] 2) The DFA module dynamically adjusts the network structure according to the input features to capture global and local features, thereby enhancing the network's ability to adapt to features. After each stage of processing, the spatial resolution of the input feature map is halved, while the number of channels remains unchanged.
[0070] 3) A DFGWA module is introduced at the end of the backbone network, which dynamically adjusts weights according to the fine-grained feature hierarchy of the image and filters redundant information to speed up network reasoning.
[0071] 4) The neck network is similar to the backbone network in structure, but it integrates the output features of all stages of the backbone network to alleviate the feature sparsity problem.
[0072] 5) The detection head adopts a decoupling design to improve detection performance.
[0073] Compared with the prior art, the present invention has the following significant advantages: for mural datasets, it has a good balance between the accuracy and speed of the detection network. 1) The DFA module is used to dynamically adjust features and update multi-scale local context information in real time; 2) The DFGWA module efficiently uses the fine-grained dynamics of background features to assign weights, thereby reducing redundant information. Through the present invention, targets in murals can be quickly and accurately detected and counted in a resource-constrained environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0075] Figure 1 The flowchart of the method described in the embodiment of the present invention is shown in FIG.
[0076] Figure 2 Schematic diagram of the lightweight mural image target detection network structure based on fine-grained features in the method described in the embodiment of the present invention.
[0077] Figure 3 Schematic diagram of the structure of the DFA module in the method described in the embodiment of the present invention.
[0078] Figure 4 It is a schematic diagram of the structure of the DFGWA module in the method described in the embodiment of the present invention.
[0079] Figure 5 It is a schematic diagram of the structure of the EWAD module in the method described in the embodiment of the present invention.
[0080] Figure 6 It is a detection effect diagram of the method described in the embodiment of the present invention. DETAILED DESCRIPTION
[0081] The specific embodiments of the present invention are further described below according to the accompanying drawings:
[0082] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0083] A lightweight mural image target detection method based on fine-grained features comprises the following steps:
[0084] Step 1: Collect mural data sets and perform data enhancement and division;
[0085] Step 2: Construct a lightweight mural image object detection network based on fine-grained features. The object detection network introduces a dynamic feature adaptation module (DFA Module) at each stage to enable the network to quickly adapt to complex features and update context information in real time. In order to improve the performance of small object detection, we designed a dynamic fine-grained weight adaptation module (DFGWA Module) to perform weighted learning on features, and introduced an efficient weighted adaptive downsampling module (EWADModule) to reduce redundant information and accelerate reasoning.
[0086] Step 3: Perform pre-training on the public dataset MS COCO to obtain pre-training weights.
[0087] Step 4: Load the pre-trained weights and fine-tune them on the mural dataset. Load the weights obtained on the mural dataset, input the image to be tested into the model to obtain the detection result, and generate the target detection image.
[0088] Step 1: Collect mural datasets, perform data enhancement and division:
[0089] Specifically, in this embodiment, a self-made data set is used, and the data set is enhanced and divided; specifically, the field collection is carried out in the Beiting Protectorate Museum in Xinjiang, and a total of 3016 mural images are collected. The mural data set has a large area, rich content, and diverse themes, including flying apsaras, donors, animals, inscriptions, bridges, musical instruments, pagodas, trees, and thousands of Buddhas. We selected 8 representative themes with large numbers, easy-to-identify pictures, and high attention as the targets of image detection. The specific categories mainly include: flying apsaras, inscriptions, donors, thousands of Buddhas, non-Buddhas, heavenly palace music, Buddhist disciples, and bodhisattvas. The image data of the data set is enhanced using white balance, gamma change, and mosaic methods, and finally a data set of 9048 murals is obtained. The data set is processed and divided into a training set, a validation set, and a test set in a ratio of 8:1:1, wherein the training set includes 7238 images, the test set includes 904 images, and the test set includes 906 images.
[0090] A lightweight mural image object detection network based on fine-grained features is constructed. The object detection network introduces a DFA module at each stage to enable the network to quickly adapt to complex features and update context information in real time. In order to improve the performance of small object detection, we design a dynamic fine-grained weight adaptation module to perform weighted learning on features, and introduce an efficient weighted adaptive downsampling module to reduce redundant information and accelerate reasoning.
[0091] Pre-training is performed on the public dataset MS COCO to obtain pre-training weights.
[0092] Load the pre-trained weights and fine-tune on the mural dataset.
[0093] Load the weights obtained on the mural dataset, input the image to be tested into the model to obtain the detection result, and generate the target detection image.
[0094] Step 2: Construct a lightweight mural image target detection network based on fine-grained features. The following steps are taken:
[0095] 1) Construct a dynamic feature adaptation module;
[0096] 2) Construct an efficient weighted adaptive downsampling module;
[0097] 3) Construct a dynamic fine-grained weight adaptation module;
[0098] 4) Construct a lightweight mural image target detection method based on fine-grained features. The specific structure diagram is as follows Figure 2 shown.
[0099] like Figure 3 As shown, constructing a DFA module to obtain local context information is mainly divided into the following steps:
[0100] 1) The input features are subjected to a 2D average pooling with a convolution kernel of 7 to reduce the spatial resolution while retaining the spatial information.
[0101]
[0102] in, is a two-dimensional pooling operation, represents the input features, is the output feature of this stage.
[0103] 2) Apply a convolution with kernel 1 to further refine the features. Then, perform adaptive global average pooling on the processed features to generate a more compact feature representation. Apply another convolution with kernel 1 to extract richer texture information, and generate attention factors through the sigmoid function. Finally, the attention factors are element-wise multiplied with the original feature map to scale the features according to their importance.
[0104]
[0105]
[0106] in, and represents adaptive global average pooling along the height and width directions, and It represents the features obtained by verifying the adaptive global pooling in the vertical and horizontal directions.
[0107] 3) Apply another convolution with kernel 1 to extract richer texture information and generate attention factors through sigmoid function. Finally, the attention factors are element-wise multiplied with the original feature map to scale the features according to their importance.
[0108]
[0109]
[0110] in, is the attention factor, represents element-by-element multiplication, is the final output.
[0111] 4) In order to capture key local information while learning broader contextual information, we perform multi-scale feature extraction on the original input features. First, DWConv with a convolution kernel of 7 is used to obtain more accurate texture information.
[0112]
[0113] in, is the input feature of this stage, It is the feature map obtained after DWConv processing.
[0114] 5) The output features of DWConv are processed through two parallel convolutional layers with a convolution kernel of 1. The output features of one branch are activated by ReLU6 to enhance the nonlinear representation of the features. Then, the features of the two branches are fused by element-by-element multiplication. Finally, DWConv with a convolution kernel of 7 is applied again to capture multi-level contextual information.
[0115]
[0116] in, is the output feature map of the second stage.
[0117] 6) We integrate through channel weighted fusion , And the original input features , thereby effectively combining multi-scale features and enhancing the ability of OD-DDA to understand image details and contextual information.
[0118]
[0119] in, It is the feature map output after the dynamic feature adaptation module is operated.
[0120] like Figure 5 As shown, building the EWAD module is mainly divided into the following steps:
[0121] 1) We perform weight calculation and feature extraction on the input features simultaneously. First, we average pool the input tensor and then generate the weight tensor using a standard convolutional layer with a kernel size of 1. To ensure that each position in the feature map correctly receives the corresponding weight value, we use a shuffle operation to add a dimension of size 1. Next, we use SoftMax to normalize to obtain the final weight factor.
[0122]
[0123] in, represents average pooling, Represents a standard convolution with a kernel of 1, which is used to integrate information from different features. Represents a shuffle operation to increase dimensionality.
[0124] 2) In order to utilize the weight information more efficiently, we downsample the input features and merge the information around each position into a more representative feature. Considering the element-by-element multiplication operation, we rearrange the dimensions of to obtain .
[0125]
[0126]
[0127] here, represents a standard convolution operation with a kernel size of 3, is an intermediate variable used for feature extraction, Represents a reordering operation, Represents the optimized feature information.
[0128] 3) We have weight information And the optimized features Element-wise multiplication is performed and then summed along the last dimension to obtain the final output of the EWAD stage.
[0129]
[0130] Here, among them, represents element-wise multiplication, and is the final output, maintaining the same dimension as the input features.
[0131] like Figure 4 As shown in the figure, building the DFGWA module to obtain global context information is mainly divided into the following steps:
[0132] 1) We filter the input features using convolution with a kernel of 1 to preliminarily reduce information redundancy to avoid excessive interference to subsequent operations. Next, we divide the processed feature map into 5 parts according to the channel partitioning. Specifically, we divide the surrounding information of the image target into three different levels: level 1, level 2, and level 3. Here, level 1 represents the fine-grained information in the image, level 3 represents the coarse-grained information, and level 2 is between level 1 and level 3. For these defined levels, we apply DWConv with kernel sizes of 3, 5, and 7, respectively, to focus on features in different ranges.
[0133]
[0134]
[0135] Among them, "split" refers to dividing the feature map along the channel dimension, and obtaining ( ) as the segmentation result, where ( ) correspond to the feature maps of level 1, level 2 and level 3 respectively.
[0136] 2) To further filter redundant information, we use the proposed EWAD module to dynamically adjust the three fine-grained levels ( ) corresponding features The weights of these granularity levels are obtained by ( ):
[0137]
[0138] 3) We calculate and , and , and We then add these results together to obtain fine-grained weighting factors. Finally, these weighting factors are combined with Perform element-by-element multiplication to generate the final result .
[0139]
[0140] in, Represents element-wise multiplication.
[0141] like Figure 2 As shown in the figure, a lightweight mural image target detection method based on fine-grained features is constructed (its structure is shown in Figure 2 The specific steps are as follows:
[0142] 1) The backbone network uses a four-stage hierarchical structure. Each stage includes a Conv layer and a DFA module. The Conv layer consists of Conv2d, BatchNorm2d and SiLU, which are used to downsample the input features.
[0143] 2) The DFA module dynamically adjusts the network structure according to the input features to capture global and local features, thereby enhancing the network's ability to adapt to features. After each stage of processing, the spatial resolution of the input feature map is halved, while the number of channels remains unchanged.
[0144] 3) A DFGWA module is introduced at the end of the backbone network, which dynamically adjusts weights according to the fine-grained feature hierarchy of the image and filters redundant information to speed up network reasoning.
[0145] 4) The neck network is similar to the backbone network in structure, but it integrates the output features of all stages of the backbone network to alleviate the feature sparsity problem.
[0146] 5) The detection head adopts a decoupling design to improve detection performance.
[0147] The above specifically discloses the specific structure of a lightweight mural image object detection network based on fine-grained features.
[0148] Step 3, the process of obtaining pre-training weights on the public dataset MS COCO includes the following steps:
[0149] 1) The network optimizer used is AdamW optimizer, with an initial learning rate of 0.003, which increases linearly to 0.01 during training. The momentum parameter is set to 0.9, and the weight decay is set to 0.025. Linear warm-up is performed in the first 5 epochs, and a total of 250 training epochs are performed. An early stopping strategy is used during training to prevent overfitting;
[0150] 2) The overall loss function used in the present invention is:
[0151]
[0152] in, , Represent classification loss and regression loss respectively. A and B represent the proportion of different losses respectively.
[0153] 3) The classification loss uses the BCE loss function, and the specific formula is as follows:
[0154]
[0155] in, is the predicted probability value, is the actual label (0 or 1).
[0156] 4) Regression loss is adopted and , the specific formula is as follows:
[0157]
[0158]
[0159]
[0160] Among them, y is the true value, It is the Intersection over Union between the predicted box and the true box; is the prediction box With real box The Euclidean distance between the center points of It is the diagonal length of the minimum bounding box covering the predicted box and the true box; It is a measure of the consistency of aspect ratio; is a positive trade-off parameter.
[0161] Step 4: Select evaluation indicators such as AP, AP50, AP75, AP_small, AP_medium, AP_large, FPS, GFLOPs, and GPU latency.
[0162] Step 5, load the pre-trained weights and fine-tune them on the mural dataset. Load the weights obtained on the mural dataset, input the image to be tested into the model to obtain the detection result, and generate the target detection image. Comparing the experimental results with the baseline model YOLOv8s, the GFLOPs of the present invention are reduced by 13.24%, while AP50 increases by 2.6%.
[0163] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0164] Finally, it should be noted that the above examples only express several implementation methods of the present application, and the descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present application, which all belong to the protection scope of the present application. Therefore, the protection scope of the patent of this application shall be based on the attached claims.
Claims
1. A lightweight mural image target detection method based on fine-grained features, characterized in that: The following steps are involved: S1. Collect mural datasets, perform data enhancement and segmentation; S2. Construct a lightweight mural image object detection network based on fine-grained features: S2.1 constructs a dynamic feature adaptation module to obtain local context information, including the following steps: S2.1.1 The input features are subjected to two-dimensional average pooling through a convolution with a convolution kernel of 7: ; in, is a two-dimensional pooling operation, represents the input features, is the output feature of this stage; S2.1.2 applies a convolution with a kernel of 1 to further refine the features; then adaptive global average pooling is performed on the processed features: ; ; in, and represents adaptive global average pooling along the height and width directions, and It indicates the features obtained by verifying the adaptive global pooling in the vertical and horizontal directions; S2.1.3 applies another convolution with a kernel of 1 to extract richer texture information, and generates an attention factor through a sigmoid function; finally, the attention factor is element-wise multiplied with the original feature map to scale the features according to their importance: ; ; in, is the attention factor, represents element-by-element multiplication, is the final output; S2.1.4 In order to capture key local information while learning broader contextual information, multi-scale feature extraction is performed on the original input features; Use DWConv with a convolution kernel of 7 to obtain texture information: ; in, is the input feature of this stage, It is the feature map obtained after DWConv processing; S2.1.5 The output features of DWConv are processed by two parallel convolutional layers with a convolution kernel of 1; the output features of one branch are activated by ReLU6 to enhance the nonlinear representation of the features, and then the features of the two branches are fused by element-by-element multiplication; finally, DWConv with a convolution kernel of 7 is applied again to capture multi-level context information; ; in, is the output feature map of the second stage; S2.1.6 integrates the , And the original input features Combining multi-scale features: ; in, It is the feature map output after the dynamic feature adaptation module operates; S2.2 constructs an efficient weighted adaptive downsampling module, including the following steps: S2.2.1 Perform weight calculation and feature extraction on the input features at the same time: perform average pooling on the input tensor, and then use a standard convolutional layer with a kernel size of 1 to generate a weight tensor; use a reordering operation to add an extra dimension of size 1 to ensure that each position in the feature map correctly receives the corresponding weight value. Next, use SoftMax for normalization to obtain the final weight factor: ; in, represents the input features of this stage, represents average pooling, represents a standard convolution with a kernel of 1, which is used to integrate information from different features. Represents a rearrangement operation used to increase the dimension; S2.2.2 downsamples the input features, merges the information around each position into a more representative feature, and rearranges the dimensions to obtain: ; ; in, represents a standard convolution operation with a kernel size of 3, is an intermediate variable used for feature extraction, Represents a reordering operation, Represents the optimized feature information; S2.2.3 Weight information And the optimized features An element-wise multiplication is performed and then summed along the last dimension to obtain the final output of the EWAD stage: ; in, represents element-wise multiplication, is the final output, maintaining the same dimension as the input features; S2.3 builds a dynamic fine-grained weight adaptation module to obtain global context information, including the following steps: S2.3.1 uses convolution with a convolution kernel of 1 to filter the input features, and divides the processed feature map into 5 parts according to the channel division; divides the surrounding information of the image target into three different levels: level 1, level 2 and level 3; among them, level 1 represents the fine-grained information in the image, level 3 represents the coarse-grained information, and level 2 is between level 1 and level 3; for level 1, level 2 and level 3, DWConv with kernel sizes of 3, 5 and 7 are applied respectively: ; ; Among them, split refers to dividing the feature map along the channel dimension, and obtaining ( ) as the segmentation result, ( ) correspond to the feature maps of level 1, level 2 and level 3 respectively; S2.3.2 Use the efficient weighted adaptive downsampling module in step S2 to dynamically adjust the three fine-grained levels ( ) corresponding features The weights of ( ): ; S2.3.3 Calculation and , and , and The element-by-element product of , and then add the results to obtain the fine-grained weighting factor; then the weighting factor is combined with Perform element-by-element multiplication to generate the final result ; ; in, Represents element-wise multiplication; S3. Perform pre-training on the public dataset MS COCO to obtain pre-training weights; S4. Load the weights obtained on the mural dataset, input the image to be tested into the model to obtain the detection result, and generate the target detection image.
2. The lightweight mural image target detection method based on fine-grained features according to claim 1 is characterized by: The step S3 includes the following sub-steps: S3.1 uses the AdamW optimizer as the network optimizer, with an initial learning rate of 0.003, which increases linearly to 0.01 during training; the momentum parameter is set to 0.9, and the weight decay is set to 0.025; linear warm-up is performed in the first 5 epochs, and a total of 250 training epochs are performed; The overall loss function used in S3.2 is: ; in, , Represent classification loss and regression loss respectively; A and B represent the proportion of different losses respectively; S3.3 classification loss uses the BCE loss function, the specific formula is as follows: ; in, is the predicted probability value, is the actual label (0 or 1); S3.4 Regression loss adopted and , the specific formula is as follows: ; ; ; Among them, y is the true value, It is the intersection-over-union ratio between the predicted box and the true box; is the prediction box With real box The Euclidean distance between the center points of It is the diagonal length of the minimum bounding box covering the predicted box and the true box; It is a measure of the consistency of aspect ratio; is a positive trade-off parameter.
