Dense detection method based on one-sided relaxed optimal transmission and pure point basis precise positioning
By combining the pyramid visual self-attention model and the one-sided relaxation optimal transfer algorithm with the Hungarian algorithm, the problems of large differences in target size and density, computational complexity and inaccurate localization in dense target detection are solved, achieving high-precision dense target counting and localization, meeting the requirements of high-level tasks.
Patent Information
- Application Number
- CN202410297187.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-03-15
AI Technical Summary
Existing dense detection methods suffer from problems such as large differences in target size and density, computational complexity, reliance on inaccurate bounding box localization leading to false detections, and difficulty in meeting the requirements of high-level practical tasks when dealing with complex scenes.
A feature extraction network is formed by combining a pyramid visual self-attention model with multi-scale dilated convolution. Density map prediction is optimized using one-sided relaxation optimal transport and Sinkhorn counting loss. Point matching is performed using the Hungarian algorithm, and the target point location is directly output.
It improves the feature extraction capability and counting accuracy of dense detection, solves the distance identity and hard constraint problems in traditional methods, achieves accurate target localization, and meets the needs of higher-level dense detection tasks.
Smart Images

Figure CN118196706B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to dense detection using a combination of multi-scale feature extraction networks, pyramid visual self-attention models, one-sided relaxation optimal transport, point-to-point precise localization, Hungarian algorithm, and density estimation with pure point-based precise localization. Background Technology
[0002] Dense detection is a hot research topic in computer vision. It estimates the number of dense objects in a scene and has wide applications in many fields such as urban planning, traffic congestion estimation, and crowd management. Dense detection also has particularly important practical applications in the field of public security.
[0003] Computing targets is challenging in complex scenes with thousands of objects, severe occlusion, and huge variations in scale. Therefore, in modern dense detection datasets, providing coarse annotations (such as points) is more feasible and less laborious than providing fine annotations (such as bounding boxes or even contours). However, dense detection starting from image generation still faces several challenges.
[0004] First, for feature processing of the original image for dense detection, mainstream methods focus on designing various convolutional neural networks (CNNs). However, dense targets near the camera are larger in scale and lower in density, and vice versa, resulting in significant differences in scale and density within the image. A widely accepted solution is to enhance the global context modeling capabilities of CNN-based models. CNNs have strong local feature extraction capabilities, but they are not perfect due to their limited receptive field. Therefore, researchers have proposed various mechanisms to improve CNN-based models. One popular approach is to design multi-column structures using input images of different resolutions to extract crowd features at different scales and densities.
[0005] Recent research has focused on designing different attention mechanisms to address scale and density variations within a global context. However, these methods are often complex, with many sensitive hyperparameters that require careful tuning on different datasets. As an orthogonal approach, some works have attempted to improve performance by optimizing image augmentation and loss functions. However, this typically requires sufficient data and expert experience. The designs are also complex, with no significant improvements.
[0006] Current visual self-attention models (Vision Transformers, ViTs) have garnered significant interest across the community and demonstrated promising results in numerous vision tasks. A major advantage of self-attention models (Transformers) is their ability to capture long contextual dependencies and benefit from the global receptive field. For example, semantic segmentation, a point-level prediction task similar to dense detection, has achieved better performance than convolutional neural network baselines by constructing visual self-attention models. A natural question then arises: can we simplify complex dense detection methods using visual self-attention models?
[0007] In addition, traditional dense detection methods mostly use detection or density regression to predict the total number. Detection-based methods calculate the target number by exhaustively detecting every individual in the image. The applicability of this method is limited because it usually requires additional annotations, such as bounding boxes, which obviously contradicts the annotation methods of current dense detection datasets. Density regression-based methods use a fixed or variable-sized Gaussian kernel to smooth the dispersed ground truth points to form a pseudo-density map, and then regress the output to the pseudo-density map. However, the quality of the generated pseudo-map is highly dependent on the Gaussian kernel size setting. Studies have shown that an inappropriate Gaussian kernel size will greatly degrade the quality of the density map, thus severely affecting counting performance.
[0008] To address these issues, representing the discrete ground truth map and predicted density map using discrete point measures and continuous measures respectively, and treating dense detection as a measure matching problem, seems like a good choice. Choosing an appropriate distance metric is crucial when matching two different types of measures. At first glance, this seems trivial, as regularized Wasserstein distance has recently become popular for calculating the difference between measures. Regularized Wasserstein distance typically adds an entropy function as a regularization term to the overall objective function to relax the hard constraints when allocating the optimal transmission volume and reduce computational cost. However, it suffers from two serious problems. First, the entropy regularization term breaks the fundamental property that distance itself is zero in the measure space, i.e., the identity theorem d(x,x) = 0. Second, the quality of the optimization is highly sensitive to the parameter setting of the entropy regularization term. Inappropriate entropy parameters can cause the trainable metric to converge to the centroid of the target, a phenomenon commonly referred to as entropy bias.
[0009] Sinkhorn divergence can serve as an improved method to address distance identity and hard constraints. Sinkhorn divergence has a self-correcting term, thus remaining stable under different entropy parameters compared to Wasserstein distance, and possessing better interpolation significance. However, it is still constrained by measure equivalence, requiring the total amount of predicted density measurements to equal the total amount of true measurements. Therefore, it cannot be directly applied to real-world scenarios where the total quality of the predicted density map differs from the total quality of the discrete labeled map. So, what strategies should we adopt to overcome this limitation?
[0010] The third challenge in dense object detection stems from the fact that while predicted density maps can more accurately estimate the number of individuals within dense targets and provide a general target distribution, this is clearly insufficient for subsequent, more advanced dense object detection tasks such as crowd tracking, activity recognition, anomaly detection, and traffic / behavior prediction. In fact, beyond simple counting tasks, the more challenging fine-grained estimation—providing the precise location of individuals within dense targets—requires a higher level of capability for downstream applications. Inspired by top-tier object detectors, some localization-based methods attempt to predict bounding boxes for individual heads. However, due to the use of only point annotations, these methods rely on heuristic estimations of ground-value bounding boxes, which are error-prone and even infeasible. These inaccurate bounding boxes not only complicate model training but also prevent post-processing non-maximum suppression (NMS) from suppressing false detections. Some other methods avoid introducing these inaccurate targets by locating individuals through points or blobs, but this requires more effort to remove duplicate individuals or segment too closely spaced individuals in crowded regions. So, can we use other methods to bypass these thorny post-processing steps, simplify the framework, and directly estimate the point location of individuals?
[0011] In summary, we propose a dense detection method based on one-sided relaxation optimal transport and pure point-based precise localization, and employ a pyramid visual self-attention model for feature extraction. First, the pyramid visual self-attention model captures global target distribution information. The Pyramid Feature Aggregation (PFA) model effectively aggregates fine-grained features from lower layers and coarse-grained features from higher layers, improving the model's feature extraction capability while reducing computational cost. This is then combined with an efficient regression head and multi-scale dilated convolution (MDC) to form a feature extraction network. Next, to address the distance identity and hard constraint issues in traditional optimal transport algorithms and overcome the limitations of metric equivalence constraints, we derive a one-sided relaxation form of the Sinkhorn distance and design a one-sided relaxed Sinkhorn counting loss. This new formula relaxes the quantity constraint, fully conforming to our problem assumptions. This is a newly proposed counting method based on metric theory, which we call the one-sided relaxation optimal transport algorithm unconstrained by metric equivalence constraints. This method will... The predicted density map is directly regressed to point labels to improve the model's prediction accuracy. We then propose a purely point-based framework for locating individuals within a target group. This framework directly uses point labels as the learning objective and outputs the coordinates of the points to locate individuals. This benefits from the high-precision localization characteristics and relatively low labeling cost of point representation. Our research found that both when multiple predicted points match a single ground truth point and vice versa, the model may become confused during training, leading to inaccurate target localization. Therefore, we propose using the Hungarian algorithm for one-to-one matching, associating predicted points with their ground truth targets. Mismatched predicted points should be classified as background points. This new framework not only improves the model's prediction accuracy but also predicts precise target localization information to meet the practical needs of higher-level dense detection tasks. Summary of the Invention:
[0012] To address the issues of poor accuracy in dense target counting and the inability of current dense target detection methods to provide precise localization of dense targets due to the significant differences in scale and density of dense targets in images within current dense detection datasets (such as ShanghaiTech, UCF_QNRF, NWPU_Crowd, etc.), this paper proposes a dense target detection method based on one-sided relaxation optimal transport and pure point basis precise localization. The invention mainly includes: using a pyramid visual self-attention model to capture global target distribution information; combining an efficient regression head with multi-scale dilated convolution to form a feature extraction network; constructing feature-based continuous measures and label-based discrete measures as edge distributions for one-sided relaxation optimal transport, respectively; combining a distance cost matrix, an entropy regularization term, and a novel one-sided boundary relaxation penalty to iteratively obtain the optimal transport matrix; and obtaining the predicted density map and counting results. Combining the pure point basis framework, the Hungarian algorithm is used for one-to-one matching of candidate points and ground truth points, and distance loss and classification entropy loss are combined to accurately predict the location information of dense targets.
[0013] The dense detection method proposed in this paper, based on one-sided relaxation optimal transport and pure point-based precise localization, has the following main steps:
[0014] Step 1: Pre-train a pyramid visual self-attention model. This model takes the densely detected original image as input. Its backbone network can be pre-trained using a large-scale classification dataset to improve its feature extraction capabilities. During this process, the scale and patch size of the visual self-attention model in each layer of the pyramid need to be defined to find a balance between effectively aggregating fine-grained and coarse-grained features and reducing computational complexity. The prediction module, composed of an efficient regression head and multi-scale dilated convolution (MDC), can be fine-tuned during training using the densely detected dataset. The densely detected original image will produce its corresponding single-channel feature map after passing through this model.
[0015] Step 2: We propose a novel counting method based on measure theory, directly regressing the predicted density map to point labels, using this as part of the loss to optimize our model. To address the distance identity and hard constraint issues in traditional optimal transmission algorithms and overcome the limitations of measure equivalence constraints, we derive a one-sided relaxation form of the Sinkhorn distance and design a one-sided relaxed Sinkhorn counting loss. This new formula relaxes the count constraint, which we call the one-sided relaxed optimal transmission algorithm unconstrained by measure equivalence constraints. The discrete ground truth map and the predicted density map obtained in step one are represented by discrete point measures and continuous measures, respectively, and used as the edge distributions of the one-sided relaxed optimal transfer matrix. The Euclidean distance between pixels at coordinate points is used as the cost matrix for optimal transfer, and the information entropy of the transfer matrix is used as the entropy regularization term. Substituting the two measures, the cost matrix, and the entropy regularization term into the Sinkhorn formula, the initial form of the transfer matrix can be calculated. Then, Sinkhorn iteration convergence is performed. During the iteration process, the continuous measure side of the transfer matrix is relaxed by 98% to obtain the optimal transfer matrix of the two measures with relaxed one-sided quantity constraints. Because boundary relaxation is performed, it is also necessary to calculate the feature vector distance loss between the continuous measure formed by the predicted density map and the edge distribution of the corresponding side of the optimal transfer matrix to form a one-sided boundary relaxation penalty. This penalty, combined with the optimization process of the one-sided relaxed optimal transfer matrix, forms the optimization loss for dense target counting, and then the gradient is obtained to optimize the model.
[0016] Step 3: We propose a pure point-based precise localization framework that can directly receive a set of labeled points for training and predict the target's location information during inference. To address the problem that model confusion can occur during training, leading to inaccurate target localization, whether multiple predicted points match a single ground truth point or vice versa, we propose a one-to-one matching using the Hungarian algorithm. This associates the predicted points from Step 1 with the ground truth target, classifying mismatched predicted points as background points. Specifically, each feature map pixel generated in Step 1 is assigned four candidate points. The framework's regression end predicts the confidence score and corresponding positional deviation for each candidate point's successful match. Then, we calculate the Euclidean distance between the pixel coordinates of each candidate point and the ground truth point. This distance, combined with the corresponding confidence score, forms the cost matrix of the Hungarian algorithm, which is then used to perform a one-to-one matching between candidate and ground truth points. Then, the cross-entropy loss between the ground truth point and the corresponding successfully matched candidate point and the Euclidean distance of the pixel coordinates are calculated to supervise the training of candidate point classification and candidate point position deviation, respectively. The combination of the two will predict the precise location information of the target, and the model is optimized in this process to improve the prediction accuracy.
[0017] Step 4: Combining the losses from Step 2 and Step 3 yields the final loss of this method. The one-sided relaxation optimal transport algorithm in Step 2 and the pure point-based precise localization framework in Step 3 serve as two branches. Starting with the feature map information obtained from Step 1, they perform loss calculations in parallel and then combine to form the final loss. Together, they optimize the model and improve the model's prediction accuracy and target localization precision.
[0018] Beneficial effects:
[0019] Compared with existing dense detection methods, the design scheme proposed in this paper can achieve the following technical effects:
[0020] 1. Enhance the model's ability to aggregate image features. The pyramid visual self-attention model in this design reduces the computational complexity of traditional self-attention models while improving the ability to extract image features, making it perform better on complex datasets.
[0021] 2. Reduce the error caused by using discrete ground truth maps to supervise the training of continuous prediction density maps. This design represents the discrete ground truth map and the continuous prediction density map using discrete point measures and continuous measures, respectively. It treats dense detection as a measure matching problem and creatively uses a new variant of Sinkhorn divergence to improve training accuracy.
[0022] 3. This paper addresses the distance identity and hard constraint issues inherent in traditional optimal transport algorithms for metric matching problems, and overcomes the limitations of metric equivalence constraints. The design derives a one-sided relaxation form of the Sinkhorn distance and designs a one-sided relaxed Sinkhorn counting loss. This new formula relaxes the count constraint and represents a novel counting method based on metric theory. We call this the one-sided relaxed optimal transport algorithm, which is not constrained by metric equivalence. This method directly regresses the predicted density map to point labels to improve model prediction accuracy.
[0023] 4. It can predict the precise localization information of dense targets, improving the model's adaptability to higher-level dense detection tasks. This design proposes a purely point-based framework for locating individuals within a target group. This framework directly uses point labels as the learning objective and outputs the coordinates of the points to locate individuals. By using the Hungarian algorithm to perform a one-to-one matching between candidate target locations and ground truth points, the predicted points are associated one-to-one with their ground truth targets. Mismatched predicted points are classified as background points. This new framework not only improves the model's prediction accuracy but also predicts the precise localization information of the targets. Attached image description:
[0024] Figure 1 Method framework flowchart
[0025] Figure 2 Flowchart of the one-sided relaxation optimal transmission algorithm
[0026] Figure 3 Flowchart of Pure Point Base Precise Positioning Framework Detailed implementation method:
[0027] Step 1: Pre-train a pyramid visual self-attention model.
[0028] Its backbone network is formed by stacking spatially separable visual self-attention modules, alternating between local and global visual self-attention modules within a window. Downsampling creates different stages, similar to a pyramid, each containing a different number of spatially separable visual self-attention modules with varying downsampling rates. Subsequently, we design multi-scale dilated convolutional blocks to form the regression head by stacking dilated convolutional layers with different dilation rates in parallel.
[0029] (1) First, the feature map is packaged using patch embedding formed by stride convolution with the same stride and kernel size.
[0030] (2) Spatially separable visual self-attention modules are formed by alternating between local and global visual self-attention modules within a window. This spatially separable visual self-attention module can be represented by the following formula:
[0031] Z′ l =LSA(LN(Z) L-1 ))+Z L-1 ,
[0032] Z″ l =MLP(LN(Z′) l ))+Z′ l ,
[0033] Z″′ l =GSA(LN(Z″) l ))+Z″ l ,
[0034] Z l =MLP(LN(Z″′) l ))+Z″′ l .
[0035] (3) Use convolution to form conditional position coding (CPE) for position information processing. Stack the spatially separable visual self-attention modules from the previous step in a pyramid shape according to different downsampling rates and numbers. The spatially separable visual self-attention modules with different downsampling rates form different stages. Insert conditional position coding between different stages to process the position information that changes after each downsampling.
[0036] (4) Then, we designed a multi-scale dilated convolutional block to form a regression head by stacking dilated convolutional layers with different dilation rates in parallel and combining residual connections, thereby aggregating the feature information of the image.
[0037] Step 2: Based on the feature map information obtained in Step 1, we propose a new prediction density map processing method based on metric theory, called the one-sided relaxation optimal transport algorithm. This method directly regresses the predicted density map to the point labels and uses this as one of the losses to optimize our model.
[0038] (1) First, use This represents a vectorized binary map with point labels, which is a discrete measure, using... This represents the vectorized prediction density map returned from step one, which is a continuous measure. ||z||1 represents the number of ground truth points in the ground truth map, and... This represents the number of predicted dense targets obtained by accumulating the predicted density maps. According to the dual formula for optimal transmission:
[0039]
[0040] We can define the optimal transmission loss between the normalized vectorized prediction density map and the vectorized binary map as:
[0041]
[0042] Therefore, the gradient of this loss with respect to the vectorized prediction density map can be obtained as follows:
[0043]
[0044] This gradient can be backpropagated to train the model parameters.
[0045] (2) The optimal transmission loss in the previous step did not break the constraint of measure equivalence. Therefore, we derived the one-sided relaxation form of the Sinkhorn distance and designed a one-sided relaxed Sinkhorn counting loss. Let P represent the cost matrix for optimal transmission, and H(P) = -∑ ij P ij log P ijThis represents the entropy regularization term used when solving the optimal transmission problem using the Sinkhorn algorithm. Therefore, we can express the optimal transmission loss from the previous step as follows:
[0046]
[0047] The above form is constrained by the measure equivalence constraint, therefore it is necessary to relax the marginal distribution of the transfer matrix P on the continuous measure side. We will use a = [a i ] i Represented as a predicted density map, using The intermediate density map constructed from the transfer matrix is represented by D(P1). m |a) represents the pixel-wise loss between the predicted density map and the edge distribution of the transfer matrix on one side of the continuous measure (i.e., the intermediate density map constructed from the transfer matrix). This loss is used to penalize the gap between the two continuous measures, thereby relaxing the constraint of measure equivalence. The formula is expressed as:
[0048]
[0049] The above formula, combined with the previous step, constitutes the one-sided relaxation optimal transmission loss that overcomes the metric equivalence constraint.
[0050] (3) When using the Sinkhorn algorithm to optimize the optimal transport problem, we set a maximum number of iterations to improve computational efficiency. However, the Sinkhorn algorithm only returns an approximate solution. Therefore, the predicted density map is only close to the true map, but not exactly the same. The optimal transport loss can fit the dense region of the target well, but the fitting effect is poor for the low-density region of the target. To solve this problem, we also defined a total change loss:
[0051]
[0052] This total change loss increases the stability of the training process. The gradient of this loss with respect to the re-expansion of the prediction density map is:
[0053]
[0054] in,
[0055] (4) To better utilize the information of the true number of ground truth points, we also define a counting loss. This loss is defined as the absolute difference between the number of ground truth points and the number of predicted ground truth points, expressed as:
[0056]
[0057] The losses obtained from the above four steps together constitute the loss function for the density map prediction part. After merging the losses from the first two steps into the optimal transmission loss, the total loss of step two can be expressed in the following form:
[0058]
[0059] Here, λ1 and λ2 are adjustable hyperparameters for the optimal transmission loss and total change loss, respectively, and are weighting factors that balance their respective weights in the total loss. Because the counting loss is often large, to ensure that the total change loss has the same proportion as the counting loss, we multiply the total change loss by the total count value in the total loss.
[0060] Step 3: Based on the feature map information obtained in Step 1, we propose a pure point-based precise localization framework. This framework can directly receive a set of labeled points for training and predict the target's location information during inference. This will also be used as one of the loss parameters to optimize our model.
[0061] (1) First, the feature map obtained in step one is regressed using convolution, denoted as Fs, where s is the downsampling stride (downsampling from the input image through the entire network), and the size of Fs is H*W. Based on Fs, we use two parallel branches to regress the candidate point coordinates and propose classification suggestions.
[0062] For the classification branch, it uses Softmax normalization and then outputs a confidence score for each candidate point. For the regression branch, it leverages the translation invariance inherent in convolutional layers to predict the offset of candidate point coordinates.
[0063] Specifically, each pixel on Fs corresponds to a patch of size s*s in the input image. In this patch, we first introduce a fixed set of candidate points R = {R...} k |k∈{1,...,K}}, each candidate point has its predefined position R. k =(x k y k These candidate points are evenly distributed across the patch. Since each pixel on Fs corresponds to K candidate points, the regression branch should generate a total of H*W*K point coordinate offset suggestions. Assume that for candidate point R... k The recommended coordinate offset is So, what are the actual predicted coordinates of this candidate point? It should be expressed as:
[0064]
[0065]
[0066] Here, γ is a normalization term that can be adjusted for relatively small predictions.
[0067] (2) Based on the candidate point confidence scores and actual predicted point coordinates obtained in the previous step, we use the Hungarian algorithm as a matching strategy to perform one-to-one matching between candidate points and ground truth points. Where D is an N*M pairwise matching cost matrix, and the elements in the matrix correspond to the distance between any two points. This distance is calculated not only by simply using pixel distance, but also by considering the confidence score of the corresponding candidate point. Formally, the cost matrix D is defined as:
[0068]
[0069] Here, τ is a weighting term used to balance the influence of pixel distance. Note that in the implementation, we need to ensure M > N, that is, the number of candidate points is greater than the number of ground truth points. This ensures that enough candidate points are generated to participate in the one-to-one matching with ground truth points, while redundant candidate points after matching are classified as background points. From the perspective of ground truth points, we use... To represent the optimal matching result, that is, the truth point P. i With candidate points Matching. Furthermore, these successfully matched candidate solutions can be represented as a set. The unmatched candidate solutions are also represented as a set. It is marked as a background point.
[0070] (3) After obtaining the one-to-one matching results between candidate points and ground truth points through the above two steps, we will calculate the Euclidean loss L. loc To supervise point regression, and use cross-entropy loss L cls To train classification suggestions. The total loss function L in step three is the sum of the two losses mentioned above, defined in the following form:
[0071]
[0072]
[0073] L = L cls +λ2L loc
[0074] Where λ1 is the weighting factor of negative suggestions in the cross-entropy loss, and λ2 is the weighting term of the impact of the equilibrium point regression loss in the total loss.
[0075] Step 4: Combining the total losses from Step 2 and Step 3 yields the final loss of this method. The one-sided relaxation optimal transfer algorithm in Step 2 and the pure point-based precise localization framework in Step 3 serve as two branches. Starting with the feature map information obtained from Step 1, they are used to calculate the loss in parallel and then combined to form the final loss. This allows for the training of a more advanced dense detection model, improving the model's prediction accuracy and target localization precision.
[0076] When the dense detection method based on one-sided relaxation optimal transport and pure point-based precise localization proposed in this paper is applied to dense detection tasks, it can not only improve the accuracy of dense target counting in traditional tasks, but also meet the actual needs of higher-level dense detection and provide precise localization information of individuals in dense targets.
Claims
1. A dense detection method based on one-sided relaxation optimal transmission and pure point-based precise localization, characterized in that: At least the following steps are included: Step 1: Pre-train a pyramid visual self-attention model; the scale and patch size of the visual self-attention model in each layer of the pyramid need to be defined; the prediction module is composed of an efficient regression head and a multi-scale dilated convolution (MDC); Step 2: A counting method based on measure theory is proposed, and a one-sided relaxation optimal transmission algorithm that is not constrained by measure equivalence is designed. First, the measure formed by the truth map and the predicted density map is converged by Sinkhorn iteration. During this process, the boundary of the continuous measure side of the transmission matrix is relaxed with a relaxation degree of 98%. Then, the feature vector distance loss between the continuous measure formed by the predicted density map and the edge distribution of the corresponding side of the optimal transmission matrix is calculated to form a one-sided boundary relaxation penalty. Step 3: Propose a pure point-based precise localization framework to predict the target's location information; use the Hungarian algorithm to perform one-to-one matching between candidate points and ground truth points, and then calculate the cross-entropy loss and Euclidean distance of pixel coordinates between ground truth points and corresponding successfully matched candidate points to supervise the optimization of the model; Step 4: Combining the losses from Step 2 and Step 3 yields the final loss of this method. The one-sided relaxation optimal transfer algorithm from Step 2 and the pure point-based precise localization framework from Step 3 serve as two branches, starting with the feature map information obtained from Step 1, and are calculated in parallel. They are then combined to form the final loss, which together optimizes the model and improves the model's prediction accuracy and target localization accuracy.
2. The dense detection method based on one-sided relaxation optimal transmission and pure point-based precise localization according to claim 1, characterized in that: In step one, a pyramid visual self-attention model is pre-trained. This model takes the densely detected original image as input. Its backbone network can be pre-trained using a large-scale classification dataset to improve its feature extraction capabilities. During this process, it is necessary to define the scale and patch size of the visual self-attention model in each layer of the pyramid, and find a balance between effectively aggregating fine-grained and coarse-grained features and reducing computational complexity. The prediction module, composed of an efficient regression head and multi-scale dilated convolution (MDC), can be fine-tuned during training using the densely detected dataset. The densely detected original image will produce its corresponding single-channel feature map after passing through this model.
3. The dense detection method based on one-sided relaxation optimal transmission and pure point-based precise localization according to claim 1, characterized in that: Step two proposes a novel counting method based on measure theory, derives the one-sided relaxation form of the Sinkhorn distance, and designs a one-sided relaxed Sinkhorn counting loss. The predicted density map is directly regressed to the point labels, serving as one of the losses to optimize our model. The discrete ground truth map and the predicted density map obtained in Step one are represented by discrete point measures and continuous measures, respectively, and used as the marginal distributions of the optimal transfer matrix under one-sided relaxation. The Euclidean distance between pixels at coordinate points is used as the cost matrix for optimal transfer, and the information entropy of the transfer matrix is used as the entropy regularization term. The two measures, the cost matrix, and the entropy regularization term are substituted into S... The Sinkhorn formula can be used to calculate the initial form of the transfer matrix. Then, Sinkhorn iteration convergence is performed. During the iteration, the continuous measure side of the transfer matrix is relaxed with a 98% relaxation degree to obtain the optimal transfer matrix of the two measures with relaxed one-sided quantity constraints. Because boundary relaxation is performed, it is also necessary to calculate the eigenvector distance loss between the continuous measure formed by the predicted density map and the edge distribution of the corresponding side of the optimal transfer matrix, forming a one-sided boundary relaxation penalty. This penalty, combined with the optimization process of the one-sided relaxation of the optimal transfer matrix, forms the optimization loss for the dense target count, and then the gradient is obtained to optimize the model.
4. The dense detection method based on one-sided relaxation optimal transmission and pure point-based precise localization according to claim 1, characterized in that: Step 3 proposes a pure point-based precise localization framework that can directly receive a set of labeled points for training. It uses the Hungarian algorithm for one-to-one matching, associating the predicted points from Step 1 with the ground truth target, and predicting the target's location information during inference. Specifically, each feature map pixel generated in Step 1 is assigned four candidate points. The framework's regression end predicts the confidence score and corresponding positional deviation of each candidate point's successful match. Then, the Euclidean distance between the pixel coordinates of each candidate point and the ground truth point is calculated. This distance, combined with the corresponding confidence score, forms the cost matrix of the Hungarian algorithm, which performs one-to-one matching between candidate points and ground truth points. Afterward, the cross-entropy loss and the Euclidean distance between the ground truth point and the corresponding successfully matched candidate point are calculated to supervise the training of candidate point classification and positional deviation, respectively. The combination of these two factors predicts the precise localization information of the target, and the model is optimized during this process to improve prediction accuracy.
Citation Information
Patent Citations
Point cloud sampling method based on optimal transmission theory
CN106952339A
3D attitude estimation method based on voxel features and sparse Sinkhorn Transformer
CN115391733A
