Explosion fragment counting and positioning method based on multi-scale characterization and selective inheritance learning

By introducing multi -scale representation and selective inheritance learning in the neural network algorithm, extracted multi -resolution features and processing and inheriting the inheritance of the adapter module, combined with counting and positioning head generating density diagrams, solving explosion fragments count and counting fragments in existing technologies and the counting count and the number of fragmented pieces and The problem of low positioning prediction and poor model robustness achieves higher prediction accuracy and model stability.

CN119360164AActive Publication Date: 2025-01-24NORTHWESTERN POLYTECHNICAL UNIV
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the explosion fragments are processed through existing neural network algorithms, and the counting and positioning prediction accuracy of the obtained explosion fragments is low and the model is poor.

Method used

Using a method based on multi -scale characterization and selective inheritance learning, the characteristics of each target explosion fragments of the training set are extracted through the encoder and decoder to obtain the multi -resolution characteristics of each target explosion fragments corresponding to the decoder of different depth. Essence Then, the feature selection and inheritance of the adapter module are processed to the multi -resolution features, and the target explosion fragments feature of each resolution of each target explosion fragment. Finally, the counting and positioning header of the target explosion fragments of each target explosion target explosion fragments features the density diagram of each resolution of each target explosion fragment, and calculate the loss value of each resolution To determine the total loss value.

Benefits of technology

It improves the accuracy of the counting and positioning prediction of explosive fragments, enhances the robustness of the model, and makes the multi -scale model more accurate and stable when the explosive fragments of different scales are processed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360164A_ABST
    Figure CN119360164A_ABST
Patent Text Reader

Abstract

The invention discloses an explosion fragment counting and positioning method based on multi-scale characterization and selective inheritance learning. The method comprises the following steps: acquiring a plurality of explosion fragments; dividing the plurality of explosion fragments according to a preset proportion to obtain a training set and a test set corresponding to the plurality of explosion fragments; each explosion fragment of the training set and the test set is preprocessed, the preprocessed training set and the preprocessed test set are obtained, and each explosion fragment of the preprocessed training set has labels with different resolutions; and inputting the preprocessed training set into the patch embedding layer to obtain a target explosion fragment corresponding to each explosion fragment in the training set. According to the invention, the technical problems that the counting and positioning prediction accuracy of the obtained explosion fragments is low and the robustness of the model is poor when the explosion fragments are processed through an existing neural network algorithm in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision, 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 are of 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 document "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 density maps, allows the input explosion fragments to have arbitrary size or resolution, and uses multi-size filters to generate different receptive fields of scale changes. 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 realize the 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." to process instances within a specific scale range with a density pyramid network, and proposed 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." to fuse multiple density maps by selecting region-aware hard pixels through PRALoss and optimizing them in a fine-grained manner. Summary of the invention

[0005] The embodiment of the present invention provides a method for counting and locating explosion fragments based on multi-scale representation and selective inheritance learning, so as to at least solve the technical problems in the prior art of processing explosion fragments through existing neural network algorithms, resulting in low prediction accuracy of counting and locating explosion fragments and poor robustness of the model.

[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; inputting the target explosion fragment feature 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; 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 it is determined through iterative training that the accuracy of the multi-scale model is no longer improved; inputting the test set into the successfully trained multi-scale model, and outputting 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 concatenation of features with different resolutions, j represents the sequence number of different resolutions, j = 1, 2, ..., N, 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, an expression for determining the total loss value of each target explosion fragment is:

[0014] Totalloss=Loss 1 / 4 +1 / 4Loss 1 / 8 +1 / 8Loss 1 / 16 +1 / 16 Loss 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 the 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 an expression for evaluating the prediction result performance of the test set by using mean square error MSE and mean absolute error MAE:

[0017]

[0018] Where n is the number of explosion fragments in the test set, and 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 the 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 whose explosion fragments are correctly predicted as positive, and FP is the number of samples in the test set whose 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 the decoder are used to extract features of each target explosion fragment in the training set, and the 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 the 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 the 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 for loss calculation to obtain 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 comprises the following steps: determining the model parameters, iteratively training the multi-scale model, and obtaining a successfully trained multi-scale model when the accuracy of the multi-scale model is no longer improved; inputting the test set into the successfully trained multi-scale model, and outputting the location and count of the objects in each explosion fragment of the test set, thereby solving the technical problem that the explosion fragments are processed by the existing neural network algorithm in the prior art, and the counting and positioning prediction accuracy of the explosion fragments 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 the features of each explosion fragment at 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, obtaining the density map of each resolution of each target explosion fragment, and finally calculating the loss value at each resolution 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 improves 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 scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification 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 can be interchanged 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 that are clearly listed, but may include other steps or units that are not clearly 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 comprising 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 may 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, obtaining a number of explosion fragments.

[0034] In the technical solution provided in the above step S101 of the present invention, a plurality of explosion fragments of the target object with 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, 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.

[0036] In the technical solution provided in the above step S102 of the present invention, a number of explosion fragments are divided according to a preset ratio to obtain training sets and test sets corresponding to the number 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 with 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] Step S104, input the preprocessed training set 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] Step S105, input each target explosion fragment in the training set into the encoder and decoder for feature extraction, and 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.

[0042] In the technical solution provided in step S105 of the present invention, if Figure 2As shown in FIG, the encoder and decoder are used to extract features of each target explosion fragment, and the multi-resolution features of each target explosion fragment corresponding to the decoders of different depths are obtained, 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 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.

[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 resolution of each target explosion fragment and the labels of each target explosion fragment at different resolutions to obtain the 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 and multiple weight values ​​at each resolution are calculated to obtain the total loss value of each target explosion fragment.

[0051] Step S110, when the training set is in the training process, 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.

[0052] In the technical solution provided in the above step S110 of the present invention, when the training set is in the training process, 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] Step S111, input the test set into the successfully trained multi-scale model, and output the prediction result of the test set, 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 result of the test set, wherein the prediction result includes the location and count 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 implementation method, step S104, inputting 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 implementation manner, in step S106, 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.

[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 the upsampled scale-customized features, while the scale-uncustomized feature forward network continuously transfers the scale-uncustomized features to higher resolutions. The soft mask generator is responsible for generating two attention maps for feature decoupling.

[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 concatenation of features with different resolutions, j represents the sequence number of different resolutions, j = 1, 2, ..., N, 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 forward the scale-non-customized features to a higher resolution. 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] Totalloss=Loss 1 / 4 +1 / 4Loss 1 / 8 +1 / 8Loss 1 / 16 +1 / 16 Loss 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 the 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 to obtain the prediction result of the test set, the method further includes:

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

[0071]

[0072] Where n is the number of explosion fragments in the test set, and 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 whose explosion fragments are correctly predicted as positive, and FP is the number of samples in the test set whose explosion fragments are incorrectly predicted as positive.

[0077] Experimental part:

[0078] 1. Experimental conditions

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

[0080] The data used in the experiment are pictures collected during the aircraft strike experiment, with a total of 2800 training images and 700 test images. In the training phase, the maximum number of training rounds is set to 3500, the initial learning rate is 0.00001, and the batch size is 8.

[0081] 2. Experimental content

[0082] The present invention uses mean square error (MSE) and mean absolute error (MAE) to measure the counting performance of explosion fragments. The precision index is used to measure the positioning performance. Experiments are conducted on the test set, and the experimental results are shown in Table 1.

[0083] Table 1 Experimental results

[0084]

[0085] The mean square error and mean absolute error of the present invention on the debris test set are 3.24 and 3.40 respectively, which verifies the effectiveness of the present invention. In general, the present invention can make full use of multi-scale information to detect and count debris. It is suitable for situations such as occlusion and dense distribution, and can well analyze the distribution of aircraft explosion fragments and support 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 a target explosion fragment feature of each resolution of each target explosion fragment; the target explosion fragment feature of each resolution of each target explosion fragment is 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 in the training process, the model parameters are updated by the random 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; 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, and achieves the multi-resolution feature of each explosion fragment extracted, and the multi-resolution feature is processed by feature selection and inheritance adapter to obtain the feature of each explosion fragment at each resolution of each explosion fragment, and the target explosion fragment feature of each resolution of each target explosion fragment is processed by the counting and positioning head to obtain the density map of each resolution of each target explosion fragment, and finally the loss value at each resolution is calculated to obtain the successfully trained multi-scale model, and 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 only for description 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 emphasis. 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 schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, 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] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0091] In addition, each functional unit in each embodiment 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 one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of 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 locating explosion fragments based on multi-scale representation and selective inheritance learning, characterized in that: include: Get several explosion fragments; Dividing a 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 with 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; Input each target explosion fragment in the training set into the encoder and decoder for feature extraction, and 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 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; The density map of each resolution of each target explosion fragment and the labels of each target explosion fragment at different resolutions are used to calculate the loss, and the loss value at each resolution is obtained; 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 training set updates the multi-scale model parameters through the stochastic gradient descent method. When it is determined through iterative training 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, where 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 fragments 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: a scale-customized feature forward network, a scale-non-customized feature forward network, and a soft mask generator.

4. The method according to claim 1, characterized in that 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 concatenation of features with different resolutions, j represents the sequence number of different resolutions, j = 1, 2, ..., N, 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, characterized in that 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 the 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 the prediction result of the test set, the method further includes: The expression for evaluating the prediction results performance of the test set by the mean square error MSE and the mean absolute error MAE is: Where n is the number of explosion fragments in the test set, and 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 the 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 whose explosion fragments are correctly predicted as positive, and FP is the number of samples in the test set whose explosion fragments are incorrectly predicted as positive.

8. A processor, characterized in that: The processor is used 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

  • Metalearning-based small sample target detection method and device

    CN114998672A

  • Migration learning-driven unexploded ammunition crater positioning and identification method

    CN117115678A

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

    CN117853840A

  • Small sample explosion accident key damaged equipment fragment identification method, system and equipment

    CN118447503A