METHOD FOR DETECTING POTENTIAL BUILDINGS WITH CLANDESTINE ENERGY CONSUMPTION AND COMPUTER-READABLE STORAGE MEDIA

A method using satellite imagery and geospatial data processing with machine learning effectively detects and prioritizes buildings with clandestine energy consumption, addressing the challenge of non-technical energy losses and enhancing energy distribution efficiency.

BR102024027592A2Pending Publication Date: 2026-07-14EQUATORIAL MARANHAO DISTRIBUIDORA DE ENERGIA SA +4

Patent Information

Authority / Receiving Office
BR · BR
Patent Type
Applications
Current Assignee / Owner
EQUATORIAL MARANHAO DISTRIBUIDORA DE ENERGIA SA
Filing Date
2024-12-30
Publication Date
2026-07-14

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader
Need to check novelty before this filing date? Find Prior Art

Description

1 / 30 METHOD FOR DETECTING POTENTIAL BUILDINGS WITH CLANDESTINE ENERGY CONSUMPTION AND READABLE STORAGE MEDIA BY COMPUTER Field of invention

[001] The present invention falls within the technical field of power generation, transmission and distribution. More specifically, the present invention relates to a method for detecting potential buildings with clandestine energy consumption and a computer-readable storage medium. Fundamentals of the invention

[002] Combating energy losses is a recurring strategic issue faced by energy production, transmission, and distribution companies. Total injected losses represented approximately 14.1% of the consumer market in 2023, according to a report by ANEEL (National Electric Energy Agency), entitled “Electrical Energy Losses in Distribution, edition 01 / 2024.

[003] Specifically, energy losses refer to the generated electrical energy that passes through transmission lines and distribution networks but is not sold, either for technical reasons (technical losses) or commercial reasons (non-technical losses). These losses are calculated as the difference between the electrical energy purchased by distributors and billed to their consumers. Furthermore, energy concessionaires pass on the calculated loss tariff values ​​to the final consumer.

[004] In particular, technical losses are inherent to the activity of distributing electrical energy, since a portion of the energy is dissipated in the process of transmission, voltage transformation, and measurement, due to physical laws. Therefore, technical losses are associated with the loading and configuration characteristics of distribution networks. Furthermore, technical losses vary according to the characteristics of the networks. Petition 870240111250, dated 12 / 30 / 2024, page 15 / 59 2 / 30 of each concession area, with only efficient levels being recognized in tariffs by ANEEL (Brazilian Electricity Regulatory Agency): the distribution system is divided according to network segments (high, medium, and low voltage), transformers, connection branches, and meters. Specific models are applied to each of these segments, using simplified information from existing networks and equipment, such as conductor length and gauge, transformer power, and energy supplied to consumer units. Based on this information, the percentage of efficient technical losses relative to the energy injected into the network is estimated.

[005] On the other hand, non-technical losses, also called commercial losses, originate mainly from theft (clandestine connection or direct diversion from the network), fraud (meter tampering or diversions), reading and measurement errors, and billing errors. More specifically, non-technical losses are calculated as the difference between total losses and technical losses. Furthermore, non-technical losses are largely associated with the management of the concessionaire and the socioeconomic characteristics of the concession areas. According to the ANEEL report "Electrical Energy Losses in Distribution", edition 01 / 2024, non-technical losses represented 19.8% of the total losses in the northern region of the country in 2023, exceeding technical losses (10.2%).Furthermore, according to the ANEEL report "Electrical Energy Losses in Distribution", edition 01 / 2021, large concessionaires are responsible for almost all non-technical losses due to the size of the market and the greater complexity of combating losses.

[006] In particular, techniques that contribute to the increase in non-technical losses involve the theft of energy directly from distribution networks, where consumers do not have meters or equipment to verify consumption. Petition 870240111250, dated 12 / 30 / 2024, page 16 / 59 3 / 30 of energy. Detecting areas where this theft occurs, referred to in this text as clandestine areas, presents complex scenarios, as it depends on reports or identification by field teams, particularly in Brazilian states, where on-site verification becomes costly due to their territorial area. Therefore, there is no real way to measure the size and location of the areas of irregularities beyond the measured energy loss.

[007] Furthermore, knowledge of the area of ​​illegal connections allows for the adoption of strategies to regularize consumers. Only after regularization can regulatory values ​​for real and regulatory non-technical losses be approximated and recognized in the tariffs charged by the concessionaires. State of the art

[008] Methodologies in the literature propose solutions for identifying non-technical losses with partially or fully automated systems in consumer unit meters. These techniques are based on the premise that energy consumers have meters and are connected to a low or medium voltage network.

[009] Furthermore, solutions in the literature propose Machine Learning techniques for identifying areas of potential fraud, using data from meters, such as consumption history and the geographic area where the meter is registered, for example.

[010] Furthermore, after the massive identification of areas with illegal connections, prioritizing these areas for the regularization of consumers requires an understanding of the rules adopted by the distributors. These rules involve multiple criteria that depend, for example, on field visits, area, street length, number of houses, among others. Moreover, each distributor may adopt different parameters that define areas for regularization. Therefore, defining prioritized lists for multiple areas with illegal connections becomes a complex task. Petition 870240111250, dated 12 / 30 / 2024, page 17 / 59 4 / 30 when the number of these areas also grows.

[011] In this sense, the literature provides several computational solutions focused on prioritized lists based on multiple criteria for different application domains, such as agriculture, commerce, etc. The advantage of this approach is the flexibility of the models that can be adopted. However, up to the present moment of study, there are no commercial solutions focused on multi-criteria prioritization for the electricity sector. Brief description of the invention

[012] The present invention describes, according to one embodiment thereof, a method for detecting potential buildings with clandestine energy consumption comprising: - detection of potential illegal constructions (PCC) including detection by image processing; and geospatial filtering; - to refine potential targets for buildings with illegal energy consumption; - validation of potential targets for buildings with illegal energy consumption; and - Prioritization of target groups for regularization.

[013] Image processing detection comprises: - Receive multiple satellite images, where the satellite images are 50 cm / px (high-resolution) in Geo Tagged Image File Format (.GEOTIFF) with three RGB layers; - detect and store latitude and longitude coordinate information of points that characterize a building in each satellite image using computational models based on Convolutional Neural Networks (CNNs); - Send satellite images to Convolutional Neural Networks (CNNs) as input data, which are processed by the model configured with a set of parameters; - Generate geospatial data for each detected building, more specifically, the latitude and longitude of the points that comprise it. Petition 870240111250, dated 12 / 30 / 2024, page 18 / 59 5 / 30 the polygon of the detected building's roof; - Store geospatial data in a database of detected buildings; where the detected constructions database includes databases that contain geospatial data equivalent to that processed by the RNC and / or external or internal geospatial data databases. [ 014] Geospatial filtering includes data input comprising: - database of detected buildings; - Zoning data that includes a geographic base in .GEOTIFF format, enabling the identification of rural and non-rural residential areas; - data on medium voltage (MV) and low voltage (LV) networks, including the latitude and longitude of the set of points or line segments and the class to which they belong, such as low voltage or medium voltage; - Meter data including latitude and longitude of the meters / consumer units; and - IBGE basic data with data that defines the geographic boundaries of Brazilian municipalities and states; where the geospatial filtering step includes, for all data lines (buildings) in the detected buildings database, extracting the centroid of the polygon that defines the geometry of the building in the set C = {ci, C2, ..., cn}, where N is the number of buildings in the database, and each building has a centroid at coordinates c = {xí ,yi} and the set of measuring equipment M = {m1,m2,m3, ...,mM}; and - select the buildings that are within the company's concession areas; where the company's concession areas are defined as a set of irregular polygons A = {a1, a2, ., am}; in order to identify the company's concession areas, if Petition 870240111250, dated 12 / 30 / 2024, page 19 / 59 6 / 30 uses the IBGE database and defines the union of all M concession areas by the equation below: m Am= UaJ J=1 equation 1; where the geospatial filtering step includes selecting a subset of buildings that belong to at least one of the concession areas, using the equation below: Cconcessao = U £ C : Ci £ Am, Vi = 1, 2, ... , N] equation 2.

[015] Geospatial filtering (1B) additionally includes filtering buildings that meet business rules, based on the distances of the buildings to meter bases and low and medium voltage networks, where: For each building centroid, select those in which, simultaneously, the Euclidean distance between the building centroid and the nearest meter centroid is greater than the value defined by the variable α, and in which the Euclidean distance between the building centroid and the nearest medium-voltage network point is less than or equal to the value defined by the variable β; dm = J(*i - xj)2 + (y - yj)2 equation 3, where: (Xi,yi) and (xj,yj) are the centroids of a construction and the coordinates of a gauge, respectively; The values ​​of α and β may vary depending on the zone where the building is located: non-rural zones or rural zones; and where geospatial filtering additionally includes: - exclude, from the subset of buildings belonging to at least one of the concession areas, those buildings with a polygon surface area (roof area) smaller than the value Petition 870240111250, dated 12 / 30 / 2024, page 20 / 59 7 / 30 defined by the parameter τ (m2); - Generate a database of Potential Illegal Constructions (PCC), which includes data from the database of detected constructions that meet all the conditions described in the geospatial filtering stage; - Include or exclude construction data from the database of Potential Clandestine Constructions (PCC); where the analysis is performed using a set of computer-readable instructions, along with supporting databases.

[016] The step of refining potential targets for buildings with illegal energy consumption involves data entry, which includes: - 50 CM / PX (high-resolution) satellite image data in Geo Tagged Image File Format (.GEOTIFF) with three RGB layers; - data on medium voltage (MV) and low voltage (LV) networks, including the latitude and longitude of the set of points or line segments and the class to which they belong, such as low voltage or medium voltage; - Meter data including latitude and longitude of the meters / consumer units; - Data from the Potential Clandestine Constructions Database: data from the database of detected constructions that meet all the conditions described in the geospatial filtering process; where the step of refining potential targets for illegal energy consumption in buildings additionally includes: Include or exclude data from constructions from the analysis by a set of computer-readable instructions, including: - Data from BT and MT network databases, meters, PPC (1B3) and satellite imagery are loaded into a memory including a set of computer instructions capable of visualizing the images and georeferenced data by overlaying Petition 870240111250, dated 12 / 30 / 2024, page 21 / 59 8 / 30 os; - a set of computer-readable instructions that analyzes each centroid in the PCC (1B3) database and verifies whether it corresponds to a building in the satellite image; wherein centroids of non-residential buildings are excluded; wherein the set of computer-readable instructions performs such analysis using one or more computer image processing models trained to identify residential or non-residential buildings with enlarged satellite images and to identify centroids superimposed on buildings in the images; - The computer-readable instruction set evaluates the quality of the results generated in the image processing detection stage, where quality is represented by the proximity of the building to the LV networks and meters; where the instruction set verifies the Euclidean distance, using latitude and longitude coordinates, of each centroid superimposed on the building and the nearest meter; where if the meter closest to the analyzed centroid has a shorter distance to another building, it is considered that the meter is linked to another building and not linked to the centroid under analysis; where the Euclidean distance of each centroid to the nearest low-voltage network is verified, considering distances between 10 meters and 2 kilometers; where the combination of centroids that are not linked to nearby meters and are close to the low-voltage network characterizes possible clandestine constructions; otherwise, the centroid is removed; - If the quality is not met, modify the filter parameters and / or the neural network parameters; - the computer-readable instruction set adds the latitude and longitude coordinates of the centroid to the post-refinement PCC database (2A1). Petition 870240111250, dated 12 / 30 / 2024, page 22 / 59 9 / 30 The validation phase for potential targets of illegal energy consumption also includes the execution of a set of computer-readable instructions for classifying illegal or non-illegal energy consumption sites; [ 017] in which the computer-readable instruction set uses computational models for image processing and analyzes images of buildings and identifies evidence of irregularity which includes at least one of: cables or wires directly connecting the low-voltage network and the residential building and absence of a metering unit in the building. [ 018] The validation phase for potential targets of illegally consuming energy in buildings also includes data entry, which includes: - PCC sample database (3A1), which includes part of the post-refinement PCC database (2A1); where the number of samples drawn from the PCC sample database is determined by the sample size calculation equation below: Z2.p. (1 — p) n =--------e2equation 4, where: n is the required sample size; Z is the critical value of the normal distribution for the desired confidence level (e.g., 1.96 for 95%, 2.58 for 99%). It is the expected proportion of the trait of interest; and is the tolerated margin of error (in decimal proportion); where the amount of PCC is finite within the base (N), the value of n is adjusted based on the proportion to N: n na= -------r i+ —11 +N Petition 870240111250, dated 12 / 30 / 2024, page 23 / 59 10 / 30 equation 5, where na is the number of samples adjusted to the total size of the PCC sample database.

[019] The validation stage of potential targets for illegal energy consumption also includes the PCC statistics calculation stage, which evaluates the quality of the results from the classified targets database through statistical methods with data from the classified targets database that includes sample data of PCC with a classification field such as illegal construction or non-illegal construction.

[020] The stage of prioritizing target groups for regularization includes identifying and ordering groups of possible illegal constructions for regularization based on grouping by distance from the targets; where distance-based target clustering (4B) involves applying computational models to define distance-based clusters, using at least one of the KNN, K-Means, or DBScane techniques.

[021] Furthermore, according to another preferred embodiment of the present invention, a computer-readable storage medium is defined comprising, stored therein, a set of computer-readable instructions, which when executed by a computer, executes the method for detecting potential clandestine energy consumption constructions of the present invention. Brief description of the figures

[022] To obtain a full and complete visualization of the object of this invention, the figures to which reference is made are presented, as follows.

[023] Figure 1 shows a flowchart of the method for detecting potential buildings with illegal energy consumption.

[024] Figure 2 shows an example of an image from the training database. Petition 870240111250, dated 12 / 30 / 2024, page 24 / 59 11 / 30

[025] Figure 3 illustrates examples of detections and classifications of constructions during training.

[026] Figure 4 shows examples of construction detections and classifications during validation.

[027] Figure 5 shows the validation of the model with low and medium building density.

[028] Figure 6 shows the validation of the model with high density of buildings.

[029] Figure 7 presents the evaluation of the model in expansion areas. Detailed description of the invention

[030] In particular, the method of the present invention uses image processing and machine learning to detect potential illegal energy consumption structures, referred to here as Potential Illegal Constructions (PCC), for which there is no information in the energy company's databases.

[031] Thus, it is assumed that potential illegal constructions do not have meters installed in their residence by the group. Furthermore, it is assumed that not all PCCs engage in the act of energy theft, since there may be processes for new energy connections for customers who fit the PCC profile.

[032] The method for detecting potential illegal energy consumption in buildings comprises the illegal construction detection stage 1 using two processes: image processing detection 1A; and geospatial filtering 1B, shown in Figure 1, in yellow boxes. The objective of the illegal construction detection stage 1 is to offer solutions for detecting buildings (residences, businesses, industries, etc.) from high-resolution satellite imagery and filtering out potential illegal constructions by extracting geospatial data of buildings (generated by the GPS solution or from other databases) that meet the company's business rules. A Petition 870240111250, dated 12 / 30 / 2024, page 25 / 59 12 / 30 The definition of the input data for the CCP 1 detection step and the definition of the processes are detailed below.

[033] The image processing detection step 1A comprises data input 1A1, which comprises receiving a plurality of satellite images, wherein the satellite images are 50 cm / px (high-resolution) in Geo Tagged Image File Format (.GEOTIFF) with three RGB layers.

[034] The objective of the image processing detection step 1A includes detecting and storing latitude and longitude coordinate information of points that characterize a building in each satellite image using computational models based on Convolutional Neural Networks (CNNs).

[035] The image processing detection stage 1A also includes sending satellite images to Convolutional Neural Networks (CNNs) as data input 1A2, which are processed by the model configured with a set of parameters 1A3; and generating geospatial data for each detected building, more specifically, the latitude and longitude of the points that make up the polygon of the detected building's roof. Furthermore, this geospatial data is stored in a database 1A4, entitled detected buildings database 1A4, in Figure 1. The detected buildings database 1A4 may contain other databases containing geospatial data equivalent to that processed by the CNN 1A5 (Fig. 1, arrow between buildings for detected buildings) and / or external or internal geospatial data databases.

[036] Thus, the detected constructions database 1A4 includes data with detected constructions, where each database entry has latitude and longitude data of the points that characterize the construction from the satellite view, that is, points that form the geometry (polygon) of the roof of each detected construction.

[037] In particular, the Open database was used. Petition 870240111250, dated 12 / 30 / 2024, page 26 / 59 13 / 30 Buildings (https: / / sites.research.google / gr / open-buildings / ) to feed our database of detected buildings 1A4.

[038] The Open Buildings database contains images in .jpeg format, and each image can contain multiple buildings, manually segmented and referenced here as objects (figure 2). Each object is a polygon that outlines the ends of the building.

[039] In addition to the Open Buildings database, a building detection model was also developed that enables identification in regions not mapped by the Open Buildings database due to the temporal disparity between the creation of the database and updated satellite images. The model is based on the YOLO-v8 architecture for building detection and classification, trained with an open database and validated in urban and rural areas.

[040] The detection of buildings using satellite image processing has several practical and scientific applications, such as security, monitoring, and civil planning. In the electricity sector, this task enables asset tracking, expansion planning, and reduction of energy losses. However, these activities require detection models that adapt to the mapped scenario and frequent processing, which may not be offered by current methodologies and databases. The model for detecting and classifying buildings in high-resolution satellite images (50 cm) was adapted from YOLOv8x and validated in a relevant environment, i.e., metropolitan and rural areas. The results show an accuracy of 87% with a confidence rate of 30% in the images tested in relevant environments, even without these images being used in training.Furthermore, the model stands out for its greater effectiveness in detection in areas with low building density, highlighting its potential for applications in regions with expanding civil construction. Petition 870240111250, dated 12 / 30 / 2024, page 27 / 59 14 / 30

[041] The Open Buildings database contains a set of 13,258 images for training, 1,934 images for validation, and 967 images for testing. In total, there are 195,059 segmented objects for training (156,645 objects), validation (26,132), and testing (12,282). This division was also used in the model training, representing a proportion of 82% of the database for training, 12% for validation, and 6% for testing.

[042] In addition, to increase the number of objects in the training, the database used several preprocessing and augmentation techniques. These techniques included resizing, adding noise, mirroring, among others. The operations used in preprocessing and augmentation are detailed in Table 1. Table 1 - Preprocessing and argumentation operations applied to the database PRE-PROCESSING Auto-orientation Applied Resizing Stretch to 640x640 AUGMENTATION Example training outputs 2 Horizontal, Vertical Mirroring 90° Rotation Clockwise, Counterclockwise, Upside down Crop Minimum zoom 0%, Maximum zoom 20% Rotation -12° and +12° Shear ±2° Horizontal, ±2° Vertical Grayscale Apply to 10% of images Hue Between -20° and +20° Saturation Between -20% and +20% Brightness Between -20% and +20% Exposure Between -15% and +15% Blur Up to 0.5px Cutout (occlusion) 5 boxes with 2% size each

[043] The neural network model adopted for adjustment and Petition 870240111250, dated 12 / 30 / 2024, page 28 / 59 The 15 / 30 training algorithm was YOLOv8x, a recent variant of the YOLO family of algorithms, designed for real-time object detection and greater accuracy. The architecture of YOLO and its variations uses an end-to-end neural network that predicts regions of interest and the probability of classes at once in an image. It differs from the approach taken by previous object detection algorithms, which reused classifiers to perform detection.

[044] For training, the model used algorithms implemented by Ultralytics and made available in the YOLOv8 library itself. 4000 epochs were estimated for training, but this was interrupted at epoch 367 due to the absence of error reduction and changes in training metrics. The other parameters followed the predefined standards of the YOLOv8 training class and are detailed in Table 2. The model was updated using an RTX 2000 1st Generation GPU, 13th generation Intel i7-13800H CPU, and 32GB of RAM. Table 2 - Model training parameters Parameter Value Batch 16 Optimizer Auto Deterministic True DNN False Learning Rate (lr0) 0.01 Learning rate (lrf) 0.01 Weight decay 0.0005

[045] During model training, a transition is observed from a low rate of correct classifications of the constructions (figure 3) to a significant increase during validation (figure 4). However, some false positives are also identified, especially in areas close to the correctly classified structures.

[046] The model was tested in a relevant environment of Petition 870240111250, dated 12 / 30 / 2024, page 29 / 59 16 / 30 application, with high-resolution images in different urban and rural locations in the state of Pará. In total, 1341 buildings were subjected to detection and classification by the model. The results show a variation in performance indicators at different confidence levels, and are presented in Table 3. Table 3 - Statistics for different confidence levels Confidence Precision Recall Fl-score Accuracy 10% 0.87 0.89 0.88 0.84 30% 0.95 0.92 0.93 0.87 50% 0.98 0.76 0.85 0.73

[047] With a confidence level of 10%, the model showed a precision of 0.87, a recall of 0.89, an F1-score of 0.88 and an accuracy of 84%. These numbers indicate a good balance between precision and recall.

[048] With confidence equal to 30%, the model's precision improves to 0.95, while recall reduces to 0.92. The F1-score at this level is 0.93, with accuracy rising to 87%, indicating an improvement in the reduction of false positives and good detection rates.

[049] However, when confidence is increased to 50%, a drop in recall is observed, falling to 0.76, although precision increases to 0.98. The F1-score at this level is 0.85, and accuracy decreases to 73%, suggesting that, although roof detection is accurate, the model may not identify some occurrences, favoring a smaller number of false positives, but compromising the overall coverage of detections.

[050] The results with confidence levels close to 30% in regions with low and medium building densities are similar to those returned by the Open Buildings Dataset (Figure 5), with the model detecting the data as purple points, compared to the Open Buildings Dataset baseline (in yellow). Note that in some points, the model identified a single building for a Petition 870240111250, dated 12 / 30 / 2024, page 30 / 59 17 / 30 set of nearby objects, blue circle in figure 5. In addition, some objects were incorrectly classified in areas without buildings. However, in these regions, geometric patterns reminiscent of rectangular shapes are observed, indicating a predisposition of the model to prioritize these patterns as buildings.

[051] The model's tendency to group buildings as a single object is further highlighted in regions with high building density (figure 6). In some situations, the model even classifies a single object as multiple buildings when compared with results from the Open Buildings Dataset (figure 6, bottom image, central blue circle). Again, the model classified areas with no buildings as buildings, however, these regions have rectangular geometric shapes (figure 6, top image, blue circle).

[052] Finally, the model was validated in regions designated as “expansion areas,” which indicate housing growth and the potential application of solutions for reducing non-technical losses (Figure 7). These areas are characterized by a smaller number of grouped residences. Furthermore, these regions were not added to the Open Building Dataset, demonstrating the potential of the proposed model for applications that require temporal reliability and recurring updates (Figure 7, center image).

[053] The model presents satisfactory results in detecting buildings in expansion areas, identifying buildings in different scenarios (figure 7). In particular, good performance is noted in areas where the roofs of the buildings have similar shades to the surrounding region (bottom image).

[054] Validation in a relevant scenario showed that the model tends to: i) classify regions with rectangular characteristics as buildings; ii) group and classify several buildings Petition 870240111250, dated 12 / 30 / 2024, page 31 / 59 18 / 30 as a single object in high-density areas; iii) correctly identify objects in low- and medium-density building areas. This last point characterizes expansion areas and potentially regions with applications for reducing non-technical losses. In total, the model showed an accuracy of 87% with examples that were not used for training.

[055] The method for detecting potential buildings with illegal energy consumption comprises the geospatial filtering step 1B which includes data input 1B1 which comprises: - the database of detected constructions 1A4; - Zoning data that includes a geographic base in .GEOTIFF format, enabling the identification of rural areas (or pasture areas) and non-rural residential areas; - Medium Voltage (MV) and Low Voltage (LV) network data, including the MV and LV network database, which is in shapefile format with georeferenced information about the company's distribution networks; where each database entry has the geographic position (latitude and longitude) of the set of points or line segments and the class to which it belongs, such as Low Voltage or Medium Voltage; - Meter data includes geographic registration data (latitude and longitude) of the company's meters / consumer units; - IBGE's basic data comprises data that defines the geographic boundaries of Brazilian municipalities and states.

[056] Specifically, the MapBiomas database (https: / / brasil.mapbiomas.org / colecoes-mapbiomas / ) is used for zoning, as the database contains the format and data necessary for the execution of the method. The IBGE database is used to delimit the company's area of ​​operation.

[057] Specifically, the geospatial filtering step 1B comprises filtering the buildings stored in the detected buildings database 1A4 as potential buildings. Petition 870240111250, dated 12 / 30 / 2024, page 32 / 59 19 / 30 clandestine operations based on the processing of geospatial data and the company's business rules.

[058] More specifically, the geospatial filtering step 1B includes, for all data lines (buildings) in the detected buildings database 1A4, extracting the centroid of the polygon that defines the geometry of the building in the set = {Ci, C2, ... , cn}, where N is the number of buildings in the database, and each building has a centroid at coordinates Ci = {%i ,yt} and the set of measuring equipment M = {m.1, m2,m3, ...,mM}; and selecting the buildings that are within the company's concession areas; where the company's concession areas are defined as a set of irregular polygons A = {a1, a2, ... , am}; where to identify the company's concession areas, the IBGE database is used and the union of all M concession areas is defined by the equation below: m Am= U aj J=1 equation 1.

[059] Additionally, geospatial filtering step 1B includes selecting a subset of buildings that belong to at least one of the concession areas, using the equation below: CcONCESSAO = ídêc: c£ ãm< Vi = 1, 2, ... ,N}equação 2.

[060] After selecting the buildings that are within the concession area, the geospatial filtering stage (1B) also involves filtering the buildings that meet the business rules, based on the distances of the buildings to the meter bases and the low and medium voltage networks, specifically: - For each centroid of the building, select those in which, simultaneously, the Euclidean distance between the centroid of the building and the centroid of the nearest gauge is greater than the value defined by the variable α, and in which the Euclidean distance Petition 870240111250, dated 12 / 30 / 2024, page 33 / 59 The distance between the centroid of the building and the nearest point on the medium-voltage network is less than or equal to the value defined by the variable β; where the Euclidean distance is given by the equation below: dm= J(*i - %)2+ (yt - yj)2equation 3, where: (Xi,yi) and (Xj,yj) are the centroids of a construction and the coordinates of a gauge, respectively; - The values ​​of α and β can vary depending on the zone where the building is located: non-rural or rural zones. The values ​​of these variables are defined by the company's business area. Zoning information for each building is extracted from the zoning database and defined based on the overlap of the building's centroid and the zone type at the geographic position of the centroid. If the value of α exceeds an upper limit, potential targets near meters not belonging to the building can be excluded. On the other hand, if the value of α is too low, the centroid of each building should be as close as possible to the coordinates of its corresponding meter, where dm = 0. For β, values ​​close to 0 result in the selection of buildings near LV and MV networks. The values ​​that demonstrated the greatest effectiveness in selecting potential targets were α = 50m for urban areas and α = 100m for rural areas.

[061] Furthermore, geospatial filtering step 1B includes excluding, from the subset of buildings that belong to at least one of the concession areas, buildings with a polygon surface area (roof area) smaller than the value defined by the parameter τ, where τ is given in square meters (m2).

[062] In particular, the variables α, β and the parameter τ (roof area) are parameters of the 1B1 filter applied in the construction, and can be updated from the business rule to 1B2 Petition 870240111250, dated 12 / 30 / 2024, page 34 / 59 21 / 30 improve the outcome of the process.

[063] Furthermore, the geospatial filtering stage 1B includes generating a database with Potential Clandestine Constructions (PCC) 1B3, which comprises data from the detected constructions database 1A4 that meet all the conditions described in the geospatial filtering stage 1B.

[064] The method for detecting potential illegal energy consumption in buildings further comprises the step of refining potential illegal energy consumption targets 2, which includes including or excluding building data in the database with Potential Illegal Constructions (PCC) 1B3; where manual analysis is performed by professionals, specifically, quality analysts (QA) or by a set of computer-readable instructions, together with supporting databases. The objective of this step is to increase the reliability of the PCC by reducing false positives and increasing true positives.

[065] The step of refining potential targets 2 of buildings with illegal energy consumption comprises data entry, which includes: - Satellite imagery data: 50 cm / px (high-resolution) satellite images in Geo Tagged Image File Format (.GEOTIFF) with three RGB layers. - Medium Voltage (MV) and Low Voltage (LV) network data: the MV (Medium Voltage) and LV (Low Voltage) network data is in shapefile format with georeferenced information about the company's distribution networks. Each entry in the database can indicate the geographic position (latitude and longitude) of the set of points or line segments, and the class to which it belongs, such as Low Voltage or Medium Voltage. - Meter data: contains geographic information (latitude and longitude) of the company's meters / consumer units. - Data from the Potential Illegal Construction Database 1B3: Petition 870240111250, dated 12 / 30 / 2024, page 35 / 59 22 / 30 data from the Constructions database were detected that meet all the conditions described in the Geospatial Filtering process.

[066] Additionally, the refinement step 2 of potential targets of buildings with illegal energy consumption comprises the inclusion or exclusion of building data from the manual / visual analysis of the results of the image processing detection step 1A by a professional, quality analyst (QA) or through a set of computer-readable instructions, including: - Data from the BT and MT network databases, meters, PPC 1B3, and satellite imagery are loaded into a memory that also includes a set of computer instructions capable of visualizing the images and georeferenced data by overlaying them; - The professional visually analyzes, or a set of computer-readable instructions analyzes, each centroid in the PCC 1B3 database and verifies if it corresponds to a building in the satellite image (justifying the need for high-resolution images - enlarged visualization and minimization of errors in the process). The set of computer-readable instructions performs this analysis using one or more computational image processing models trained to identify residential or non-residential buildings (industries, boats, soccer fields, etc.) with enlarged satellite images and to identify centroids superimposed on buildings in the images. The centroids of non-residential buildings can be excluded; - The professional visually assesses, or a set of computer-readable instructions evaluates, the quality of the results generated in the image processing detection step 1A. Examples of evaluation include the proximity conditions of the building for LV networks and meters. To do this, the professional or the set of instructions checks the distance. Petition 870240111250, dated 12 / 30 / 2024, p. 36 / 59 23 / 30 Euclidean distance, using latitude and longitude coordinates, is calculated from each centroid superimposed on the building and the nearest meter. If the meter closest to the analyzed centroid is closer to another building, it is considered that the meter is linked to another building and not to the centroid under analysis. The distance analyzed in this process can range from 5 meters to 500 meters. Additionally, the Euclidean distance from each centroid to the nearest low-voltage network is verified, considering distances between 10 meters and 2 kilometers. The combination of centroids that are not linked to nearby meters and are close to the low-voltage network characterizes possible illegal constructions, which are added to the PCC Post QA refinement database. Otherwise, the centroid can be removed from the PCC Post QA refinement database.Furthermore, if the quality is disapproved by the professional or by the computer-readable instruction set, that is, if the number of false positives or true negatives entered into the Possible Clandestine Constructions database (input of stage 2) exceeds 50% of the total number of centroids in the database, the professional or the computer-readable instruction set suggests or modifies the filter parameters 1B1 used and / or the neural network parameters 1A3. - After analysis, the professional or a set of computer-readable instructions adds the refinement results to the post-refinement PCC database 2A1. For included constructions, the professional or a set of computer-readable instructions adds the latitude and longitude coordinates of the centroid. For constructions already belonging to the PCC database 1B3, the data is replicated to the post-refinement PCC database 2A1.

[067] Thus, the step of refining potential targets 2 of buildings with illegal energy consumption comprises generating a post-refinement PCC database 2A1, which includes the data Petition 870240111250, dated 12 / 30 / 2024, page 37 / 59 24 / 30 maintained from the PCC 1B3 2 database, removing targets excluded by the professional or by the computer-readable instruction set and adding data from the centroids of buildings included in the refine potential targets step 2 of buildings with clandestine energy consumption.

[068] The method for detecting potential buildings with illegal energy consumption additionally includes the potential target validation step 3, which involves evaluating the quality of the results 3A of buildings with illegal energy consumption generated in the potential target refinement step 2 of buildings with illegal energy consumption, contained in the post-refinement PCC database 2A1, from field visits or the execution of a set of computer-readable instructions for classifying PCCs as illegal (true positive) or non-illegal (false positive) buildings.

[069] More specifically, the classification of PCCs as clandestine (true positive) or non-clandestine (false positive) constructions can be performed by the inspecting agent or by a set of computer-readable instructions. When the classification of PCCs as clandestine (true positive) or non-clandestine (false positive) constructions is performed by a professional, it is done through visits to the constructions present in PCC samples extracted from the 3A1 PCC sample database, using the latitude and longitude information of the constructions. When the classification of PCCs as clandestine or non-clandestine constructions is performed by a set of computer-readable instructions, computational models for image processing analyze images of the constructions and identify evidence of irregularity, such as cables or wires directly connecting the low-voltage network and the residential construction, and without a metering unit in the construction.The quality of the results is achieved. Petition 870240111250, dated 12 / 30 / 2024, pp. 38 / 59 25 / 30 based on statistical data from the classified sample.

[070] In this sense, the validation stage of potential targets 3 of buildings with clandestine energy consumption additionally includes data entry, which includes: - PCC 3A1 sample database, which includes part of the post-refinement PCC 2A1 database.

[071] In particular, the number of samples drawn from the PCC 3A1 sample database is determined by the sample size calculation equation below, ensuring that the quantity is representative of the total population with a specified confidence level and margin of error. The general equation for calculating the sample size is: Z2.p. (1 — p)n= -----2----e2equation 4, where: n is the required sample size; Z is the critical value of the normal distribution for the desired confidence level (e.g., 1.96 for 95%, 2.58 for 99%). It is the expected proportion of the trait of interest; and is the tolerated margin of error (in decimal proportion).

[072] Since the amount of PCC is finite within the base (N), the value of n is adjusted based on the proportion to N: n na= -------T i+ n—11 +N equation 5, where na is the number of samples adjusted to the total size of the PCC 3A1 sample database.

[073] The validation stage of potential targets 3 of buildings with illegal energy consumption can be carried out by an inspector. The regions for field visits by the inspector can be selected by the business area or by a set of computer-readable instructions, and the groups of Petition 870240111250, dated 12 / 30 / 2024, pp. 39 / 59 26 / 30 targets for the visit are randomly selected in these regions. Furthermore, the validation stage of potential targets (3) of buildings with illegal energy consumption can be carried out using a set of computer-readable instructions. The strategy for selecting targets for inspection is based on defining visit regions randomly through manual identification by the business area or by algorithms that generate regions randomly. The number of targets in a region can vary between 50 and 2000. The strategy of visiting by region is adopted due to the impossibility of strictly random visits to targets dispersed throughout the company's area of ​​operation. When visiting the coordinates present in the sample of illegal energy consumption sites, the inspector classifies each building as illegal or non-illegal. The classifications are stored in the classified targets database 3A2.The 3A2 classified target database comprises sample data from CCPs with a classification field such as illegal construction or non-illegal construction.

[074] Furthermore, the validation stage of potential targets 3 of buildings with clandestine energy consumption additionally includes the PCC 3B statistical calculation stage, which evaluates the quality of the results from the 3A2 classified target database through statistical methods. The PCC 3B statistical calculation stage includes data input that includes: - Data from the 3A2 classified target database, which includes sample data from CCPs with classification fields such as illegal construction or non-illegal construction.

[075] Specifically, the PCC 3B statistical calculation step additionally includes generating statistical data on the results of the field inspection, in the form of a statistical report of the target detection and selection process, in which the statistical data qualitatively represent the error and success rates generated in the process, including: Petition 870240111250, dated 12 / 30 / 2024, pp. 40 / 59 27 / 30 Accuracy: the proportion of correct predictions in relation to the total number of predictions. It serves to measure the overall performance of the process. - Precision: the proportion of true positives in relation to all positive predictions (true positives and false positives). Evaluates the accuracy of the positive predictions. - Sensitivity: the proportion of true positives in relation to the total number of actual positive cases. It measures the process's ability to capture true positives. - F1-score: harmonic mean between precision and sensitivity, balancing both. It serves as a balanced measure for precision and sensitivity.

[076] The method for detecting potential illegal energy consumption in buildings additionally includes the prioritization step of target groups for regularization 4, which includes identifying and ordering groups of possible illegal buildings for regularization based on financial investment analysis. The results of this step generate financial reports focusing on data on investment and return in case of regularization. These reports can be used for strategic decision-making. The prioritization step of target groups for regularization 4 can occur in parallel with the field validation step of potential targets 3, in two PCC grouping scenarios: grouping based on investment optimization 4A and grouping based on distance from targets 4B.

[077] Distance-based clustering of 4B targets involves using computational methods that take into account the distance between possible clandestine constructions, aiming to delineate groups within specified spatial regions. The distance-based clustering process for 4B targets applies computational models focused on defining groups based on distance (e.g., K-NN, K-Means, DBScan). Petition 870240111250, dated 12 / 30 / 2024, pp. 41 / 59 28 / 30 resulting in a set of PCC groups based on parameters from each algorithm. When adding a new element to the database, a value is added that represents the group to which the new element belongs.

[078] Furthermore, distance-based target clustering 4B includes data input comprising: - Post-refinement PCC database 2A1 comprising data maintained from the PCC database of the refinement phase 2 of potential targets of illegally tapped energy, removing excluded targets and adding data from the centroids of buildings included in the refinement phase 2 of potential targets of illegally tapped energy.

[079] Distance-based grouping of targets 4B generates a database of potential clandestine individuals grouped by distance 4B1.

[080] Investment optimization-based clustering 4A involves clustering post-QA refinement PCCs based on computational methods that optimize investment variables. Specifically, investment optimization-based clustering 4A uses computational models to find clusters that optimize investment variables. Examples of investment variables are the cost of regularizing illegal construction or the estimated revenue recovered from regularizing illegal construction. These variables can be combined to generate optimization functions that meet the company's needs. As a result, clusters are created that are characterized by the profiles of the financial optimization variables, stored in the Potential Illegal Constructions database, grouped by investment.

[081] Investment optimization-based clustering 4A comprises data input that includes: - PCC post-refinement 2A1 database: comprising the data maintained from the PCC database of the potential refinement stage. Petition 870240111250, dated 12 / 30 / 2024, pp. 42 / 59 29 / 30 targets 2 of buildings with illegal energy consumption, removing excluded targets and adding data from the centroids of buildings included in the step of refining potential targets 2 of buildings with illegal energy consumption.

[082] The investment optimization-based clustering 4A generates a database of potential illegal activities grouped by investment 4A1.

[083] The method for detecting potential buildings with illegal energy consumption additionally includes the prioritization of groups based on 4C financial investment analysis, including combining financial information from regional offices and the company, which includes specific costs and returns for each region and general parameters used for overall investment evaluation. Next, the financial rate of return is calculated for each group, considering the data provided. Based on this calculation, the groups are prioritized according to the highest rate of return per investment. The prioritization strategy must be defined beforehand, as the module does not allow prioritizing multiple strategies simultaneously. Finally, the module generates detailed 4C1 financial reports that consolidate the information and highlight the results of each group or a set of several groups.

[084] The group prioritization stage based on 4C financial investment analysis comprises data input that includes: - PCC post-refinement database 2A1: which comprises the data maintained from the PCC database from the refinement stage 2 of potential targets of buildings with illegal energy consumption, removing excluded targets and adding data from the centroids of buildings included in the refinement stage 2 of potential targets of buildings with illegal energy consumption.

[085] Additionally, the present invention relates to a Petition 870240111250, dated 12 / 30 / 2024, pp. 43 / 59 30 / 30 computer-readable storage media, comprising, stored therein, a set of computer-readable instructions, wherein when the set of computer-readable instructions is executed by one or more processors, the one or more processors implement the method of the present invention, as described above.

[086] In particular, computer-readable storage media can be memory, which can be non-volatile, such as a hard disk drive (HDD) or a solid-state drive (SSD), or volatile, such as random-access memory (RAM). Furthermore, readable storage media can be any other medium or medium that can carry, store, or record the expected program code in the form of an instruction or a data structure or a set of instructions and can be accessed by one or more computers or one or more processors, but is not limited to them. Alternatively, readable storage media can be a circuit or any other device or medium that can implement a storage, transport, or recording function, such as a signal or carrier.

[001] Specifically, the computer-readable instruction set represents the algorithm or computer program code or data structure that performs the method of the present invention described above.

[087] The processor can be a general-purpose processor, which can be a microprocessor or any conventional processor or similar.

[088] Those skilled in the art will appreciate the knowledge presented here and will be able to reproduce the invention in the forms presented and in other variants, covered within the scope of the appended claims. Petition 870240111250, dated 12 / 30 / 2024, pp. 44 / 59

Claims

1 / 7 CLAIMS 1. Method for detecting potential illegal energy consumption constructions, characterized by comprising: - detection of potential illegal constructions (PCC) (1) including detection by image processing (1A); and geospatial filtering (1B); - refining potential targets (2) of illegal energy consumption constructions; - validation of potential targets (3) of illegal energy consumption constructions; and - prioritization of target groups for regularization (4).

2. Method according to claim 1, characterized in that the image processing detection (1A) comprises: - receiving a plurality of satellite images, wherein the satellite images are 50 cm / px (high-resolution) in Geo Tagged Image File Format (.GEOTIFF) with three RGB layers; - detect and store latitude and longitude coordinate information of points that characterize a building in each satellite image using computational models based on Convolutional Neural Networks (CNNs); - send satellite images to the Convolutional Neural Network (CNN) as data input (1A2), which are processed by the model configured with a set of parameters (1A3); - generate geospatial data for each detected building, more specifically, latitude and longitude of the points that make up the roof polygon of the detected building; - store the geospatial data in a detected buildings database (1A4); where the detected buildings database (1A4) includes databases that include geospatial data equivalent to those processed by the CNN (1A5) and / or databases of data Petition 870240111250, of 12 / 30 / 2024, p. 45 / 59 2 / 7 external or internal geospatial.

3. Method, according to claim 1, characterized in that the geospatial filtering (1B) includes data input (1B1) comprising: - detected constructions database (1A4); - zoning data including a geographic base in .GEOTIFF format that allows the identification of rural and non-rural housing areas; - medium voltage (mt) and low voltage (bt) network data including latitude and longitude of the set of points or line segments and the class to which they belong, such as low voltage or medium voltage; - meter data with latitude and longitude of the meters / consumer units; and - IBGE database data with data that delimits geographic markings of Brazilian municipalities and states; wherein the geospatial filtering step (1B) includes, for all data lines (constructions) in the detected constructions database (1A4), extracting the centroid of the polygon that defines the geometry of the construction in the set C = {ci, C2, ..., cn}, where N being the number of constructions in the base, and each construction having a centroid at coordinates a = {x1, y1} and the set of measuring equipment M = {m1, m2, m3, ..., mM}; and select the constructions that are within the company's concession areas; where the company's concession areas are defined as a set of irregular polygons A = {ui, a2, ..., am}; where to identify the company's concession areas, the IBGE database is used and the concession is defined by the equation below: the union of all M areas of m = Ua j=1 Petition 870240111250, of 12 / 30 / 2024, page 46 / 59 3 / 7 equation 1; where the geospatial filtering step (1B) includes selecting a subset of constructions that belong to at least one of the concession areas, using the equation below: Cconcessao = T £ C : Ci £ ãm, Vi = 1, 2, .„, N} equation 2.

4. Method, according to claim 1, characterized in that the geospatial filtering (1B) additionally includes filtering the constructions that meet the business rules, based on the distances of the constructions to the meter bases and the low and medium voltage networks, in which: for each centroid of the construction, select those in which, at the same time, the Euclidean distance between the centroid of the construction and the centroid of the nearest meter is greater than the value defined by the variable α, and in which the Euclidean distance between the centroid of the construction and the nearest point of the medium voltage network is less than or equal to the value defined by the variable β; where the Euclidean distance is given by the equation below: dm = ^(x - η) + (yi - yj)2 equation 3, where: (Xi,yi) and (Xj,yj) are the centroids of a construction and the coordinates of a meter, respectively; The values ​​of α and β can vary depending on the area where the building is located: non-rural areas or rural areas;and wherein geospatial filtering (1B) additionally includes: - excluding, from the subset of constructions belonging to at least one of the concession areas, constructions with a polygon surface area (roof area) smaller than the value defined by the parameter τ (m2); Petition 870240111250, dated 12 / 30 / 2024, page 47 / 59 4 / 7 - generating a database with Potential Clandestine Constructions (PCC) (1B3), which includes data from the database of detected constructions (1A4) that meet all the conditions described in the geospatial filtering step (1B); - including or excluding construction data in the database with Potential Clandestine Constructions (PCC) (1B3); wherein the analysis is performed by a set of computer-readable instructions, together with supporting databases and data.

5. Method, according to claim 1, characterized in that the step of refining potential targets (2) of constructions with clandestine energy consumption comprises data input, which includes: - 50 cm / px (high-resolution) satellite image data in Geo Tagged Image File Format (.GEOTIFF) with three RGB layers; - medium voltage (mt) and low voltage (bt) network data that includes latitude and longitude of the set of points or line segments and the class to which they belong, such as low voltage or medium voltage; - meter data with latitude and longitude of the meters / consumer units; - data from the Potential Clandestine Constructions Database (1B3): data from the database of detected constructions that meet all the conditions described in the geospatial filtering process (1B);wherein the step of refining potential targets (2) of buildings with clandestine energy consumption additionally comprises: including or excluding building data from analysis by a set of computer-readable instructions, including: - data from the LV and MV network databases, meters, PPC (1B3) and satellite images are loaded into a memory including a set of computer instructions capable of visualizing the images and georeferenced data, overlaying Petition 870240111250, of 12 / 30 / 2024, page 48 / 59 5 / 7; - a set of computer-readable instructions that analyzes each centroid of the PPC (1B3) database and verifies whether it corresponds to a building in the satellite image; wherein the centroids of non-residential buildings are excluded;wherein the computer-readable instruction set performs such analysis using one or more computational image processing models trained to identify residential or non-residential buildings with enlarged satellite images and to identify centroids superimposed on buildings in the images; - the computer-readable instruction set evaluates the quality of the results generated in the image processing detection step (1A), wherein the quality is represented by the proximity of the building to the LV networks and meters; wherein the instruction set verifies the Euclidean distance, using latitude and longitude coordinates, of each centroid superimposed on the building and the nearest meter; wherein if the meter closest to the analyzed centroid has a shorter distance to another building, it is considered that the meter is linked to another building and is not linked to the centroid under analysis;where the Euclidean distance of each centroid to the nearest low-voltage network is verified, considering distances between 10 meters and 2 kilometers; where the combination of centroids that are not linked to nearby meters and are close to the low-voltage network characterizes possible clandestine constructions; otherwise, the centroid is removed; - if there is a quality failure, modify the filter parameters (1B1) and / or the neural network parameters (1A3); - the computer-readable instruction set adds the latitude and longitude coordinates of the centroid to the post-refinement PCC database (2A1). Petition 870240111250, dated 12 / 30 / 2024, pp. 49 / 59 6 / 7; 6. Method, according to claim 1, characterized in that the validation step of potential targets (3) of buildings with clandestine energy consumption also includes the execution of a set of computer-readable instructions for classifying the PCC into clandestine or non-clandestine buildings; wherein the set of computer-readable instructions uses computational models for image processing and analyzes images of the buildings and identifies evidence of the irregularity which includes at least one of: cables or wires directly interconnecting the low-voltage network and the residential building and absence of a metering unit in the building.

7. Method, according to claim 1, characterized in that the validation step of potential targets (3) of buildings with clandestine energy consumption also includes data input, which includes: - PCC sample database (3A1), which includes part of the post-refinement PCC database (2A1); wherein the number of samples extracted from the PCC sample database (3A1) is made by the sample calculation equation below: Z2.p. (1 — p) n =--------e2 equation 4, where: n is the required sample size; Z is the critical value of the normal distribution for the desired confidence level (e.g., 1.96 for 95%, 2.58 for 99%); is the expected proportion of the characteristic of interest; and is the tolerated margin of error (in decimal proportion); where the amount of PCC is finite within the base (N), the value of n is adjusted based on the proportion to N: Petition 870240111250, dated 12 / 30 / 2024, page.50 / 59 7 / 7 η ηα = --------Λ 1+η-1 equation 5, where ηα is the number of samples adjusted to the total size of the PCC sample database (3A1).

8. Method, according to claim 1, characterized in that the validation step of potential targets (3) of constructions with clandestine energy consumption also includes the PCC statistics calculation step (3B), which evaluates the quality of the results of the classified targets database (3A2) through statistical methods with data from the classified targets database (3A2) that includes sample data of PCC with classification field as clandestine construction or non-clandestine construction.

9. Method, according to claim 1, characterized in that the prioritization step of target groups for regularization (4) includes identifying and ordering groups of possible illegal constructions for regularization based on distance-based grouping of the targets (4B); wherein distance-based grouping of the targets (4B) comprises applying computational models to define distance-based groups, from at least one of the KNN, K-Means or DBScan techniques.

10. Computer-readable storage media, characterized by comprising, stored therein, a set of computer-readable instructions which, when executed by a computer, performs the method as defined in any one of claims 1 to 9. Petition 870240111250, dated 12 / 30 / 2024, pp. 51 / 59