An Artificial Intelligence‐Based Framework to Accelerate Data‐Driven Policies to Promote Solar Photovoltaics in Lisbon

Due to the unavailability of up‐to‐date and georeferenced information about Lisbon's existing solar energy systems, tracking the progress of solar energy in relation to the city's Climate Action Plans 2030 is a complex task, thus hindering the potential of data‐driven decision‐making for a targeted implementation of photovoltaics (PV) in buildings and urban infrastructure. To overcome the challenges posed, an integrated approach to accelerate policy‐making based on artificial intelligence (AI) resources and local citizens' and stakeholders' participation is developed and piloted in Lisbon. Recurring to a two‐step AI model setup to identify and geolocate PV systems, key policy indicators are calculated to inform policy‐makers about the evolution of PV deployment in the city and contribute to tailor future incentives to more depressed or energy poor districts. The AI model based on open data orthophotos from 2016 allowed estimates for the installed peak power at the city level, in that year, to be delivered in a few minutes, whereas manual inspection of aerial images will have taken several months. Although the PV capacity determined is 30% lower than the historical official numbers, the proof of concept for the proposed framework is achieved and validated by local stakeholders.


Introduction
Aware of the huge pressure by the growing urban population, local governments all over the world are formally signing the Covenant of Mayors for Climate and Energy, the world's largest movement for local climate and energy actions.Covenant signatories commit to adopting an integrated approach to climate change mitigation and adaptation, whereas most of them set vision for a carbon neutrality by 2050, in alignment with the Paris goals.Signatories are required to develop, within the first 2 years of adhesion, a Sustainable Energy and Climate Action Plan (SECAP) with the aims of cutting CO 2 emissions by at least 40% by 2030 and increasing resilience to climate change.These bold political commitments mark the beginning of a long-term process with cities committed to reporting on the implementation progress of their plans every 2 years.However, designing, implementing, and monitoring a SECAP is a complex task for cities.The mitigation goals and strategies required for promoting energy efficiency in end-use sectors are not only difficult to establish, but also to implement and monitor.Therefore, cities urge for available tools and methods that support them in these difficult tasks.
In its Climate Action Plan, [1] developed under the C40 cities network umbrella, and upgrading its CoM SECAP, Lisbon has set ambitious goals of cutting off its greenhouse gas emissions (GHG) by 70% in 2030 relative to 2002.According to GHG historical data published every year, [2] almost half of the emissions in the city are due to the residential and services sector, i.e., the building stock, being CO 2 emissions the most significant GHG.Now, in alignment with the goal to transform the building stock into zero-emission buildings by 2050, set out by the European Commission, and with the recent nomination of Lisbon as one of the 100 climate-neutral cities by 2030, several measures have been put in course to increase both the energy efficiency and local production of energy in buildings.In this article, we will focus on the second issue.
Lisbon is the third European capital with the most sun-hours (almost 3000 h of sunlight per year), which makes solar energy the local renewable source with the greatest potential.Both photovoltaic (PV) and thermal technologies perform well under Lisbon's typical weather, however, PV is more suited to leverage a mass electrification of the local energy supply system by, when coupled with other equipment, allowing for an integrated and flexible response to the variety of indoor energy services and needs (such as lighting, heating, cooling, refrigeration, cooking, appliances, domestic hot water, and even storage).
Despite the great potential for solar PV production in Lisbon, the installed capacity is still very low: in 2021, according to official data from the Portuguese Directorate-General for Energy and Geology (DGEG), only 551 PV systems corresponding to around 8 MW existed in the city (Figure 1).This amount represented just 0.4% of the city's annual electricity consumption. [3]When compared to the theoretical potential (i.e., more than 2 GWp if all rooftops were used) and to the levels of PV deployment in many northern European cities with less sunny weather, long-term barriers become apparent: an overall low level of energy literacy, generalized misconceptions about the cost-benefit of the technology, old building stock without proper rooftop structural bearing, and a lack of municipal, regional, and national support mechanisms.To overcome these challenges and to realize the solar potential of Lisbon, the goal of achieving 103 MW of installed PV capacity was set in the CAP 2030, while a strategy called Lisboa Cidade Solar was devised to encourage PV adoption through information provision, education, capacitation and technical support to citizens, businesses, and municipality.
Fortunately, a significant increase in the deployment rate of PV has been witnessed since 2021, thanks to a more consolidated legal framework for individual and collective self-consumption regimes.The leveraging factor made possible by the National Program from the National Climate Fund to support more efficient buildings (PAE þ S), launched in 2021, was also game-changing, as well as the more recent support for the creation of renewable energy communities on the private residential, central public administration, and services sectors. [4]On the private services and industries side, organizations and businesses have also become more aware of the cost-benefit of PV and its advantages to the growing concerns with ESG, with good practice and innovative examples being shared among peers.The same is reflected in the banking sector that is starting to provide accessible instruments for the financing of "green" projects.
The long-awaited growth of PV in Lisbon, and the generalized "boom" at the national level, has caused the registration rate of new self-consumption installations and the whole process of commissioning to slow down, which means that info about the true PV capacity installed is permanently delayed.Although the distribution system operator (DSO) open data portal makes available the cumulative value for all the municipalities in a trimestral basis, this is not sufficient for a fine tracking of the degree of accomplishment of Lisbon's solar energy goals and more tailored policy-making, especially at the light of distributed/community PV.
Due to the heterogeneity of the territory, it is essential to geolocate and map the current PV assets if one wants to unveil the motivations behind the adoption of PV across the city.In its 24 civil parishes, Lisbon has buildings from several construction periods, different typologies, and ownership status that bring together a variety of citizen communities and many urban configurations, thus it is crucial for local policy-and decision-making to be informed by geographically resolved data that can overlap with other layers, like sociodemographic and economics for instance.In this sense, several strategies can be explored to gather more information about PV evolution in Lisbon, some recurring to official data and open data or by more sophisticated means.The crescent field of artificial intelligence (AI) thus presents itself as a promising tool to create new information and knowledge and to reveal correlations that help policy-making toward cities' carbon neutrality.
In this article, we share insights from the pilot for a novel AI-based approach to policy-making in Lisbon focusing on a PV geolocation case study.Only open data from the municipal urban data center were used for the proof of concept, which comprises the steps that are detailed in the Methods section: 1) definition of one policy to be tested and its KPIs; 2) preparation of relevant datasets and AI-models set up; and 3) cocreation methods for stakeholder and citizens involvement in the process.In the Results section, the estimates obtained are discussed in line with the stakeholder feedback for the scenarization of future policy paths, and in Conclusion, we highlight the main contributions of this work along with future improvements and applications.

Experimental Section
The work presented in this article has been developed within the scope of the European project AI4PublicPolicy, [5] a joint effort of policy-makers and cloud/AI experts to unveil AI's potential for automated, transparent, and citizen-centric development of public policies.The main outcome of this project is the virtualized policy management environment (VPME), an all-in-one/stand-alone platform that will aggregate, support, and accelerate the entire policy development lifecycle.In Figure 2, an overview of the proposed AI-based policy-making process is presented.
The city of Lisbon, as a pilot within this project, focused on exploring intelligent methods to design and test energy management policies.Hence, the first issue that was tackled relates to a much-needed information provision about solar energy in the city.The focus was placed on the contribution of solar mapping tools to policy-making and on creating knowledge from datasets that otherwise would remain unused.
In the scope of the pilot, the process began with the definition of one first test-policy, along with the identification of the relevant datasets in the VPME.Then, these are passed onto the AI experts that are responsible for the selection, set up, and run of the proper AI models.When results become available, the policy-maker can request refinements, changes, and draw conclusions for the policy.Finally, by engaging with local stakeholders, the policy can be further evaluated and refined, and new policies codesigned.

Integrated Policy Testing
The first test-policy defined was called "Photovoltaic (PV) systems mapping for a climate neutral Lisbon", according to Table 1.
The relevant datasets passed on to the AI expert through the VPME platform were the following: 1) Shapefile with the administrative boundaries for the city and its 24 civil parishes; 2) Orthophotos of the city with 10 cm/pixel (Figure 3) accessible via an open data API.
It must be highlighted that the input aerial images should ideally be from a more recent year, to provide an accurate bigger picture for the current situation.However, since one of the goals was to rely solely on open data, the most recent dataset available was that in the city's platform dating from 2016.Other possibilities are later discussed in Section 4.1.Due to the unavailability of up-to-date and geolocated information about Lisbon's PV assets, the city is unable to track its progress in relation to its 2030 goals and plan based on the geographical distribution of systems.
To monitor the yearly achieved PV installed capacity based on the identification of existing systems, their locations, sizes, and, when possible, further characterization.The solar installations detected by the AI algorithm will be input to a map to be made publicly available -an update to the existing but incomplete map currently available in the city's Solis platform. [25]s for the initial KPIs to be determined using the AI models and the orthophotos, they were: 1) Number of PV installations in the city and in each parish; 2) Installed PV capacity in the city and in each parish.
With this information, the AI expert can understand the problem and employ/test the most adequate model(s) to deliver the pretended KPIs.Apart from these aggregated values, the geolocation of each PV system and its size/capacity is itself a crucial result for the policy-maker.

AI-Based KPI Estimation
The use of AI to detect geographically distributed PV installations and to estimate the corresponding peak power is still a relatively new field of research.Pioneering work such as the work of Malouf et al., [6] dating only from 2016, set the scene for many state-of-the-art approaches that make use of aerial imagery to fast geolocate PV assets.Purely academic at first, sophisticated methods now have great potential to assist solar cities and their stakeholders in the planning and implementation of PV projects.
In the study of Wu and Biljecki, [7] the identification of ideal spots for PV installations was explored using geospatial data and aerial images, while Mayer et al. [8] took some steps ahead by using 3D models of buildings.Combined with highresolution aerial images, 3D allowed for a detailed mapping and characterization of PV across the city, also used to monitor the increasing number of PV installations in recent years.Kasmi et al. and Stowell et al. [9,10] have also recurred to aerial and satellite images of cities to similar ends but focused on open data and crowdsourcing for the training sets of the AI models.In the study of Kausika et al., [11] the potential for improved policy-making and infrastructure planning based on such geolocation is highlighted.
Recent research [12] addressed a challenge similar to that of the present article by using a combination of two models consisting of a computer vision model and a machine learning model.The training set consisted of 43 features extracted from geographical information systems' data, making it a very robust approach.Another method was employed to study the dynamics of PV adoption using temporal data and spatial dataset combined with low-resolution satellite images. [13]In this study, the local adoption patterns through time were derived by integrating census data and PV plant registries.Ultimately, a similar goal is envisioned for the present work when the kind of data required becomes available.
As shown in Table 2, robust AI solutions require more than satellite or orthophotos of urban settings.Gathering the additional data, sometimes inaccessible or nonexistent, is a time-consuming task, which within a project can represent additional human resources and budget.To reduce the resources needed, it was opted to rely on open data orthophotos and the use of fast-established reference models.
The solution implemented in this work (Table 2, first row) is a two-step vision model.The first step deals with object detection to identify PV installations from orthophotos, while the second step handles the corresponding image segmentation to estimate the number of pixels that represent the surface of PV panels.
For the initial step, the 8th version of the model You-Only-Look-Once (YOLO) by Ultralytics was used. [14]YOLOv8 comes in four different sizes: "s" for small, "m" for medium, "l" for large, and "x" for extra-large.Depending on its size each model is deeper or shallower, thus for the detection of PV installations in orthophotos the medium size was selected, since one-class image detection problem does not require a very deep network.
YOLOv8 models come pretrained on multipurpose datasets, so it should be easy to use transfer learning techniques to leverage its potential on a single-label problem: the detection of photovoltaic panels on aerial images.As a first try (i.e., our model "v1") the reference model was fine-tuned using the original labeled dataset of California aerial images. [6]Then, the open data orthophoto map [15] of the city of Lisbon from 2016 (Figure 3) was used to create the images on which the consolidated model would look for PV installations.The resulting tiles were collected through a call to the orthophoto map server containing the coordinates for the initial test areas.
The first results of the application of our model "v1" to Lisbon's dataset achieved an accuracy of 0.5, that was below the agreed acceptable level (assumed 0.7 for this case), with too many false positives and missing cases.This was not unexpected, since rooftops structures in typical Californian buildings and colors differ significantly to the those in Lisbon, nonetheless this first attempt allowed for the identification of several challenges to a correct detection of PV in Lisbon: for instance, the presence of skylights that appear dark blue and mimic the rectangular shape of PV panels (Figure 4, left); existing complex structures in the rooftop (Figure 4, center); very dark colored surfaces that make it difficult to identify any panels (Figure 4, right); or smaller clusters of panels that one cannot easily distinguish and classify either as PV or thermal collectors (Figure 4, right).
It appeared clear that YOLOv8 should be fine-tuned with aerial images that better characterized the city's overhead view (i.e., to build our model "v2"), thus a set of labeled images was prepared from scratch (Figure 4).Hundreds of images from three distinct civil parishes in Lisbon were manually inspected to draw polygons around the visible PV structures.These were input to the model for training, however, the quantity achieved was not sufficient to be used to fine tune YOLOv8 and to produce significant improvement.
Since the process of labeling images is a slow and timeconsuming task it became evident that other sources of larger PV-labeled images were essential.Hence, the dataset from the study of Hou et al. [16] was also incorporated: three groups of samples were available, each collected at different spatial resolutions of 0.8, 0.3, and 0.1 m.The model fine-tuned on the second dataset (i.e., our model "v3") had better accuracy, but it was still struggling with several false positives.Finally, one last dataset with features closer to the ones of Lisbon was retrieved from the study of Kasmi et al., [9] consisting of an open-source dataset of more than 15 000 images put together via crowdsourcing.
After experimenting with different combinations of the available datasets, the best combination appeared to be the use of the crowdsourced dataset for training and a combination of Lisbon images, from three of its districts (totaling around 300 images), and another part of the crowdsourced dataset for validation.With this combination, the fine-tuning of YOLOv8 yields the best results (i.e., our model "v4"), considered good for the city-wide PV detection.In Figure 5, some examples of the detection are shown.
To evaluate the PV detection model "v4", a Precision-recall curve was used, which consists on the graphical representation Deepsolarþþ [12] Low-resolution satellite images PV deployment dataset; Demographic data of several US cities Identifies the adoption phases at a spatially resolved level defined by census block groups Faster RCNN þ ensamble ML model [13] Satellite images Demographics; Natural environment; Built environment; Energy, infrastructure, market, and policy; Social and natural disaster vulnerability Percentage of rooftops covered with PV; Percentage of households with at least one PV panel; Ratio of solar panels to roof area Roofpedia [7] Satellite images Buildings footprints Mapping of roofs with a geospatial roof registry; Sustainable roof index 3D-PV-Locator [8] Orthophotos 3D buildings dataset Large-scale detection; Size estimation; 3D orientation of rooftop PV of the tradeoff between precision (the ratio of positive predictions that are actually positive) and recall (the ratio of real positives that are predicted as positive).This curve is usually used in binary problems, as it gives a more balanced view on the performance of a model working on an imbalance dataset.According to Figure 6, left, a good tradeoff between precision and recall.The F1-score of the model is 0.80, as for the F1-confidence curve, calculated using the precision and the recall of the model, it was also used to score its performance (Figure 6, right).Another tool used for the evaluation of the object detection model is the confusion matrix, a table that shows the number of true positives and false negatives for each label.In this case, only the PV label mattered in being distinguished from the background.The confusion matrix (Figure 7) shows that 72% of PV installations are correctly classified.
The second step of this AI solution encompasses an image segmentation model to identify the percentage that corresponds  to PV panels in the images detected by YOLOv8.For this task, the U-net model was selected.This model consists of a convolutional neural network, first introduced in a 2015 article [17] and developed for medical purposes, currently widely used for a variety of image segmentation scenarios.The model architecture involves an encoder and a decoder that compress and expand sequentially each image to detect important features.It also integrates some connections called "skip-connections" that allow the model to preserve information about the image during each phase of the encoding process.
The U-net was trained on the crowdsourced dataset to separate the surface of PV panels from the background.The corresponding mask of each image-a black-and-white representation of the image that shows in white the area of the target and in black the background-was used to train this model.The percentage of image that depicts PV can be calculated through the ratio of white pixels over the total, as shown in Figure 8.
Intersection over union (IoU), also called Jaccard-index, was employed to evaluate the performance of this model in particular.IoU measures the overlap between the predicted mask and the original mask (the ground truth), i.e., the ratio of the area of intersection of the two masks.The final version of this model measured a Jaccard-index of 0.74 on the test set.

Stakeholder and Citizen Participation
Historically, public policies have been devised and put in place without seeking input from the citizens and local communities.However, it has become more evident that citizen-centric approaches to policy-making that consider their experiences and opinions at the earliest stages, and in a participatory fashion, might lead to more successful implementation. [18]It was under such a mindset that several cocreation workshops were organized at different stages of the pilot process, involving participants ranging from energy agencies, researchers, and IT experts to municipal officers, association representatives, and citizens.
At the first stage, stakeholders helped to identify barriers and opportunities for solar photovoltaics in Lisbon, and validated the path set out for the first test-policy.For more details on the methods for cocreation and results, please refer to Section 3.3 in AI4PublicPolicy [19] and Section 3.4 in AI4PublicPolicy. [20]At a later stage, the stakeholders were presented with the VPME workflow and the results of the test-policy and discussed possibilities for future exploration.Through a survey, their overall feedback was collected, and they expressed their interest in testing the tool to eventually employ the proposed framework in their own organizations.

Results
Following the approaches explained in the previous section, the policy KPIs were calculated and compared with the official baseline values to understand how well the AI models are performing (3.1).Complementary, the test-policy and VPME evaluation obtained from the stakeholders allowed for a validation of the proof of concept, as can be verified in Section 3.2, and their willingness to remain involved in the further policies definition and enhancement and in the future exploitation of the tool.

Estimated PV in Lisbon
The consolidated AI model was run for the totality of the city coverage, allowing for the count of PV systems installed at city-scale for the available orthophotos dataset.From here, it was possible to address KPI #1 by determining the number of systems detected in each of the 24 civil parishes in Lisbon and ranking them according to the level of PV penetration (Figure 9).
To calculate the corresponding PV peak power, corresponding to KPI #2, for each installation (P PV ), the following formula was used where A img is the area estimated using the U-net model, α is an average module tilt angle of 38°, P m is the average unit power (0.310 kWp), and A m the average unit area of 1.6335 m 2 (referring to the most common market technology of PV modules installed in the city in 2016).The estimates for the city and for each parish are presented in Table 3. Comparing the official data, as depicted in Figure 1, with the city-wide estimation, it can be verified that the latter is around 30% lower than the registered value of 3288 kWp for 2016, which is quite good, considering the several sources of uncertainty involved in the several steps of this estimation.However, knowing that official data for 2021 reported 551 PV installations in Lisbon, it is clear that the 912 detected for 2016 is a highly overestimated value, which can be due to the limitation (of both machine and human) in being able to discern the amount of PV rows that belong to each system solely from images-in Figure 5, for instance, the model has detected 4 rows that counted as 4 individual installations.
As recognized earlier, more locally labeled images would be nice to have for better estimates.But, as no further labeled data is expected to be produced in the near future, a method to refine the city-wide PV power estimation will be explored based on the Downstream Task Accuracy proposed in the study of Kasmi et al. [21] Considering the ranking of the parishes, we can verify that Olivais, and Lumiar were by far the most solar ones in 2016, which is not surprising since these feature some of the sociodemographic aspects that motivated an early adoption of rooftop PV: predominance of single-family buildings in low-rise neighborhoods, higher income households, and higher education levels.These are also some of the most densely built parishes and are not subject to rules of landscape such as in the city center and historical areas.
Nonetheless, there are other parishes in Lisbon with demographics similar to the top 3, which point out one important issue that concerns the identification of PV against solar thermal.Even the best-trained eye can struggle to distinguish one technology from the other in several cases-the color, the shape, and size can be very similar, sometimes only distinguishable by the modules' arrangement, their frames, water pipes near the panels, and the thermosyphon when present.Thus, it is possible that the YOLOv8 model is excessively detecting solar thermal (false positives) and that U-net might be underestimating the area of PV panels.
Despite the improvement needed to the PV detection algorithm, this is a workflow that brings considerable advantage for the policy under testing, given that a manual inspection of  all orthophotos could take several months, with the risk of quickly becoming out of date.

Stakeholder Feedback
The answers provided to the policy and VPME evaluation survey by the stakeholders were collected anonymously during the latest cocreation workshop organized.Since the intent of the workshop was to validate and evaluate the desirability of the AI-based policy-making framework, the affiliations of the participants ranged from energy agencies to NGOs, municipality's officers, and R&D entities.
For more details on the questions posed and respective answers, the reader is referred to the Supporting Information.
It is interesting to note that the group is overall pro-solar and sees solar energy as one of the keys to achieve carbon neutrality, which is in line with the test-policy.Also aligned with the PV detection distribution across the city, it is clear that PV should be promoted in buildings of public interest (best candidates for citizen-led energy communities), in services and office buildings (great consumers of electricity with higher financial capacity for investing and ESG concerns), but also in public multifamily buildings (where energy poor and socially vulnerable households are typically located).
Considering the low satisfaction score regarding the current rate of solar uptake in Lisbon, it can be concluded that the previous applications are not yet supported enough.In fact, the most voted issues for future policymaking concern the support to the creation of energy communities to better match the supply and the demand and to prioritize the PV deployment in building with the highest potential to achieve this match.Another issue that was selected by more than half of the participants relates to the low levels of energy literacy and to the lack of knowledge about the cost-benefit of PV.Finally, new business models to allow the creation of community solar were highlighted too.
The group thinks the test-policy was well explored, yet more data should be used in the future to derive more in-depth knowledge and conclusions.As for the VPME platform itself, as the means to operationalize the AI-based policy-making framework, the stakeholders believe that its visual appearance is good, but with major enhancements to be made at the navigation level.They also see the VPME's logic as good, with the potential for the Municipality to make good use of it, as well as their own organizations.To this end, some of the participants stated their interest in a hands-on testing session and to keep involved in the development of the tools and the fine-tuning of the overall AI-based workflow proposed.
Essentially, the participants highlighted the complexity of the legal aspects, the idiosyncratic technicalities of energy communities, and the lack of robust public education about the benefits of PV adoption as the main barriers to the concretization of Lisbon as a solar city.The resulting visualization of the city-wide installed capacity represents the stepping stone for anyone to become aware of their neighboring PV systems, to which they might connect when they wish to create a local energy community.In this sense, the proposed AI-based framework can contribute to study optimized connections according to aggregated load and production profiles, distance between premises, and location of energy-poor families (for an increased social impact).

Conclusion
In this article, the proof of concept for a novel approach to policymaking based on AI was presented.Starting from the collection of relevant datasets in parallel with the definition of a test-policy, the advantages of adopting this framework to drive the transformation of policy-making processes in Lisbon were validated by local stakeholders during participatory sessions at different stages of the pilot.
As the third European capital city with the most sun hours, the pilot focused on an information provision test-policy to geolocate PV installations across the territory and to infer the installed capacity in each of the 24 civil parishes.This was achieved by employing the image detection model YOLOv8, which was trained especially for PV in urban settings using a combination of freely available datasets, one of them being orthophotos for the city of Lisbon in 2016 that were manually labeled by some of the coauthors.
Although the current estimates-which are relative to the year of 2016 given the lack of up-to-date free aerial images-fall 30% below the official installed peak power in Lisbon for that year, the AI model employed has proven itself capable of avoiding several months of manual work and thus to significantly accelerate the development of PV mapping in the city.An AI solution such as the one explored in this project might be very relevant to cities when no PV database is available or is too difficult to build from scratch, or even because the registration of systems by the relevant entities is delayed.AI in this case represents one alternative strategy to provide estimates of the amount of PV systems, overall installed capacity, and geographic distribution in a relatively timely manner.
The proposed framework has the potential to play a relevant role in the understanding of what can be the effective ways to accelerate PV projects' technical planning, economic and social impact evaluation, and funding on the city-scale.Subsequently, decision-making will also be facilitated through finer knowledge of the geographical distribution of PV in all the parishes, especially to direct incentives and to support the deployment in energy-poor neighborhoods with good solar exposure.
After a thorough validation of the PV systems detected by the AI model and with the consent of each system owner, the validated set will be used to update the existing but very incomplete map that is publicly available in the city's solar platform Solis [3] and contribute to escalate community solar.The aim is to establish and consolidate an AI-based and continuous update of this public map, building on the lessons learned from the pilot presented in this article.With such knowledge available publicly, businesses and citizens might also become more informed and interested to adopt PV and to kickstart citizen-led initiatives like community solar, contributing to a fair energy transition for all and with all in the city.

Future Work
The implementation of the proposed AI-based policy-making process entails a deeper involvement of local authorities' officers, to realize the benefits of this approach instead of the traditional working in silos.The definition of impactful PV-related policies will only be possible with the continuous engagement of civil society and stakeholders, which are key for the refinement of the KPIs to accomplish.
Considering the AI model for PV detection employed in this work, it is crucial to acquire more datasets for improved training and finetuning.Free aerial images with minimum acceptable quality are somewhat difficult to obtain, so other data sources like the Google Earth engine for extracting high-quality images or European space agency (ESA's) multispectral satellite imagery are under investigation.Nonetheless, further improvements will be carried on building on lessons learned and on more recent algorithms from the scientific literature, as reviewed in Section 2.2, eventually with the complement of additional input data as in the package proposed in the study of Tremenbert et al. [22] One example of additional data to complement the detection phase or to infer the PV panel inclination would be the local digital surface model (DSM), as this would help to derive the slope of each portion of the rooftops and to discard some of the urban structures that mimic PV.Still, an updated DSM might not always be available and with sufficient resolution.
Another possibility for improving the detection model could be to use a multilabel dataset with a label for PV panels and another for solar thermal (ST).However, if in one hand solar thermal mapping would be even more difficult because ST is not subject to official registration-their production is fully self-consumed-on the other hand, the visual identification required to produce labeled images for ST would be subject to challenges similar to those of PV: visual similarity to rooftop windows, skylights and other structures.Nonetheless, overhead thermal images might help to distinguish between PV and ST, since the latter are usually cooler at night due to the cooling fluid inside the panels.The acquisition date of such images must also match the other datasets'.
When a robust version of the PV mapping is achieved, it is meant to be incorporated into the existing public map. [3]ence, in the light of emerging energy communities, it should serve the purpose of informing about the PV systems in proximity (that are seldom visible from the street level) and help to motivate the creation of more collective solar, instead of the business-as-usual self-owned PV.Building on this map, more intricate optimization analysis for energy communities under diverse criteria might be conducted under the proposed VPME tool.
Another future path will encompass the creation of a time-lapse PV map for Lisbon.Based on orthophotos from different years, or ideally on satellite images with higher time steps, and with algorithms similar to those explored in the study of Wang et al., [23] it will be possible to infer the year of deployment of the detected systems.In fact, the city's open data platform has overhead images from the years 2001, 2003, 2006, and 2011, however, the PV capacity in the city was very small then, not allowing for interesting results.
Complementarily, other strategies that do not recur to overhead images, but rather on crowdsourcing and social media content are being addressed to gather more data about systems that are publicly showcased mostly by installers. [24]t must also be noted that as the scientific literature and case studies about the subject are rather scarce, especially concerning cities in more southern countries and with a great diversity of rooftop structures.This work aims to fill in this gap and to raise awareness of the need for such studies.In this sense, the labeled images produced in the scope of this work are intended to be shared with the scientific community in the future.

Figure 1 .
Figure 1.Evolution of the PV capacity installed in Lisbon under the different regimes of microgeneration (blue), minigeneration (orange), and self-consumption (green).Note: the 2-year gap in 2019 and 2020 is due to the impossibility to access the respective data.

Figure 2 .
Figure 2. Schematic of the proposed energy management policy-making process, based on VPME.
Photovoltaic (PV) systems mapping for a climate-neutral Lisbon

Figure 3 .
Figure 3. Orthophotomaps for the city of Lisbon in 2016.

Figure 4 .
Figure 4. Example of the manually labeled images (red polygons).

Figure 5 .
Figure 5. Example of the detection of PV panels: false positives (top) and true positives (bottom).

Figure 6 .
Figure 6.Precision-recall curve (left) and F1-confidence curve for the final version "v4" of the model (right).

Figure 7 .
Figure 7. Confusion matrix for the final version of the model.

Figure 8 .
Figure 8.The mask of the image created by the U-net model (left) and the input image (right).

Figure 9 .
Figure 9. VPME dashboard with the aggregated number of and top 10 of the parishes with more PV installations.

Table 1 .
Definition of test-policy as in the VPME platform.

Table 2 .
Summary of reviewed rooftop PV detection AI models.

Table 3 .
Number of PV systems and aggregated peak power estimated for the city (first row) and for each civil parish.