Explosion fragment counting and localization method based on multi-scale representation and selective inheritance learning

Through multi-scale representation and selective inheritance learning methods, multi-resolution features of explosion fragments are extracted and processed, which solves the problems of low explosion fragment counting and positioning prediction accuracy and poor model robustness in existing technologies, and achieves higher prediction accuracy and model stability.

CN119360164BActive Publication Date: 2025-09-12NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411288118.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-09-12
Estimated Expiration
2044-09-14

AI Technical Summary

Technical Problem

Existing neural network algorithms have low counting and positioning prediction accuracy when processing explosion fragments, and the model has poor robustness.

Method used

A method based on multi-scale representation and selective inheritance learning is adopted. Multi-resolution features are extracted through the encoder and decoder, and the multi-resolution features are processed using the feature selection and inheritance adapter module. The density map is generated through the counting and localization heads, and the model is iteratively trained in combination with the stochastic gradient descent method.

Benefits of technology

The accuracy of explosion fragment counting and location prediction is improved, and the robustness of the model is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360164B_ABST
    Figure CN119360164B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for counting and locating explosion fragments based on multi-scale representation and selective inheritance learning. The method comprises: obtaining a plurality of explosion fragments; dividing the plurality of explosion fragments according to a preset ratio to obtain a training set and a test set corresponding to the plurality of explosion fragments; preprocessing each explosion fragment in the training set and the test set to obtain a preprocessed training set and a test set, wherein each explosion fragment in the preprocessed training set has a label of a different resolution; and inputting the preprocessed training set into a patch embedding layer to obtain a target explosion fragment corresponding to each explosion fragment in the training set. The present invention solves the technical problem in the prior art of processing explosion fragments using existing neural network algorithms, resulting in low explosion fragment counting and location prediction accuracy and poor model robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a method for counting and locating explosion fragments based on multi-scale representation and selective inheritance learning. Background Art

[0002] In the process of explosion fragment processing, when the explosion fragments have different scales, the multi-scale feature fusion method aims to solve the problem of inaccurate detection caused by scale changes by utilizing multi-scale features or multi-context information.

[0003] Y. Zhang et al. proposed a multi-column neural network architecture in the paper "Y. Zhang, D. Zhou, S. Chen, S. Gao, and Y. Ma Single-image crowd counting via multi-column convolutional neural network, in Proc. IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 589-597.", which maps explosion fragments to a density map, allows the input explosion fragments to have arbitrary size or resolution, and uses multi-size filters to generate different receptive fields of varying scales. V.Sindagi et al. proposed a multi-level bottom-top and top-bottom feature fusion for crowd counting. Proceedings of the IEEE / CVF international conference on computer vision. 2019. in the paper “VA.Sindagi and MP.Vishal Multi-level bottom-top and top-bottom feature fusion for crowd counting. Proceedings of the IEEE / CVF international conference on computer vision. 2019.” to combine information from shallower layers to deeper layers and vice versa at multiple levels, and designed a scale complementary feature extraction block of a cross-scale residual function to explicitly implement complementary features flowing from adjacent convolutional layers along the fusion path.

[0004] In addition to multi-scale feature fusion, multi-scale density fusion also hierarchically merges multi-scale density maps to improve counting performance. Z. Ma et al. proposed a scale-aware probabilistic model in the paper "Z. Ma, X. Wei, X. Hong, and Y. Gong. Learning scales from points: A scale-aware probabilistic model for crowd counting. 2020, pp. 220-228.", using a density pyramid network to process instances within a specific scale range and a scale distribution estimator to estimate the scale distribution with weak supervision to guide the fusion of multi-scale density maps. Q. Song et al. proposed an adaptive selection strategy in the paper "Q. Song, C. Wang, Y. Wang, Y. Tai, C. Wang, J. Li, J. Wu, and J. Ma. To choose or to fuse? scale selection for crowd counting. 2021, pp. 2576-2583.", which selects region-aware hard pixels through PRALoss and optimizes them in a fine-grained manner to fuse multiple density maps. Summary of the Invention

[0005] The embodiments of the present invention provide a method for counting and locating explosion fragments based on multi-scale representation and selective inheritance learning, which at least solves the technical problems in the prior art of processing explosion fragments through existing neural network algorithms, resulting in low explosion fragment counting and positioning prediction accuracy and poor model robustness.

[0006] According to one aspect of an embodiment of the present invention, a method for counting and locating explosion fragments based on multi-scale representation and selective inheritance learning is provided. The method may include: obtaining a number of explosion fragments; dividing the number of explosion fragments according to a preset ratio to obtain a training set and a test set corresponding to the number of explosion fragments; preprocessing each explosion fragment in the training set and the test set to obtain a preprocessed training set and a test set, wherein each explosion fragment in the preprocessed training set has a label of different resolutions; inputting the preprocessed training set into a patch embedding layer to obtain a target explosion fragment corresponding to each explosion fragment in the training set; inputting each target explosion fragment in the training set into an encoder and a decoder for feature extraction to obtain multi-resolution features of each target explosion fragment corresponding to decoders of different depths, wherein the multi-resolution features include 1 / 4 resolution features, 1 / 8 resolution features, 1 / 16 resolution features, and 1 / 32 resolution features; inputting the multi-resolution features of each target explosion fragment into a feature selection and inheritance adaptation layer. The invention relates to a method for obtaining a target explosion fragment feature of each resolution of each target explosion fragment by inputting the target explosion fragment feature of each resolution of each target explosion fragment into a counting and positioning head to obtain a density map of each resolution of each target explosion fragment; performing loss calculation on the density map of each resolution of each target explosion fragment and the labels of different resolutions of each target explosion fragment to obtain a loss value at each resolution; determining a total loss value of each target explosion fragment based on the loss value at each resolution and multiple weight values; updating the multi-scale model parameters by the stochastic gradient descent method during the training process of the training set, and obtaining a successfully trained multi-scale model when iterative training determines that the accuracy of the multi-scale model is no longer improved; inputting the test set into the successfully trained multi-scale model to output the prediction result of the test set, wherein the prediction result includes the positioning and counting of objects in each explosion fragment in the test set.

[0007] Optionally, the preprocessed training set is input into the patch embedding layer to obtain a target explosion fragment corresponding to each explosion fragment in the training set, including: dividing the explosion fragments in the training set into non-overlapping 4×4 target explosion fragments.

[0008] Optionally, the feature selection and inheritance adapter module includes: a scale-customized feature forward network, a scale-non-customized feature forward network and a soft mask generator.

[0009] Optionally, the multi-resolution features of each target explosion fragment are input into the feature selection and inheritance adapter module, and the expression of the target explosion fragment feature of each resolution of each target explosion fragment is obtained as follows:

[0010]

[0011]

[0012] Where C represents the splicing of features with different resolutions, j represents the sequence number of different resolutions, j = 1, 2, ..., N, It is a two-channel attention map, which is divided into A along the channel dimension c and A u , · is the Hadamard product, O represents the features output by the feature selection and inheritance adapter modules, and R represents the features output by the feature selection module. represents the multi-resolution features input to the feature selection and inheritance adapter module, represents the scale-non-customized feature forward network, C θc represents the scale-customized feature forward network, A θm is the soft mask generator, θm As a parameter.

[0013] Optionally, based on the loss value at each resolution and multiple weight values, the expression for determining the total loss value of each target explosion fragment is:

[0014] Total loss = Loss 1 / 4 +1 / 4Loss 1 / 8 +1 / 8Loss 1 / 16 +1 / 16Loss 1 / 32

[0015] Among them, Totalloss is the total loss value of each target explosion fragment, Loss 1 / 4 is the loss value of 1 / 4 resolution feature, Loss 1 / 8 is the loss value of 1 / 8 resolution feature, Loss 1 / 16 is the loss value of 1 / 16 resolution feature, Loss 1 / 32 is the loss value of the 1 / 32 resolution feature, 1 / 4 is the weight value of the loss value of the 1 / 8 resolution feature, 1 / 8 is the weight value of the loss value of the 1 / 16 resolution feature, and 1 / 16 is the weight value corresponding to the loss value of the 1 / 32 resolution feature.

[0016] Optionally, after inputting the test set into the successfully trained multi-scale model to obtain the prediction result of the test set, the method further includes: performing performance evaluation of the prediction result of the test set using mean square error (MSE) and mean absolute error (MAE). The expression is:

[0017]

[0018] Where n is the number of explosion fragments in the test set, y i is the true value of the i-th explosion fragment, is the predicted value of the i-th explosion fragment.

[0019] Optionally, after inputting the test set into the successfully trained multi-scale model to obtain a prediction result of the test set, the method further includes:

[0020] The expression for evaluating the performance of the multi-scale model by precision is:

[0021]

[0022] Among them, TP is the number of samples in the test set where the explosion fragments are correctly predicted as positive, and FP is the number of samples in the test set where the explosion fragments are incorrectly predicted as positive.

[0023] Beneficial effects of the present invention:

[0024] The present invention proposes an explosion fragment counting and positioning method based on multi-scale representation and selective inheritance learning. The encoder and decoder are used to extract features of each target explosion fragment in the training set, and multi-resolution features of each target explosion fragment corresponding to decoders of different depths are obtained, wherein the multi-resolution features include 1 / 4 resolution features, 1 / 8 resolution features, 1 / 16 resolution features and 1 / 32 resolution features; the feature selection and inheritance adapter module processes the multi-resolution features of each target explosion fragment to obtain target explosion fragment features of each resolution of each target explosion fragment; the counting and positioning head processes the target explosion fragment features of each resolution of each target explosion fragment to obtain a density map of each resolution of each target explosion fragment; the density map of each resolution of each target explosion fragment and the labels of different resolutions of each target explosion fragment are used to calculate the loss value at each resolution; when the training set is in the training process, the multi-resolution features are updated by the stochastic gradient descent method. The method is to obtain a successfully trained multi-scale model by extracting multi-resolution features of each explosion fragment and processing the multi-resolution features through feature selection and inheritance adapter to obtain each explosion fragment feature of each resolution of each explosion fragment, and process the target explosion fragment features of each resolution of each target explosion fragment through counting and positioning heads to obtain a density map of each resolution of each target explosion fragment, and finally calculate the loss value at each resolution to obtain a successfully trained multi-scale model. The successfully trained multi-scale model has the technical effect of improving the counting and positioning prediction accuracy of explosion fragments and improving the robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0026] Figure 1 is a flow chart of a method for counting and locating explosion fragments based on multi-scale representation and selective inheritance learning according to an embodiment of the present invention;

[0027] Figure 2 4 is a structural block diagram of explosion fragment detection according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products or devices.

[0030] Example 1

[0031] According to an embodiment of the present invention, a method for counting and locating explosion fragments based on multi-scale representation and selective inheritance learning is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system containing at least one set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0032] Figure 1 is a flow chart of a method for counting and locating explosion fragments based on multi-scale representation and selective inheritance learning according to an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:

[0033] Step S101: Acquire a number of explosion fragments.

[0034] In the technical solution provided in step S101 of the present invention, a plurality of explosion fragments of target objects of different sizes are obtained, wherein each of the plurality of explosion fragments is an RGB explosion fragment, I∈R 3×H×W , where each explosion fragment contains 3 channels, and the height and width of each explosion fragment are H and W respectively.

[0035] Step S102: Divide the plurality of explosion fragments according to a preset ratio to obtain training sets and test sets corresponding to the plurality of explosion fragments.

[0036] In the technical solution provided in the above step S102 of the present invention, a plurality of explosion fragments are divided according to a preset ratio to obtain a training set and a test set corresponding to the plurality of explosion fragments, wherein the explosion fragments in the verification stage of the multi-scale model are randomly selected from the test set.

[0037] Step S103 , preprocessing each explosion fragment in the training set and the test set to obtain a preprocessed training set and a test set, wherein each explosion fragment in the preprocessed training set has a label of a different resolution.

[0038] In the technical solution provided in step S103 of the present invention, each explosion fragment in the training set and the test set is input for cropping, and the width and height of each explosion fragment are adjusted to an integer multiple of 256. Figure 2 4 is a structural block diagram of explosion fragment detection according to an embodiment of the present invention.

[0039] In step S104, the preprocessed training set is input into the patch embedding layer to obtain the target explosion fragment corresponding to each explosion fragment in the training set.

[0040] In the technical solution provided in the above step S104 of the present invention, the patch embedding layer processes the preprocessed training set to obtain the target explosion fragment corresponding to each explosion fragment in the training set.

[0041] In step S105, each target explosion fragment in the training set is input into the encoder and decoder for feature extraction, and multi-resolution features of each target explosion fragment corresponding to decoders of different depths are obtained, where the multi-resolution features include 1 / 4 resolution features, 1 / 8 resolution features, 1 / 16 resolution features, and 1 / 32 resolution features.

[0042] In the technical solution provided in step S105 of the present invention, Figure 2As shown, the encoder and decoder extract features of each target explosion fragment, and obtain the multi-resolution features of each target explosion fragment corresponding to the decoder of different depths, that is, Figure 2 The multi-resolution features in represent the 1 / 4 resolution features, 1 / 8 resolution features, 1 / 16 resolution features, and 1 / 32 resolution features in the module.

[0043] Step S106 , inputting the multi-resolution features of each target explosion fragment into the feature selection and inheritance adapter module to obtain the target explosion fragment features of each resolution of each target explosion fragment.

[0044] In the technical solution provided in the above step S106 of the present invention, the feature selection and inheritance adapter module processes the multi-resolution features of each target explosion fragment to obtain the target explosion fragment features of each resolution of each target explosion fragment.

[0045] Step S107 , inputting the target explosion fragment features of each target explosion fragment at each resolution into the counting and positioning head to obtain a density map of each target explosion fragment at each resolution.

[0046] In the technical solution provided in the above step S107 of the present invention, the counting and positioning head processes the target explosion fragment features of each resolution of each target explosion fragment to obtain a density map of each resolution of each target explosion fragment, wherein the counting and positioning head is composed of four convolutional layers, a normalization layer and a ReLU activation function.

[0047] Step S108 , performing loss calculation on the density map of each target explosion fragment at each resolution and the labels of each target explosion fragment at different resolutions to obtain a loss value at each resolution.

[0048] In the technical solution provided in step S108 of the present invention, if Figure 2 As shown, the loss between the density map of each resolution of each target explosion fragment and the labels of different resolutions of each target explosion fragment is calculated to obtain the loss value at each resolution.

[0049] Step S109 : determining the total loss value of each target explosion fragment based on the loss value at each resolution and multiple weight values.

[0050] In the technical solution provided in the above step S109 of the present invention, the loss value at each resolution and multiple weight values ​​are calculated to obtain the total loss value of each target explosion fragment.

[0051] In step S110 , during the training process of the training set, the multi-scale model parameters are updated by the stochastic gradient descent method. When iterative training determines that the accuracy of the multi-scale model is no longer improved, a successfully trained multi-scale model is obtained.

[0052] In the technical solution provided in the above step S110 of the present invention, when the training set is being trained, the multi-scale model parameters are updated by the stochastic gradient descent method, and when iterative training determines that the accuracy of the multi-scale model is no longer improved, a successfully trained multi-scale model is obtained.

[0053] In step S111 , the test set is input into the successfully trained multi-scale model, and the prediction result of the test set is output, wherein the prediction result includes the location and count of objects in each explosion fragment in the test set.

[0054] In the technical solution provided in the above step S111 of the present invention, the successfully trained multi-scale model processes the test set and outputs the prediction results of the test set, wherein the prediction results include the positioning and counting of objects in each explosion fragment in the test set.

[0055] The above method of this embodiment is further introduced below.

[0056] As an optional embodiment, step S104 inputs the preprocessed training set into the patch embedding layer to obtain the target explosion fragment corresponding to each explosion fragment in the training set, including: dividing the explosion fragments in the training set into non-overlapping 4×4 target explosion fragments.

[0057] In this embodiment, the explosion fragments in the training set are divided into non-overlapping 4×4 target explosion fragments, that is, one explosion fragment is evenly divided into 16 target explosion fragments, and the size of each target explosion fragment is 64×64.

[0058] As an optional embodiment, in step S106 , the feature selection and inheritance adapter module includes: a scaled customized feature forward network, a scaled non-customized feature forward network, and a soft mask generator.

[0059] In this embodiment, the feature selection and inheritance adapter module consists of three learnable components: a scale-customized feature forward network, a scale-uncustomized feature forward network, and a soft mask generator. The scale-customized feature forward network is responsible for combining upsampled scale-customized features, while the scale-uncustomized feature forward network continuously propagates the scale-uncustomized features to higher resolutions. The soft mask generator is responsible for generating two attention maps for feature disentanglement.

[0060] As an optional embodiment, in step S106, the multi-resolution features of each target explosion fragment are input into the feature selection and inheritance adapter module, and the expression of the target explosion fragment feature of each resolution of each target explosion fragment is obtained as follows:

[0061]

[0062] Where C represents the splicing of features with different resolutions, j represents the sequence number of different resolutions, j = 1, 2, ..., N, It is a two-channel attention map, which is divided into A along the channel dimension c and A u , · is the Hadamard product, O represents the features output by the feature selection and inheritance adapter modules, and R represents the features output by the feature selection module. represents the multi-resolution features input to the feature selection and inheritance adapter module, represents the scale-non-customized feature forward network, C θc represents the scale-customized feature forward network, A θm is the soft mask generator and θm is the parameter.

[0063] In this embodiment, the features of larger explosion fragments are the most aggregated at 1 / 32 resolution and the most dispersed at 1 / 4 resolution. Through the feature selection module, the features of larger explosion fragments at lower resolutions are selected step by step and inherited upward to higher resolutions. The most aggregated features at a specific scale are called scale-customized features, and vice versa. The soft mask generator performs a masking operation on the scale-non-customized features and consists of three convolutional layers. The feature selection module is responsible for combining the upsampled scale-customized features. The soft mask generator continues to pass the scale-non-customized features forward to higher resolutions. If these features are unnecessary, the soft mask generator can still suppress them to minimize their impact. Their relationship can be expressed by the following formula:

[0064]

[0065] As an optional embodiment, in step S109, based on the loss value at each resolution and multiple weight values, the total loss value of each target explosion fragment is determined as follows:

[0066] Total loss = Loss 1 / 4 +1 / 4Loss 1 / 8 +1 / 8Loss 1 / 16 +1 / 16Loss 1 / 32

[0067] Among them, Totalloss is the total loss value of each target explosion fragment, Loss 1 / 4 is the loss value of 1 / 4 resolution feature, Loss 1 / 8 is the loss value of 1 / 8 resolution feature, Loss 1 / 16 is the loss value of 1 / 16 resolution feature, Loss 1 / 32 is the loss value of the 1 / 32 resolution feature, 1 / 4 is the weight value of the loss value of the 1 / 8 resolution feature, 1 / 8 is the weight value of the loss value of the 1 / 16 resolution feature, and 1 / 16 is the weight value corresponding to the loss value of the 1 / 32 resolution feature.

[0068] In this embodiment, the loss value at each resolution is multiplied and added with the loss value at each resolution to determine the total loss value of each target explosion fragment.

[0069] As an optional embodiment, in step S111, after inputting the test set into the successfully trained multi-scale model and obtaining the prediction result of the test set, the method further includes:

[0070] The expressions for evaluating the performance of the prediction results of the test set by the mean square error MSE and the mean absolute error MAE are:

[0071]

[0072] Where n is the number of explosion fragments in the test set, y i is the true value of the i-th explosion fragment, is the predicted value of the i-th explosion fragment.

[0073] As an optional embodiment, in step S111, after inputting the test set into the successfully trained multi-scale model to obtain the prediction result of the test set, the method further includes:

[0074] The expression for evaluating the performance of the multi-scale model by precision is:

[0075]

[0076] Among them, TP is the number of samples in the test set where the explosion fragments are correctly predicted as positive, and FP is the number of samples in the test set where the explosion fragments are incorrectly predicted as positive.

[0077] Experimental part:

[0078] 1. Experimental Conditions

[0079] The present invention is a central processing unit The experiment was conducted using Python language and written on an i9-10920X 3.5GHz CPU, a 309024G GPU, 128G memory, and a WINDOWS10 operating system.

[0080] The data used in the experiment consisted of 2,800 training images and 700 test images collected during the aircraft strike experiment. During the training phase, the maximum number of training rounds was set to 3,500, the initial learning rate was 0.00001, and the batch size was 8.

[0081] 2. Experimental content

[0082] This method uses mean square error (MSE) and mean absolute error (MAE) to measure the performance of counting explosive fragments. Precision is used to measure the performance of localization. Experiments were conducted on a test set, and the experimental results are shown in Table 1.

[0083] Table 1 Experimental results

[0084]

[0085] The proposed method achieved mean squared error and mean absolute error of 3.24 and 3.40, respectively, on a debris test set, validating its effectiveness. Overall, the proposed method fully leverages multi-scale information for debris detection and counting. It is applicable to situations with occlusion and dense distribution, effectively analyzing the distribution of aircraft explosion debris and supporting applications such as damage assessment.

[0086] In an embodiment of the present invention, a plurality of explosion fragments are obtained; the plurality of explosion fragments are divided according to a preset ratio to obtain a training set and a test set corresponding to the plurality of explosion fragments; each explosion fragment in the training set and the test set is preprocessed to obtain a preprocessed training set and a test set, wherein each explosion fragment in the preprocessed training set has a label of different resolutions; the preprocessed training set is input into a patch embedding layer to obtain a target explosion fragment corresponding to each explosion fragment in the training set; each target explosion fragment in the training set is input into an encoder and a decoder for feature extraction to obtain multi-resolution features of each target explosion fragment corresponding to decoders of different depths, wherein the multi-resolution features include 1 / 4 resolution features, 1 / 8 resolution features, 1 / 16 resolution features and 1 / 32 resolution features; the multi-resolution features of each target explosion fragment are input into a feature selection and inheritance adapter module to obtain target explosion fragment features of each resolution of each target explosion fragment; the target explosion fragment features of each resolution of each target explosion fragment are input into a counting and positioning head to obtain a density map of each resolution of each target explosion fragment; the density map of each resolution of each target explosion fragment is compared with the density map of each target explosion fragment. The loss is calculated for labels of different resolutions to obtain the loss value at each resolution; based on the loss value at each resolution and multiple weight values, the total loss value of each target explosion fragment is determined; when the training set is trained, the model parameters are updated by the stochastic gradient descent method, and iterative training determines that the accuracy of the multi-scale model is no longer improved, a successfully trained multi-scale model is obtained; the test set is input into the successfully trained multi-scale model to obtain the prediction result of the test set, which solves the technical problem that the counting and positioning prediction accuracy of the explosion fragments obtained by processing the explosion fragments by the existing neural network algorithm in the prior art is low and the robustness of the model is poor. The method achieves the goal of extracting multi-resolution features of each explosion fragment, processing the multi-resolution features by feature selection and inheritance adapter, obtaining each explosion fragment feature of each resolution of each explosion fragment, and processing the target explosion fragment features of each resolution of each target explosion fragment by counting and positioning heads to obtain a density map of each resolution of each target explosion fragment. Finally, the loss value at each resolution is calculated to obtain a successfully trained multi-scale model. The successfully trained multi-scale model improves the counting and positioning prediction accuracy of the explosion fragments and has good robustness of the model.

[0087] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0088] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0089] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0090] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0091] In addition, the functional units in various embodiments of the present invention may be integrated into a first processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0092] The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for counting and localizing explosion fragments based on multi-scale representation and selective inheritance learning, characterized by: include: Obtain several explosion fragments; Divide a number of explosion fragments according to a preset ratio to obtain a training set and a test set corresponding to the explosion fragments; Preprocessing each explosion fragment in the training set and the test set to obtain a preprocessed training set and a test set, wherein each explosion fragment in the preprocessed training set has a label of different resolutions; The preprocessed training set is input into the patch embedding layer to obtain the target explosion fragment corresponding to each explosion fragment in the training set; Each target explosion fragment in the training set is input into the encoder and decoder for feature extraction, and multi-resolution features of each target explosion fragment corresponding to decoders of different depths are obtained, where the multi-resolution features include 1 / 4 resolution features, 1 / 8 resolution features, 1 / 16 resolution features, and 1 / 32 resolution features; Input the multi-resolution features of each target explosion fragment into the feature selection and inheritance adapter module to obtain the target explosion fragment features of each resolution of each target explosion fragment; Inputting the target explosion fragment features of each resolution of each target explosion fragment into the counting and positioning head to obtain a density map of each resolution of each target explosion fragment; Calculate the loss of each target explosion fragment's density map at each resolution and each target explosion fragment's labels at different resolutions to obtain the loss value at each resolution. Based on the loss value at each resolution and multiple weight values, the total loss value of each target explosion fragment is determined; During the training process, the multi-scale model parameters are updated by the stochastic gradient descent method. When iterative training determines that the accuracy of the multi-scale model is no longer improved, a successfully trained multi-scale model is obtained. The test set is input into the successfully trained multi-scale model, and the prediction results of the test set are output. The prediction results include the location and count of objects in each explosion fragment in the test set.

2. The method according to claim 1, characterized in that The preprocessed training set is input into the patch embedding layer to obtain the target explosion fragment corresponding to each explosion fragment in the training set, including: The explosion fragments in the training set are divided into non-overlapping 4×4 target explosion fragments.

3. The method according to claim 1, characterized in that The feature selection and inheritance adapter module includes: scale-customized feature forward network, scale-non-customized feature forward network and soft mask generator.

4. The method according to claim 1, wherein The multi-resolution features of each target explosion fragment are input into the feature selection and inheritance adapter module, and the expression of the target explosion fragment feature of each resolution of each target explosion fragment is obtained as follows: Where C represents the splicing of features with different resolutions, j represents the sequence number of different resolutions, j = 1, 2, ..., N, It is a two-channel attention map, which is divided into A along the channel dimension c and A u , · is the Hadamard product, O represents the features output by the feature selection and inheritance adapter modules, and R represents the features output by the feature selection module. represents the multi-resolution features input to the feature selection and inheritance adapter module, represents the scale-non-customized feature forward network, C θc represents the scale-customized feature forward network, A θm is the soft mask generator, θm As a parameter.

5. The method according to claim 1, wherein Based on the loss value at each resolution and multiple weight values, the expression for determining the total loss value of each target explosion fragment is: Totalloss=Loss 1 / 4 +1 / 4Loss 1 / 8 +1 / 8Loss 1 / 16 +1 / 16Loss 1 / 32 Among them, Totalloss is the total loss value of each target explosion fragment, Loss 1 / 4 is the loss value of 1 / 4 resolution feature, Loss 1 / 8 is the loss value of 1 / 8 resolution feature, Loss 1 / 16 is the loss value of 1 / 16 resolution feature, Loss 1 / 32 is the loss value of the 1 / 32 resolution feature, 1 / 4 is the weight value of the loss value of the 1 / 8 resolution feature, 1 / 8 is the weight value of the loss value of the 1 / 16 resolution feature, and 1 / 16 is the weight value corresponding to the loss value of the 1 / 32 resolution feature.

6. The method according to claim 1, characterized in that After inputting the test set into the successfully trained multi-scale model to obtain a prediction result of the test set, the method further includes: The expressions for evaluating the performance of the prediction results of the test set by the mean square error MSE and the mean absolute error MAE are: Where n is the number of explosion fragments in the test set, y i is the true value of the i-th explosion fragment, is the predicted value of the i-th explosion fragment.

7. The method according to claim 1, characterized in that After inputting the test set into the successfully trained multi-scale model to obtain a prediction result of the test set, the method further includes: The expression for evaluating the performance of the multi-scale model by precision is: Among them, TP is the number of samples in the test set where the explosion fragments are correctly predicted as positive, and FP is the number of samples in the test set where the explosion fragments are incorrectly predicted as positive.

8. A processor, characterized in that: The processor is configured to run a program, wherein the program executes the method according to any one of claims 1 to 7 when running.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Complex scene crowd counting method based on scene classification and multi-scale feature fusion

    CN111783589A

  • Explosion fragment positioning and counting method based on virtual data generation

    CN117853840A