Wire instance detection method and system based on key point matching
Through the wire instance detection method based on key point matching, dynamic feature mapping and multi-scale feature fusion are used to solve the accuracy problem of wire detection under complex background and lighting changes, and the continuous detection and high accuracy detection effects of wire instances are achieved.
Patent Information
- Application Number
- CN202411775989.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-12-05
AI Technical Summary
When existing wire detection methods deal with interference factors such as complex background, light changes, and viewing angle changes in aerial images, it is difficult to accurately detect slender and low-contrast wires, and it is difficult to accurately distinguish different wire examples in wire crossing and dense areas.
A conductor instance detection method based on key point matching is proposed. A four-dimensional feature matrix is generated through dynamic feature mapping and enhancement processing, projection transformation and feature enhancement are performed, and continuous detection and matching of conductor instances are achieved through multi-scale feature fusion and thermal map analysis.
Effectively capture multi-scale features of the wire, ensure the continuity and integrity of wire instances, improve the accuracy and reliability of wire detection, and be able to deal with interference factors such as complex backgrounds and lighting changes.
Smart Images

Figure CN119672004A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of target detection, and in particular to a wire instance detection method and system based on key point matching. Background Art
[0002] In the operation and maintenance of power systems, the safety status of transmission lines is directly related to the reliability and stability of power supply. With the rapid development of UHV transmission networks and the continuous advancement of smart grid construction, traditional manual inspection methods can no longer meet the needs of large-scale, high-frequency, and high-precision inspections. The introduction of aerial inspection technology has brought new development opportunities for power line detection. It can not only quickly obtain a wide range of high-resolution image data, but also effectively avoid the safety risks of manual inspections in complex terrain and harsh environments. Especially in areas with complex terrain such as mountains and jungles, aerial photography can obtain detailed information on areas that are difficult to reach with traditional manual inspections, providing important data support for the preventive maintenance of power lines.
[0003] At present, the research on wire detection in aerial images mainly focuses on edge detection, Hough transform and deep learning. The edge detection-based method extracts image edge features through operators such as Canny and combines morphological processing to achieve preliminary recognition of wires, but it is easy to produce a large number of false edges when processing images with complex backgrounds and uneven lighting. The Hough transform-based method uses the characteristics of wires appearing as straight lines or approximate straight lines in the image for detection, but the detection effect is poor for scenes with curved wires and multiple wires crossing. The deep learning method achieves detection by building a convolutional neural network model and learning the high-level semantic features of wires, but the existing models often require a large amount of labeled data for training, and there is a problem of limited receptive field when processing ultra-long wires.
[0004] In practical applications, the existing wire detection methods still have the following technical difficulties: First, the wires in aerial images are characterized by "ultra-thin and low contrast", especially in complex backgrounds, the wire pixels are difficult to effectively distinguish from the background, and traditional feature extraction methods are difficult to capture such subtle target features; second, in high-resolution aerial images, the wires span multiple image blocks, and the existing feature matching algorithms are difficult to ensure the consistency of feature description when processing cross-block wire connections, resulting in breakpoints and false connections; third, due to the influence of camera perspective, illumination changes and atmospheric disturbances, the apparent features of the same wire in different images are significantly different, and the existing feature description methods are difficult to establish stable feature expressions; fourth, in wire crossing and dense areas, the projections of multiple wires overlap, coupled with the influence of shadows and occlusions, the existing instance segmentation methods are difficult to accurately distinguish different wire instances, and easily cause confusion in the wire connection relationship. These technical difficulties seriously restrict the application effect of wire detection algorithms in actual engineering. Summary of the invention
[0005] The purpose of the invention is to propose a wire instance detection method and system based on key point matching to solve the above problems existing in the prior art.
[0006] The technical solution is a wire instance detection method based on key point matching, comprising the following steps:
[0007] S1. Obtain original aerial image data, generate a four-dimensional feature matrix through dynamic feature mapping and enhancement processing; perform projection transformation on the four-dimensional feature matrix to obtain three-dimensional projection feature data; perform feature enhancement and multi-scale feature fusion based on the three-dimensional projection feature data to generate fused feature data; generate enhanced feature map data based on the fused feature data;
[0008] S2, based on the enhanced feature map data, feature matrix data is obtained through feature reorganization; based on the feature matrix data, recursive decomposition and mapping are performed to generate response matrix data; based on the response matrix data, adaptive threshold data is calculated and key points are screened; feature enhancement is performed on the screened key points, and a feature description set and a key point set are output;
[0009] S3. Generate heat map data through multi-layer heat maps based on the key point set and feature description set; construct a spatial association matrix and multi-dimensional constraints based on the heat map data and the spatial positions of the key points, perform endpoint matching, and obtain matching score data; construct and verify wire instances based on the matching score data, and finally output a wire instance set;
[0010] S4. Based on the wire instance set, boundary feature analysis is performed to obtain a boundary feature matrix; based on the boundary feature matrix, cross-block instance matching is performed to generate cross-block matching data; based on the cross-block matching data, topology optimization is performed to generate topology credibility data; based on the topology credibility data, instance fusion and quality assessment are performed to generate a confidence map and a global wire map.
[0011] The wire instance detection system based on key point matching includes:
[0012] at least one processor; and,
[0013] a memory communicatively connected to at least one of the processors; wherein,
[0014] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the wire instance detection method based on key point matching.
[0015] Beneficial effects: The present invention effectively captures the multi-scale features of the wire, achieves accurate positioning of key points, ensures the continuity and integrity of the wire instance, and achieves accurate reconstruction of the wire system in a large scene; it can effectively handle interference factors such as complex background, illumination changes, and perspective changes in aerial images, thereby improving the accuracy and reliability of wire detection; at the same time, it ensures both computational efficiency and the global consistency of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Flow chart of the method of the present invention.
[0017] Figure 2 This is a flow chart of step S1 of the present invention.
[0018] Figure 3 This is a flow chart of step S2 of the present invention.
[0019] Figure 4 This is a flow chart of step S3 of the present invention.
[0020] Figure 5 This is a flow chart of step S4 of the present invention. DETAILED DESCRIPTION
[0021] like Figure 1 As shown, the present application proposes a wire instance detection method based on key point matching, comprising the following steps:
[0022] S1. Obtain original aerial image data, generate a four-dimensional feature matrix through dynamic feature mapping and enhancement processing; perform projection transformation on the four-dimensional feature matrix to obtain three-dimensional projection feature data; perform feature enhancement and multi-scale feature fusion based on the three-dimensional projection feature data to generate fused feature data; generate enhanced feature map data based on the fused feature data;
[0023] S2, based on the enhanced feature map data, feature matrix data is obtained through feature reorganization; based on the feature matrix data, recursive decomposition and mapping are performed to generate response matrix data; based on the response matrix data, adaptive threshold data is calculated and key points are screened; feature enhancement is performed on the screened key points, and a feature description set and a key point set are output;
[0024] S3. Generate heat map data through multi-layer heat maps based on the key point set and feature description set; construct a spatial association matrix and multi-dimensional constraints based on the heat map data and the spatial positions of the key points, perform endpoint matching, and obtain matching score data; construct and verify wire instances based on the matching score data, and finally output a wire instance set;
[0025] S4. Based on the wire instance set, boundary feature analysis is performed to obtain a boundary feature matrix; based on the boundary feature matrix, cross-block instance matching is performed to generate cross-block matching data; based on the cross-block matching data, topology optimization is performed to generate topology credibility data; based on the topology credibility data, instance fusion and quality assessment are performed to generate a confidence map and a global wire map.
[0026] like Figure 2 As shown, according to one aspect of the present application, step S1 is further:
[0027] S11, obtaining original aerial image data, constructing a four-dimensional feature matrix, including a spatial coordinate dimension, a time dimension, and an image channel dimension; calculating a first standard deviation and a first mean of each slice in the four-dimensional feature matrix, and generating an adaptive weight coefficient based on a ratio relationship between the first standard deviation and the first mean; performing a weighted combination of the four-dimensional feature matrix and the adaptive weight coefficient, and outputting three-dimensional projection feature data;
[0028] S12, based on the three-dimensional projection feature data, calculating the feature variance value and the gradient amplitude; based on the feature variance value, determining the enhancement coefficient and the balance coefficient; based on the median of the gradient amplitude, determining the adjustment coefficient; linearly combining the three-dimensional projection feature data and its second-order gradient, and weighting them using the enhancement coefficient, the balance coefficient and the adjustment coefficient, and outputting the enhanced feature data; wherein the balance coefficient is obtained by subtracting the enhancement coefficient from 1;
[0029] S13, dividing the enhanced feature data according to different scales to generate a multi-scale feature sequence; calculating the correlation matrix between the features of each scale in the multi-scale feature sequence to obtain feature correlation data; constructing a weight matrix based on the feature correlation data; performing weighted fusion on the multi-scale feature sequence based on the weight matrix, and outputting fused feature data;
[0030] S14. Based on the fused feature data, calculate its maximum value, minimum value and standard deviation; based on the maximum value and minimum value, normalize the fused feature data to obtain normalized feature data; based on the standard deviation, calculate the dynamic scaling factor; multiply the normalized feature data by the dynamic scaling factor, and finally output the enhanced feature map data.
[0031] In one embodiment of the present application, an original aerial image I(x, y, t) is obtained, where (x, y) represents the spatial coordinates and t represents the time dimension, a fourth-order tensor T(x, y, t, c) is constructed, where c represents the image channel dimension, and a projection operator P:T → R is defined. 3, project the fourth-order tensor into the three-dimensional feature space; the projection rule is: P(T) = ∑(w_i * T_i), where w_i is the adaptive weight coefficient, calculated by the following formula: w_i = softmax(σ(T_i) / μ(T_i)), where σ(T_i) represents the standard deviation of the tensor slice and μ(T_i) represents the mean.
[0032] Construct the enhancement function E(f) = α * f + β * G(f), where f is the feature after projection and G(f) is the gradient enhancement term: G(f) = ▽ 2 f * (1 + γ|▽f|), α, β, γ are adaptive parameters, dynamically adjusted by feature statistics: α = log(1 + var(f)); β = 1 - α; γ = median(|▽f|). Construct a pyramid feature sequence {F_k}, k∈[1, K], and use a cross-scale attention mechanism: A(F_k) = ∑(θ_ij * F_i * F_j), i, j∈[1, K]; θ_ij =normalize(F_i T * W * F_j), W is a learnable weight matrix. The final output enhanced feature map F_out: F_out = M(E(P(T))) * A({F_k}), where M is the adaptive normalization operator: M(x) = (x - min(x)) / (max(x) -min(x))*λ, λ is the dynamic scaling factor: λ = log(1 + std(x)).
[0033] In another embodiment of the present application, the adaptive weight calculation of the four-dimensional feature matrix is specifically: W(k) = η(R(k))·exp(-λ·σ(k) / μ(k)); wherein R(k) =Σ(|F(i, j, k) - F(i, j, k-1)|) / N, R(k) is the temporal change rate of the k-th dimension feature; σ(k) = sqrt(Σ(F(i, j, k) - μ(k)) 2 / M), σ(k) is the standard deviation of the k-th dimension feature; μ(k) = Σ(F(i, j, k) / M), μ(k) is the mean of the k-th dimension feature; η(x) = 1 / (1+exp(-ax)) is the sigmoid normalization function; F(i, j, k) represents the value of the k-th dimension of the four-dimensional feature matrix at position (i, j); N is the number of time series samples; M is the number of spatial sampling points; λ is the balance coefficient, which is used to adjust the influence of variance on weight; a is the scaling factor of the sigmoid function.
[0034] The process of generating dynamic coefficients for feature enhancement is as follows: E(x, y) = α(x, y)·F(x, y) + β(x, y)·L(x, y); where α(x, y) = (1 - exp(-v(x, y) / v_max))·g(x, y), α(x, y) is the local enhancement coefficient; β(x, y) = 1 - α(x, y), β(x, y) is the balance coefficient; v(x, y) = Σ(|▽F(x, y)| 2 ), v(x, y) is the local gradient strength; L(x, y) = F(x, y) - γ·▽ 2 F(x, y), L(x, y) are Laplace enhancement terms; g(x, y) = exp(-|I(x, y) - μ| 2 / 2σ 2 ), g(x, y) is the Gaussian weight; v_max is the maximum value of the gradient intensity; γ is the weight coefficient of the Laplace operator; ▽ represents the gradient operator; ▽ 2 represents the Laplace operator; I(x, y) is the original image intensity; μ is the local mean; σ is the Gaussian kernel parameter.
[0035] This embodiment constructs a feature extraction and conversion framework from four dimensions to three dimensions through dynamic feature mapping and enhancement processing, and realizes the multi-dimensional capture and enhancement of wire features in aerial images. By constructing a four-dimensional feature matrix, the spatial position, time series and image channel information are encoded at the same time, providing a rich information basis for subsequent feature extraction. In the feature conversion process, the adaptive weight coefficient is generated by calculating the ratio of the standard deviation and the mean, which can automatically adjust the importance of features of different dimensions and effectively suppress the noise and interference in the aerial image. The feature enhancement stage adopts the joint constraint of the feature variance value and the gradient amplitude, and realizes the dynamic enhancement of the feature through the adaptive adjustment coefficient, which not only maintains the detailed features of the wire, but also enhances its contrast with the background. Through multi-scale feature fusion, while maintaining the integrity of the wire, the discriminability of the feature is improved, making the subsequent key point detection and matching more accurate and reliable. This embodiment improves the detection capability of slender wire structures under complex backgrounds, especially when dealing with interference factors such as common illumination changes and perspective changes in aerial images, it shows strong robustness.
[0036] According to one aspect of the present application, step S11 is further:
[0037] S111, acquiring and extracting spatial coordinate information based on the original aerial image data to generate a position matrix; extracting time series information to obtain time series data; separating image channels to obtain channel feature data; combining the position matrix, time series data and channel feature data to construct a four-dimensional feature matrix;
[0038] S112, slicing the four-dimensional feature matrix, slicing along the spatial dimension to obtain spatial slice data, slicing along the time dimension to obtain time series slice data, and slicing along the channel dimension to obtain channel slice data; calculating local statistics of the spatial slice data, the time series slice data, and the channel slice data, and outputting the slice statistical data;
[0039] S113, based on the slice statistical data, calculating the first standard deviation of each slice to obtain a standard deviation sequence; based on the slice statistical data, calculating the first mean of each slice to obtain a mean sequence; dividing the standard deviation sequence by the mean sequence to generate a ratio sequence; normalizing the ratio sequence and outputting an adaptive weight coefficient;
[0040] S114. Based on the four-dimensional feature matrix and the adaptive weight coefficient, the projection of the feature matrix on each dimension is calculated to obtain dimensional projection data; the dimensional projection data is weightedly combined with the adaptive weight coefficient to generate weighted projection data; the weighted projection data is transformed into a dimensionality reduction mode to output three-dimensional projection feature data.
[0041] This embodiment realizes multi-dimensional feature encoding of aerial image data by constructing a four-dimensional feature matrix. By extracting spatial coordinate information, time series information and channel feature information, a four-dimensional matrix containing complete feature information is constructed, which can fully capture the spatial structure and time series change characteristics of the wire. In the feature processing process, by multi-dimensionally slicing the matrix, spatial slice data, time series slice data and channel slice data are obtained respectively, and the local statistics of each slice are calculated, which can effectively suppress noise interference. By calculating the ratio relationship between the standard deviation sequence and the mean sequence, an adaptive weight coefficient is generated, which can automatically adjust the contribution of each dimensional feature according to the importance of the feature. Through feature projection and weighted combination, feature dimensionality reduction from four dimensions to three dimensions is achieved, while maintaining the key feature information of the wire. This embodiment provides a rich and reliable feature basis for subsequent feature processing through multi-dimensional feature encoding and adaptive weight adjustment.
[0042] According to one aspect of the present application, step S12 is further:
[0043] S121, receiving three-dimensional projection feature data, calculating feature distribution in a local window to obtain distribution feature data; generating a variance matrix by counting local variance of the feature; normalizing the variance matrix, and outputting feature variance data;
[0044] S122, reading the three-dimensional projection feature data, calculating the gradients in the horizontal and vertical directions to obtain directional gradient data; calculating the gradient amplitude based on the directional gradient data, generating a gradient amplitude map; extracting the main directional features of the gradient, and outputting the gradient feature data;
[0045] S123, acquiring feature variance data, calculating the maximum and minimum values of the local area to obtain extreme value data; constructing an adaptive mapping function based on the extreme value data to generate mapping coefficient data; converting the mapping coefficient data into an enhancement coefficient α, and outputting Alpha parameter data;
[0046] S124, receiving gradient feature data, calculating a distribution histogram of gradient amplitude to obtain amplitude distribution data; extracting a median feature of the distribution to generate statistical feature data; calculating an adjustment coefficient γ based on the statistical feature data, and outputting Gamma parameter data;
[0047] S125, reading the three-dimensional projection feature data, calculating the second-order derivative of the feature to obtain the second-order gradient data; extracting the curvature information of the feature to generate the curvature feature data; combining the second-order gradient data with the curvature feature data to output the enhanced base data;
[0048] S126, obtaining Alpha parameter data, Gamma parameter data and enhanced base data, constructing a feature enhancement function to obtain enhancement function data; calculating the enhanced weight distribution, generating weight distribution data; performing adaptive enhancement processing on the features, and outputting enhanced feature data.
[0049] This embodiment achieves effective enhancement of projection feature data through feature variance calculation and gradient analysis. By calculating the feature distribution and variance matrix in the local window, the local statistical characteristics of the feature are obtained, which can accurately reflect the local changes of the wire structure. In the gradient feature extraction process, a complete gradient feature description is constructed by calculating the gradient information in the horizontal and vertical directions, and the adjustment coefficient is determined by amplitude distribution analysis, which can effectively enhance the edge features of the wire. By combining the feature variance and gradient information, an adaptive feature enhancement function is constructed, which can dynamically adjust the degree of enhancement according to the importance of the local feature, which not only maintains the detailed features of the wire, but also improves its contrast with the background. This embodiment improves the discriminability of wire features through feature statistical analysis and adaptive enhancement, and provides a reliable feature basis for subsequent key point detection.
[0050] like Figure 3 As shown, according to one aspect of the present application, step S2 is further:
[0051] S21, reorganizing the enhanced feature map data into feature matrix data including spatial position and feature dimension; calculating the eigenvector of the feature matrix data to obtain a left eigenvector matrix and a right eigenvector matrix; calculating the eigenvalue diagonal matrix based on the left eigenvector matrix and the right eigenvector matrix, and processing the residual term through a nonlinear mapping function to output the decomposed feature data;
[0052] S22, based on the left eigenvector matrix and the right eigenvector matrix in the decomposed feature data, calculating the spatial attention mapping value and the feature attention mapping value; performing matrix multiplication operation on the spatial attention mapping value and the feature attention mapping value to generate a key point response matrix; constructing a learnable weight matrix, adjusting the key point response matrix, and outputting the response matrix data;
[0053] S23, based on the response matrix data, calculating the second mean, the second standard deviation and the information entropy; based on the information entropy, calculating the dynamic coefficient; combining the second mean, the second standard deviation and the dynamic coefficient to generate adaptive threshold data; based on the adaptive threshold data, screening the response matrix data, and outputting the candidate point set data;
[0054] S24, based on the candidate point set data, extracting local neighborhood features for each candidate point; calculating the gradient and second-order derivative of the local neighborhood features, generating adaptive convolution kernel data; obtaining the image size, calculating the position encoding value; based on the position encoding value, the adaptive convolution kernel data and the local neighborhood features, combining and generating a feature description set;
[0055] S25. Based on the candidate point set data and the feature description set, the local significance score and spatial distribution score of each point are calculated; based on the variance value of the feature description set, the balance factor is calculated; based on the balance factor, the local significance score and the spatial distribution score are weightedly combined to obtain a weighted combination score; based on the weighted combination score, the points are finally screened by dynamically filtering the preset threshold and outputting the key point set.
[0056] In one embodiment of the present application, the feature map F_out is reorganized into a feature matrix M(p, q), where p represents the spatial position and q represents the feature dimension; bidirectional recursive feature decomposition (BRFD) is adopted: M = U∑V T + R, where U is the left eigenvector matrix, ∑ is the eigenvalue diagonal matrix, V is the right eigenvector matrix, and R is the residual matrix: R = H(M - U∑V T ), H is a nonlinear mapping function: H(x) = tanh(ωx) / (1 + e -φx ), ω, φ are adaptive parameters.
[0057] Construct the key point response matrix K: K = Ψ(U) * Ω(V); where Ψ(U) is the spatial attention map: Ψ(U) = softmax(U T * W_u * U), Ω(V) is the feature attention map: Ω(V) = softmax(V T* W_v * V) W_u, W_v are learnable weight matrices. Dynamic Threshold Optimization Network (DTON) is introduced to calculate the adaptive threshold τ: τ=μ(K)+Δ*σ(K), where Δ= log(1 + entropy(K)), entropy(K) is the information entropy; generate the candidate point set C: C = {(x, y) | K(x, y) >τ}.
[0058] For each candidate point c∈C, calculate its feature descriptor D(c): D(c) = Φ(N(c)) * Γ(c), where N(c) is the local neighborhood of point c, Φ is the local feature extraction operator: Φ(x) = conv(x, g(x)), g(x) is the adaptive convolution kernel: g(x) = normalize(▽ 2 x + |▽x|), Γ(c) is the position code: Γ(c) = [sin(πx / W), cos(πx / W), sin(πy / H), cos(πy / H)], W and H represent the width and height of the feature map, respectively. The final output is the optimized key point set P and the corresponding feature description set D: P = {p | p∈C, Q(p) > η}, where Q(p) is the point quality score: Q(p) =ρ * L(p) + (1-ρ) * S(p), L(p) is the local significance score, S(p) is the spatial distribution score, and ρ is the balance factor: ρ= sigmoid(var(D(p))), D(p) is the feature descriptor of point p, var represents the variance, and η is the dynamic screening threshold: η=median(Q) + std(Q), where median represents the median and std represents the standard deviation.
[0059] In another embodiment of the present application, the characteristic recursive decomposition calculation process is specifically: D(F) = U·Σ·V T + R(F); where R(F) =ψ(F - U·Σ·V T ), R(F) is the nonlinear residual term; ψ(x) = sign(x)·log(1+|x|) is the nonlinear mapping function; U is the left eigenvector matrix; V is the right eigenvector matrix; Σ is the eigenvalue diagonal matrix; F is the input feature matrix; sign(x) is the sign function; |x| represents the absolute value.
[0060] This embodiment constructs an efficient feature reorganization and key point extraction framework by designing a recursive decomposition and mapping strategy. First, the enhanced feature map is reorganized into a feature matrix containing spatial position and feature dimensions. The effective decomposition of features is achieved by calculating the left and right feature vector matrices, which not only reduces the computational complexity but also retains the main structural information of the wire. In the feature mapping stage, a dual mapping mechanism of spatial attention and feature attention is adopted, and adaptive enhancement of key areas is achieved through a learnable weight matrix, which is particularly suitable for processing the feature extraction of slender wire structures in aerial images. In the key point screening stage, an adaptive threshold mechanism based on information entropy is introduced. By comprehensively considering the mean, standard deviation and information entropy, intelligent screening of potential key points is achieved, and the positioning accuracy of key points is improved. In the final feature enhancement stage, a robust feature descriptor is constructed by extracting local neighborhood features and combining position encoding. This descriptor can not only accurately characterize the local geometric features of the wire, but also has strong rotation and scale invariance. This embodiment improves the detection accuracy of wire key points and the discriminability of feature description in complex scenes through the synergy of feature decomposition, dual attention mechanism and adaptive threshold.
[0061] According to one aspect of the present application, step S22 is further:
[0062] S221, read the decomposed feature data, extract the left eigenvector matrix and the right eigenvector matrix; perform scale normalization on the two matrices to obtain a normalized left matrix and a normalized right matrix; calculate the statistical features of the matrix and output the feature statistical data;
[0063] S222, obtain the normalized left matrix, calculate the relative relationship of the spatial position to obtain the position relationship data; construct a local connection map, generate the connection map data; calculate the spatial attention distribution based on the position relationship data and the connection map data, and output the spatial attention mapping value;
[0064] S223, receiving the normalized right matrix, calculating the correlation between feature channels to obtain a channel correlation matrix; extracting the main mode of the feature, generating pattern feature data; calculating the feature attention distribution based on the channel correlation matrix and the pattern feature data, and outputting the feature attention mapping value;
[0065] S224, reading the spatial attention mapping value and the feature attention mapping value, constructing the corresponding relationship of the mapping values to obtain corresponding relationship data; calculating the matching degree of the mapping value to generate matching degree data; performing matrix multiplication operation on the corresponding relationship data and the matching degree data, and outputting the initial key point response matrix;
[0066] S225, obtaining an initial key point response matrix, constructing a dynamic weight learning network to obtain learning network data; calculating the response distribution of the network, generating distribution feature data; constructing a learnable weight matrix based on the learning network data and the distribution feature data, and outputting the weight matrix data;
[0067] S226, receiving the initial key point response matrix and weight matrix data, calculating the fitness between the matrices to obtain fitness data; performing matrix adjustment operations to generate adjustment matrix data; normalizing the adjustment matrix data and outputting the response matrix data.
[0068] This embodiment realizes efficient mapping and enhancement of decomposed features by constructing a dual attention mechanism. First, by normalizing the scale of the left and right feature vector matrices, a stable feature basis is established, which can reduce the impact of feature scale changes. In the spatial attention calculation process, by constructing a local spatial relationship graph and calculating the relative distance, an adaptive evaluation of the importance of spatial position is achieved, which can highlight the key structural features of the wire. In the feature attention calculation stage, by analyzing the correlation and main direction information between feature channels, an attention mapping at the feature level is constructed, which can simultaneously focus on the importance of spatial structure and feature expression. Finally, the response matrix is dynamically adjusted through a learnable weight matrix to achieve adaptive enhancement of features. This embodiment improves the expressiveness and discriminability of wire features through the synergistic effect of spatial attention and feature attention.
[0069] According to one aspect of the present application, step S23 is further:
[0070] S231, receiving response matrix data, and obtaining a regional matrix sequence according to spatial region division; calculating pixel distribution of each region to obtain distribution feature data; performing statistical analysis on the distribution feature data, and outputting statistical basic data;
[0071] S232, reading statistical basic data, calculating the mean of the local area to obtain a local mean matrix; extracting global mean features, generating global mean data; performing weighted combination of the local mean matrix and the global mean data, and outputting comprehensive mean data;
[0072] S233, obtaining statistical basic data, calculating the local standard deviation to obtain the local variance matrix; extracting the global dispersion feature, generating dispersion data; performing normalization processing based on the local variance matrix and dispersion data, and outputting the standard deviation data;
[0073] S234, receiving statistical basic data, calculating the probability distribution of the local area to obtain a probability distribution matrix; calculating information entropy based on the probability distribution, generating local entropy value data; performing spatial aggregation on the local entropy value data, and outputting information entropy data;
[0074] S235, reading information entropy data, constructing a dynamic mapping function to obtain mapping function data; calculating the change trend of the entropy value, generating change trend data; calculating the coefficient based on the mapping function data and the change trend data, and outputting dynamic coefficient data;
[0075] S236, obtaining comprehensive mean data, standard deviation data and dynamic coefficient data, constructing an adaptive combination function to obtain combination function data; calculating the weight distribution of parameters to generate weight distribution data; performing weighted combination on the three types of data, and outputting adaptive threshold data;
[0076] S237, receiving response matrix data and adaptive threshold data, calculating the difference between the response value and the threshold to obtain difference matrix data; extracting the position that meets the threshold condition and generating position index data; extracting the corresponding response value based on the position index data and outputting the candidate point set data.
[0077] This embodiment realizes accurate screening of the response matrix through adaptive threshold construction. First, by performing regional division and statistical analysis on the response matrix, detailed distribution feature information is obtained, which can accurately capture the changing characteristics of the local response. In the threshold parameter calculation process, a multi-dimensional evaluation system is established by comprehensively considering the local mean, standard deviation and information entropy, which can adaptively determine the screening criteria. The adaptive adjustment of the threshold is realized by introducing the dynamic coefficient, and the strictness of the screening criteria can be automatically adjusted according to the complexity of the image content. The screening process accurately extracts the candidate key points by calculating the difference between the response value and the threshold, which not only ensures the reliability of the key points, but also avoids excessive false detections. This embodiment realizes accurate screening of key points through multi-dimensional statistical feature analysis and dynamic threshold adjustment.
[0078] According to one aspect of the present application, step S24 is further:
[0079] S241, based on the candidate point set data, extracting multi-scale neighborhood blocks with each candidate point as the center to generate a neighborhood block sequence; performing direction normalization processing on the neighborhood block sequence to obtain normalized neighborhood data; calculating the grayscale distribution characteristics of the normalized neighborhood data, and outputting neighborhood feature data;
[0080] S242, based on the neighborhood feature data, calculating the first-order gradients in the horizontal and vertical directions to obtain a gradient vector field; based on the gradient vector field, calculating the Laplace operator response to generate a second-order derivative map; performing a weighted combination of the gradient vector field and the second-order derivative map according to the intensity distribution, and outputting gradient feature data;
[0081] S243, based on the gradient feature data, calculating the local response intensity and the local gradient direction histogram to obtain direction distribution data; based on the direction distribution data, constructing an adaptive Gaussian filter to generate filter coefficients; modulating the filter coefficients with the local response intensity to output adaptive convolution kernel data;
[0082] S244, obtaining image size parameters, generating coordinate grids in horizontal and vertical directions, and obtaining position coordinate data; performing sine and cosine transforms on the position coordinate data to obtain periodic coding data; extracting global scale information based on the image size parameters; normalizing the periodic coding data based on the global scale information, and outputting a position coding value;
[0083] S245. Based on the adaptive convolution kernel data, the neighborhood feature data is filtered to obtain filtered feature data; the filtered feature data is concatenated with the position coding value in the channel dimension to generate combined feature data; the combined feature data is dimensionally adjusted and normalized to output a feature description set.
[0084] In one embodiment of the present application, the process of generating an adaptive convolution kernel is specifically as follows: K(x, y) = λ(x, y)·D(x, y) + (1-λ(x, y))·G(x, y); wherein D(x, y) = Σ(h(θ)·Δ(x·cos(θ)+y·sin(θ))), D(x, y) is a directional response kernel; G(x, y) = exp(-(x 2 +y 2 ) / (2σ_g 2 ))·(1-x 2 / σ_x 2 -y 2 / σ_y 2 ), G(x, y) is the Gaussian-Laplacian kernel; λ(x, y) = sigmoid(||▽I(x, y)||) is the adaptive weight; h(θ) is the direction histogram; Δ(·) is the Dirac function; σ_g, σ_x, σ_y are the kernel function parameters; ▽I(x, y) is the image gradient.
[0085] This embodiment realizes the accurate description of candidate points by constructing a multi-scale local feature descriptor. First, by extracting multi-scale neighborhood blocks and performing directional normalization, a stable feature extraction foundation is established, which can effectively handle the scale changes of the wire. In the gradient feature extraction process, a complete local structure description is constructed by calculating the first-order gradient and second-order derivative response, and the adaptive enhancement of features is realized by the design of an adaptive Gaussian filter. By introducing a position encoding mechanism, the global position information is organically integrated with the local features, which can better express the spatial structural relationship of the wire. Finally, through feature combination and normalization processing, a feature description set with strong discriminability is generated. This embodiment constructs a feature descriptor that maintains local details and contains global information through the combination of multi-scale feature extraction and position encoding.
[0086] In another embodiment of the present application, step S22 may also be:
[0087] S22a, reading the decomposed feature data, separating and obtaining a left feature vector matrix and a right feature vector matrix; calculating the spatial distribution characteristics of the feature vectors to obtain distribution feature data; normalizing the distribution feature data, and outputting normalized feature data;
[0088] S22b, obtaining the left eigenvector matrix, constructing a local spatial relationship graph to obtain spatial relationship data; calculating the relative distance of the spatial positions, generating distance matrix data; based on the spatial relationship data and the distance matrix data, outputting spatial association data;
[0089] S22c, receiving the right eigenvector matrix, calculating the similarity between feature channels to obtain a channel similarity matrix; extracting the main direction information of the feature, generating directional feature data; combining the channel similarity matrix with the directional feature data, and outputting feature association data;
[0090] S22d, read spatial correlation data, construct a self-attention mapping network to obtain attention network data; calculate attention weight distribution, generate weight distribution data; apply attention weights to spatial correlation data, and output spatial attention mapping;
[0091] S22e, acquiring feature association data, extracting local response patterns to obtain response pattern data; calculating response intensity distribution, generating intensity distribution data; outputting feature attention mapping based on the response pattern data and intensity distribution data;
[0092] S22f, receiving the spatial attention map and the feature attention map, calculating the interaction response matrix to obtain the interaction matrix data; extracting the main components of the response to generate the principal component data; performing feature enhancement on the interaction matrix data, and outputting the enhanced response data;
[0093] S22g, read the enhanced response data, construct a learnable weight matrix to obtain the learning weight data; apply the weight matrix to perform feature transformation to generate transformed feature data; normalize the transformed feature data and output the key point response matrix; adjust the key point response matrix through the learnable weight matrix and output the response matrix data.
[0094] like Figure 4 As shown, according to one aspect of the present application, step S3 is further:
[0095] S31. Based on the key point set, calculate the characteristic entropy value and local variance value of each key point; based on the characteristic entropy value and local variance value, calculate the adaptive variance parameter, and build an improved Gaussian distribution model; based on the Gaussian distribution model, generate a local heat map for each key point and fuse them, and output the heat map data;
[0096] S32, based on the heat map data and the feature description set, calculate the cosine similarity of the feature description to obtain feature similarity data; obtain and calculate the distance matrix based on the spatial position of the key point to generate position-related data; perform weighted combination of the feature similarity data and the position-related data to output a spatial association matrix;
[0097] S33, based on the spatial association matrix, calculating the feature similarity, geometric constraint value and linear consistency value between the candidate endpoint pairs; based on the feature similarity, geometric constraint value and linear consistency value, calculating the constraint mean data, and generating a first adaptive weight; based on the first adaptive weight, performing a weighted combination of the feature similarity, geometric constraint value and linear consistency value, and outputting matching score data;
[0098] S34, based on the matching score data, calculating the topological consistency score of each pair of matching endpoints; based on the variance of the matching score data, calculating the dynamic balance factor; based on the dynamic balance factor, performing a weighted combination of the matching score data and the topological consistency score to generate wire credibility data; based on the wire credibility data and the coordinates of the matching endpoints, constructing a wire path, and using a path correction algorithm to generate wire path data;
[0099] S35. Based on the wire path data and the wire credibility data, the visualization consistency score, the regional support score and the topological uniqueness score of each wire instance are calculated; based on the degree of change of the visualization consistency score, the regional support score and the topological uniqueness score, the second adaptive weight is determined; based on the second adaptive weight, the visualization consistency score, the regional support score and the topological uniqueness score are weightedly combined to generate instance quality data; based on the instance quality data, the wire instances are screened and optimized, and a set of wire instances is output.
[0100] In one embodiment of the present application, based on the key point set P and the feature description set D, an adaptive multi-layer heatmap network (AMHN) is constructed, and for each key point p∈P, an improved Gaussian heatmap H is generated: H(x, y, p) = exp(-((x-x_p) 2 + (y-y_p) 2 ) / (2σ_p 2 )), where σ_p is the adaptive variance: σ_p=α*E(p) + β*V(p), E(p) is the characteristic entropy of the point: E(p) = -∑(D(p)_i * log(D(p)_i)), V(p) is the local variance: V(p) = var(N(p)), α, β are dynamic weights: α = sigmoid(E(p)), β = 1-α, and N(p) is the local neighborhood of point p.
[0101] The hierarchical spatial attention mechanism (HSA) is introduced to construct the spatial correlation matrix S: S(i, j) = ψ(D(p_i), D(p_j))*φ(pos(p_i), pos(p_j)), where ψ is the feature similarity function: ψ(a, b) = (a·b) / (|a|·|b|); φ is the position correlation function: φ(a, b) = exp(-||ab|| 2 / λ); λ is the adaptive scale parameter: λ = median(||pos(p_i)-pos(p_j)|| 2 ). A multi-constraint endpoint matching network (MEMN) is constructed. For each pair of candidate endpoints (p_i, p_j), the matching score M is calculated: M(i, j) = w_1·F(i, j) + w_2·G(i, j) + w_3·L(i, j); where F(i, j) is the feature similarity: F= S(i, j); G(i, j) is the geometric constraint: G = exp(-|d(i, j)-μ_d| / σ_d); L(i, j) is the linear consistency: L =cos(θ(i, j)); d(i, j) is the distance between endpoints; θ(i, j) is the angle with the main direction; μ_d, σ_d are distance statistics; w_1, w_2, w_3 are adaptive weights: [w_1, w_2, w_3] = softmax([F_avg, G_avg, L_avg]).
[0102] Construct an adaptive wire instance generator (AWIG). For each matching pair (p_i, p_j): calculate the wire credibility C: C(i, j) = ρ·M(i, j) + (1-ρ)·T(i, j), where T is the topological consistency score and ρ is the dynamic balance factor: ρ = sigmoid(var(M)); construct the wire path W: W(i, j) = {x(t)| t∈[0, 1]} x(t) = p_i + t(p_j-p_i) + B(t), B(t) is the path correction term: B(t) = κ·sin(πt)·n, κ is the bending coefficient, and n is the normal vector.
[0103] A multi-verification optimization network (MVON) is applied to calculate the instance quality score Q for each wire instance W: Q(W) = α·V(W) + β·R(W) + γ·U(W), where V is the visualization consistency score, R is the regional support score, and U is the topological uniqueness score; α, β, and γ are adaptive weights.
[0104] In another embodiment of the present application, the process of generating and calculating the multi-layer heat map is specifically as follows: H(x, y) = Σ(w_k·G_k(x, y)); where G_k(x, y) = exp(-(|x-x_k| 2 +|y-y_k| 2 ) / (2σ_k 2 ))·s_k; w_k = exp(-E_k / E_max) / (Σexp(-E_i / E_max)), w_k is the adaptive weight of the kth key point; G_k(x, y) is the Gaussian heat map centered on the key point (x_k, y_k); σ_k = β·sqrt(V_k) is the adaptive variance parameter; s_k is the confidence score of the key point; E_k is the characteristic entropy value of the key point, E_k = -Σ(p_i·log(p_i)); V_k is the local variance of the key point neighborhood; E_max is the maximum entropy value; β is the scale adjustment coefficient; p_i is the normalized probability of the feature histogram.
[0105] The specific process of outputting the spatial association matrix is as follows: the weighted fusion calculation formula of feature similarity and spatial distance is F(i, j) = α(t)·S_feat(i, j) + β(t)·S_pos(i, j) + γ(t)·S_dir(i, j); where S_feat(i, j) = cos(V(i), V(j)) = V(i)·V(j) / (||V(i)||·||V(j)||), S_feat(i, j) is the cosine similarity of the feature descriptor; S_pos(i, j) = exp(-||P(i)-P(j)|| 2 / σ 2 ), S_pos(i, j) is the Gaussian similarity of the spatial position; S_dir(i, j) = |cos(θ(i)-θ(j))|, S_dir(i, j) is the consistency measure of the direction vector; α(t), β(t), γ(t) are adaptive weight coefficients, which are dynamically adjusted according to the statistical characteristics of the local area; V(i), V(j) are the feature description vectors of key points i and j; P(i), P(j) are the spatial coordinates of key points i and j; θ(i), θ(j) are the main direction angles at key points i and j; σ is the scale parameter of the Gaussian kernel, which is adaptively set according to the image resolution; ||·|| represents the Euclidean norm; t is the time step of the current processing.
[0106] The matching score calculation process of multi-dimensional constraints is as follows: S(p, q) = ω1·D(p, q) + ω2·G(p, q) +ω3·C(p, q); where D(p, q) = exp(-||f(p) - f(q)|| 2 / σ_f 2 ), D(p, q) is the similarity measure of feature descriptors; G(p, q) = exp(-θ(p, q) 2 / σ_θ 2 )·exp(-d(p,q) 2 / σ_d 2 ), G(p, q) is a geometric constraint; C(p, q) = exp(-|κ(p) - κ(q)| / σ_κ), C(p, q) is a curvature consistency constraint; f(p) and f(q) are feature descriptors of endpoints p and q; θ(p, q) is the angle between the endpoint connection direction and the main direction; d(p, q) is the normalized distance between the endpoints; κ(p) and κ(q) are the local curvatures at the endpoints; ω1, ω2, ω3 are constraint weights, and Σωi=1; σ_f, σ_θ, σ_d, σ_κ are scale parameters of each constraint.
[0107] This embodiment realizes accurate detection and matching of wire instances by constructing a multi-layer heat map and a spatial association matrix. First, a multi-layer heat map is generated based on a set of key points, and an improved Gaussian distribution model is constructed by calculating the feature entropy value and the local variance value, which can better express the continuity and integrity of the wire structure. In the spatial feature enhancement stage, an effective spatial association mechanism is established by calculating the weighted combination of the cosine similarity of the feature description and the distance matrix, and the connection accuracy of the wire instance is improved. The multi-dimensional constraint matching stage introduces multiple constraints of feature similarity, geometric constraints and linear consistency. Through the dynamic adjustment of adaptive weights, accurate matching of wire instances is achieved, and complex situations such as wire crossing and overlapping in aerial images are effectively solved. In the wire instance verification stage, a comprehensive quality assessment system is constructed by calculating the topological consistency score and the visual consistency score, which can effectively filter out false matches and improve the reliability of wire detection. This embodiment realizes accurate detection and reliable matching of complex wire structures in aerial images through the synergy of heat maps, spatial associations and multi-dimensional constraints.
[0108] According to one aspect of the present application, step S32 is further:
[0109] S321, receiving heat map data and a feature description set, extracting direction information of the feature description to obtain direction feature data; calculating the amplitude distribution of the feature, generating amplitude distribution data; normalizing the direction feature data and the amplitude distribution data, and outputting normalized feature data;
[0110] S322, reading normalized feature data, constructing feature vector pairs to obtain feature pair sets; calculating cosine distances between feature pairs, generating distance mapping data; scaling the distance mapping data, and outputting feature similarity data;
[0111] S323, obtaining the spatial coordinate information of the key points, calculating the Euclidean distance between the point pairs to obtain the original data of the distance matrix; constructing a Gaussian kernel function of the spatial distance to generate kernel function data; applying the kernel function transformation to the original data of the distance matrix to output the position-related data;
[0112] S324, receiving feature similarity data, calculating similarity distribution of local areas to obtain local distribution data; extracting global similarity patterns to generate pattern feature data; constructing adaptive weights based on local distribution data and pattern feature data, and outputting similarity weight data;
[0113] S325, reading location-related data, analyzing the clustering characteristics of the spatial location to obtain clustering characteristic data; calculating the continuity of the spatial distribution to generate continuity data; combining the clustering characteristic data and the continuity data to construct a spatial weight, and outputting the location weight data;
[0114] S326. Obtain feature similarity data, position-related data, similarity weight data and position weight data, construct a multidimensional correlation function to obtain correlation function data; calculate the fusion coefficient of each dimension to generate fusion coefficient data; perform weighted combination on the multidimensional features and output a spatial correlation matrix.
[0115] This embodiment achieves accurate matching of wire instances through feature similarity calculation and spatial association analysis. First, by extracting the directional information of the heat map data and feature description, the basis for feature matching is established, which can effectively handle the directional change of the wire. In the similarity calculation process, by constructing feature vector pairs and calculating the cosine distance, the similarity measurement at the feature level is realized. At the same time, the Gaussian kernel function transformation of the spatial distance is introduced, which effectively combines the feature similarity and spatial position constraints. By analyzing the similarity distribution of local areas and the clustering characteristics of spatial positions, an adaptive weight allocation mechanism is constructed, which can automatically adjust the importance of the features in the matching process according to their reliability. Finally, the feature similarity and position correlation are fused through a multidimensional correlation function to generate a comprehensive spatial association matrix. This embodiment improves the accuracy and reliability of wire instance matching through the organic combination of feature similarity and spatial constraints.
[0116] According to one aspect of the present application, step S33 is further:
[0117] S331, based on the spatial association matrix, extracting the feature vectors of the candidate endpoint pairs, calculating the cosine distance of the feature vectors, and obtaining a similarity matrix; based on the similarity matrix, constructing a feature distribution histogram, generating distribution feature data; normalizing the distribution feature data, and outputting feature similarity data;
[0118] S332, based on the spatial association matrix, obtaining the spatial coordinates of the candidate endpoint pairs, calculating the Euclidean distance between the endpoints, and obtaining a distance matrix; based on the distance matrix, statistically analyzing the distance distribution characteristics in the local area and generating distance statistics; comparing the distance statistics with a preset threshold and outputting distance constraint data;
[0119] S333, based on the spatial correlation matrix, obtain the position information of the endpoint pairs, calculate the connection direction vector, and obtain the direction matrix; based on the gradient amplitude in step S12, extract the main direction feature of the image and generate the main direction data; calculate the angle between the direction matrix and the main direction data, and output the direction constraint data;
[0120] S334, extracting structural features of the local area based on the distance constraint data and the direction constraint data to obtain structural feature data; calculating the structural consistency score based on the structural feature data to generate structural constraint data; combining the distance constraint data, the direction constraint data and the structural constraint data to output a geometric constraint value;
[0121] S335, based on the spatial association matrix, obtaining the connection information of the endpoint pairs, calculating the curvature characteristics of the connection, and obtaining curvature data; based on the connection information, extracting the linear metric characteristics of the connection, generating linear feature data; based on the curvature data and the linear feature data, calculating the linear consistency score, and outputting the linear constraint value;
[0122] S336. Based on the feature similarity data, geometric constraint values and linear constraint values, calculate the mean of each constraint to obtain constraint mean data; based on the constraint mean data, generate second weight coefficient data; perform weighted combination of the feature similarity data, geometric constraint values, linear constraint values and the second weight coefficient data to output matching score data.
[0123] This embodiment achieves accurate screening of candidate matching pairs through multi-dimensional constraint evaluation. First, by analyzing the distribution characteristics and distance statistics of feature vectors, a basic matching evaluation system is established, which can comprehensively measure the reliability of matching. In the geometric constraint calculation process, a complete geometric constraint system is constructed by analyzing the directional relationship and spatial structure characteristics of endpoint pairs, which can effectively filter unreasonable matches. The linear constraint evaluation stage further ensures the rationality of the matching results by analyzing the curvature characteristics and linear metric characteristics of the connection. Finally, through the dynamic allocation of adaptive weights, the effective fusion of various constraints is achieved, and a comprehensive matching score is generated. This embodiment constructs a reliable matching evaluation system through the synergy of feature similarity, geometric constraints and linear constraints.
[0124] like Figure 5 As shown, according to one aspect of the present application, step S4 is further:
[0125] S41, obtaining boundary area data of adjacent image blocks in the wire instance set, extracting boundary features, and generating a boundary feature matrix; based on the boundary feature matrix, calculating the inner product and norm of boundary feature vectors of adjacent blocks to obtain feature vector data; normalizing the feature vector data, and outputting boundary alignment score data;
[0126] S42, based on the wire instance set, extracting the wire endpoint information at the boundary; based on the boundary alignment score data and the wire endpoint information, calculating the direction vector angle between the endpoint pairs to obtain direction consistency data; based on the neighborhood area of the wire endpoints, calculating the spatial overlap and generating overlap data; based on the wire endpoint information, extracting the curvature features of the endpoints and calculating the difference values, and outputting the curvature feature data; based on the mean of the direction consistency data, the overlap data and the curvature feature data, calculating the adaptive weights and combining them to generate cross-block matching data;
[0127] S43, based on the cross-block matching data, construct an initial graph structure including all endpoints and connection relationships; calculate the structural support, path smoothness and global consistency value of each edge in the initial graph structure to obtain edge attribute data; calculate the dynamic weight coefficient based on the variance of each attribute in the edge attribute data; based on the dynamic weight coefficient, perform weighted combination on the edge attribute data to output topology credibility data;
[0128] S44, based on the topology credibility data and the wire instance set, calculating the output values of a predetermined number of fusion feature evaluation functions to obtain an evaluation result; based on the evaluation result, generating fusion parameter data; based on the fusion parameter data, applying a fusion operator family to each pair of wire instances to perform feature fusion, and outputting fusion instance data;
[0129] S45. Based on the fused instance data, calculate the output values of a predetermined number of quality assessment functions to generate quality indicator data; based on the quality indicator data, calculate the information entropy of each quality indicator to obtain first weight coefficient data; perform weighted combination of the quality indicator data and the first weight coefficient data to generate a confidence map; based on the confidence map, optimize the fused instance data and output a global conductor map.
[0130] In one embodiment of the present application, based on the wire instance set {W_k} in each image block, k represents the block index, a boundary feature alignment network (BFAN) is constructed, and for the boundary area of adjacent image blocks (k, l): a boundary feature matrix B is constructed: B(k, l) = Ω(F_k)∩Ω(F_l), where Ω(F) is a boundary feature extraction operator, and F_k, F_l are feature maps of adjacent blocks; a boundary alignment score A is calculated: A(k, l) = ∑(μ_i * ν_i) / (|μ_i|·|ν_i|); μ_i, ν_i are feature vectors of corresponding boundary points. Construct a cross-block instance association network (CIAN), and for the wire endpoint pair (p_i, p_j) at the boundary: calculate the cross-block matching score Mc(i, j) = w_1·D(i, j) + w_2·O(i, j) + w_3·T(i, j), where D is the direction consistency: D = cos(θ_i - θ_j); O is the spatial overlap: O = IoU(R_i, R_j); T is the topological continuity: T = exp(-|c_i - c_j| / σ); θ is the wire direction vector, R is the endpoint neighborhood area, and c is the curvature feature; w_1, w_2, w_3 are adaptive weights: [w_1, w_2, w_3] = softmax([D_avg, O_avg, T_avg]).
[0131] Construct a dynamic topology optimization network (DTON) and generate a global wire graph G(V, E): V is the set of all endpoints; E is the wire connection relationship. For each edge e∈E: calculate the topological credibility C_t: C_t(e) = α·S(e) + β·P(e) + γ·Q(e), where S is the structural support, P is the path smoothness, and Q is the global consistency; α, β, γ are dynamic weights: [α, β, γ] = normalize([var(S), var(P), var(Q)]). Construct an Adaptive Instance Fusion Network (AIFN), and for each fusion instance (W_i, W_j): calculate the fusion parameters: F(i, j) = {λ_k | k∈[1, K]}; λ_k = softmax(ψ_k(W_i, W_j)); ψ_k is the k-th fusion feature evaluation function; generate the fusion instance W_f: W_f = ∑(λ_k * Φ_k(W_i, W_j)), Φ_k is the fusion operator family. Construct a Multi-dimensional Quality Assessment Network (MQAN) to evaluate the global results: calculate the quality indicator set Q: Q = {q_1, q_2, ..., q_n}; q_i = Ψ_i(G, {W_f}), where Ψ_i is the i-th quality evaluation function. Generate the final confidence map C: C(x, y) = ∑(w_i *q_i(x, y)), w_i = softmax(entropy(q_i)), where entropy is entropy.
[0132] In another embodiment of the present application, the process of calculating the boundary alignment score is specifically as follows: B(i, j) = ρ·A(i, j) + (1-ρ)·M(i, j); where A(i, j) = (f_i·f_j T ) / (||f_i||·||f_j||), A(i, j) is the inner product similarity of the boundary feature vector; M(i, j) = exp(-d(i, j) 2 / σ_m 2 )·exp(-|θ_i-θ_j| / σ_θ), M(i, j) is the position-direction matching degree; f_i, f_j are boundary feature vectors; d(i, j) is the distance between boundary point pairs; θ_i, θ_j are the direction angles at the boundary; ρ is the balance coefficient; σ_m, σ_θ are scale parameters.
[0133] The process of cross-block instance fusion parameter optimization is as follows: M(i, j) = Δ(t)·H(i, j)+ε(t)·O(i, j)+ζ(t)·T(i, j); where H(i, j) = Σ(min(h_i(k), h_j(k))) / Σ(max(h_i(k), h_j(k))), H(i, j) is the overlap measure of the heat map; O(i, j) = A_overlap / (A_i + A_j - A_overlap), O(i, j) is the spatial overlap rate; T(i, j) = exp(-||τ_i - τ_j|| 2 / σ_τ 2 ), T(i, j) is the topological similarity; h_i(k), h_j(k) are the heat map values of instance i and j; A_overlap is the overlapping area; A_i, A_j are the instance areas; τ_i, τ_j are topological feature vectors; Δ(t), ε(t), ζ(t) are time-varying weight coefficients; σ_τ is the scale parameter of the topological feature.
[0134] The specific process of topological credibility evaluation is as follows: T(e) = φ(t)·S(e) + χ(t)·P(e) +ψ(t)·C(e); where S(e) =Σ(exp(-d(e,n) / σ_d)), S(e) is the structural support of edge e; P(e) = exp(-|κ_max(e)| / σ_κ)·exp(-Δθ(e) / σ_θ), P(e) is the path smoothness; C(e) = min(Σw_i·c_i(e), Σw_j·c_j(e)), C(e) is the global consistency value; d(e, n) is the distance from edge e to the neighboring structure n; κ_max(e) is the maximum curvature of edge e; Δθ(e) is the directional change; c_i(e) and c_j(e) are local consistency measures; φ(t), χ(t), and ψ(t) are time-varying weight coefficients; w_i and w_j are local weights.
[0135] This embodiment realizes the accurate reconstruction of the global topological structure of the wire through boundary feature analysis and cross-block instance matching. First, feature extraction and alignment analysis are performed on the boundary areas of adjacent image blocks. By calculating the inner product and norm of the boundary feature vector, an effective boundary alignment mechanism is established, which can accurately handle the splicing relationship between image blocks. In the cross-block instance matching stage, the directional consistency, spatial overlap and curvature characteristics are comprehensively considered, and a multi-dimensional matching criterion is constructed. The accurate matching of cross-block wire instances is realized through the dynamic adjustment of adaptive weights, which effectively solves the problem of wire cross-region continuity in large-scene aerial images. In the topology optimization stage, a complete graph structure optimization framework is established by calculating the structural support, path smoothness and global consistency, which can effectively eliminate wrong connections and improve the accuracy of the wire topological structure. In the final instance fusion stage, by constructing multiple fusion feature evaluation functions, the intelligent fusion of wire instances in overlapping areas is realized, and the reliability of the fusion results is ensured by quality evaluation. This embodiment realizes the global detection and reconstruction of wires in large-scene aerial images through the organic combination of boundary analysis, cross-block matching and topology optimization.
[0136] According to one aspect of the present application, step S42 is further:
[0137] S421, receiving boundary alignment score data and wire endpoint information at the boundary, extracting the spatial coordinates of the endpoints to obtain endpoint coordinate data; calculating connection vectors of adjacent endpoints to generate connection vector data; performing unitization processing on the connection vector data and outputting normalized direction data;
[0138] S422, read the normalized direction data, construct the direction matrix of the endpoint pair to obtain direction matrix data; calculate the angle between the direction vectors to generate angle data; calculate the direction consistency score based on the angle data, and output the direction consistency data;
[0139] S423, obtaining the spatial coordinates of the endpoint, extracting the local neighborhood with the endpoint as the center to obtain neighborhood block data; calculating the feature distribution of the neighborhood block, generating distribution feature data; performing feature matching on adjacent neighborhood blocks, and outputting neighborhood matching data;
[0140] S424, receiving neighborhood matching data, calculating the overlapping area between neighborhood blocks to obtain overlapping area data; counting the feature consistency of the overlapping area to generate consistency data; calculating the overlap score based on the overlapping area data and the consistency data, and outputting the overlap data;
[0141] S425, reading the path information near the endpoint, extracting the local path segment to obtain the path segment data; calculating the discrete curvature of the path, generating discrete curvature data; smoothing the discrete curvature data, and outputting the curvature feature data;
[0142] S426, obtaining directional consistency data, overlap data and curvature feature data, calculating the statistical distribution of various types of data to obtain statistical feature data; extracting mean features of the data to generate mean feature data; constructing weight coefficients based on the statistical feature data and the mean feature data, and outputting weight coefficient data;
[0143] S427, receiving three types of feature data and weight coefficient data, constructing a feature fusion function to obtain fusion function data; calculating a weighted combination of features to generate combined feature data; normalizing the combined feature data to output cross-block matching data.
[0144] This embodiment realizes the continuous reconstruction of wires between adjacent image blocks through boundary feature analysis and cross-block matching. First, by extracting the spatial coordinates and direction information of the endpoints, the basis for cross-block matching is established, which can accurately handle the connection relationship between image blocks. In the process of directional consistency analysis, a complete directional constraint system is constructed by calculating the directional angle of the endpoint pairs and the local neighborhood features, which can effectively identify reasonable cross-block connections. By analyzing the overlapping features of the neighborhood blocks and the curvature features of the path, the continuity and smoothness of cross-block matching are further guaranteed. Finally, through the dynamic adjustment of adaptive weights, the effective fusion of multi-dimensional features is realized, and reliable cross-block matching results are generated. This embodiment improves the accuracy of cross-block wire reconstruction through comprehensive analysis of directional consistency, overlap and curvature features.
[0145] According to one aspect of the present application, step S43 is further:
[0146] S431, based on the cross-block matching data, extract the endpoint space coordinates and generate a node coordinate set; based on the cross-block matching data and the node coordinate set, extract the connection relationship between the endpoints, construct an adjacency matrix, and obtain adjacency relationship data; combine the node coordinate set and the adjacency relationship data to construct an initial graph structure, and output the initial graph data;
[0147] S432, based on the initial graph data, calculating the degree distribution characteristics of each node to obtain degree distribution data; based on the initial graph data and the degree distribution data, counting the local connection pattern to generate connection pattern data; based on the degree distribution data and the connection pattern data, calculating the structural importance of each node, and outputting the node weight data;
[0148] S433, based on the initial graph data and the node weight data, calculate the node pair weights of each edge connection to obtain the initial value of the edge weight; based on the initial graph data and the node weight data, extract the direction vector features of the edge to generate the edge direction data; combine the initial value of the edge weight and the edge direction data to output the basic attribute data of the edge;
[0149] S434, based on the edge basic attribute data, calculate the local support for each edge to obtain support data; based on the edge basic attribute data, count the local distribution characteristics of the edge to generate distribution feature data; combine the support data with the distribution feature data to output the structural support value;
[0150] S435, based on the edge basic attribute data, calculating the curvature change of the path to obtain curvature change data; based on the edge basic attribute data and the curvature change data, extracting the turning point features of the path to generate turning feature data; based on the curvature change data and the turning feature data, evaluating the smoothness of the path and outputting a smoothness value;
[0151] S436, based on the structural support value and the smoothness value, construct a global consistency evaluation matrix to obtain a consistency matrix; calculate the eigenvalue distribution of the consistency matrix to generate eigenvalue data; based on the consistency matrix and the eigenvalue data, calculate the global consistency score and output the consistency value;
[0152] S437. Based on the structural support value, smoothness value and consistency value, the variance of each attribute is calculated to obtain variance statistics; based on the variance statistics, third weight coefficient data is generated; the structural support value, smoothness value, consistency value and the third weight coefficient data are weighted and combined to output topological credibility data.
[0153] This embodiment achieves the overall optimization of the wire network by constructing a global topological graph structure. First, the initial graph structure is constructed by extracting endpoint coordinates and adjacency relationships, which provides a theoretical basis for the global optimization of the wire network. In the process of node importance evaluation, a node weight system is constructed by analyzing degree distribution characteristics and local connection patterns, which can highlight the importance of key nodes. In the edge attribute calculation stage, a complete edge evaluation system is established by comprehensively considering structural support, path smoothness and global consistency, which can accurately reflect the reliability of the edge. Finally, through the calculation of dynamic weight coefficients, adaptive fusion of various attributes is achieved, and reliable topological credibility evaluation results are generated. This embodiment improves the global consistency and reliability of wire network reconstruction through the synergy of node weight analysis and edge attribute evaluation. Especially when dealing with complex wire crossing and branching situations, the integrity and continuity of the network structure can be effectively maintained.
[0154] According to one aspect of the present application, step S44 is further:
[0155] S441, obtaining topology credibility data and wire instance pairs to be fused, extracting the spatial coordinate sequence of the instance to obtain coordinate sequence data; calculating the spatial overlapping area of the instance pair to generate overlapping area data; constructing a feature description of the instance pair based on the coordinate sequence data and the overlapping area data, and outputting the instance feature data;
[0156] S442, reading the instance feature data, calculating the local shape features of the instance to obtain a shape feature matrix; extracting the direction change features of the instance to generate direction change data; combining the shape feature matrix with the direction change data, normalizing them, and outputting morphological description data;
[0157] S443, receiving instance feature data and morphological description data, calculating similarity scores between instances to obtain a similarity matrix; generating structural feature data based on structural features of the local area; combining the similarity matrix and the structural feature data, and outputting a feature evaluation value;
[0158] S444, obtaining feature evaluation values, constructing a multi-layer evaluation network to obtain evaluation network data; calculating response values of each layer of the network, generating a response value sequence; performing weighted combination on the response value sequence, and outputting fusion parameter data;
[0159] S445, reading the instance feature data and fusion parameter data of the to-be-fused instance pair, constructing an adaptive fusion operator according to the parameters to obtain fusion operator data; calculating the weight distribution of the fusion operator to generate weight distribution data; combining the fusion operator data and the weight distribution data, and outputting fusion operation data;
[0160] S446, receiving instance feature data and fusion operation data, reconstructing features of the instance to obtain reconstructed feature data; calculating consistency constraints of the features to generate constraint condition data; performing feature optimization based on the reconstructed feature data and constraint condition data, and outputting fused instance data.
[0161] This embodiment realizes accurate reconstruction of wire instances through feature fusion and instance optimization. First, by extracting the spatial coordinate sequence and overlapping area information of the instance, the basis of instance fusion is established, and the overlapping and connection relationship between instances can be accurately processed. In the process of morphological feature analysis, a complete morphological description system is constructed by calculating the local shape features and direction change features, which can accurately describe the geometric characteristics of the wire. In the fusion parameter calculation stage, by constructing a multi-layer evaluation network, the adaptive optimization of the fusion parameters is realized, and the fusion mode can be automatically adjusted according to the instance features. Finally, through the design and application of the fusion operator, the accurate reconstruction of the instance features is realized, and the rationality of the reconstruction results is ensured by the introduction of constraint conditions. This embodiment improves the accuracy and reliability of wire instance reconstruction through the combination of feature reconstruction and constraint optimization. In particular, when processing the overlapping and crossing areas between instances, the continuity and geometric characteristics of the wire can be maintained, avoiding the breakage and deformation problems that are prone to occur in traditional methods. By introducing adaptive fusion operators and multi-layer evaluation mechanisms, this embodiment also has strong scene adaptability and can handle wire instance reconstruction problems of different types and complexities.
[0162] In one embodiment of the present application, a wire instance detection method based on key point matching is proposed. The resolution of the original image is 6k×8k. The wire distribution is analyzed block by block by image segmentation. There are two advantages: 1) For extremely slender and complexly distributed wires, segmentation alleviates the difficulty of wire analysis; 2) The wire is approximately considered to be a straight line in the local image block, so only the two endpoints of the wire need to be detected to complete the wire instantiation. Feature extraction is performed. This module mainly includes HRNet high-resolution feature extraction, attention mechanism full-image feature perception and multi-resolution feature fusion. In the prediction stage, the key point regression heat map related to the wire position, the wire feature description map and the wire position mask map are predicted simultaneously. The wire endpoint matching is completed through the predicted key points and the feature description map corresponding to the key points to realize the wire instantiation. Specifically, the following steps are included:
[0163] S1. Use convolutional neural network to build feature extraction architecture and integrate full-image perception mechanism to ensure accurate capture of multi-scale and multi-level features.
[0164] Taking into account the thin wires and the pixel-level width distribution characteristics, HRNet and self-attention mechanism are used to achieve high-resolution feature extraction and full-image perception of features. HRNet is a network structure used for image processing tasks (such as posture estimation, semantic segmentation, etc.), which better captures detail information by maintaining high-resolution feature maps. Unlike traditional convolutional neural networks, HRNet maintains high-resolution feature representation throughout the network and enhances the expressiveness of features through multi-scale fusion. In this embodiment, HRNet outputs feature maps of four scales, respectively achieving feature map extraction with 4x to 32x downsampling.
[0165] Wire distribution often spans the entire image. To enhance the network's ability to perceive the entire image, the self-attention mechanism in the Transformer model is used to achieve full pixel perception. Specifically, the 4x downsampled feature map is rearranged into a sequence, and the model's ability to perceive context positions is enhanced by rotating position encoding. The self-attention mechanism is used to implement the model's representation of features at each position while paying attention to the features of all positions in the input sequence, thereby capturing long-distance dependencies.
[0166] Rotational position encoding is an encoding technique used in Transformer models that enhances the model's contextual understanding by injecting position information into the input sequence. Traditional absolute position encodings (such as sin / cos encodings) are directly added to the input embedding vector, while rotational position encodings rotate the input embedding vector and the position encoding element-wise to represent the position relationship in a high-dimensional space.
[0167] For the input vector x and position vector θ, the rotation position encoding formula is as follows:
[0168] ;
[0169] where x even Represents the even-numbered elements in the input vector; x odd represents the odd-numbered position elements in the input vector; θ is the rotation angle generated by the position. This approach allows the model's attention mechanism at different positions to better capture the relative position relationship.
[0170] The self-attention mechanism is a core component of the Transformer model. When calculating the representation of each word, the model pays attention to all words in the input sequence at the same time, thereby capturing long-range dependencies. By calculating the relevance of each word to other words in the input sequence (i.e., attention weight), the self-attention mechanism can flexibly focus on the most relevant information. The calculation process of the self-attention mechanism is as follows: Calculate the query Q (query), key K (key) and value V (value): Q = XW Q ; K = XW K ; V = XW V ; where X is the representation matrix of the input sequence, W Q , W K and W V is a trainable matrix weight. Calculate the attention output: selfAtten(x)=softmax(QK T / sqrt(d k ))·V=softmax(XW Q ·(XW K ) T / sqrt(d k ))·XW V ; where d k is the dimension of the key vector, which is used to scale the dot product result. Through the above steps, the self-attention mechanism aggregates the input sequence information and generates a new contextual representation for each word, enabling the model to efficiently process sequence data and capture the dependencies between full-image features.
[0171] Multi-layer feature fusion is achieved through the feature pyramid network. Specifically, for the 32-fold downsampled feature map, high-level semantic features are gradually integrated into low-level features through upsampling and lateral connection. The fused feature map contains both high-level semantic information and low-level spatial detail information, providing richer feature representation in the detection task. In order to control the memory usage, the self-attention mechanism is only implemented on the downsampled 32-fold feature map to enhance the global perception ability of pixels. The multi-scale features are fused through the feature pyramid network, and the final output is a 4-fold downsampled feature map for subsequent key point prediction and matching.
[0172] S2. Use heat map regression technology to detect key points and combine them with spatial perception feature point matching to achieve accurate positioning and connection of wire endpoints.
[0173] Key point detection based on heat map regression is a technique for locating key points in an image (such as joint points in human posture, facial feature points, etc.). The probability distribution of each key point is represented by a heat map, and the coordinates of the key point are determined based on the position of the heat map. The position of the real key point is represented by a Gaussian distribution H k (x, y), the real coordinates of the key point whose center is (x k ,y k ), k represents the key point index, and σ controls the diffusion degree of Gaussian distribution. This embodiment only uses L2 loss to supervise the training: H k (x, y) = exp(-((x k ) 2 +(y- y k ) 2 ) / 2σ 2 ); During model training, since the wire is too thin and long, a larger σ needs to be set at the beginning of training to alleviate the optimization difficulty. In the later stage of model training, σ is gradually reduced to control the prediction diffusion degree. In the prediction stage, the wire endpoint position is determined by the maximum value in the local area.
[0174] The key point detection part can only obtain the location of the wire endpoints, but cannot know which points make up a wire. In order to complete the wire instantiation detection, a spatially aware feature point matching algorithm is constructed. The key point feature description feature map is predicted at the model prediction end, and the corresponding position feature point description prediction x is extracted through the real coordinates of the key points. k ∈R n , where R is a set of ordered arrays consisting of n real numbers; then calculate the similarity matrix Sim∈R between the two points m*m , where m is the number of feature points.
[0175] In order to enhance the spatial position perception between matching time points, the rotation position encoding and self-attention mechanism are also used to enhance the perception of features in space and between each other. During training, the matching matrix is supervised by the negative log-likelihood loss function, and the loss function is expressed as: sim = selfAtten(x)·selfAtten(x) T ;loss match =(1 / m)∑ k=0 k=m -log(softmax (softmax(simk, dim=0), dim=1)), where k represents the kth pair of matching points, and there are m pairs of matching points in total.
[0176] S3. Introduce an auxiliary perception branch based on wire mask prediction to optimize wire area recognition and enhance the consistency and completeness of detection results.
[0177] Due to the thin and extremely narrow characteristics of the wire, a wire segmentation mask prediction branch is added during the training process to enhance the model's perception of the entire wire. During training, the cross entropy loss is used to optimize the wire mask prediction. The loss function is as follows: mask =(1 / HW)∑ i=0 i=H-1 ∑ J=0 J=W-1 -log(sigmoid(x ij )); where x ij represents the mask prediction value at the i-th row and j-th column. Finally, the optimized loss function is expressed as: loss=λ1·loss heatmap +λ2·loss match +λ3·loss mask ; Among them, λ1, λ2, and λ3 are used to adjust the loss ratio and are set to 0.1, 10, and 1, respectively. heatmap is the loss function used for supervised heatmap regression.
[0178] This embodiment effectively reduces the difficulty of analyzing complex wire distribution by processing large-resolution images in blocks, making wire detection more accurate. In each smaller image block, the wire can be regarded as a straight line, which simplifies the detection process and improves the accuracy of wire endpoint detection. The HRNet high-resolution feature extraction module is used, combined with the attention mechanism and multi-resolution feature fusion, to capture the fine-grained features and global context information of the wire, and enhance the adaptability of the model to different scenes and wire forms. By predicting the key point regression heat map, the wire feature description map and the wire position mask map, combined with the wire endpoint matching strategy enhanced by the self-attention mechanism, the accurate extraction of wire instances is achieved, and good detection effects can be maintained even in complex situations where the wires are dense or crossed. The image block strategy reduces the size of the image processed by the model at one time, reduces the demand for computing resources, and makes the detection process more efficient. At the same time, by merging the wire endpoints between image blocks, the local wire instantiation results can be seamlessly extended to the entire image, ensuring the integrity and coherence of wire detection in the entire image.
[0179] According to one aspect of the present application, a wire instance detection system based on key point matching includes:
[0180] at least one processor; and,
[0181] a memory communicatively connected to at least one of the processors; wherein,
[0182] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the wire instance detection method based on key point matching described in any one of the above embodiments.
[0183] The present invention constructs a complete wire detection framework, and realizes the accurate identification and reconstruction of complex wire systems in aerial images through the organic combination of four main links: feature extraction, key point matching, wire instance detection and global topology reconstruction. In the feature extraction stage, the multi-scale features of the wire are effectively captured through the feature conversion and enhancement from four dimensions to three dimensions; in the key point matching stage, the accurate positioning of the key points is achieved through recursive decomposition and dual attention mechanism; in the wire instance detection stage, the continuity and integrity of the wire instance are ensured through multi-layer heat map and multi-dimensional constraint matching; in the global topology reconstruction stage, the accurate reconstruction of the wire system in a large scene is achieved through boundary analysis and cross-block matching. The present invention has strong adaptability and robustness, and can effectively handle interference factors such as complex background, illumination changes, and perspective changes in aerial images, thereby improving the accuracy and reliability of wire detection. In particular, when processing large-scale aerial images, the strategy of block processing and cross-block matching ensures both computational efficiency and global consistency of detection results.
[0184] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.
Claims
1. A wire instance detection method based on key point matching, characterized in that: The steps include: S1. Obtain original aerial image data, generate a four-dimensional feature matrix through dynamic feature mapping and enhancement processing; perform projection transformation on the four-dimensional feature matrix to obtain three-dimensional projection feature data; Based on the three-dimensional projection feature data, feature enhancement and multi-scale feature fusion are performed to generate fused feature data; Based on the fused feature data, enhanced feature map data is generated; S2, based on the enhanced feature map data, feature matrix data is obtained by feature reorganization; Based on the feature matrix data, recursive decomposition and mapping are performed to generate response matrix data; Based on the response matrix data, calculate the adaptive threshold data and filter the key points; Perform feature enhancement on the selected key points and output a feature description set and a key point set; S3. Based on the key point set and the feature description set, heat map data is generated through a multi-layer heat map; based on the heat map data and the spatial positions of the key points, a spatial association matrix and multi-dimensional constraints are constructed to perform endpoint matching and obtain matching score data; Based on the matching score data, a wire instance is constructed and verified, and finally a wire instance set is output; S4. Based on the wire instance set, boundary feature analysis is performed to obtain a boundary feature matrix; Based on the boundary feature matrix, cross-block instance matching is performed to generate cross-block matching data; Based on the cross-block matching data, topology optimization is performed to generate topology credibility data; Based on the topological credibility data, instance fusion and quality assessment are performed to generate confidence maps and global wire maps.
2. The wire instance detection method based on key point matching according to claim 1, characterized in that: Step S1 is further as follows: S11, obtaining original aerial image data, constructing a four-dimensional feature matrix, including a spatial coordinate dimension, a time dimension, and an image channel dimension; calculating a first standard deviation and a first mean of each slice in the four-dimensional feature matrix, and generating an adaptive weight coefficient based on a ratio relationship between the first standard deviation and the first mean; performing a weighted combination of the four-dimensional feature matrix and the adaptive weight coefficient, and outputting three-dimensional projection feature data; S12, calculating feature variance value and gradient amplitude based on the three-dimensional projection feature data; Based on the feature variance value, the enhancement coefficient and the balance coefficient are determined; based on the median of the gradient amplitude, the adjustment coefficient is determined; the three-dimensional projection feature data and its second-order gradient are linearly combined, and the enhancement coefficient, the balance coefficient and the adjustment coefficient are used for weighting to output the enhanced feature data; S13, dividing the enhanced feature data according to different scales to generate a multi-scale feature sequence; Calculate the correlation matrix between each scale feature in the multi-scale feature sequence to obtain feature correlation data; Based on the feature correlation data, a weight matrix is constructed; Based on the weight matrix, multi-scale feature sequences are weighted fused and fused feature data is output; S14, based on the fused feature data, calculating its maximum value, minimum value and standard deviation; Based on the maximum value and the minimum value, the fused feature data is normalized to obtain normalized feature data; Based on the standard deviation, a dynamic scaling factor is calculated; The normalized feature data is multiplied by the dynamic scaling factor and the enhanced feature map data is finally output.
3. The wire instance detection method based on key point matching according to claim 2, characterized in that: Step S2 is further as follows: S21, reorganizing the enhanced feature map data into feature matrix data including spatial position and feature dimension; Calculate the eigenvectors of the eigenmatrix data to obtain a left eigenvector matrix and a right eigenvector matrix; Based on the left eigenvector matrix and the right eigenvector matrix, the eigenvalue diagonal matrix is calculated, and the residual term is processed through a nonlinear mapping function to output the decomposed eigendata; S22, calculating the spatial attention mapping value and the feature attention mapping value based on the left eigenvector matrix and the right eigenvector matrix in the decomposed feature data; Perform matrix multiplication on the spatial attention map value and the feature attention map value to generate a key point response matrix; construct a learnable weight matrix, adjust the key point response matrix, and output the response matrix data; S23, calculating the second mean, the second standard deviation and the information entropy based on the response matrix data; Based on information entropy, the dynamic coefficient is calculated; combining the second mean, the second standard deviation and the dynamic coefficient to generate adaptive threshold data; Based on the adaptive threshold data, the response matrix data is screened and the candidate point set data is output; S24, extracting local neighborhood features for each candidate point based on the candidate point set data; Calculate the gradient and second-order derivative of the local neighborhood features to generate adaptive convolution kernel data; obtain the image size and calculate the position encoding value; combine and generate a feature description set based on the position encoding value, adaptive convolution kernel data and local neighborhood features; S25. Based on the candidate point set data and the feature description set, calculate the local significance score and spatial distribution score of each point; based on the variance value of the feature description set, calculate the balance factor; Based on the balance factor, the local significance score and the spatial distribution score are weightedly combined to obtain a weighted combination score. Based on the weighted combination score, the points are finally screened by dynamically filtering the preset threshold and outputting a set of key points.
4. The wire instance detection method based on key point matching according to claim 3 is characterized in that: Step S3 is further as follows: S31. Based on the key point set, calculate the characteristic entropy value and local variance value of each key point; based on the characteristic entropy value and local variance value, calculate the adaptive variance parameter, and build an improved Gaussian distribution model; based on the Gaussian distribution model, generate a local heat map for each key point and fuse them, and output the heat map data; S32, based on the heat map data and the feature description set, calculating the cosine similarity of the feature description to obtain feature similarity data; Obtain and calculate the distance matrix based on the spatial position of key points to generate position-related data; Perform a weighted combination of feature similarity data and location-related data to output a spatial association matrix; S33, calculating feature similarity, geometric constraint value and linear consistency value between candidate endpoint pairs based on the spatial association matrix; Based on the feature similarity, the geometric constraint value and the linear consistency value, the constraint mean data is calculated to generate a first adaptive weight; based on the first adaptive weight, the feature similarity, the geometric constraint value and the linear consistency value are weightedly combined to output matching score data; S34, calculating the topological consistency score of each pair of matching endpoints based on the matching score data; Calculate the dynamic balance factor based on the variance of the matching score data; Based on the dynamic balance factor, the matching score data and the topological consistency score are weighted and combined to generate the wire credibility data; Based on the wire credibility data and the coordinates of the matching endpoints, the wire path is constructed, and the wire path data is generated by using the path correction algorithm; S35, calculating a visualization consistency score, a regional support score, and a topology uniqueness score of each wire instance based on the wire path data and the wire credibility data; Determining a second adaptive weight based on the degree of change of the visualization consistency score, the regional support score, and the topological uniqueness score; Based on the second adaptive weight, the visualization consistency score, the region support score and the topology uniqueness score are weightedly combined to generate instance quality data; Based on the instance quality data, the wire instances are screened and optimized, and a wire instance set is output.
5. The wire instance detection method based on key point matching according to claim 4, characterized in that: Step S4 is further as follows: S41, obtaining boundary area data of adjacent image blocks in the wire instance set, extracting boundary features, and generating a boundary feature matrix; based on the boundary feature matrix, calculating the inner product and norm of boundary feature vectors of adjacent blocks to obtain feature vector data; Normalize the feature vector data and output the boundary alignment score data; S42, extracting the wire endpoint information at the boundary based on the wire instance set; Based on the boundary alignment score data and the wire endpoint information, the direction vector angle between the endpoint pairs is calculated to obtain the direction consistency data; Based on the neighborhood area of the wire endpoints, the spatial overlap is calculated to generate overlap data; Based on the wire endpoint information, the curvature characteristics of the endpoints are extracted and the difference values are calculated, and the curvature characteristic data is output; Based on the mean of the directional consistency data, the overlap data and the curvature feature data, the adaptive weights are calculated and combined to generate cross-block matching data; S43, based on the cross-block matching data, construct an initial graph structure including all endpoints and connection relationships; Calculate the structural support, path smoothness and global consistency value of each edge in the initial graph structure to obtain edge attribute data; calculate the dynamic weight coefficient based on the variance of each attribute in the edge attribute data; Based on the dynamic weight coefficient, the edge attribute data is weighted and combined to output the topological credibility data; S44, based on the topology credibility data and the wire instance set, calculating the output values of a predetermined number of fusion feature evaluation functions to obtain an evaluation result; based on the evaluation result, generating fusion parameter data; Based on the fusion parameter data, a fusion operator family is applied to each pair of wire instances to perform feature fusion and output fusion instance data; S45. Based on the fused instance data, calculate the output values of a predetermined number of quality assessment functions to generate quality indicator data; based on the quality indicator data, calculate the information entropy of each quality indicator to obtain first weight coefficient data; perform weighted combination of the quality indicator data and the first weight coefficient data to generate a confidence map; based on the confidence map, optimize the fused instance data and output a global conductor map.
6. The wire instance detection method based on key point matching according to claim 5, characterized in that: Step S11 is further as follows: S111, acquiring and extracting spatial coordinate information based on the original aerial image data to generate a position matrix; extracting time series information to obtain time series data; separating image channels to obtain channel feature data; The position matrix, time series data and channel feature data are combined to construct a four-dimensional feature matrix; S112, slicing the four-dimensional feature matrix, slicing along the space dimension to obtain space slice data, slicing along the time dimension to obtain time series slice data, and slicing along the channel dimension to obtain channel slice data; Calculate local statistics of spatial slice data, time series slice data and channel slice data, and output slice statistics; S113, calculating the first standard deviation of each slice based on the slice statistical data to obtain a standard deviation sequence; Based on the slice statistics, the first mean of each slice is calculated to obtain a mean sequence; Divide the standard deviation sequence by the mean sequence to generate a ratio sequence; normalize the ratio sequence and output the adaptive weight coefficient; S114. Based on the four-dimensional feature matrix and the adaptive weight coefficient, the projection of the feature matrix on each dimension is calculated to obtain dimensional projection data; the dimensional projection data is weightedly combined with the adaptive weight coefficient to generate weighted projection data; the weighted projection data is transformed into a dimensionality reduction mode to output three-dimensional projection feature data.
7. The wire instance detection method based on key point matching according to claim 5, characterized in that: Step S24 is further as follows: S241, based on the candidate point set data, extracting multi-scale neighborhood blocks with each candidate point as the center to generate a neighborhood block sequence; performing direction normalization processing on the neighborhood block sequence to obtain normalized neighborhood data; Calculate the grayscale distribution characteristics of normalized neighborhood data and output neighborhood feature data; S242, based on the neighborhood feature data, calculating the first-order gradients in the horizontal and vertical directions to obtain a gradient vector field; based on the gradient vector field, calculating the Laplace operator response to generate a second-order derivative map; performing a weighted combination of the gradient vector field and the second-order derivative map according to the intensity distribution, and outputting gradient feature data; S243, based on the gradient feature data, calculating the local response intensity and the local gradient direction histogram to obtain direction distribution data; based on the direction distribution data, constructing an adaptive Gaussian filter to generate filter coefficients; modulating the filter coefficients with the local response intensity to output adaptive convolution kernel data; S244, obtaining image size parameters, generating coordinate grids in horizontal and vertical directions, and obtaining position coordinate data; performing sine and cosine transforms on the position coordinate data to obtain periodic coded data; and extracting global scale information based on the image size parameters; Based on the global scale information, the periodic encoding data is normalized and the position encoding value is output; S245. Based on the adaptive convolution kernel data, the neighborhood feature data is filtered to obtain filtered feature data; the filtered feature data is concatenated with the position coding value in the channel dimension to generate combined feature data; the combined feature data is dimensionally adjusted and normalized to output a feature description set.
8. The wire instance detection method based on key point matching according to claim 5, characterized in that: Step S33 is further as follows: S331, based on the spatial association matrix, extracting the feature vectors of the candidate endpoint pairs, calculating the cosine distance of the feature vectors, and obtaining a similarity matrix; based on the similarity matrix, constructing a feature distribution histogram, generating distribution feature data; normalizing the distribution feature data, and outputting feature similarity data; S332, based on the spatial association matrix, obtaining the spatial coordinates of the candidate endpoint pairs, calculating the Euclidean distance between the endpoints, and obtaining a distance matrix; Based on the distance matrix, the distance distribution characteristics in the local area are counted to generate distance statistics; Compare the distance statistics with the preset threshold and output the distance constraint data; S333, based on the spatial correlation matrix, obtain the position information of the endpoint pairs, calculate the connection direction vector, and obtain the direction matrix; based on the gradient amplitude in step S12, extract the main direction feature of the image and generate the main direction data; calculate the angle between the direction matrix and the main direction data, and output the direction constraint data; S334, extracting structural features of the local area based on the distance constraint data and the direction constraint data to obtain structural feature data; calculating the structural consistency score based on the structural feature data to generate structural constraint data; combining the distance constraint data, the direction constraint data and the structural constraint data to output a geometric constraint value; S335, based on the spatial correlation matrix, obtaining the connection information of the endpoint pairs, calculating the curvature characteristics of the connection lines, and obtaining curvature data; Based on the line information, the linear metric features of the line are extracted to generate linear feature data; based on the curvature data and the linear feature data, the linear consistency score is calculated and the linear constraint value is output; S336, based on the feature similarity data, the geometric constraint value and the linear constraint value, calculating the mean of each constraint to obtain constraint mean data; based on the constraint mean data, generating second weight coefficient data; The feature similarity data, the geometric constraint value, the linear constraint value and the second weight coefficient data are weighted and combined to output the matching score data.
9. The wire instance detection method based on key point matching according to claim 5, characterized in that: Step S43 is further as follows: S431, extracting endpoint space coordinates based on cross-block matching data, and generating a node coordinate set; Based on the cross-block matching data and the node coordinate set, the connection relationship between the endpoints is extracted, the adjacency matrix is constructed, and the adjacency relationship data is obtained; Combine the node coordinate set and the adjacency relationship data to construct the initial graph structure and output the initial graph data; S432, based on the initial graph data, calculating the degree distribution characteristics of each node to obtain degree distribution data; based on the initial graph data and the degree distribution data, counting the local connection pattern to generate connection pattern data; Based on the degree distribution data and connection pattern data, the structural importance of each node is calculated and the node weight data is output; S433, based on the initial graph data and the node weight data, calculate the node pair weights of each edge connection to obtain the initial value of the edge weight; based on the initial graph data and the node weight data, extract the direction vector features of the edge to generate the edge direction data; combine the initial value of the edge weight and the edge direction data to output the basic attribute data of the edge; S434, based on the edge basic attribute data, calculating the local support for each edge to obtain support data; based on the edge basic attribute data, counting the local distribution characteristics of the edge to generate distribution characteristic data; Combine the support data with the distribution feature data and output the structural support value; S435, based on the edge basic attribute data, calculating the curvature change of the path to obtain curvature change data; based on the edge basic attribute data and the curvature change data, extracting the turning point features of the path to generate turning feature data; Based on the curvature change data and turning feature data, the path smoothness is evaluated and the smoothness value is output; S436, constructing a global consistency evaluation matrix based on the structural support value and the smoothness value to obtain a consistency matrix; Calculate the eigenvalue distribution of the consistency matrix and generate eigenvalue data; Based on the consistency matrix and eigenvalue data, the global consistency score is calculated and the consistency value is output; S437, based on the structural support value, the smoothness value and the consistency value, calculating the variance of each attribute to obtain variance statistical data; based on the variance statistical data, generating third weight coefficient data; The structural support value, smoothness value, consistency value and the third weight coefficient data are weighted and combined to output the topology credibility data.
10. A wire instance detection system based on key point matching, characterized in that: include: at least one processor; as well as, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the wire instance detection method based on key point matching according to any one of claims 1 to 9.
Citation Information
Patent Citations
Medical key point detection method and device based on multi-scale topological graph and application
CN113192043A
Aerial image target detection method, equipment and medium
CN114140683A
Aerial image positioning method based on airborne task machine
CN116452995A
Complex road target detection method based on multi-modal fusion aerial view
CN117058646A
Coarse-to-fine different-source image matching method based on edge guidance
CN118135256A
Cited By
Real-time displacement monitoring method and system for tension test of horizontal acting force of ground wire
CN120125637A
Airport video image classification method based on artificial intelligence
CN120126058A
Gardening cultivation space structure identification and layout optimization method based on Capsule network
CN120509301A
Horticulture cultivation space structure recognition and layout optimization method based on capsule network
CN120509301B
Display screen abnormal point detection method and system based on image processing
CN120912535A