# Extract-Transform-Load Process Leveraging Computer Vision to Enable Computer Modelling of Smart Grids

Juan J Cuenca, Lina M Cuenca-Silva, Alexis Zarate-Caballero, Diego Orjuela-Aguirre

<figure><img src="image_1.png" /></figure>

## To cite this version:

Juan J Cuenca, Lina M Cuenca-Silva, Alexis Zarate-Caballero, Diego Orjuela-Aguirre. Extract-Transform-Load Process Leveraging Computer Vision to Enable Computer Modelling of Smart Grids. 2024 IEEE Latin American Conference on Computational Intelligence, Nov 2024, Bogota D.C., Colombia. hal-04815778

HAL Id: hal-04815778

https://hal.science/hal-04815778v1

Submitted on 3 Dec 2024

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Extract-Transform-Load Process Leveraging
Computer Vision to Enable Computer Modelling of
Smart Grids

Juan J. Cuenca

EH-Sigma Research Group
EHS Ltda

Neiva, Colombia

juan.cuenca@ehs.com.co

Lina M. Cuenca-Silva

EH-Sigma Research Group
EHS Ltda

Neiva, Colombia

lina.cuenca@ehs.com.co

Alexis Zarate-Caballero

EH-Sigma Research Group
EHS Ltda

Neiva, Colombia

alexis.zarate@ehs.com.co

Diego Orjuela-Aguirre

Independent Researcher
Hannover, Germany

diego.ing91@gmail.com

**Abstract**—A novel extract-transform-load methodology applying computer vision to build electrically equivalent models of electricity grids (i.e., digital twins of smart grids) is proposed. Here, we standardise information from electricity grids in various formats into a single visual input for object and text recognition, transformation and loading into a computer simulator. The proposed method is tested using state of the art computer vision algorithms: YOLOv8 for object detection (re-trained using two generic datasets of geometric figures) and PaddleOCR for text recognition. Validation is performed using two real electricity distribution networks in the centre-south region of Colombia, with a global object detection accuracy of up to 80.4%. Initial results suggest that the proposed method significantly reduces human effort compared to two classic approaches. The benefits and shortcomings of the proposed method are discussed together with future work opportunities.

**Index Terms**—smart grids, computer vision, extract transform load, digital twins, distribution networks

## I. INTRODUCTION

As a paramount strategy for sustainability, a transformation is underway for electrical grids to become smart grids (SG), this mostly is to facilitate the massive integration of renewable energies and distributed energy resources (DER) [1]. The intelligent operation of these small-scale resources connected to the low voltage and medium voltage electricity networks (i.e., distribution networks) has immense technical potential: reducing energy prices, optimising the use of the infrastructure, reducing losses, delaying otherwise necessary infrastructure upgrades, etc. [2].

A notable challenge associated to SG deployment is network supervision: the electrical infrastructure has technical limits (e.g., voltage and current values) that must be always respected to prevent a blackout. Electricity networks historically are operated with limited observability, this means that the distribution system operator (DSO) installed a few measuring

devices with low latency on critical points of the grid to verify off-line (i.e., a posteriori, with batches of measurements) if voltage and current are within the safety limits.

With the emergence of SGs, the supervision task has become unmanageable through low-latency measurements because the introduction of DER means voltages and currents are more variable and stochastic in smaller time steps [1]. Moreover, while advanced metering infrastructure has been proposed [3], just installing additional measuring devices everywhere in the grid is not feasible due to cost concerns, and latency issues from existing telecommunications infrastructure (e.g., most DSOs use power-line communication (PLC) [4]) for which latency, and data quality and management are reportedly significant issues.

DSOs require now high observability of their networks, and computer models (i.e., digital twins) of the network that can simulate the state of the grid have been proposed [5]. However, these require full knowledge of the topology of the grid (i.e., the geographical location of each node, the length and specifications of each cable, the size and location of each transformer, etc.). To this date, computer models for electricity networks are being built manually, which represents significant human effort. Collecting information in the field, measuring line resistances, transcribing without error quantities into a format understandable for the computer simulator, testing, etc. This paper offers an alternative: instead of allocating significant human resources to build computer models of electricity networks, some tasks can be automated through computer vision [6]. This article reports on the development of an extract-transform-load (ETL) tool for SG supervision, its challenges and limitations, and future perspectives. The main contributions of this paper are as follows.

* Presenting and testing the application of state of the art computer vision algorithms for object detection and text recognition to build computer models of electrical distribution grids from archived electrical design plans/documents.

This research was funded by the Ministry of Science Technology and Innovation of Colombia (MinCiencias) through the Francisco José de Caldas Fund, special cooperation agreement No. 266/2023. This research also received funding from EHS Ltda, contract No. 112721-319-2023.
<figure><img src="image_3.png" /><figcaption>Fig. 1: Proposed ETL-based approach</figcaption></figure>

* Contrast the accuracy of the proposed model against two human approaches: manual transformation from archived electrical plans/documents, and information collection in the field.

The remainder of this article is structured as follows. Section II presents the methodology, together with its challenges and limitations, section III presents the selected case studies and briefly describes the physical nuances of computer models for SGs, and section IV presents the results of the proposed method and the two alternatives for comparison. This is followed by the conclusions and discussion on lessons learned from two perspectives: computer intelligence, and SG deployment in section V.

## II. ETL METHODOLOGY

DSOs have significant information on their networks in digital and paper format (i.e., visual representation of the geographical distribution of customers, poles and lines, transformers, etc.) but the human task of transforming these is not trivial. Fig. 1 presents the layout of the proposed methodology with references to the different subsections in this article addressing each step of the process.

ETL approaches have gained attention over recent years when it comes to data accumulation from multiple sources for analysis and research in industry [7]. Databases can be populated using a sequential process in which data is (1) extracted from various sources/forms, (2) integrated, cleaned and transformed into a common form and (3) loaded into the database. Correct implementation and execution of ETL processes reportedly leads to the effective analysis and research of different study cases and allows for replicability [8].

### A. Input data standardisation

Information from DSOs on their networks come in different shapes and forms, from old electrical maps that were drawn by designers decades ago to build the electricity network, to more recent surveys in digital computer-aided design (CAD) format (e.g., portable document format .pdf, digital drawings in AutoCAD's .dwg format, etc.). These various sources of information make the task of the computer modeller particularly complicated, as it would be virtually impossible to design a script that can generalise well enough for different formats and versions. To overcome this, the first step of this ETL approach is to normalise the data into a format that can be managed with better generalisation.

One advantage from design practices in electrical engineering comes from standardisation of drawings. While the formats, templates and document sizes vary, visual representations of circuit elements are standard, as registered in electrical codes (e.g., in [9]). The objects are generic in their visual format (e.g., an electrical transformer is drawn as a triangle, an electrical pole as a circle, etc.), and this can be leveraged to standardise input data in visual form. It is proposed to transform all possible representations of the networks (i.e., printed and digital) to a single digital format for image (e.g., .jpg, .png, .bmp, etc.) with sufficient resolution to allow for the identification of objects and text, this way generalisation is made on input images and classification objects.

### B. Object detection

Advances in computer vision allow for the abstraction of information from images [6]: features can be used by machine learning - notably convolutional neural networks - to teach computers and systems to recognise elements. The accuracy of computer vision entails the use of models that have been trained with large amounts of labelled data [10]. Moreover, a notable limitation for the development of computer vision approaches is the important computational effort it takes to calculate the weights of the model (i.e., it is computationally heavy to train for computer vision). In contrast, state of the art computer vision algorithms allow for the use of pre-trained models that with a marginal amount of additional training with special datasets, can reach good performances [11].

Computer vision models that allow re-training are specialised in recognising predefined categories of objects (e.g., human, bicycle, car, traffic sign, etc.) and these are not particularly useful for the application proposed. The selection of the re-training dataset must therefore include new categories that represent the objects to be identified. Although the assigned categories may vary for different electricity grid codes, the consensus is the use of basic geometric figures (e.g., triangles, circles, hexagons, line segments, etc.). The appropriate selection of objects and their correct labelling derived from the applicable grid code is necessary for three categories of elements: buses/nodes, cables/lines, and substations/transformers [9]. Aside from the classification of the geometric figure, its position is required to represent the geographical distribution of the elements and how they are connected. For this, the output of the computer vision model must also include the coordinates of the bounding boxes.

1) *Small object detection:* an important challenge for this study is the relatively small size of the objects to identify, compared to the size of the image. As an example, an electricity grid printed on A0-sized paper has 9,933 x 14,043 pixels at a resolution of 300 pixels per inch (ppi), and it can include circuit elements that do not exceed 50 by 50 pixels. A real anonymised electricity network is presented in Fig. 2, showing the relatively small size of the elements to identify.

It has been reported that even if the computer vision model is trained using small-sized objects too, its recognition ability is largely limited by this ratio [12]. It is proposed to segment
<figure><img src="image_4.png" /><figcaption>Fig. 2: Electricity grid and inset showing the relatively small size of elements. Privacy-sensitive information deleted.</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Fig. 3: Identification of elements connected by a cable using the same inset from Fig. 2.</figcaption></figure>

the input image into four out-of-phase overlapping pixel-grids (i.e., two horizontally and two vertically) of *N* smaller images that will be processed separately for object detection. Instead of one, four pixel-grids are proposed because it is not possible to avoid an object being in the frontier of a pixel grid, not allowing its identification. Ultimately, the objects recognised in all pixel-grids will be cross-referenced to eliminate duplicates.

### C. Text recognition

Electrical diagrams contain additional information required to build the electrical models: the cross-section and material of the cables, the specifications of the electrical transformers, information on customer installations, etc. It is therefore necessary to also identify text and its position. Text can be recognised through computer vision because characters are in essence not different from objects in an image. However, one model only is not good at generalising classification of geometric figures and text recognition simultaneously [10]. It is proposed then to use a different specialised model in a second stage to recognise text and its bounding boxes for further processing and labelling of the circuit elements.

### D. From geometric to geographic representations

Calculating electrical parameters for the computer model requires the estimation of cable distances; notably, resistance and reactance values that depend on how long these cables are. This could be done in theory through computer vision, but it is particularly challenging because of how easy it would be to mislabel other elements as lines (e.g., an electrical substation normally represented as a triangle, could be mislabelled as three cables). To overcome this, the proposition is to identify the centre of each line using an alternative visual queue.

Standard networks can carry electrical energy using two, three, four and up to five cables, and according to grid codes, electrical diagrams must include short transversal line segments (i.e., slash symbols, “/” as seen in Fig. 3) in the middle of a line to indicate how many cables are installed

(e.g., instead of actually drawing three cables between two electrical poles, one line is drawn with three slashes in the middle): this is an easier object to recognise with computer vision.

Identifying the existence of a line does not yet indicate which elements it is connecting: as a two-terminal element it is also necessary to identify which buses/nodes are associated through the cable. It is proposed to identify these elements by verifying if the pixel space between their respective bounding boxes contains the geometrical centre of the line, as shown in Fig. 3 where the bounding boxes of two bus elements form a grey region that encloses the geometrical centre of a cable element. This process is repeated for all potential pairs of elements with the goal of identifying all possible connections. While unlikely, it is possible for a cable object's geometrical centre to be located in the pixel-space of more than one pair of elements. If this conflict arises, the line object closer to the mid-point between the geometric centres of the conflicting pairs of elements will be privileged.

The next step is then to convert this to real distances using a scaling factor. Electrical diagrams include scale from centimetres in the printed paper to meters in real life. This can in theory be abstracted using computer vision, but will be left for future work: for the purpose of this article the pixel-meter scale will be set up manually.

### E. Data labelling

After identifying the bounding boxes of elements and text in the entire studied image, the next challenge is matching them together. The intuitive way of doing this is by matching the nearest elements with text, but in some portions of the image the text and elements may be clumped. To solve this it is proposed to do the neighbour matching leveraging additional information from the labels in text. As shown in Fig. 3 the labels of the elements start with a letter followed by a number, the letter corresponds to the type of element (e.g., for Fig. 3 “M” is a “medium voltage bus”, and “T” is a substation or a
"transformer"). Data labelling will be done by category: bus, cable, and substation elements independently.

### F. Building electrical models

With the elements' locations, bounding boxes, and their labels, it is trivial to write a script that transforms information into a format that is readable for the computer simulator of electricity grids. As an additional check, a human must supervise the model produced for connectivity and assignment of elements (i.e., are all buses connected?, are lines connected to two elements only?, are all transformers assigned to a bus?, etc.). The interface with the simulation tool is therefore a transformation script that takes in tabular data from the computer vision module, and outputs files that are readable for the electrical simulator. Algorithm 1 presents the detailed steps to follow in the proposed ETL method.

## III. CASE STUDIES

### A. Computer vision models

For this application, two state of the art computer vision models were selected. **YOLOv8** is a computer vision model with object detection, classification, and segmentation capabilities, it is accessible through a Python package and was selected for its good performance and ability to re-train. The weights of an existing model were retrained with two datasets for geometric figure classification containing 98 and 525 labelled training images in [13] and [14] respectively. This produced two element recognition models that will be compared in this work, namely **ETL small** and **ETL large**. The labels originally representing geometric figures (e.g., "circle", "triangle", "square") were renamed as the electrical element represented (e.g., "bus", "substation", "customer"). For text recognition, **PaddleOCR** (practical ultra lightweight optical character recognition) was selected for its reported good performance and easiness of use through a Python package [15]. Re-training of the models and simulations were all performed using a personal computer running 64-bit Windows, with an Intel Core i5 (10th gen) processor, and 8 GB of RAM. For completeness, re-training was also performed using an Nvidia Tesla T4 with GPU memory of 16GB, Cuda v7.5 from Google Colab [16]. Training time using CPU for small and large datasets were 2.21 h and 25.14 h, while using GPU this was greatly reduced to 0.085 h and 0.344 h respectively.

### B. Electrical networks

Two anonymised electricity networks in the centre-south region of Colombia were selected to test the model.

* **Rural network:** with 223 domestic and 73 agricultural electricity customers, this medium voltage electricity grid has 3,437 buses at a voltage level of 13.8 kV, 187 substations and approximately 74 km of cables.

* **Urban network:** this relatively smaller medium voltage grid serves only 178 domestic customers with 32 substations and roughly 8.31 km of cables connecting 838 nodes also at a voltage level of 13.8 kV.

<table><caption>**Algorithm 1 Proposed ETL algorithm**</caption><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td>Input data:</td><td></td><td></td></tr><tr><td>1:</td><td>Get Network</td><td>▷ In visual format</td></tr><tr><td>2:</td><td>Get N</td><td>▷ Partitions for small object identification</td></tr><tr><td>3:</td><td>Get Scale</td><td>▷ Pixel/meter ratio</td></tr><tr><td>4:</td><td>Get ElementRecog, TextRecog</td><td>▷ Re-trained models</td></tr><tr><td></td><td>Object detection and text recognition:</td><td></td></tr><tr><td>5:</td><td>Images ← f(Network, N)</td><td>▷ Partition image</td></tr><tr><td>6:</td><td>for i ← 1 to Images do</td><td>▷ for each small image</td></tr><tr><td>7:</td><td>Elem, BoundBox<sub>Elem</sub> ← ElementRecog(i)</td><td></td></tr><tr><td>8:</td><td>Label, BoundBox<sub>Label</sub> ← TextRecog(i)</td><td></td></tr><tr><td>9:</td><td>end for</td><td></td></tr><tr><td>10:</td><td>for e ← 1 to Elem do</td><td>▷ for each element calc. position</td></tr><tr><td>11:</td><td>Pos<sub>Elem</sub>(e) ← Centre(BoundBox<sub>Elem</sub>(e))</td><td></td></tr><tr><td>12:</td><td>end for</td><td></td></tr><tr><td>13:</td><td>for l ← 1 to Label do</td><td>▷ for each label calc. position</td></tr><tr><td>14:</td><td>Pos<sub>Label</sub>(l) ← Centre(BoundBox<sub>Label</sub>(l))</td><td></td></tr><tr><td>15:</td><td>end for</td><td></td></tr><tr><td></td><td>From geometric to geographic information:</td><td></td></tr><tr><td>16:</td><td>for c ← 1 to Elem ∈ Cables do</td><td>▷ for each cable</td></tr><tr><td>17:</td><td>for {b<sub>x</sub>, b<sub>y</sub>} ← 1 to Elem ∈ Buses do</td><td>▷ for pairs</td></tr><tr><td>18:</td><td>if Pos<sub>Elem</sub>(c) ∈ PixSpace(b<sub>x</sub>, b<sub>y</sub>) then</td><td></td></tr><tr><td>19:</td><td>Con(c) ← [b<sub>x</sub>, b<sub>y</sub>] ▷ Assign connected buses</td><td></td></tr><tr><td>20:</td><td>Len(c) ← |Pos<sub>Elem</sub>(b<sub>x</sub>) - Pos<sub>Elem</sub>(b<sub>y</sub>)|]</td><td></td></tr><tr><td>21:</td><td>end if</td><td></td></tr><tr><td>22:</td><td>end for</td><td></td></tr><tr><td>23:</td><td>end for</td><td></td></tr><tr><td>24:</td><td>BoundBox<sub>Elem</sub> ← BoundBox<sub>Elem</sub>/Scale ▷ Re-scale</td><td></td></tr><tr><td>25:</td><td>BoundBox<sub>Label</sub> ← BoundBox<sub>Label</sub>/Scale ▷ Re-scale</td><td></td></tr><tr><td>26:</td><td>Pos<sub>Elem</sub> ← Pos<sub>Elem</sub>/Scale ▷ Re-scale elem. position</td><td></td></tr><tr><td>27:</td><td>Pos<sub>Label</sub> ← Pos<sub>Label</sub>/Scale ▷ Re-scale label position</td><td></td></tr><tr><td>28:</td><td>Len ← Len/Scale ▷ Re-scale cable lengths</td><td></td></tr><tr><td></td><td>Data labelling for subsets of elements:</td><td></td></tr><tr><td>29:</td><td>for b ← 1 to Elem ∈ Buses do</td><td>▷ for each bus</td></tr><tr><td>30:</td><td>Label<sub>Elem</sub>(b) ← min<sub>l∈Label</sub> |Pos<sub>Elem</sub>(b) - Pos<sub>Label</sub>(l)|</td><td></td></tr><tr><td>31:</td><td>end for</td><td></td></tr><tr><td>32:</td><td>for c ← 1 to Elem ∈ Cables do</td><td>▷ for each cable</td></tr><tr><td>33:</td><td>Label<sub>Elem</sub>(c) ← min<sub>l∈Label</sub> |Pos<sub>Elem</sub>(c) - Pos<sub>Label</sub>(l)|</td><td></td></tr><tr><td>34:</td><td>end for</td><td></td></tr><tr><td>35:</td><td>for s ← 1 to Elem ∈ Subs do</td><td>▷ for each substation</td></tr><tr><td>36:</td><td>Label<sub>Elem</sub>(s) ← min<sub>l∈Label</sub> |Pos<sub>Elem</sub>(s) - Pos<sub>Label</sub>(l)|</td><td></td></tr><tr><td>37:</td><td>end for</td><td></td></tr><tr><td></td><td>Interface with electric simulator:</td><td></td></tr><tr><td>38:</td><td>Bus.dss ← TranScript(Pos, Label) ∨ Buses</td><td></td></tr><tr><td>39:</td><td>Cable.dss ← TranScript(Con, Label, Len) ∨ Cables</td><td></td></tr><tr><td>40:</td><td>Sub.dss ← TranScript(Pos, Label) ∨ Subs</td><td></td></tr><tr><td>41:</td><td>Save Bus.dss, Cable.dss, Sub.dss</td><td></td></tr></tbody></table>

The electrical designs are available in visual format (i.e., .PDF that was subsequently transformed to high resolution .jpg files). Input images were then manually altered to delete background information (e.g., template, trees, roads, rivers, etc.). The following challenges were identified in coordination with the regional DSO when discussing this application:
<figure><img src="image_6.png" /><figcaption>Fig. 4: Classification of different elements for the two test networks using small and large re-training datasets.</figcaption></figure>

1) *Phase unbalance*: the inset in Fig. 3 shows two buses connected through three cables (i.e., three small lines drawn parallel to the cable, one for each electrical phase). An important limitation of the proposed model is phase identification. Phases are not interchangeable, and the visual representation of the model is not clear on which phase is connected in single-phased portions of the network. Among other reasons, the two networks were selected for this study because they only have three-phase connections, leaving this issue for future work.

2) *Neighbouring networks*: it is often the case that two or more networks are neighbouring each other and have a shared connection point that is normally open (i.e., disconnected). This is done for redundancy purposes: if there is a fault causing a blackout in one network, this normally open connection point can be closed, restoring service from the other. This is a challenge for computer vision because there is no way to identify these normally open points, or to differentiate where the frontiers of the networks are. The studied networks indeed present this issue, therefore as part of the pre-processing cleaning step the neighbouring networks were manually deleted. The authors acknowledge this to be an important limitation, a future work opportunity is to add visual queues for “frontier elements” between neighbouring networks that can also be identified through computer vision.

### C. Comparing model builders

To validate the usefulness and effectiveness of the *ETL method* proposed, two human approaches are compared. While it is subjective to quantify the time it takes for a human to complete a task, the orders of magnitude are representative of the task and are therefore useful for comparison with the computer vision model. The reader is advised to consider this subjectivity when analysing the human performance. To standardise, the same human with previous experience building computer models of electricity networks was allocated the same task as the ETL computer vision model using two approaches:

1) *Office human:* this is the common procedure to develop computer models of electricity grids. A human must read the documentation in visual and other formats available, transcribe it into tabular form, to then transform it to a format understandable for the computer simulator. The resulting model will be called the *office method*.

<figure><img src="image_7.png" /><figcaption>Fig. 5: Scatter plot with estimated and real cable distances on the rural network (left), for cables shorter than 50m (right).</figcaption></figure>

2) *Field human:* an alternative approach is sending a human to “visit” the electricity grid, and to register the GPS location of elements, their electrical ratings, cable configurations, etc. This approach guarantees having the most up-to-date information for the electricity model, but it comes a great human effort and economic cost (note that the times registered do not include transportation to the site). A third electrical model using this *on the field* method was built for comparison.

## IV. RESULTS AND VALIDATION

The classification results can be found in Fig. 4. While the model fails to recognise elements in all categories regardless of the dataset used for training, note that using a large dataset results in a considerably better performance (85.7% and 30.7% improvement for urban and rural networks respectively). It is suggested for future work to build larger custom training datasets: using labelled elements from actual electrical designs is expected to boost performance. An important remark is that at this early stage, human supervision is required to fix and complete the ETL models (i.e., labelling the missing elements and re-labelling those that were given the wrong category as an extra step between instructions 9 and 10 in Algorithm 1). In contrast, the performance of the text recognition module is perfect, with 100% of text labels correctly identified and assigned in the second recognition stage.

### A. Comparison of models

While this is not a regression problem, the cable distances estimated are of great importance for the development of the computer models. A scatter plot showing the estimated and real distances (i.e., from GPS data) for the rural network is presented in Fig. 5. There are more cables with a distance less than 50m, for which the mean square error (MSE) is smaller than for larger distances. The rural network has 3,436 cable elements out of which 3,272 are shorter than 50m, for these an MSE of 2.3 was calculated; and for the remaining 163 long cables the MSE is 5.8. These errors are within acceptable margins if we consider that the visual representation used as input does not include the vertical axis of our three-dimensional world. Using GPS information to calculate distances does capture that extra axis, explaining these differences.

The comparison of models is shown in Table I, where the global classification accuracy, computational and human times are presented. Note that the ETL models also require human
<table><caption>TABLE I: Results for different models.</caption><thead><tr><th>Case Study</th><th>Model</th><th>Classif. acc. [%]</th><th>Re-train time* [h]</th><th>Human time** [h]</th><th>Total time [h]</th></tr></thead><tbody><tr><td rowspan="4">Urban</td><td>ETL (small)</td><td>42.9</td><td>0.085</td><td>56</td><td>56.1</td></tr><tr><td>ETL (large)</td><td><b>79.6</b></td><td>0.344</td><td>20</td><td><b>20.3</b></td></tr><tr><td>Office human</td><td>100</td><td>-</td><td>104</td><td>104</td></tr><tr><td>Field human</td><td>100</td><td>-</td><td>124</td><td>124</td></tr><tr><td rowspan="4">Rural</td><td>ETL (small)</td><td>55.6</td><td>0.085</td><td>92</td><td>92.1</td></tr><tr><td>ETL (large)</td><td><b>80.4</b></td><td>0.344</td><td>26</td><td><b>26.3</b></td></tr><tr><td>Office human</td><td>100</td><td>-</td><td>160</td><td>160</td></tr><tr><td>Field human</td><td>100</td><td>-</td><td>188</td><td>188</td></tr></tbody></table>

time associated to supervision to fix and complete the models with missing elements.

The re-training time for the large dataset is four times larger than for the smaller dataset, but this is associated to an increase in classification accuracy. The latter is then associated with a big reduction in human effort spent in supervision. Building the computer models using human approaches takes significantly more time, especially when considering that the computer vision model must be re-trained only once, after which there is a negligible computational cost (i.e., less than one second to evaluate all images from the four pixel-grids).

1) Electrical comparison of models: Using a simple script, the models were ultimately transformed to .DSS format, to proceed with simulation work using the state of the art open source distribution system simulator (OpenDSS) developed by the Electric Power Research Institute (EPRI) [17]. This allowed us to conduct simulations to estimate the voltage and current values in all portions of the grid using each model (i.e., ETL small, large, Office and Field human). Taking Field human as the “ground truth”, Table II presents the mean average percentage error (MAPE) in cable resistance, voltages and currents in the studied networks. These error values suggest a good accuracy compared to electrical measuring devices (i.e., in the order of 0.1%).

<table><caption>TABLE II: Electrical network model errors</caption><thead><tr><th>Case Study</th><th>Model</th><th>Resistance MAPE [%]</th><th>Voltage MAPE [%]</th><th>Current MAPE [%]</th></tr></thead><tbody><tr><td rowspan="3">Urban</td><td>ETL (small)</td><td>0.0845</td><td>0.0023</td><td>0.0246</td></tr><tr><td>ETL (large)</td><td>0.0882</td><td>0.0063</td><td>0.0277</td></tr><tr><td>Office human</td><td>0.0877</td><td>0.0036</td><td>0.0494</td></tr><tr><td rowspan="3">Rural</td><td>ETL (small)</td><td>0.1258</td><td>0.0564</td><td>0.0235</td></tr><tr><td>ETL (large)</td><td>0.1211</td><td>0.0475</td><td>0.0716</td></tr><tr><td>Office human</td><td>0.1630</td><td>0.0221</td><td>0.0461</td></tr></tbody></table>

V. CONCLUSIONS

This article presents a novel ETL method leveraging computer vision to develop electrically equivalent models of SGs (i.e., digital twins). While numerous shortcomings are noted (e.g., human supervision required, measuring 3d distances in a 2d image, etc.), the potential for human time reductions is representative. At the early stages of this work, the accuracy in the physical measurements from the electrically equivalent model are within acceptable tolerances, and further developments

suggest improvements. The potential applications of this work cover the simulation-based branch of electrical engineering: renewable energy penetration, expansion planning, resiliency, security assessment studies, etc. A future work opportunity is to complement the proposed ETL model with other geographic information systems and data science to obtain the most up-to-date electrical models without field visits. This can be ultimately complemented with the use of natural language processing in the extraction phase to digest written reports and specifications before/in place of computer vision.

ACKNOWLEDGMENT

The authors give special thanks to Electrohuila S.A. E.S.P. for their valuable input.

REFERENCES

[1] J. J. Cuenca, E. Jamil, and B. Hayes, “State of the art in energy communities and sharing economy concepts in the electricity sector,” *IEEE Trans. on Ind. Appl.*, vol. 57, no. 6, pp. 5737–5746, 2021.

[2] A. Singhal and R. Saxena, “Software models for smart grid,” in *2012 First Int. Workshop on Software Eng. Challenges for the Smart Grid (SE-SmartGrids)*, 2012, pp. 42–45.

[3] H. Mohapatra and A. K. Rath, “A fault tolerant routing scheme for advanced metering infrastructure: an approach towards smart grid,” *Cluster computing*, vol. 24, no. 3, pp. 2193–2211, 2021.

[4] O. R. Banda-Sayco, G. R. Laura-Choquehuanca, M. A. Zea-Vargas, S. A. Javier-Quispe, and P. L. Pari-Pinto, “Development of an indoor hybrid plc/vlc/ir communication system based on tcp/ip model,” in *2020 IEEE Congreso Bienal de Argentina (ARGENCON)*, 2020, pp. 1–7.

[5] B. Gao, H. Liu, H. Su, Z. Hong, C. Ji, and M. Zhao, “Design and typical application of digital twin architecture in smart grid,” in *2022 7th Asia Conf. on Power and Electrical Eng. (ACPEE)*, 2022, pp. 2140–2144.

[6] J. Redmon, S. Divvala, R. Girshick, and A. Farhadi, “You only look once: Unified, real-time object detection,” in *2016 IEEE Conf. on Computer Vision and Pattern Recognition (CVPR)*. Los Alamitos, CA, USA: IEEE Computer Society, jun 2016, pp. 779–788.

[7] H. Homayouni, “Testing extract-transform-load process in data warehouse systems,” in *2018 IEEE Int. Symposium on Software Reliability Eng. Workshops (ISSREW)*, 2018, pp. 158–161.

[8] S. Henry, S. Hoon, M. Hwang, D. Lee, and M. DeVore, “Engineering trade study: extract, transform, load tools for data migration,” in *2005 IEEE Design Symposium, Systems and Inf. Eng.*, 2005, pp. 1–8.

[9] Instituto colombiano de normas técnicas y certificación (ICONTEC), “Código eléctrico colombiano (NTC2050),” 1998.

[10] P. S. Ilyasi, G. Gupta, M. S. Sai, K. Saatwik, B. S. Kumar, and D. Vij, “Object-text detection and recognition system,” in *2021 10th Int. Conf. on System Modeling & Advancement in Research Trends (SMART)*, 2021, pp. 539–545.

[11] G. Jocher, A. Chaurasia, and J. Qiu, “Ultralytics YOLO,” Jan. 2023. [Online]. Available: https://github.com/ultralytics/ultralytics

[12] H. Yi, B. Liu, B. Zhao, and E. Liu, “Small object detection algorithm based on improved yolov8 for remote sensing,” *IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing*, vol. 17, pp. 1734–1747, 2024.

[13] Work, “shape detection dataset,” Feb 2024, visited on 2024-04-25. [Online]. Available: https://universe.roboflow.com/work-bzti1/shape-detection-n1tzt

[14] Talha, “geometricShapes dataset,” Jan 2024, visited on 2024-04-25. [Online]. Available: https://universe.roboflow.com/talhaturjsw/geometricShapes

[15] Y. Du, C. Li, R. Guo, X. Yin, W. Liu, J. Zhou, Y. Bai, Z. Yu, Y. Yang, Q. Dang, and H. Wang, “Pp-ocr: A practical ultra lightweight ocr system,” 2020.

[16] Google Inc., “Google Colab,” 2024. [Online]. Available: https://colab.research.google.com/

[17] R. C. Dugan and T. E. McDermott, “An open source platform for collaborating on smart grid research,” in *2011 IEEE Power and Energy Society General Meeting*, 2011, pp. 1–7.

<footnote>* Re-training with GPU. Note that it is only necessary to re-train once</footnote>

<footnote>** Values are indicative and should be interpreted as an estimation.</footnote>