A Two-Stage Topology Identification Strategy for Low-Voltage Distribution Grids Based on Contrastive Learning
Abstract
1. Introduction
- (1)
- The generalization capability of intelligent learning models based on neural networks is limited by their heavy dependence on labeled samples. Most existing methods rely on fully labeled topology datasets for supervised learning. However, the LVDG face challenges including low measurement device coverage and high manual labeling costs, resulting in limited availability of labeled data. This significantly reduces model generalization performance in complex scenarios.
- (2)
- Current methods demonstrate insufficient depth in mining node correlation features. While traditional graph learning methods can utilize explicit topological structure information, their ability to aggregate implicit correlation features between nodes remains weak. This makes it difficult to ensure the robustness of topology inference results, particularly when dealing with noisy or incomplete data.
- (1)
- A novel two-stage topology identification strategy for LVDGs is proposed. This strategy features a progressive initial construction-precise refinement framework for robust topology inference. This strategy overcomes the strong dependency on labeled data inherent in conventional single-stage identification models. The method performs topology inference directly using existing voltage/current time-series data from the LVDG, without requiring additional high-precision measurement devices. This significantly reduces deployment costs and effectively addresses practical challenges of incomplete measurement data and outdated topology records.
- (2)
- A DTW-Prim based topology initialization method is proposed. The DTW algorithm enables elastic alignment and similarity quantification of multi-node electrical time series. Dynamic coupling relationships between nodes are accurately captured. The Prim algorithm is then employed to construct the initial topological skeleton. This effectively avoids the matching failure issues of traditional distance metrics in non-Euclidean spaces.
- (3)
- An unsupervised GAT model (Unsup-GAT) based on contrastive learning is proposed for topology refinement. By developing a positive-negative sample pair generation mechanism, the model learns relative distance relationships of node embeddings in unsupervised settings. Leveraging existing data and physical constraints, erroneous connections in low-voltage topology structures are effectively corrected. This significantly improves the model’s adaptability in complex the LVDG environments.
2. Proposed Two-Stage Topology Identification Method
2.1. Architecture of the Proposed Method
2.2. Preliminary Construction Based on DTW-Prim Algorithm
2.2.1. Time Series Alignment and Low-Voltage Data Similarity Evaluation Based on DTW
2.2.2. Low-Voltage Topology Framework Generation Strategy Based on Prim Algorithm
2.3. Precise Correction Based on Unsup-GAT Model
2.3.1. Feature Fusion Learning Based on Graph Attention Network
2.3.2. Loss Function Paradigm Based on Contrastive Learning
3. Algorithm Flow of the Proposed Two-Stage LVDG Topology Identification
4. Case Study Analysis
4.1. Case Configuration
4.2. Analysis of Model Training Process
4.3. Analysis of Topology Identification Results
4.4. Comparison of Different Algorithms
4.5. Analysis of Model Robustness
5. Conclusions
- (1)
- The proposed DTW-Prim algorithm can accurately capture the similarity relationships between nodes through the elastic alignment and similarity quantification of time series, and construct the initial topology structure. Experiments on 7 LVDGs of different scales show that the average F1 Score of the preliminary identification result in Stage 1 reaches 87.32%, laying a topological foundation for the precise correction in Stage 2.
- (2)
- The proposed Unsup-GAT model based on the contrastive learning paradigm realizes the learning of complex correlation patterns in unsupervised scenarios through node information aggregation and attention weight assignment, and can identify and correct local connection errors in the initial topology. Experimental results show that the average F1 Score of the topology identification result in Stage 2 is increased by 11.7 percentage points, finally reaching 99.02%.
- (3)
- The robustness test shows that compared with other comparison algorithms, the proposed algorithm not only has the highest accuracy but also can realize highly robust inference of the topology structure through the progressive framework of “preliminary construction-precise correction”. For every 0.04 p.u. increase in noise amplitude, the F1 Score of the proposed algorithm decreases by an average of only 2.2 percentage points, which verifies the identification performance of the proposed algorithm in practical engineering scenarios with poor data quality.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Rizeakos, V.; Bachoumis, A.; Andriopoulos, N.; Birbas, M.; Birbas, A. Deep learning-based application for fault location identification and type classification in active distribution grids. Appl. Energy 2023, 338, 120932. [Google Scholar] [CrossRef] [Scilit]
- García, S.; Mora-Merchán, J.M.; Larios, D.F.; Personal, E.; Parejo, A.; León, C. Phase topology identification in low-voltage distribution networks: A Bayesian approach. Int. J. Electr. Power Energy Syst. 2023, 144, 108525. [Google Scholar] [CrossRef] [Scilit]
- Lei, Y.; Yang, F.; Feng, Y.; Hu, W.; Cheng, Y. A Topology Identification Strategy of Low-Voltage Distribution Grids Based on Feature-Enhanced Graph Attention Network. Energies 2025, 18, 2821. [Google Scholar] [CrossRef] [Scilit]
- Athanasiadis, C.L.; Papadopoulos, T.A.; Kryonidis, G.C.; Doukas, D.I. A review of distribution network applications based on smart meter data analytics. Renew. Sustain. Energy Rev. 2024, 191, 114151. [Google Scholar] [CrossRef] [Scilit]
- Zhao, J.; Xu, M.; Wang, X.; Zhu, J.; Xuan, Y.; Sun, Z. Data-driven based low-voltage distribution system transformer-customer relationship identification. IEEE Trans. Power Deliv. 2021, 37, 2966–2977. [Google Scholar] [CrossRef] [Scilit]
- Byun, H.J.; Zheng, Y.P.; Choi, S.J.; Shon, S.G. New identification method for power transformer and phase in distribution systems. Appl. Mech. Mater. 2018, 878, 291–295. [Google Scholar] [CrossRef] [Scilit]
- Ge, H.; Xu, B.; Zhang, X.; Bi, Y. Low-voltage overhead lines topology identification method based on high-frequency signal injection. Arch. Electr. Eng. 2021, 70, 791–800. [Google Scholar] [CrossRef] [Scilit]
- García, S.; Fresia, M.; Mora-Merchán, J.M.; Carrasco, A.; Personal, E.; Leon, C. A data-driven topology identification method for low-voltage distribution networks based on the wavelet transform. Electr. Power Syst. Res. 2025, 243, 111517. [Google Scholar] [CrossRef] [Scilit]
- Al Khafaf, N.; Song, H.; McGrath, B.; Jalili, M. Identification of low voltage distribution transformer–customer connectivity based on unsupervised learning. Energy Rep. 2023, 9, 72–79. [Google Scholar] [CrossRef] [Scilit]
- Jiao, F.; Li, Z.; Ai, J.; Yang, H.; Deng, Y.; Li, D.; Gao, W.; Lai, Z.; Fu, X. Topology Identification Method for Low-Voltage Distribution Node Networks Based on Density Clustering Using Smart Meter Real-time Measurement Data. IEEE Access 2024, 12, 83600–83610. [Google Scholar] [CrossRef] [Scilit]
- Feng, N.; Du, Y.; Ding, Y. A heuristic-search-based topology identification and parameter estimation method in low voltage distribution grids with low observability. IEEE Trans. Smart Grid 2024, 15, 5826–5839. [Google Scholar] [CrossRef] [Scilit]
- Zhao, J.; Li, L.; Xu, Z.; Wang, X.; Wang, H.; Shao, X. Full-scale distribution system topology identification using Markov random field. IEEE Trans. Smart Grid 2020, 11, 4714–4726. [Google Scholar] [CrossRef] [Scilit]
- Zhang, H.; Cao, J.; Shen, Q. Topology identification of low-voltage distribution network based on latent tree model and cluster search. J. Electr. Power Sci. Technol. 2025, 40, 170–178, 195. [Google Scholar]
- Zhang, L.; Cong, W.; Dong, G.; Sun, Y. Method for single-phase electric meter phase discrimination based on multiple linear regression. In Proceedings of the 2019 IEEE 8th International Conference on Advanced Power System Automation and Protection (APAP), Xi’an, China, 21–24 October 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 177–181. [Google Scholar]
- Liu, B.; Chen, J.; Li, J. Distribution network topology identification method based on state estimation with mixed integer programming and structural equation model. Int. J. Electr. Power Energy Syst. 2024, 162, 110251. [Google Scholar] [CrossRef] [Scilit]
- Tian, Z.; Wu, W.; Zhang, B. A mixed integer quadratic programming model for topology identification in distribution network. IEEE Trans. Power Syst. 2015, 31, 823–824. [Google Scholar] [CrossRef] [Scilit]
- Farajollahi, M.; Shahsavari, A.; Mohsenian-Rad, H. Topology identification in distribution systems using line current sensors: An MILP approach. IEEE Trans. Smart Grid 2019, 11, 1159–1170. [Google Scholar] [CrossRef] [Scilit]
- Karimi, H.S.; Natarajan, B. Joint topology identification and state estimation in unobservable distribution grids. IEEE Trans. Smart Grid 2021, 12, 5299–5309. [Google Scholar] [CrossRef] [Scilit]
- Ma, L.; Wang, L.; Liu, Z. Topology identification of distribution networks using a split-EM based data-driven approach. IEEE Trans. Power Syst. 2021, 37, 2019–2031. [Google Scholar] [CrossRef] [Scilit]
- Razmi, P.; Ghaemi Asl, M.; Canarella, G.; Emami, A.S. Topology identification in distribution system via machine learning algorithms. PLoS ONE 2021, 16, e0252436. [Google Scholar] [CrossRef] [Scilit]
- Xu, D.; Wu, Z.; Xu, J.; Hu, Q. A data-model hybrid driven topology identification framework for distribution networks. CSEE J. Power Energy Syst. 2023, 10, 1478–1490. [Google Scholar]
- Wu, H.; Xu, Z.; Zhao, J.; Chai, S. Gridtopo-GAN for distribution system topology identification. IEEE Trans. Ind. Inform. 2022, 19, 5356–5366. [Google Scholar] [CrossRef] [Scilit]
- Ni, Q.; Jiang, H. Topology identification of low-voltage distribution network based on deep convolutional time-series clustering. Energies 2023, 16, 4274. [Google Scholar] [CrossRef] [Scilit]
- Poudel, S.; Ramachandran, T.; Veeramany, A.; Francis, C.; Reiman, A.P. Topology Identification Using Graph Theory Informed State Estimation-Based Model Selection for Power Distribution Systems. IEEE Trans. Ind. Inform. 2023, 20, 3563–3573. [Google Scholar] [CrossRef] [Scilit]
- Flynn, C.; Pengwah, A.B.; Razzaghi, R.; Andrew, L.L.H.; Flynn, D. An improved algorithm for topology identification of distribution networks using smart meter data and its application for fault detection. IEEE Trans. Smart Grid 2023, 14, 3850–3861. [Google Scholar] [CrossRef] [Scilit]
- Senin, P. Dynamic time warping algorithm review. Inf. Comput. Sci. Dep. Univ. Hawaii Manoa Honol. USA 2008, 855, 40. [Google Scholar]
- Zhang, S.; Liu, W.; Wan, H.; Bai, Y.; Yang, Y.; Ma, Y.; Lu, Y. Combing data-driven and model-driven methods for high proportion renewable energy distribution network reliability evaluation. Int. J. Electr. Power Energy Syst. 2023, 149, 108941. [Google Scholar] [CrossRef] [Scilit]
- Barja-Martinez, S.; Aragüés-Peñalba, M.; Munné-Collado, Í.; Lloret-Gallego, P.; Bullich-Massagué, E.; Villafafila-Robles, R. Artificial intelligence techniques for enabling Big Data services in distribution networks: A review. Renew. Sustain. Energy Rev. 2021, 150, 111459. [Google Scholar] [CrossRef] [Scilit]
- Veličković, P.; Cucurull, G.; Casanova, A.; Romero, A.; Lio, P.; Bengio, Y. Graph attention networks. arXiv 2017, arXiv:1710.10903. [Google Scholar]
- Tian, Y.; Sun, C.; Poole, B.; Krishnan, D.; Schmid, C.; Isola, P. What makes for good views for contrastive learning? Adv. Neural Inf. Process. Syst. 2020, 33, 6827–6839. [Google Scholar]
- Khosla, P.; Teterwak, P.; Wang, C.; Sarna, A.; Tian, Y.; Isola, P.; Maschinot, A.; Liu, C.; Krishnan, D. Supervised contrastive learning. Adv. Neural Inf. Process. Syst. 2020, 33, 18661–18673. [Google Scholar]
- Habib, A.K.M.A.; Hasan, M.K.; Hassan, R.; Islam, S.; Thakkar, R.; Vo, N. Distributed denial-of-service attack detection for smart grid wide area measurement system: A hybrid machine learning technique. Energy Rep. 2023, 9, 638–646. [Google Scholar] [CrossRef] [Scilit]
- Yang, L.; Teh, J. Review on vulnerability analysis of power distribution network. Electr. Power Syst. Res. 2023, 224, 109741. [Google Scholar] [CrossRef] [Scilit]









| Number of Nodes | |
|---|---|
| LVDG 1 | 49 |
| LVDG 2 | 78 |
| LVDG 3 | 31 |
| LVDG 4 | 55 |
| LVDG 5 | 51 |
| LVDG 6 | 62 |
| LVDG 7 | 86 |
| Stage 1 Results | Stage 2 Results | |||||||
|---|---|---|---|---|---|---|---|---|
| TP | TN | FP | FN | TP | TN | FP | FN | |
| LVDG 1 | 44 | 1161 | 15 | 4 | 48 | 1176 | 0 | 0 |
| LVDG 2 | 73 | 2987 | 16 | 4 | 76 | 3001 | 2 | 1 |
| LVDG 3 | 28 | 462 | 3 | 2 | 30 | 465 | 0 | 0 |
| LVDG 4 | 51 | 1476 | 9 | 3 | 54 | 1485 | 0 | 0 |
| LVDG 5 | 47 | 1267 | 8 | 3 | 49 | 1274 | 1 | 1 |
| LVDG 6 | 55 | 1881 | 10 | 6 | 61 | 1891 | 0 | 0 |
| LVDG 7 | 73 | 3637 | 18 | 12 | 83 | 3652 | 3 | 2 |
| Precision/% | Recall/% | F1 Score/% | Training Duration/Min | Calculation Duration/s | |
|---|---|---|---|---|---|
| Algorithm 1 | 78.33 | 88.20 | 82.97 | / | 1.55 |
| Algorithm 2 | 83.17 | 92.04 | 87.38 | / | 3.71 |
| Algorithm 3 | 92.58 | 97.23 | 94.85 | 86.50 | 3.82 |
| Algorithm 4 | 98.85 | 99.19 | 99.02 | 97.25 | 3.80 |
| Algorithm 5 | 96.05 | 98.18 | 97.10 | 102.08 | 3.15 |
| Algorithm 6 | 85.27 | 94.47 | 89.63 | / | 4.29 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Lei, Y.; Yang, F.; Feng, Y.; Hu, W.; Cheng, Y. A Two-Stage Topology Identification Strategy for Low-Voltage Distribution Grids Based on Contrastive Learning. Energies 2025, 18, 5886. https://doi.org/10.3390/en18225886
Lei Y, Yang F, Feng Y, Hu W, Cheng Y. A Two-Stage Topology Identification Strategy for Low-Voltage Distribution Grids Based on Contrastive Learning. Energies. 2025; 18(22):5886. https://doi.org/10.3390/en18225886
Chicago/Turabian StyleLei, Yang, Fan Yang, Yanjun Feng, Wei Hu, and Yinzhang Cheng. 2025. "A Two-Stage Topology Identification Strategy for Low-Voltage Distribution Grids Based on Contrastive Learning" Energies 18, no. 22: 5886. https://doi.org/10.3390/en18225886
APA StyleLei, Y., Yang, F., Feng, Y., Hu, W., & Cheng, Y. (2025). A Two-Stage Topology Identification Strategy for Low-Voltage Distribution Grids Based on Contrastive Learning. Energies, 18(22), 5886. https://doi.org/10.3390/en18225886

