IP positioning method and system based on sparse explanation and attention stability calibration
By employing an IP localization method based on sparse interpretation and attention stability calibration, key feature contributions are output, constraining the consistency of landmark attention, and constructing a two-dimensional reliable localization region. This solves the problem of unstable localization in existing technologies and achieves accurate and reliable IP localization.
Patent Information
- Application Number
- CN202611362862.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-20
AI Technical Summary
Existing IP location methods struggle to provide a spatially reliable range with statistical coverage in regulatory and business auditing scenarios, and they also have difficulty adaptively adjusting the reliability of spatial evidence for different target IPs, leading to unstable location results.
A method combining sparse interpretation and attentional stability calibration is adopted. Key features are output through instance-level sparse interpretation to constrain the consistency of landmark attention, implement attentional perturbation, and construct a two-dimensional reliable localization region using two-dimensional joint inconsistency score and conformal correction factor.
It achieves precise point positioning, interpretability of key evidence, and credibility of spatial intervals, making it suitable for risk-sensitive scenarios such as cybersecurity tracing, financial risk control, and regulatory auditing.
Smart Images

Figure CN123145019A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of trusted IP location technology, and relates to an IP location method and system based on sparse interpretation and attention stability calibration. Background Technology
[0002] IP geolocation aims to infer the geographical location of a target IP address in the real world based on IP address attributes, network measurement data, routing information, and known landmark nodes. This technology is widely used in scenarios such as network attack attribution, cyberspace mapping, financial risk control, access compliance, content distribution, and abnormal access identification. However, as applications expand from general location awareness to regulatory and risk decision-making, simply using learning-based IP geolocation methods—inputting multi-source network features such as IP attributes, round-trip time (RTT), and traceroute into regression or graph learning models to obtain point predictions by minimizing coordinate errors—is insufficient for practical needs. For regulatory and business auditing operations, it is also necessary to specify which network evidence is primarily used for this geolocation and provide a credible geographical range that reflects the uncertainty of the prediction.
[0003] Existing technologies such as GraphGeo, RIPGeo, TrustGeo, and ExGeo improve IP location performance from the perspectives of graph structure modeling, perturbation robustness, uncertainty awareness, and interpretable representation. While these technologies have significantly promoted the development of street-level IP location, in regulatory compliance and business auditing scenarios, the models in these methods use a large number of features and landmarks, resulting in insufficient concentration of key evidence contributions for individual target IPs; furthermore, they are difficult to provide a spatially reliable range with statistical coverage meaning.
[0004] The currently published paper "A Reliable IP Location Method Based on Graph Neural Network and Conformal Quantile Regression [J]. Computer Science, 2026, 53(7):308-314" (hereinafter referred to as CQR-IPGeo) proposes to combine graph neural networks with conformal quantile regression. First, it learns the upper and lower conditional quantile points of latitude and longitude, and then uses the inconsistency scores on the calibration set to perform conformal correction on the quantile interval, thereby obtaining a location interval with a pre-set confidence level. This method proves that conformal prediction can extend IP location from point estimation to interval estimation, but the basic boundary of its interval comes from conditional quantile regression, requiring the simultaneous learning of multiple upper and lower quantile points and training with quantile loss. In high-precision landmark attention-based location, the target IP is usually weighted and aggregated through multiple known landmarks. If there is a significant rearrangement between the initial landmark attention and the attention after re-evaluation, or if the location result changes significantly after softening or sharpening the landmark weights, the current prediction is more sensitive to spatial evidence. Such attentional consistency and perturbation response already contain instance-level localization stability information, but the existing CQR-IPGeo method does not directly translate this internal stability into interval scale, causing its localization interval to mainly rely on quantile boundary learning results, making it difficult to adaptively adjust for the reliability of spatial evidence for different target IPs.
[0005] Therefore, in order to solve the above problems, there is an urgent need for an IP localization method and system based on sparse interpretation and attention stability calibration, which has high point localization accuracy, interpretability of key evidence, and spatial interval credibility. Summary of the Invention
[0006] This invention proposes an IP localization method and system based on sparse interpretation and attention stability calibration, which effectively solves the problems in the prior art.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: an IP localization method based on sparse interpretation and attention stability calibration, comprising the following steps:
[0008] S100: Construct a pre-trained IP point localization model and obtain the multi-source network features of the target IP to be located, as well as the known landmark features and landmark locations associated with the target IP;
[0009] S200: The multi-source network features are sparsely weighted through instance-level sparse interpretation, and the contributions of key features are determined and Top-K key features are output;
[0010] S300: Based on the IP point localization model, and using the representation relationship between the target IP and the known landmark features of the location processed by instance-level sparse interpretation, the initial landmark score is calculated, and the initial landmark attention and initial point position are obtained based on the initial landmark score.
[0011] S400: Based on the initial landmark attention, a landmark guidance representation is formed, and after combining it with the target IP, a refined landmark attention is calculated. After constraining the consistency between the initial landmark attention and the refined landmark attention, the refined point position is output.
[0012] S500: Apply attentional perturbation to the initial landmark score and obtain the perturbation attention location, while applying feature perturbation to the Top-K key features and obtaining the feature perturbation location;
[0013] S600: Construct multiple location responses and establish the instance interval scale of the target IP based on the initial point location, refined point location, disturbance attention location, and characteristic disturbance location;
[0014] S700: Establish an independent calibration set, calculate the two-dimensional joint inconsistency score, determine the conformal correction factor, and construct a two-dimensional reliable positioning region based on the conformal correction factor and the instance interval scale;
[0015] S800: The output should include at least the key feature contribution, Top-K key features, initial landmark attention, refined landmark attention, and audit information of the two-dimensional reliable localization region.
[0016] Further, step S200 includes:
[0017] A shared gating function is used to generate instance-level feature gating for multi-source network features and features with known locations, and element-level and feature group-level sparse regularization are used to jointly limit the number of effective features.
[0018] The amplitude normalization of the gated multi-source network features and the features of known locations is used to obtain the key feature contributions, and the Top-K key features are output.
[0019] Further, step S300 includes:
[0020] Based on the IP point localization model, the gated multi-source network features and known landmark features are mapped to a shared latent space. The initial landmark score is calculated using latent correlation and spatial regularization. The initial landmark attention is obtained based on the initial landmark score, and the initial point position is obtained based on the initial landmark attention.
[0021] Further, step S400 includes:
[0022] After the initial landmark attention is formed into a landmark guidance representation, it is combined with the target IP to form a refined target representation;
[0023] Based on the refined target representation, the refined landmark score and refined landmark attention are recalculated through potential relevance and spatial regularization.
[0024] The distribution distance constraint is used to ensure the consistency between the initial landmark attention and the refined landmark attention, and the location of the refined point is output.
[0025] Further, step S500 includes:
[0026] Based on the initial landmark scores, softened attention and sharpened attention are constructed, and softened perturbation attention locations and sharpened perturbation attention locations are established;
[0027] Set an attenuation coefficient, attenuate the Top-K key features, and re-execute the calculation process of steps S300-S400 to obtain the feature perturbation position.
[0028] Further, step S600 includes:
[0029] The coordinate deviation between the initial point position and the refined point position is set as the position response before and after refinement; the maximum coordinate deviation between the disturbance attention position and the refined point position is set as the maximum position response of the attention disturbance; the coordinate deviation between the feature disturbance position and the refined point position is set as the feature disturbance position response; and the instance interval scale of the target IP is constructed based on the position response before and after refinement, the maximum position response of the attention disturbance, and the feature disturbance position response.
[0030] Further, step S700 includes:
[0031] An independent calibration set is established, and a two-dimensional joint inconsistency score is obtained based on the precise point location, landmark location, and instance interval scale.
[0032] The coverage level is set to 0.05, and the conformal correction factor is determined based on the 95% order of the finite sample of the two-dimensional joint inconsistency score, so that the two-dimensional reliable positioning region has a nominal joint coverage level of 95%.
[0033] The present invention also proposes an IP positioning system, including a data acquisition module for acquiring multi-source network characteristics of the target IP to be located, as well as known landmark characteristics and landmark locations associated with the target IP;
[0034] The embodiment coefficient interpretation module is used to perform sparse weighting on the multi-source network features through instance-level sparse interpretation, determine the contribution of key features, and output Top-K key features;
[0035] The landmark attention aggregation module is used to calculate the initial landmark score based on the representation relationship between the target IP and the known landmark features of the location through instance-level sparse interpretation processing, and to obtain the initial landmark attention and the initial point position based on the initial landmark score;
[0036] The self-consistent attention refinement module is used to form a landmark guidance representation based on the initial landmark attention, and calculate the refined landmark attention after combining it with the target IP. After constraining the consistency between the initial landmark attention and the refined landmark attention, the refined point position is output.
[0037] The controlled perturbation module is used to apply attentional perturbation to the initial landmark score and obtain the perturbation attention position, while applying feature perturbation to the Top-K key features and obtaining the feature perturbation position;
[0038] The stability instance scaling module is used to construct multiple location responses and establish the instance interval scale of the target IP based on the initial point location, refined point location, perturbation attention location, and feature perturbation location.
[0039] The conformal calibration module is used to establish an independent calibration set, calculate the two-dimensional joint standardized inconsistency score, determine the conformal correction factor, and construct a two-dimensional reliable positioning region based on the conformal correction factor and the instance interval scale.
[0040] The audit output module is used to output audit information that includes at least the contribution of key features, Top-K key features, initial landmark attention, refined landmark attention, and two-dimensional reliable localization area.
[0041] The present invention also proposes an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the above-described method.
[0042] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] In this invention, by gating and sparsely weighting multi-source network features through instance-level sparse interpretation, the key feature contributions and Top-K key features can be output, enabling the model to explain the key network features used for locating a single target IP.
[0045] In this invention, the stability of landmark aggregation can be improved by constraining the consistency between initial landmark attention and refined landmark attention and by implementing attention perturbation.
[0046] In this invention, multiple positional responses are constructed by initial point position, refined point position, perturbation attention position, and feature perturbation position to form the instance interval scale of the target IP, which is not obtained by the difference between upper and lower conditional quantiles; thus, samples that are easy to locate and have stable evidence obtain a tighter interval, while difficult or sensitive samples obtain a more conservative interval.
[0047] In this invention, two-dimensional joint inconsistency scores and conformal correction factors are used to simultaneously constrain two coordinate directions to perform statistical calibration on the instance interval scale of the target IP, thereby making full use of the existing stability information within the model while maintaining the coverage semantics.
[0048] In summary, this invention features precise point positioning, interpretability of key evidence, and credibility of spatial intervals, making it suitable for risk-sensitive scenarios such as cybersecurity tracing, financial risk control, and regulatory auditing. Attached Figure Description
[0049] Figure 1 This is the overall flowchart of the present invention. Detailed Implementation
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] Example 1:
[0052] like Figure 1 As shown, this invention proposes an IP localization method based on sparse interpretation and attention stability calibration, comprising the following steps:
[0053] Step S100: Construct a pre-trained IP point localization model and obtain the multi-source network features of the target IP to be located, as well as the known landmark features and landmark locations associated with the target IP; this includes the following:
[0054] First, let the target IP to be located be... subscript This represents the target IP index. The set of known landmarks associated with the target IP is denoted as . in, Indicates the first A number of related landmarks For landmark indexing, This represents the total number of associated landmarks corresponding to the target IP. The original feature vectors of the target IP and the landmarks with known locations are denoted as follows: and ,in The input feature dimension; the first The known two-dimensional locations of the landmarks are denoted as follows: The real landmark location of the target IP is denoted as Preferably, the original latitude and longitude are transformed to a local kilometer coordinate system, so that the two coordinate directions are denoted as... ;in , These correspond to local distance coordinates in the longitude and latitude directions, respectively, making it easy to calculate the interval width directly in kilometers;
[0055] Among them, the multi-source network characteristics of selected target IPs (denoted as...) ), location of known landmark features (denoted as ) and the actual location of the landmark (denoted as Using this as the model training dataset, the IP point localization model is represented as follows:
[0056] ;
[0057] in, This is represented as an IP point location model with parameters. This represents the location prediction result output by the IP point localization model. During training, based on the error between the predicted and actual locations, and combined with instance-level sparse interpretation loss, self-consistent attention constraint loss, controlled perturbation stability loss, and interval scale constraint loss, the model parameters are jointly optimized, as shown below:
[0058] argmin ;
[0059] The fact point localization loss is defined as follows:
[0060]
[0061] The overall training objective is defined as:
[0062]
[0063] in, These are the weights for instance-level sparse interpretation, self-consistent attention, controlled perturbation stability, and interval-scale constraint loss, respectively. After training, the IP point localization model parameters are frozen, as well as the following... The IP point localization model trained above participates in the calculation process in steps S300-S500 during the inference phase.
[0064] It should be noted that the multi-source network characteristics, known location landmark characteristics, and landmark locations of the acquired target IP are preprocessed. This preprocessing mainly includes attribute features and network measurement features. Attribute features include at least IPv4 address encoding, Autonomous System number (AS), ISP, and registration authority; network measurement features include at least RTT, route hop count, Traceroute path statistics, last-hop latency, and packet loss statistics. Attribute features are preprocessed using embedding or one-hot encoding, while network measurement features are preprocessed using robust normalization, and missing features are masked.
[0065] Step S200: Sparsely weight the multi-source network features through instance-level sparse interpretation, determine the contribution of key features, and output the Top-K key features; this includes the following:
[0066] Then, a shared gating function is used to generate instance-level feature gating for multi-source network features and known location landmark features; and for any IP node, denoted as ,in The gate vector is represented as follows:
[0067]
[0068] in, and These are the trainable gated weight matrix and the bias vector, respectively. For the Sigmoid function, The gated multi-source network features and the features of known-location landmarks are represented by the following formula:
[0069]
[0070] in, This represents the Hadamard element-wise product.
[0071] To limit the number of effective features and retain feature groups with physical meaning, element-level and feature group-level sparsity regularization is employed, as follows:
[0072]
[0073] Among them, for training batches ,in This represents the set of target IP indices in the current training batch. and These are the element-level and feature group-level sparsity coefficients, respectively. To preset the number of feature groups, For feature group index, Indicates the first Feature groups, This represents a subvector of the target IP gating vector on this feature set. and They represent Norm and Norm.
[0074] The key feature contributions are obtained by normalizing the amplitudes of the gated multi-source network features and the features of known locations, as expressed below:
[0075]
[0076] in, and All are feature indexes. A constant used to prevent division by zero and improve numerical stability. According to... Sort the data from largest to smallest and output the Top-K key features, where This is the preset number of key features for the output.
[0077] Step S300: Calculate the initial landmark score based on the representation relationship between the target IP and the known landmark features of the location, processed by instance-level sparse interpretation. Obtain the initial landmark attention and initial point location based on the initial landmark score; this includes the following:
[0078] The gated multi-source network features and the features of known-location landmarks are mapped to the shared latent space, as shown below:
[0079]
[0080]
[0081] in, This represents vector concatenation. Representation layer normalization, and To share encoding parameters, This is a zero-occupancy vector for the unknown location of the target IP.
[0082] The initial landmark scores are calculated using latent correlation and spatial regularization, as shown below:
[0083]
[0084] To reduce the impact of spatial outliers in the landmark set, the normalized distance of the landmark's location relative to the local center of the current landmark set is calculated. And construct the initial landmark score:
[0085]
[0086] in, The intensity is the spatial regularity.
[0087] Initial landmark attention definition:
[0088]
[0089] in, For the landmark summation index in Softmax normalization, and .
[0090] The initial point position is defined as:
[0091]
[0092] in, and These are the coordinate transformation parameters.
[0093] Step S400: Based on the initial landmark attention, a landmark-guided representation is formed, and after combining it with the target IP, a refined landmark attention is calculated. After constraining the consistency between the initial landmark attention and the refined landmark attention, the refined point position is output; this includes the following:
[0094] The initial landmark attention is used to form a landmark guidance representation, which is then combined with the target IP to form a refined target representation; whereby the landmark guidance representation is denoted as... The refined target is denoted as The expression is as follows:
[0095] ;
[0096]
[0097] in, and These are refined parameters.
[0098] Based on the refined target representation, the refined landmark score (denoted as ) is recalculated through latent relevance and spatial regularization. ) and refined landmark notes (denoted as The expression is as follows:
[0099]
[0100]
[0101] The consistency between initial landmark attention and refined landmark attention is constrained using Kullback-Leibler divergence, Jensen-Shannon divergence, or other distribution distances; the expression for attention inconsistency is as follows:
[0102]
[0103] in, Note the divergence stability constant.
[0104] The refining point location is defined as:
[0105]
[0106] Preferably, it can be As the fact point location of the target IP.
[0107] Among them, for training batches ,in Let the set of target IP indices in the current training batch be represented. The self-consistent attention loss is defined as:
[0108]
[0109] Step S500: Apply attentional perturbation to the initial landmark scores and obtain the perturbation attention location; simultaneously apply feature perturbation to the Top-K key features and obtain the feature perturbation location; this includes the following:
[0110] Softening and sharpening attention are constructed based on the initial landmark scores; the expressions are as follows:
[0111]
[0112]
[0113] in, and These are the softening and sharpening temperature parameters, respectively.
[0114] And construct softened perturbation attention locations (denoted as...) ) and sharpening perturbation attention location (denoted as );
[0115]
[0116]
[0117] A slight attenuation is applied to the Top-K key features to assess the stability of the feature evidence. Let the attenuation coefficient be... The gating values corresponding to the Top-K features Replace with With the remaining features unchanged, the fact localization is performed again to obtain feature perturbation predictions. This refers to the location of the feature perturbation. This perturbation only changes the weight strength of key evidence, without altering the feature semantics or the candidate landmark set.
[0118] The disturbance loss in the above process can be defined as:
[0119]
[0120] Step S600: Based on the initial point location, refined point location, perturbation attention location, and characteristic perturbation location, construct multiple location responses and establish the instance interval scale of the target IP; this includes the following:
[0121] Define position response:
[0122]
[0123]
[0124]
[0125] in, Indicates the positional response before and after refining. This indicates the location of the maximum disturbance response. Indicates the location response to characteristic perturbations;
[0126] The instance interval scale is defined as:
[0127]
[0128] in, It is the minimum scale constant. These are the combination coefficients for the three positional responses. The combination coefficients are selected on the independent validation set and frozen before the final conformal calibration.
[0129] Preferably, to further promote interval compactness, without changing the effectiveness of conformal calibration, the average value of the instance interval scale can be used as the training-period width regularization:
[0130]
[0131] Width regularization is used only to improve the stability of the IP point localization model to attention and feature perturbations; the final coverage level is determined by independent conformal calibration, not by... Direct guarantee.
[0132] Step S700: Establish an independent calibration set, calculate the two-dimensional joint inconsistency score, determine the conformal correction factor, and construct a two-dimensional reliable positioning region based on the conformal correction factor and instance interval scale; including the following:
[0133] Let the final independent calibration set be ,Include One calibration sample. Model training, hyperparameter selection, and the selection of instance scale combination coefficients are all performed before entering... Previously completed, the independent calibration set did not participate in model parameter learning and hyperparameter selection. For the first independent calibration set... From a sample, we obtain fact point predictions. Real location and instance scale ;
[0134] Define a two-dimensional joint non-consistent score:
[0135]
[0136] in, To calibrate the sample index, For the first The joint non-consistency score of each calibration sample. The conformal normalized scale stability constant;
[0137] Set the level of coverage loss Corresponding nominal joint coverage level ;Will Sort in ascending order and adjust the order using a finite number of samples:
[0138]
[0139] in, For conformal sorting order, ceil(·) represents rounding up; [the order is missing from the original text]. The sorting scores are denoted as conformal correction factors. .
[0140] For the new target IP, the final intervals in the two coordinate directions are as follows:
[0141]
[0142] The two-dimensional reliable positioning area is:
[0143]
[0144] Under the condition that the calibration samples and test samples are interchangeable and the training, calibration, and inference processes are consistent, the two-dimensional region has a nominal level. Joint coverage guarantee. Due to a single inconsistency score. Simultaneously taking the maximum value of the standardized error in both coordinate directions, its coverage semantics directly correspond to the true latitude and longitude falling into the two-dimensional reliable positioning area, rather than performing independent marginal calibrations for the two coordinate directions separately.
[0145] Step S800: The output should include at least the audit information for key feature contributions, Top-K key features, initial landmark attention, refined landmark attention, and 2D reliable localization regions; including the following:
[0146] For the target IP, the final interval widths in the two coordinate directions are respectively
[0147]
[0148] The average location range width of a single target IP is
[0149]
[0150] test set The overall average positioning interval width is
[0151]
[0152] This invention simultaneously outputs structured audit information, including Top-K key features and their contributions, Top-M key landmarks and their initial and refined landmark attention, attention inconsistency, three types of location responses, instance interval scale, conformal correction factor, nominal coverage level, and two-dimensional reliable positioning region. The Top-M key landmarks are obtained by ranking the initial or refined landmark attention. The preset number of key landmarks to be output, and .
[0153] Therefore, in this invention, by gating and sparsely weighting the multi-source network features through instance-level sparse interpretation, the key feature contributions and Top-K key features can be output, enabling the model to explain the key network features used for locating a single target IP.
[0154] By constraining the consistency between initial landmark attention and refined landmark attention and implementing attention perturbations, the stability of landmark aggregation can be improved.
[0155] Multiple location responses are constructed by initial point location, refined point location, perturbation attention location, and feature perturbation location to form the instance interval scale of the target IP, which is not obtained by the difference between upper and lower conditional quantiles; so that easy-to-locate and evidence-stable samples obtain a tighter interval, and difficult or sensitive samples obtain a more conservative interval.
[0156] By employing a two-dimensional joint inconsistency score and a conformal correction factor to simultaneously constrain two coordinate directions, the instance interval scale of the target IP is statistically calibrated, thus fully utilizing the existing stability information within the model while maintaining the coverage semantics.
[0157] In summary, this invention features precise point positioning, interpretability of key evidence, and credibility of spatial intervals, making it suitable for risk-sensitive scenarios such as cybersecurity tracing, financial risk control, and regulatory auditing.
[0158] Comparative Example 1:
[0159] (a) Selecting a dataset:
[0160] This embodiment uses three large-scale real-world internet IP geolocation datasets from New York, Los Angeles, and Shanghai. The datasets contain 91,808, 92,804, and 126,258 IP addresses respectively, and all three datasets include active network measurements from four probe hosts. The landmark densities in New York, Los Angeles, and Shanghai are approximately 116, 76, and 20 nodes / km² respectively, covering different scenarios such as high-density, medium-density, and sparse landmarks.
[0161] Each dataset is divided into a development set and a test set in an 80% to 20% ratio. In the development set, approximately 70% of the IP nodes are used as known location landmarks, and the remaining 30% are used as target IPs for model learning. To ensure data independence in conformal prediction, the target IPs for model learning are further divided into training targets, validation targets, and final calibration targets; preferably in a 60%:20%:20% ratio. The training targets are used for model parameter learning, the validation targets are used for selecting the combination coefficients of hyperparameters and instance interval scales, and the final calibration targets are only used to calculate the conformal correction factor. The ground truth coordinates in the test set are only used for the final offline evaluation.
[0162] Each dataset includes two main types of information: (1) network measurement data, including RTT, route hop count, traceroute path statistics, and last hop delay measurements; and (2) node attribute information, including IPv4 address related encoding, AS, ISP, and registration authority. New York and Los Angeles contain 6-dimensional attribute features and 24-dimensional network measurement features, while Shanghai contains 27-dimensional attribute features and 24-dimensional network measurement features.
[0163] (ii) Selection of comparison models:
[0164] This embodiment selects GraphGeo, RIPGeo, TrustGeo, ExGeo, and CQR-IPGeo as the main comparison methods. GraphGeo, RIPGeo, TrustGeo, and ExGeo methods have all been covered in existing literature and will not be elaborated upon here. All methods are evaluated using the same training set, validation set, final calibration set, and test set partitioning, the same landmark-target node partitioning, and the same test samples to ensure the fairness of the experimental comparison.
[0165] To enable comparisons of primitive point localization methods such as GraphGeo, RIPGeo, TrustGeo, and ExGeo within a unified confidence interval evaluation framework, this embodiment adds post-hoc two-dimensional joint conformal calibration to their point prediction results. Specifically, for any baseline method, initially only an independent validation set is used. Determine two global coordinate scales in the longitude and latitude directions. and .in, and These reflect the typical prediction error scales of the baseline method in two coordinate directions and are fixed before proceeding to the final conformal calibration stage. Preferably, they can be determined based on the average absolute coordinate residuals on the validation set.
[0166] ,c
[0167] in, and Let represent the true position and predicted position of the i-th verification sample in the coordinate direction c, respectively.
[0168] After fixing the global coordinate scale, for the final calibration set For the i-th sample in the baseline method, the two-dimensional joint inconsistency score is defined as:
[0169]
[0170] Set the coverage level to And in accordance with the same finite sample correction rule as in this invention, the calibration set is... Sort the data to obtain the conformal correction factor corresponding to the baseline. For the target IP during the testing phase, its coordinate direction c The baseline confidence interval is represented as:
[0171]
[0172] The corresponding two-dimensional reliable positioning area is:
[0173]
[0174] Because longitude and latitude each use a fixed global scale. and Therefore, the average interval widths of the two are not required to be the same, that is, there are usually two. .
[0175] It should be noted that, and All test samples using the same baseline method remain fixed, rather than dynamically changing for a single target IP. Therefore, the aforementioned baseline method only obtains a global error scale in the coordinate direction, without using the instance interval scale proposed in this invention. This invention dynamically constructs the position response before and after refinement of the target IP, the position response with maximum attention disturbance, and the position response with characteristic disturbance based on the target IP itself. This allows different target IPs to have different instance interval scales. Therefore, under the same conformal calibration principle, it is possible to fairly compare the differences in coverage and interval compactness between the global scale interval and the instance adaptive scale interval.
[0176] For CQR-IPGeo, a confidence interval is constructed using a graph neural network, conditional quantile regression, and conformal correction according to its published method. In the unified 95% experiment, the target coverage level is set to 0.05, and the system is retrained and calibrated according to the corresponding 95% quantile setting. CQR-IPGeo, as one of the publicly available confidence interval baselines closest to the present invention in this embodiment, is used to compare the differences between "quantile boundary-driven intervals" and "attention stability-driven instance scales".
[0177] (III) Setting evaluation indicators:
[0178] To simultaneously evaluate high accuracy and high reliability performance, the following metrics are used in this embodiment.
[0179] Root Mean Square Error (RMSE): The root mean square error of the geographic distance between the predicted point location and the actual location. The lower the value, the smaller the overall positioning error, and the more sensitive it is to larger errors.
[0180] Mean Absolute Error (MAE): The average absolute error of the geographic distance between the predicted point location and the actual location. The lower the value, the higher the average positioning accuracy.
[0181] Median Error: The median of the geolocation error of the test sample, used to reflect the positioning error of a typical sample.
[0182] Longitude coverage and latitude coverage are denoted as follows: and In the local kilometer coordinates of this embodiment, they respectively correspond to , Two directions:
[0183]
[0184] in, This is an indicator function.
[0185] The two-dimensional joint coverage is defined as:
[0186]
[0187] The average interval widths in the longitude and latitude directions are denoted as follows: and In this embodiment, all data is converted to kilometer statistics. The overall average positioning interval width is defined as:
[0188]
[0189] This embodiment uses the New York dataset as the core engineering indicator verification dataset. Under the condition of a unified nominal joint coverage level of 95%, the focus is on verifying that the actual two-dimensional joint coverage rate is higher than 95% and the average positioning interval width is less than 4km.
[0190] (iv) Results Analysis:
[0191] 1. Point positioning comparison:
[0192] First, the basic accuracy of the point positioning backbone used in this invention is verified. Under unified data partitioning and input conditions, the existing point positioning experimental results in New York, Los Angeles, and Shanghai are shown in Table 1 below, with units of km. These results illustrate that self-consistent landmark attention and controlled attention perturbations can provide relatively accurate center locations before the construction of uncertainty intervals.
[0193] Table 1: Comparison of Basic Performance of Point Positioning
[0194]
[0195] The results from the point localization analysis show that the sparse feature interpretation, self-consistent landmark attention, and controlled attention perturbation employed in this invention maintain low RMSE, MAE, and MedianError on the New York, Los Angeles, and Shanghai datasets. Particularly in the high-density landmark scene in New York, the low center point error provides a favorable foundation for constructing compact and reliable intervals under 95% coverage conditions.
[0196] 2. Comparison of confidence intervals:
[0197] In the trusted interval experiments, all methods used the same test set and set the nominal joint coverage level to 95%. GraphGeo, RIPGeo, TrustGeo, and ExGeo used the aforementioned post-hoc two-dimensional joint conformal method to form intervals; CQR-IPGeo was retrained and calibrated at 95% according to its published conformal quantile regression route; this invention uses a stable instance interval scale and two-dimensional joint non-consistent fractional conformal calibration. Table 2 below uses the "coverage + interval width" display format consistent with existing interval localization work, while adding joint coverage and average localization interval width to directly correspond to the engineering indicators of this invention.
[0198] Table 2. Overall performance comparison of the 95% confidence interval of the New York dataset.
[0199]
[0200] Regarding the trust interval portion, the main difference between this invention and post-conformal baselines such as GraphGeo, RIPGeo, TrustGeo, and ExGeo is that point localization baselines only provide a uniform or post-hoc interval based on calibration errors, while this invention constructs different instance interval scales for each target IP before calibration by refining the position responses before and after calibration, the position response with the maximum attentional perturbation, and the position response with the feature perturbation. Therefore, target IPs with stable evidence and easy localization do not need to bear the large interval radius corresponding to difficult samples, and theoretically can obtain a more compact average interval at the same nominal coverage level.
[0201] The main difference between this invention and CQR-IPGeo lies in the different mechanisms for generating the base intervals. CQR-IPGeo learns the upper and lower quantile boundaries through conditional quantile regression and then performs conformal calibration; this invention does not set up upper and lower conditional quantile prediction heads for interval output, but directly transforms the attentional consistency and perturbation position response within the point localization model into instance interval scales, and then performs unified calibration through two-dimensional joint inconsistency scores. Thus, this invention directly couples the "internal stability of high-precision landmark localization" with the "sample adaptive width of the reliable interval".
[0202] From an engineering perspective, this invention fixes the coverage level as follows: This aims to achieve a nominal joint coverage level of 95%; whether the final "true joint latitude and longitude coverage rate is higher than 95%" is confirmed by independent test set measurements. An average positioning interval width of less than 4 km is determined by high-precision point positioning, instance interval scale, training-period width regularization, and conformal correction factors, and should be based on the final experimental results on the New York dataset. This approach preserves the statistical coverage semantics of conformal prediction while avoiding obtaining a superficial width index by artificially truncating conformal intervals.
[0203] In summary, this invention integrates instance-level sparse interpretation, self-consistent attention, controlled perturbation stability, and two-dimensional joint non-consistency score joint conformal calibration into a unified trusted IP location framework. This enables the final result to simultaneously possess point location accuracy, interpretability of key evidence, and spatial interval credibility. This method can be used for network attack attribution, financial fraud detection, access control, regulatory compliance, and other scenarios requiring trusted auditing of IP locations.
[0204] Example 2:
[0205] This embodiment proposes an IP positioning system for use with the method proposed in the configured embodiment, including: a data acquisition module, used to acquire multi-source network characteristics of the target IP to be located, as well as known landmark characteristics and landmark locations associated with the target IP;
[0206] The embodiment coefficient interpretation module is used to perform sparse weighting on the multi-source network features through instance-level sparse interpretation, determine the contribution of key features, and output Top-K key features;
[0207] The landmark attention aggregation module is used to calculate the initial landmark score based on the representation relationship between the target IP and the known landmark features of the location through instance-level sparse interpretation processing, and to obtain the initial landmark attention and the initial point position based on the initial landmark score;
[0208] The self-consistent attention refinement module is used to form a landmark guidance representation based on the initial landmark attention, and calculate the refined landmark attention after combining it with the target IP. After constraining the consistency between the initial landmark attention and the refined landmark attention, the refined point position is output.
[0209] The controlled perturbation module is used to apply attentional perturbation to the initial landmark score and obtain the perturbation attention position, while applying feature perturbation to the Top-K key features and obtaining the feature perturbation position;
[0210] The stability instance scaling module is used to construct multiple location responses and establish the instance interval scale of the target IP based on the initial point location, refined point location, perturbation attention location, and feature perturbation location.
[0211] The conformal calibration module is used to establish an independent calibration set, calculate the two-dimensional joint standardized inconsistency score, determine the conformal correction factor, and construct a two-dimensional reliable positioning region based on the conformal correction factor and the instance interval scale.
[0212] The audit output module is used to output audit information that includes at least the contribution of key features, Top-K key features, initial landmark attention, refined landmark attention, and two-dimensional reliable localization area.
[0213] It is understood that the content of the above method embodiments is applicable to this embodiment, the function specifically implemented in this embodiment is the same as the function specifically implemented in the above method embodiments, and the beneficial effects achieved by this system embodiment are also the same as the beneficial effects achieved by the above method embodiments.
[0214] This embodiment provides an electronic device, including a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the method described in Embodiment 1.
[0215] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in Embodiment 1.
[0216] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An IP localization method based on sparse interpretation and attention stability calibration, characterized in that, Includes the following steps: S100: Construct a pre-trained IP point localization model and obtain the multi-source network features of the target IP to be located, as well as the known landmark features and landmark locations associated with the target IP; S200: The multi-source network features are sparsely weighted through instance-level sparse interpretation, and the contributions of key features are determined and Top-K key features are output; S300: Based on the IP point localization model, and using the representation relationship between the target IP and the known landmark features of the location processed by instance-level sparse interpretation, the initial landmark score is calculated, and the initial landmark attention and initial point position are obtained based on the initial landmark score. S400: Based on the initial landmark attention, a landmark guidance representation is formed, and after combining it with the target IP, a refined landmark attention is calculated. After constraining the consistency between the initial landmark attention and the refined landmark attention, the refined point position is output. S500: Apply attentional perturbation to the initial landmark score and obtain the perturbation attention location, while applying feature perturbation to the Top-K key features and obtaining the feature perturbation location; S600: Construct multiple location responses and establish the instance interval scale of the target IP based on the initial point location, refined point location, disturbance attention location, and characteristic disturbance location; S700: Establish an independent calibration set, calculate the two-dimensional joint inconsistency score, determine the conformal correction factor, and construct a two-dimensional reliable positioning region based on the conformal correction factor and the instance interval scale; S800: The output should include at least the key feature contribution, Top-K key features, initial landmark attention, refined landmark attention, and audit information of the two-dimensional reliable localization region.
2. The IP localization method based on sparse interpretation and attention stability calibration according to claim 1, characterized in that, Step S200 includes: A shared gating function is used to generate instance-level feature gating for multi-source network features and features with known locations, and element-level and feature group-level sparse regularization are used to jointly limit the number of effective features. The amplitude normalization of the gated multi-source network features and the features of known locations is used to obtain the key feature contributions, and the Top-K key features are output.
3. The IP localization method based on sparse interpretation and attention stability calibration according to claim 2, characterized in that, Step S300 includes: Based on the IP point localization model, the gated multi-source network features and known landmark features are mapped to a shared latent space. The initial landmark score is calculated using latent correlation and spatial regularization. The initial landmark attention is obtained based on the initial landmark score, and the initial point position is obtained based on the initial landmark attention.
4. The IP localization method based on sparse interpretation and attention stability calibration according to claim 3, characterized in that, Step S400 includes: After the initial landmark attention is formed into a landmark guidance representation, it is combined with the target IP to form a refined target representation; Based on the refined target representation, the refined landmark score and refined landmark attention are recalculated through potential relevance and spatial regularization. The distribution distance constraint is used to ensure the consistency between the initial landmark attention and the refined landmark attention, and the location of the refined point is output.
5. The IP localization method based on sparse interpretation and attention stability calibration according to claim 1, characterized in that, Step S500 includes: Based on the initial landmark scores, softened attention and sharpened attention are constructed, and softened perturbation attention locations and sharpened perturbation attention locations are established; Set an attenuation coefficient, attenuate the Top-K key features, and re-execute the calculation process of steps S300-S400 to obtain the feature perturbation position.
6. The IP localization method based on sparse interpretation and attention stability calibration according to claim 5, characterized in that, Step S600 includes: The coordinate deviation between the initial point position and the refined point position is set as the position response before and after refinement; the maximum coordinate deviation between the disturbance attention position and the refined point position is set as the maximum position response of the attention disturbance; the coordinate deviation between the feature disturbance position and the refined point position is set as the feature disturbance position response; and the instance interval scale of the target IP is constructed based on the position response before and after refinement, the maximum position response of the attention disturbance, and the feature disturbance position response.
7. The IP localization method based on sparse interpretation and attention stability calibration according to claim 1, characterized in that, Step S700 includes: An independent calibration set is established, and a two-dimensional joint inconsistency score is obtained based on the precise point location, landmark location, and instance interval scale. The coverage level is set to 0.05, and the conformal correction factor is determined based on the 95% order of the finite sample of the two-dimensional joint inconsistency score, so that the two-dimensional reliable positioning region has a nominal joint coverage level of 95%.
8. An IP positioning system, characterized in that, include: The data acquisition module is used to acquire the multi-source network characteristics of the target IP to be located, as well as the known landmark characteristics and landmark locations associated with the target IP; The embodiment coefficient interpretation module is used to perform sparse weighting on the multi-source network features through instance-level sparse interpretation, determine the contribution of key features, and output Top-K key features; The landmark attention aggregation module is used to calculate the initial landmark score based on the representation relationship between the target IP and the known landmark features of the location through instance-level sparse interpretation processing, and to obtain the initial landmark attention and the initial point position based on the initial landmark score; The self-consistent attention refinement module is used to form a landmark guidance representation based on the initial landmark attention, and calculate the refined landmark attention after combining it with the target IP. After constraining the consistency between the initial landmark attention and the refined landmark attention, the refined point position is output. The controlled perturbation module is used to apply attentional perturbation to the initial landmark score and obtain the perturbation attention position, while applying feature perturbation to the Top-K key features and obtaining the feature perturbation position; The stability instance scaling module is used to construct multiple location responses and establish the instance interval scale of the target IP based on the initial point location, refined point location, perturbation attention location, and feature perturbation location. The conformal calibration module is used to establish an independent calibration set, calculate the two-dimensional joint standardized inconsistency score, determine the conformal correction factor, and construct a two-dimensional reliable positioning region based on the conformal correction factor and the instance interval scale. The audit output module is used to output audit information that includes at least the contribution of key features, Top-K key features, initial landmark attention, refined landmark attention, and two-dimensional reliable localization area.
9. An electronic device, characterized in that, The device includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the electronic device to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which, when executed by a processor, implements the method described in any one of claims 1 to 7.
