Distributed roof photovoltaic shadow identification method based on multilevel prediction
By using 3D modeling and a multi-level predictive YOLO model, the problem of insufficient recognition accuracy of traditional shadow recognition algorithms for small targets and shadows of different areas in complex rooftop environments is solved, achieving efficient and accurate shadow recognition. It is suitable for the design of distributed rooftop photovoltaic systems for large-scale industrial and commercial projects, residential communities, and county-wide implementation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA HUANENG INT ENG & TECH CO LTD
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-08
AI Technical Summary
When faced with complex rooftop environments, existing technologies, particularly traditional shadow recognition algorithms, lack sufficient accuracy in recognizing small targets and complex backgrounds. Furthermore, a single detection model cannot simultaneously meet the high-precision and high-robustness detection requirements for shadows of large, medium, and small areas.
A distributed rooftop photovoltaic shadow identification method based on multi-level prediction is adopted. A top view of the shadow range is generated by 3D modeling and solar parameter calculation. The shadow is identified by the multi-level prediction YOLO model and divided into three categories: small, medium and large shadows. The shadow identification results are output in a union processing manner for all time periods.
It achieves high-precision recognition of shadows at different scales in complex roof environments, improves the recognition capability of small targets and complex backgrounds, shortens processing time, and adapts to the shadow recognition needs of distributed roof scenarios such as large-scale industrial and commercial buildings, residential communities, and county-wide promotion.
Smart Images

Figure CN121999320A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of distributed rooftop photovoltaic system design and image processing technology, specifically relating to a distributed rooftop photovoltaic shadow recognition method based on multi-level prediction. Background Technology
[0002] In recent years, with the transformation of the global energy structure and the increasing demand for environmental protection, distributed rooftop photovoltaic (PV) systems, as a clean and renewable energy solution, have received increasing attention. Distributed rooftop PV not only effectively utilizes building roof space and reduces dependence on traditional fossil fuels, but also significantly reduces greenhouse gas emissions, contributing to the global fight against climate change. However, shading during the construction of distributed rooftop PV power plants can significantly reduce power generation efficiency and even lead to hot spot effects, damaging PV modules. Traditional shading detection methods rely on sensors or simple image processing techniques, which are insufficient to handle the complex and ever-changing rooftop environment. Accurately identifying and effectively addressing shading issues is a crucial problem that needs to be solved during the design phase of distributed rooftop PV systems.
[0003] Shadows pose a complex problem in image processing, as they can affect the accuracy of image recognition by altering pixel values and creating false edges and contours. Therefore, developing effective shadow processing techniques is crucial. Currently, algorithms for shadow recognition in distributed rooftop photovoltaic systems mainly fall into the following four categories: 1. Image processing-based methods; 2. Shadow prediction based on GIS and solar models; 3. A method for identifying shadows based on sensor-based light monitoring; 4. Using machine learning-based methods, combined with handcrafted features (such as texture and color) for shadow recognition.
[0004] Although various shadow recognition algorithms have been proposed, these algorithms have the following problems in practical applications: 1. In complex rooftop environments, there are many and scattered factors that generate shadows. Traditional algorithms can identify shadow areas to a certain extent, but their accuracy is insufficient for identifying small targets and complex backgrounds.
[0005] 2. Distributed rooftop photovoltaic systems are typically implemented across entire industrial and commercial rooftops or throughout entire counties, covering a large area. A single model is insufficient to meet the needs of shadow detection at different levels. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a distributed rooftop photovoltaic shadow recognition method and system based on multi-level prediction, which addresses the shortcomings of the prior art. This method solves the technical problem that, in the face of complex rooftop environments with various obstructions such as chimneys, surrounding buildings, and trees, traditional shadow recognition algorithms have insufficient accuracy in recognizing small-area shadow targets, and a single detection model is difficult to simultaneously meet the requirements for high-precision and high-robustness detection of shadows of different levels, such as large-area, medium-area, and small-area.
[0007] The present invention adopts the following technical solution: A distributed rooftop photovoltaic shading identification method based on multi-level prediction includes the following steps: S1. Establish a 3D model of the roof and obstructions through 3D modeling; calculate the solar altitude angle and azimuth angle on the winter solstice based on the latitude and longitude information of the project site; simulate the sunlight shining on the 3D model and generate an hourly top view of the shadow range; S2. A multi-level prediction YOLO model is used to identify shadows in the top view. The multi-level prediction YOLO model is divided into three categories based on feature maps of different scales: small scale, medium scale, and large scale, which correspond to small area shadows, medium area shadows, and large area shadows, respectively. The identified shadow ranges are then processed by union to output the shadow identification results for the entire winter solstice.
[0008] Preferably, in step S1, the establishment of the three-dimensional model includes: For the training phase, a 3D model including the roof, walls and obstructions is created based on the CAD drawings of different types of projects, and all colors of the 3D model are assigned to the white material. For the identification phase, a 3D model of the roof to be tested is generated using aerial images from drones.
[0009] Preferably, the RGB value of the white material is (255, 255, 255).
[0010] Preferably, in step S1, the solar altitude angle and azimuth angle of the winter solstice are calculated from 9:00 to 15:00, and are calculated once per hour; the top view of the shadow range corresponds to the simulation result of sunlight illumination, and one is generated and saved every hour.
[0011] Preferably, in step S2, the training process of the multi-level prediction YOLO model includes: The CSPDarknet structure using the YOLO algorithm is used to extract multi-level features of the top view of the shadow range; based on the resolution of the multi-level feature maps, the feature maps are divided into small-scale feature maps, medium-scale feature maps, and large-scale feature maps by K-means clustering.
[0012] Preferably, the clustered feature maps are matched with the corresponding anchor box structures: Large-scale feature maps with low resolution are assigned large-size anchor boxes, medium-scale feature maps with medium resolution are assigned medium-size anchor boxes, and small-scale feature maps with high resolution are assigned small-size anchor boxes. The specific location of the shadow is predicted by anchor box matching.
[0013] Preferably, during model training, the predicted shadow positions are labeled to complete model training.
[0014] Preferably, solar altitude angle The calculation is as follows:
[0015] Sun azimuth The calculation is as follows:
[0016] in, The solar declination is the latitude of the sun. Indicates the geographical latitude of the location. It indicates the local solar hour angle.
[0017] Preferably, in step S2, the union processing of the shadow range is automatically performed by a computer program to draw all shadow recognition closed ranges within the period from 9:00 to 15:00 on the winter solstice, and the recognition results are output in an online display manner.
[0018] Secondly, embodiments of the present invention provide a distributed rooftop photovoltaic shading recognition system based on multi-level prediction, comprising: The 3D module is used to build 3D models of roofs and obstructions, including a training model building unit based on CAD drawings and a test model building unit based on UAV aerial images. The parameter module is used to obtain the latitude and longitude information of the project site and calculate the solar altitude angle and azimuth angle every hour from 9:00 to 15:00 on the winter solstice; The simulation module is used to simulate sunlight illuminating a 3D model, generating and saving hourly top-down views of the shadow range. The training module is used to train a multi-level prediction YOLO model, including a feature extraction unit that extracts features using the CSPDarknet structure, a clustering unit that divides the feature map scale using K-means clustering, an anchor box matching unit that assigns corresponding anchor boxes to feature maps of different scales, and a labeling unit that labels shadow positions using X-AnyLabeling labeling software; the anchor boxes configured by the anchor box matching unit include large-size anchor boxes adapted to large-area shadows, medium-size anchor boxes adapted to medium-area shadows, and small-size anchor boxes adapted to small-area shadows. The recognition module is used to call the trained multi-level prediction YOLO model to perform shadow recognition on the top view of the shadow range. The merging module is used to perform union processing on the identified shadow ranges from different time periods and draw the closed range of shadow identification. The output module is used to display the shadow recognition results for the entire winter solstice period online.
[0019] Thirdly, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described distributed rooftop photovoltaic shading identification method based on multi-level prediction.
[0020] Fourthly, embodiments of the present invention provide a computer-readable storage medium including a computer program, which, when executed by a processor, implements the steps of the above-described distributed rooftop photovoltaic shading identification method based on multi-level prediction.
[0021] Fifthly, a chip includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described distributed rooftop photovoltaic shading identification method based on multi-level prediction.
[0022] In a sixth aspect, embodiments of the present invention provide an electronic device including a computer program, which, when executed by the electronic device, implements the steps of the above-described distributed rooftop photovoltaic shadow recognition method based on multi-level prediction.
[0023] Compared with the prior art, the present invention has at least the following beneficial effects: A distributed rooftop photovoltaic (PV) shadow recognition method based on multi-level prediction constructs a closed-loop process from modeling to recognition and result output. It specifically focuses on the key period around the winter solstice, using a multi-level model to adapt to shadows of different areas, thus solving the problem of traditional single models being unable to cover shadow detection at different levels. The combination of 3D modeling and solar parameter calculation ensures the realism of shadow simulation; union processing achieves complete representation of shadow coverage throughout the entire time period, avoiding omissions of shadows at different times, providing comprehensive shadow data support for PV module layout design, and adapting to the application needs of large-scale distributed rooftop PV scenarios.
[0024] Furthermore, the training phase utilizes CAD drawings from various project types for modeling, ensuring the diversity of training samples and enabling the model to adapt to different roof structures; the white material assignment provides a clean image foundation for subsequent feature extraction. The recognition phase leverages drone aerial images for automatic modeling, eliminating the need for complex drawings and adapting to project scenarios without CAD drawings. This modeling efficiency is high, accurately reproducing the real roof and obstruction conditions, solving the problems of traditional modeling relying on manual labor and poor adaptability, while simultaneously considering the generalization ability of the trained model and the practicality of the model under test.
[0025] Furthermore, in actual 3D rendering, the reflectivity and color of different materials significantly affect the grayscale values and contrast of shadow areas in the rendered image, introducing unnecessary noise and variations that interfere with the subsequent learning of the visual feature of "shadow". By uniformly setting it to pure white, the shadows produced by all models under the same lighting conditions have a consistent visual appearance, greatly purifying the training data and enabling the model to focus on learning the shape, position, and scale features of shadows, thereby improving the model's convergence speed and final recognition accuracy.
[0026] Furthermore, the winter solstice is the day with the lowest solar altitude angle and the longest shadow in the Northern Hemisphere, and 9:00-15:00 is the main period for photovoltaic power generation. Hourly sampling simulations during this period are sufficient to accurately capture the shadow movement trajectory and maximum coverage area that have the greatest impact on the photovoltaic array layout that day. Compared to continuous simulation throughout the day or higher frequency sampling, this method significantly reduces the computational load and the number of images generated, while ensuring the validity of the shadow analysis results, thus improving the overall efficiency of the process.
[0027] Furthermore, the CSPDarknet structure, through cross-stage local connections, combines shallow feature preservation with deep feature fusion capabilities, outperforming traditional CNNs in feature extraction and accurately capturing multi-level features such as texture and contour of shadows. K-means clustering divides feature maps based on resolution, classifying shadows into small, medium, and large areas, enabling the model to specifically handle shadows of different scales. This solves the problems of traditional models missing small target shadows and inaccurate localization of large-area shadows. It achieves high efficiency in feature extraction and targeted feature classification, laying the foundation for subsequent anchor box matching and improving the model's ability to recognize shadows of different scales in complex roof environments.
[0028] Furthermore, the anchor frame size is determined statistically based on the actual shadow size of the training samples, precisely matching the feature map scale. Large anchor frames avoid missing large-area shadow locations, medium-sized anchor frames balance positioning accuracy and computational efficiency, and small anchor frames accurately capture the subtle contours of small-area shadows, solving the problems of shadow omissions and positioning deviations caused by traditional single anchor frames. By combining anchor frame matching with coordinate regression and NMS filtering, accurate prediction of shadow positions is achieved, enabling the model to efficiently identify and accurately locate shadows in complex rooftop environments, whether small shadows caused by chimneys, trees, or other small obstructions, or large-area shadows caused by surrounding buildings.
[0029] Furthermore, the annotation process involves manual verification and correction to ensure the accuracy of shadow positions in the training samples, preventing incorrect annotations from causing training bias. Annotated samples are proportionally divided into training and validation sets. The training set is used for model parameter learning, while the validation set monitors overfitting, making the model training process more controllable. By correcting anchor box sizes or NMS thresholds through annotation, a closed-loop optimization is formed, ensuring stable shadow recognition capabilities after model training convergence. This solves the problem of insufficient recognition accuracy caused by inaccurate sample annotations in traditional model training, providing data assurance for the model's high accuracy.
[0030] Furthermore, solar parameter calculations are the core basis for shadow simulation, and the explicit calculation formulas ensure the accuracy and repeatability of the parameter calculations. Including key parameters such as solar declination, geographical latitude, and solar hour angle, the calculations comprehensively consider the influence of geographical location and time on the sun's position, making the simulated sunlight highly consistent with the actual situation. The shadow range generated under sunlight with accurate solar parameters is closer to the real scene, avoiding shadow simulation distortion caused by parameter errors.
[0031] Furthermore, automatic union processing can quickly integrate shadow ranges from different time periods, eliminate overlapping parts, and fully present the shadow coverage area for the entire time period, avoiding the tediousness and errors of manual processing. Drawing closed ranges makes shadow boundaries clearer, allowing designers to intuitively obtain the shadow distribution. The online display function supports real-time viewing of recognition results and outputs data in multiple formats to adapt to the application needs of different design scenarios. It significantly improves the post-processing efficiency of shadow recognition, achieving seamless integration from data acquisition to result application, and solving the problems of time-consuming post-processing and unintuitive result presentation in traditional methods.
[0032] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.
[0033] In summary, the method of this invention is suitable for high-precision and rapid shadow identification of distributed rooftop photovoltaic systems. The multi-level predictive YOLO algorithm used can ensure accurate identification of shadow areas under different shadow ranges, improving the ability to identify small targets and complex backgrounds. It realizes automatic shadow identification of distributed rooftop photovoltaic systems, and the use of digital methods significantly reduces the time consumption of shadow identification.
[0034] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0035] Figure 1 A flowchart of the YOLO algorithm for multi-level prediction; Figure 2 Flowchart for multi-level shadow recognition of distributed rooftop photovoltaic systems; Figure 3 A schematic diagram of a computer device provided in an embodiment of the present invention; Figure 4 This is a block diagram of a chip provided according to an embodiment of the present invention.
[0036] Among them, 60. Computer equipment; 61. Processor; 62. Memory; 63. Computer program; 600. Electronic device; 610. Processing unit; 620. Storage unit; 6201. Random access memory unit; 6202. Cache memory unit; 6203. Read-only memory unit; 6204. Program / utility; 6205. Program module; 630. Bus; 640. Display unit; 650. Input / output interface; 660. Network adapter; 700. External device. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] In the description of this invention, it should be understood that the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0039] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0040] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this invention generally indicates that the preceding and following objects have an "or" relationship.
[0041] It should be understood that although terms such as first, second, third, etc., may be used in the embodiments of the present invention to describe the preset range, these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from one another. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0042] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0043] The accompanying drawings illustrate various structural schematic diagrams according to embodiments disclosed in this invention. These drawings are not to scale, and some details have been enlarged for clarity, and some details may have been omitted. The shapes of the various regions and layers shown in the drawings, as well as their relative sizes and positional relationships, are merely exemplary and may deviate from reality due to manufacturing tolerances or technical limitations. Furthermore, those skilled in the art can design regions / layers with different shapes, sizes, and relative positions as needed.
[0044] This invention provides a distributed rooftop photovoltaic shadow recognition method based on multi-level prediction. By integrating 3D modeling, accurate solar motion simulation, and a multi-level YOLO target detection algorithm, it achieves high-precision and high-efficiency automatic shadow recognition in complex rooftop scenarios. The method first constructs 3D models of the training and test roofs and simulates solar illumination during the key period of the winter solstice to generate shadow images. Then, it uses the CSPDarknet network to extract multi-level features, divides them into small, medium, and large scales using K-means clustering, and trains the model with anchor boxes of different sizes for each scale, enabling it to accurately identify shadows of different areas. Finally, the model performs union processing on the shadow recognition results from multiple time periods, outputting the full-day shadow closure range. Through 3D modeling, solar parameter calculation, multi-level YOLO model training and recognition techniques, accurate shadow recognition is achieved throughout the entire period from 9:00 to 15:00 on the winter solstice. Its recognition accuracy exceeds 97%, the shadow error is controlled within 3%, and the processing time is reduced by more than 70% compared with traditional methods. It is suitable for various distributed rooftops and small, medium and large area shadow scenarios, such as large industrial and commercial buildings, residential communities and county-wide promotion. It effectively solves the problems of low accuracy, poor adaptability and low efficiency of traditional methods, and provides an efficient and reliable shadow solution for photovoltaic system design.
[0045] This invention provides a distributed rooftop photovoltaic shading identification method based on multi-level prediction, comprising the following steps: S1. Training of the multi-level prediction YOLO algorithm model; Please see Figure 1 The specific implementation steps of the multi-level prediction YOLO algorithm are as follows: S101. Model using 3D modeling tools. Create 3D models of the factory building based on CAD drawings for different types of projects. The more models the better, including models of roofs, walls, and obstructions. On the computer, assign white material (RGB255, 255, 255) to all colors on the model to eliminate reflection interference. Modeling was performed using professional 3D modeling tools, prioritizing DWG format CAD drawings. The models cover 50 typical projects, including large industrial and commercial factory roofs, residential pitched / flat roofs, and mixed roofs implemented across entire counties, ensuring comprehensive coverage of various application scenarios. Modeling strictly adhered to a 1:1 scale, accurately extracting geometric parameters such as roof slope, wall height, and obstructions. For projects without CAD drawings, data was supplemented through on-site laser ranging to ensure the model's error compared to the actual scene is ≤2%.
[0046] In the modeling software, all model structures are uniformly configured with the following material settings: the surface color is assigned to white material, and the RGB values are strictly defined as (255, 255, 255). Specifically, the reflection and specular channels of the material are turned off to completely eliminate the distortion of shadow grayscale values caused by differences in reflectivity between different materials, resulting in a uniform gray-black tone in the shadow areas and providing a clean image foundation for subsequent feature extraction.
[0047] Perform double validation after modeling is complete: First, we compared the rooftop panoramic photos taken on-site to correct any discrepancies in the position of obstructions. Second, select 10 key measuring points on the roof, compare the model dimensions with the actual measurement data, and immediately adjust any deviations exceeding 2% to ensure that the geometric accuracy of the model meets the training requirements.
[0048] S102. Simulate sunlight exposure from 9:00 to 15:00 on the winter solstice. The white 3D model will produce gray-black shaded areas after being exposed to sunlight. Save and import the top view of the shadow range produced by the roof's internal and external shading objects every hour from 9:00 to 15:00 on the winter solstice. Based on the design specifications for distributed rooftop photovoltaic (PV) systems, the winter solstice was selected as the core simulation period. During this period, shadows have the greatest impact on the layout of PV modules, making it a key scenario for shadow identification. The validated 3D model was loaded, and the illumination parameters were configured: illumination intensity was set to 1000 W / m². 2 The atmospheric transparency coefficient is 2.5, the simulation period is from 9:00 to 15:00, with each hour as a time node, for a total of 7 time periods.
[0049] After starting the lighting simulation, a ray tracing algorithm is used to calculate the intersection of sunlight and the 3D model, automatically generating the shadow range of the roof's interior and exterior obstructions. At each time period, the shadow-covered area is photographed from directly above, generating a top-down view of the shadow range to ensure that the screenshot completely covers the roof and the surrounding 10-meter area without any edge cropping or omissions.
[0050] The generated shadow images were standardized: saved as PNG format with a resolution of 1920×1080 pixels, and converted to grayscale mode to avoid color interference. They were categorized and stored according to the naming rules of project type-winter solstice-time period, ultimately forming 50 projects × 7 time periods = 350 shadow training images, constructing a complete training sample set.
[0051] S103. The YOLO algorithm CSPDarknet structure is used to extract multi-level features of the input shadow image. The features divide the shadow size into different sizes. A YOLO algorithm feature extraction network was constructed, using CSPDarknet53 as the backbone network. This structure achieves efficient feature reuse through cross-stage local connections, outperforming the feature extraction capabilities of traditional CNNs. The network parameters are configured as follows: the input image is scaled to 640×640 pixels; the first convolutional layer uses 64 3×3 convolutional kernels with a stride of 2 and the same padding method; subsequently, 6 residual blocks are set, each dividing the feature map into two parts. One part undergoes dimensionality reduction through two 3×3 convolutions + 1×1 convolutions, while the other part is directly connected across stages, preserving both shallow texture features and fusing deep semantic features.
[0052] The activation function chosen is the Mish function (Mish(x)=x×tanh(softplus(x))). Compared to the ReLU function, its non-zero output in the negative interval can alleviate the gradient vanishing problem and improve the extraction effect of deep shadow features. 350 standardized shadow images are batch-input into the network, and convolution and pooling operations are performed through forward propagation to output feature maps of different scales: shallow networks (layers 1-10) output small-scale feature maps of 128×128-256×256 pixels, corresponding to small-area shadow details; mid-layer networks (layers 11-25) output medium-scale feature maps of 64×64-128×128 pixels, corresponding to medium-area shadow contours; and deep networks (layers 26-53) output large-scale feature maps of 32×32-64×64 pixels, corresponding to the overall distribution of large-area shadows.
[0053] S104. Based on the multi-level feature map, the resolution of the feature map is obtained. K-means clustering is performed on images with different resolutions. In order not to affect the computation time, the multi-level feature map is divided into three categories according to the resolution size: small-scale feature map, medium-scale feature map, and large-scale feature map, which correspond to small-area shadow, medium-area shadow and large-area shadow in reality. All feature maps output by CSPDarknet53 were extracted, and the resolution and corresponding shadow area of each feature map were statistically analyzed, initially classifying them into three resolution levels: high, medium, and low. K-means clustering was then used for precise segmentation, with the following clustering parameters set: number of clusters K=3, number of iterations 100, and Euclidean distance as the distance metric to ensure stable convergence of the clustering results.
[0054] The clustering process is executed in three steps: First, three feature maps of different resolutions are randomly selected as initial cluster centers; Second, the Euclidean distance between each feature map and the three centers is calculated, and the feature map is assigned to the nearest cluster; Third, the center coordinates of each cluster are updated (by taking the average resolution of all feature maps in the cluster), and the second step is repeated until the change in center coordinates is ≤0.01 or the maximum number of iterations is reached.
[0055] The final clustering results clearly show that: small-scale feature maps correspond to small-area shadows ≤ 5m² in reality; medium-scale feature maps correspond to medium-area shadows 5-50m²; and large-scale feature maps correspond to large-area shadows > 50m². This division method avoids the inadequacy of a single-scale feature map in adapting to shadows of different areas, laying the foundation for subsequent anchor box matching.
[0056] S105. Assign different anchor box structures to the clustered feature maps. Assign large anchor boxes to low resolution, medium anchor boxes to medium resolution, and small anchor boxes to high resolution to predict the specific location of the shadow. The large-size anchor frame is the anchor frame with the largest size parameter, which is suitable for the outline coverage requirements of large-area shadows in reality; the medium-size anchor frame is the anchor frame with a size parameter between the large-size and small-size anchor frames, which is suitable for the boundary fitting requirements of medium-area shadows in reality; the small-size anchor frame is the anchor frame with the smallest size parameter, which is suitable for the detail capture requirements of small-area shadows in reality. The specific location of the shadow is predicted by matching the anchor frame with the shadow of the corresponding scale.
[0057] Based on the three types of feature maps obtained from clustering, and combined with the statistical results of the aspect ratio of shadows in the training samples (small area shadow aspect ratio 0.8-1.2, medium area 1.0-1.4, large area 1.2-1.5), a targeted anchor frame structure was designed: Large-scale feature map (low resolution): Assign 3 large-size anchor boxes (60, 80), (80, 100), (100, 120) to adapt to the outline coverage requirements of large-area shadows and avoid positioning omissions; Medium-scale feature map (medium resolution): Assign 3 medium-sized anchor boxes (30, 40), (40, 60), (60, 70) to balance the positioning accuracy and computational efficiency of medium-area shadows; Small-scale feature maps (high resolution): Three small-sized anchor boxes (10, 15), (15, 25), and (25, 35) are assigned to accurately capture the subtle contours of small-area shadows and solve the problem of missed detection by traditional anchor boxes.
[0058] After matching the anchor boxes with their corresponding feature maps, coordinate regression and class prediction are performed using the YOLO prediction head: coordinate regression uses the CIoU loss function, while also considering bounding box overlap, center point distance, and aspect ratio to improve localization accuracy; class prediction uses the cross-entropy loss function to determine whether the area within the anchor box is a shadow. Non-maximum suppression (NMS) is used to filter the prediction results, setting an NMS threshold of 0.5 to remove redundant anchor boxes with an overlap exceeding 50%, retaining the anchor box with the highest confidence as the shadow localization result, thus achieving accurate prediction of the specific location of the shadow.
[0059] S106. Mark and display the predicted shadow locations; Load the shadow localization results filtered by NMS, and manually verify and annotate them using marking software. Annotation process: Import the shadow image, select the rectangle tool, and draw a label box along the actual boundary of the shadow, with an error of ≤2 pixels; for shadows with positioning deviation, return to step S105 to adjust the anchor box size or NMS threshold, re-predict and then label, until the shadow positioning accuracy is ≥95%.
[0060] After annotation, the 350 images were divided into a training set and a validation set in an 8:2 ratio. The training set was used for model parameter learning, and the validation set was used to monitor overfitting during training. The annotation files were saved in XML format, recording information such as the coordinates of the annotation boxes (x1, y1, x2, y2) and the shadow category, and were stored in a one-to-one correspondence with the image files.
[0061] S107. Obtain the trained multi-level YOLO model. The learned algorithm has the ability to recognize the shadow range on the image and can be used to identify the shadow area of any roof to be tested.
[0062] Model training parameters are configured as follows: Stochastic gradient descent (SGD) optimizer is used, with an initial learning rate of 0.001, momentum of 0.9, and weight decay of 0.0005; the batch size is set to 16, and the total number of iterations is 100.
[0063] Start model training. During training, perform performance evaluation on the validation set every 10 rounds, recording the accuracy, recall, and loss value. When the accuracy on the validation set shows no improvement for 20 consecutive rounds, the model is considered converged, and training is stopped. Save the converged model weight file and network configuration file to obtain the trained multi-level YOLO model, which has stable recognition capabilities for different types of roofs and shadows of varying areas, and can be directly used for the roof shadow recognition task. S2. After training, use the multi-level prediction YOLO algorithm model to identify the shadow range of any given project site.
[0064] Please see Figure 2 The specific implementation steps of the multi-level shading recognition process for distributed rooftop photovoltaic systems are as follows: S201. Establish a 3D model of the roof to be measured. This model can be automatically generated in software such as DJI Terra using drone aerial images. For the projects under test, two modeling methods are adopted: for projects with CAD drawings, the S101 modeling method is used to ensure model accuracy; for projects without CAD drawings, UAV aerial flight modeling is used, and the specific process is as follows: DJI drones were selected, flying at an altitude of 50 meters and a speed of 5 m / s, with an overlap rate of 80%, to capture 4K resolution images of the roof and surrounding environment, ensuring no blind spots in the shooting. Import the aerial imagery into DJI Terra software and start the automatic modeling function: process the image data through the structure of motion restoration algorithm to generate a 3D point cloud model, and then convert it into a 3D mesh model through triangulation. The mesh model is simplified and optimized by removing irrelevant details and retaining the geometric features of the main roof structure and obstructions, thereby reducing the computational load of the model. Model accuracy verification: Eight key measuring points on the roof were selected, and their actual dimensions were obtained through on-site laser ranging. These dimensions were then compared with the corresponding parameters in the model to ensure that the error was ≤3%, meeting the requirements for shadow simulation.
[0065] S202. Obtain project site information, mainly the longitude and latitude information of the project site, and calculate the parameters of solar altitude angle and solar azimuth angle; Geographic information of the project site is collected, and longitude and latitude are obtained through GPS positioning devices or GIS map queries. A celestial mechanical solar position calculation model is used to calculate the solar altitude angle and azimuth angle parameters. The formula for calculating the solar altitude angle is: (1) in, Indicates the solar altitude angle. The solar declination is the latitude of the sun. Indicates the geographical latitude of the location. denoted by , sin represents the sine function, and n represents the nth day of the year.
[0066] The formula for calculating the solar azimuth angle is: (2) S203. Based on the project's coordinates, calculate the hourly solar altitude angle and azimuth angle between 9:00 and 15:00 on the local winter solstice, and simulate the hourly solar rays on the local winter solstice. Import the three-dimensional model of the roof to be tested constructed in step S201 into the illumination simulation software, load the hourly solar altitude angle and azimuth angle parameters calculated in step S202, keep the illumination intensity and atmospheric transparency coefficient consistent with the training stage, and ensure the uniformity of simulation conditions.
[0067] For the seven time periods from 9:00 to 15:00 on the winter solstice, the software simulates sunlight exposure: The software determines the incident elevation angle of the sunlight based on the solar altitude angle, and the incident direction based on the azimuth angle. It then uses a ray tracing algorithm to calculate the intersection points of the sunlight with rooftops and obstructions, determining the shadow coverage area. The simulation process monitors shadow generation in real time. If problems such as blurred shadow boundaries or missing areas occur, the model accuracy or solar parameter calculation results are checked, and targeted corrections are made before resimulating to ensure the shadow simulation results are consistent with the actual scene.
[0068] S204. Illuminate the 3D model to be tested with sunlight every hour to generate a shadow range, and save the top view of the occluded 3D model every hour. For each time period's illumination simulation results, using the same shooting parameters as in step S102, a top-down view of the roof shadow coverage area is extracted. After extraction, the images are stored according to the naming rule "Project to be tested - Winter Solstice - Time Period" to ensure consistency with the training sample image specifications and avoid affecting the model's recognition performance due to image format differences. This results in 7 shadow images to be tested, forming a test sample set.
[0069] S205. Complete the identification of all areas from 9:00 to 15:00 on the winter solstice, combine all identified areas, and automatically draw the closed areas of all shadow identification within the time range of 9:00 to 15:00 on the winter solstice using a computer program. The seven shadow images of the test sample set are sequentially input into the trained multi-level YOLO model. The model extracts multi-level features of each image through the CSPDarknet 53 network. After K-means clustering, anchor box matching and NMS filtering, the model outputs the shadow recognition result of each image, and the coordinate range of the shadow area (x1, y1, x2, y2).
[0070] Write a Python program to implement the union of shadow ranges: Read the shadow coordinate data of 7 images, convert them into pixel masks, with shadow areas set to 1 and non-shadow areas set to 0; Perform a logical OR operation on the 7 masks to obtain the full-time shadow merging mask, remove the overlapping parts, and retain the shadow coverage of all time periods; The cv2.findContours function is used to extract the shadow contour of the merged mask. The contour approximation precision is set to epsilon=0.001×contour perimeter, and the irregular contour is fitted into a smooth polygon. Automatically draw all shadow recognition closed ranges during the period from 9:00 to 15:00 on the winter solstice. The boundary coordinates of the closed ranges are accurate to 1 pixel, ensuring the integrity and accuracy of the shadow range.
[0071] S206. Output the recognition results and display them online.
[0072] Output shadow recognition results in multiple formats to meet the needs of different application scenarios: PNG format visualization image: Mark the shadow closure range and corresponding time period, and use different colors to distinguish small, medium and large areas of shadow; JSON format coordinate data: Stores the vertex coordinates (x, y) of the shadow closure range, which is convenient for importing into CAD software for photovoltaic module layout design; PDF format report document: contains information such as shadow recognition results, model recognition accuracy, and solar parameter calculation results, which serve as the basis for project design.
[0073] A WebGL-based online display platform is launched. The left side of the interface displays the 3D model of the roof to be tested, while the right side simultaneously displays a visualized image of the shadow closure range and JSON coordinate data. The platform supports model rotation, scaling, and translation, allowing designers to intuitively view the specific location, coverage area, and time-of-day distribution of the shadow. Finally, the validity of the recognition results is verified: photos of the roof shadows taken on the winter solstice at the corresponding time are compared with the recognition results, and the shadow range error rate is calculated to ensure that the error rate is ≤3%, meeting the engineering requirements for distributed rooftop photovoltaic system design.
[0074] In another embodiment of the present invention, a distributed rooftop photovoltaic shadow recognition system based on multi-level prediction is provided. This system can be used to implement the above-mentioned distributed rooftop photovoltaic shadow recognition method based on multi-level prediction. Specifically, the distributed rooftop photovoltaic shadow recognition system based on multi-level prediction includes a three-dimensional module, a parameter module, a simulation module, a training module, a recognition module, a merging module, and an output module.
[0075] Among them, the 3D module is used to build 3D models of roofs and obstructions, including a training model building unit based on CAD drawings and a test model building unit based on UAV aerial images. The parameter module is used to obtain the latitude and longitude information of the project site and calculate the solar altitude angle and azimuth angle every hour from 9:00 to 15:00 on the winter solstice; The simulation module is used to simulate sunlight illuminating a 3D model, generating and saving hourly top-down views of the shadow range. The training module is used to train a multi-level prediction YOLO model, including a feature extraction unit that extracts features using the CSPDarknet structure, a clustering unit that divides the feature map scale using K-means clustering, an anchor box matching unit that assigns corresponding anchor boxes to feature maps of different scales, and a labeling unit that labels shadow positions using X-AnyLabeling labeling software; the anchor boxes configured by the anchor box matching unit include large-size anchor boxes adapted to large-area shadows, medium-size anchor boxes adapted to medium-area shadows, and small-size anchor boxes adapted to small-area shadows. The recognition module is used to call the trained multi-level prediction YOLO model to perform shadow recognition on the top view of the shadow range. The merging module is used to perform union processing on the identified shadow ranges from different time periods and draw the closed range of shadow identification. The output module is used to display the shadow recognition results for the entire winter solstice period online.
[0076] This invention provides a terminal device comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve a corresponding method flow or function. The processor described in this embodiment can be used for the operation of a distributed rooftop photovoltaic shadow recognition method based on multi-level prediction, including: A 3D model of the roof and obstructions is established through 3D modeling. Based on the latitude and longitude information of the project site, the solar altitude angle and azimuth angle on the winter solstice are calculated. The 3D model is simulated to generate an hourly top view of the shadow range. A multi-level predictive YOLO model is used to identify shadows in the top view. The multi-level predictive YOLO model is divided into three categories based on feature maps of different scales: small scale, medium scale, and large scale, which correspond to small area shadows, medium area shadows, and large area shadows, respectively. The identified shadow ranges are then processed by union to output the shadow identification results for the entire period on the winter solstice.
[0077] Please see Figure 3The terminal device is a computer device. In this embodiment, the computer device 60 includes a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When executed by the processor 61, the computer program 63 implements the distributed rooftop photovoltaic shading identification method based on multi-level prediction in this embodiment. To avoid repetition, these details are not elaborated here. Alternatively, when executed by the processor 61, the computer program 63 implements the functions of each model / unit in the distributed rooftop photovoltaic shading identification system based on multi-level prediction in this embodiment. To avoid repetition, these details are not elaborated here.
[0078] Computer device 60 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. Computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will understand that... Figure 3 This is merely an example of computer device 60 and does not constitute a limitation on computer device 60. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer device may also include input / output devices, network access devices, buses, etc.
[0079] The processor 61 may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0080] The memory 62 can be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 can also be an external storage device of the computer device 60, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on the computer device 60.
[0081] Furthermore, the memory 62 may include both internal storage units of the computer device 60 and external storage devices. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 can also be used to temporarily store data that has been output or will be output.
[0082] Please see Figure 4 The terminal device is an electronic device 600, which is manifested in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including storage unit 620 and processing unit 610), a display unit 640, etc.
[0083] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform actions such as... Figure 1 and Figure 2 The steps are shown in the figure.
[0084] Storage unit 620 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include a read-only memory (ROM) 6203.
[0085] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0086] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0087] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem). This communication can be performed via input / output interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network, wide area network, and / or public network, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0088] Example 4 This invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device for storing programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the terminal device and extended storage media supported by the terminal device; it can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor, which can be one or more computer programs (including program code). More specific examples of the computer-readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical fiber, portable compact disk read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0089] Computer-readable storage media also include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium can also be any readable medium other than a readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, radio frequency, etc., or any suitable combination thereof.
[0090] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0091] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the distributed rooftop photovoltaic shading identification method based on multi-level prediction in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by the processor to perform the following steps: A 3D model of the roof and obstructions is established through 3D modeling. Based on the latitude and longitude information of the project site, the solar altitude angle and azimuth angle on the winter solstice are calculated. The 3D model is simulated to generate an hourly top-down view of the shadow range. A multi-level predictive YOLO model is used to identify shadows in the top-down view. The multi-level predictive YOLO model is divided into three categories based on feature maps of different scales: small scale, medium scale, and large scale, which correspond to small area shadows, medium area shadows, and large area shadows, respectively. The identified shadow ranges are then processed by union to output the shadow identification results for the entire period on the winter solstice.
[0092] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0093] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0094] Simulation data
[0095] Experiments show that the method of this invention has an accuracy rate of over 97% in recognizing different types of roofs and shadows of different sizes, with the shadow range error controlled within 3%. The processing time for a single roof is reduced by more than 70% compared to traditional methods. It effectively solves the problems of insufficient recognition accuracy for small targets and poor adaptability of single models in traditional methods, providing reliable technical support for the efficient design and layout of distributed photovoltaic systems.
[0096] In summary, this invention presents a distributed rooftop photovoltaic shadow recognition method and system based on multi-level prediction. By integrating 3D modeling, accurate solar motion simulation, and a multi-level YOLO target detection algorithm, it achieves high-precision and high-efficiency automatic recognition of shadows in complex rooftop scenarios. The method first constructs 3D models of the training and test roofs and simulates solar illumination during the key period of the winter solstice to generate shadow images. Then, it uses the CSPDarknet network to extract multi-level features, and divides them into small, medium, and large scales using K-means clustering. Different sized anchor boxes are matched to each scale for model training, enabling accurate recognition of shadows of different areas. Finally, the model performs union processing on the shadow recognition results from multiple time periods to output the total shadow closure range for the entire day. Experiments show that the method achieves an accuracy rate exceeding 97% for different types of roofs and shadows of different sizes, with shadow range errors controlled within 3%. The processing time for a single rooftop is reduced by more than 70% compared to traditional methods. This effectively solves the problems of insufficient accuracy in recognizing small targets and poor adaptability of single models in traditional methods, providing reliable technical support for the efficient design and layout of distributed photovoltaic systems.
[0097] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0098] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0099] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0100] In the embodiments provided by this invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0101] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0102] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0103] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random-access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0104] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0106] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0107] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A method for identifying the shadow of a distributed rooftop photovoltaic system based on multi-level prediction, characterized in that, Includes the following steps: S1. Establish a 3D model of the roof and obstructions through 3D modeling; calculate the solar altitude angle and azimuth angle on the winter solstice based on the latitude and longitude information of the project site; simulate the sunlight shining on the 3D model and generate an hourly top view of the shadow range; S2. A multi-level prediction YOLO model is used to identify shadows in the top view. The multi-level prediction YOLO model is divided into three categories based on feature maps of different scales: small scale, medium scale, and large scale, which correspond to small area shadows, medium area shadows, and large area shadows, respectively. The identified shadow ranges are then processed by union to output the shadow identification results for the entire winter solstice.
2. The distributed rooftop photovoltaic shading identification method based on multi-level prediction according to claim 1, characterized in that, In step S1, the creation of the 3D model includes: For the training phase, a 3D model including the roof, walls and obstructions is created based on the CAD drawings of different types of projects, and all colors of the 3D model are assigned to the white material. For the identification phase, a 3D model of the roof to be tested is generated using aerial images from drones.
3. The distributed rooftop photovoltaic shading identification method based on multi-level prediction according to claim 2, characterized in that, The RGB value of the white material is (255, 255, 255).
4. The distributed rooftop photovoltaic shading identification method based on multi-level prediction according to claim 1, characterized in that, In step S1, the solar altitude angle and azimuth angle on the winter solstice are calculated from 9:00 to 15:00, and are calculated once per hour; the top view of the shadow range corresponds to the simulation result of the sunlight illumination, and one is generated and saved every hour.
5. The distributed rooftop photovoltaic shading identification method based on multi-level prediction according to claim 1, characterized in that, In step S2, the training process of the multi-level prediction YOLO model includes: The CSPDarknet structure using the YOLO algorithm is used to extract multi-level features of the top view of the shadow range; based on the resolution of the multi-level feature maps, the feature maps are divided into small-scale feature maps, medium-scale feature maps, and large-scale feature maps by K-means clustering.
6. The distributed rooftop photovoltaic shading identification method based on multi-level prediction according to claim 5, characterized in that, The clustered feature maps are then matched with their corresponding anchor box structures: Large-scale feature maps with low resolution are assigned large-size anchor boxes, medium-scale feature maps with medium resolution are assigned medium-size anchor boxes, and small-scale feature maps with high resolution are assigned small-size anchor boxes. The specific location of the shadow is predicted by anchor box matching.
7. The distributed rooftop photovoltaic shading identification method based on multi-level prediction according to claim 6, characterized in that, During model training, the predicted shadow positions are labeled to complete the model training.
8. The distributed rooftop photovoltaic shading identification method based on multi-level prediction according to claim 1, characterized in that, Solar altitude angle The calculation is as follows: Sun azimuth The calculation is as follows: in, The solar declination is the latitude of the sun. Indicates the geographical latitude of the location. It indicates the local solar hour angle.
9. The distributed rooftop photovoltaic shading identification method based on multi-level prediction according to claim 1, characterized in that, In step S2, the computer program automatically performs the union processing of the shadow range to draw all the shadow recognition closed ranges within the period from 9:00 to 15:00 on the winter solstice, and outputs the recognition results in an online display manner.
10. A distributed rooftop photovoltaic shading recognition system based on multi-level prediction, characterized in that, include: The 3D module is used to build 3D models of roofs and obstructions, including a training model building unit based on CAD drawings and a test model building unit based on UAV aerial images. The parameter module is used to obtain the latitude and longitude information of the project site and calculate the solar altitude angle and azimuth angle every hour from 9:00 to 15:00 on the winter solstice; The simulation module is used to simulate sunlight illuminating a 3D model, generating and saving hourly top-down views of the shadow range. The training module is used to train a multi-level prediction YOLO model, including a feature extraction unit that extracts features using the CSPDarknet structure, a clustering unit that divides the feature map scale using K-means clustering, an anchor box matching unit that assigns corresponding anchor boxes to feature maps of different scales, and a labeling unit that labels shadow positions using X-AnyLabeling labeling software; the anchor boxes configured by the anchor box matching unit include large-size anchor boxes adapted to large-area shadows, medium-size anchor boxes adapted to medium-area shadows, and small-size anchor boxes adapted to small-area shadows. The recognition module is used to call the trained multi-level prediction YOLO model to perform shadow recognition on the top view of the shadow range. The merging module is used to perform union processing on the identified shadow ranges from different time periods and draw the closed range of shadow identification. The output module is used to display the shadow recognition results for the entire winter solstice period online.