# Cloud Detection and Tracking Based on Object Detection with Convolutional Neural Networks
## 3 Results  
The proposed method can be used with different solar technologies of different sizes. For example, a network of low-cost sensors based on the proposed method can be deployed in the heliostat field to predict the available solar radiation in SCR, improving the control of the receiver and helping to avoid temperature peaks in it, which is one of the key issues in SCR. The same can be done for large photovoltaic plants. Thanks to the low cost of the sensor, a network of sensors can be used to help control the plant and the stability of the grid. These sensors and the information about solar radiation transients can also help with storage management, thermal or electrical, in large plants or small facilities, contributing to an improvement in the competitiveness of solar technologies and their greater deployment. The new approach can be used together with smart solar trackers such as Hel-IoT, using the image for the smart tracking of clouds and predicting the estimated time for a transient. This new capability gives Hel-IoT the ability to track the Sun, detect shadows and blockages, and the ability to track clouds. The first model retraining results show that the model performed well in object detection and classification and, therefore, produced a good overall result in detecting the new objects. Figure 6 shows the evolution of the classification, localization, and total losses during the 80,000 epochs of the retraining process. This figure shows sufficient training with low error rates. Localization loss is the error generated when placing the detection of the object in the image. In this study, the localization error was quantified using the weighted-smooth-l1 function, based on the Huber loss function [29], which describes the penalty incurred by an estimation procedure. Classification loss is the error made when assigning a label to the detected object; in this case, a weighted-sigmoid-focal function was employed. This function is based on the focal loss approach [30], which improves the learning process with a sparse set of examples and prevents the vast number of negative classifications from overwhelming the detector during training, achieving state-of-the-art accuracy and speed. Total loss is composed of both the classification and localization losses. The optimizer recommended in the API object detection: the momentum optimizer, with a learning rate = 0.0799, was chosen for the training. The training process finished with localization, classification, and total validation error values of 3.6 \(\times\) 10\({}^{-3}\), 0.04, and 0.06, respectively, so the retraining was sufficient and finished without overfitting. Table 1 summarizes the main training results. This paper presents the first version of the retrained model. However, the Hel-IoT web server has been running continuously since April 2022. During this time, the neural network model has been retrained, with supervised learning, several times. The model is undergoing continuous improvement, as it is periodically retrained with new images in cases where the detection fails or does not have enough precision. To test the cloud detection, trajectory, and remaining time calculation, an image sequence of the PSA sky (Spain) from 24 June 2022 was used. Fifteen images were taken every ten seconds, then the object detection model identified the objects in the images and the trajectory algorithm computed the trajectory of every cloud detected together with the remaining time for the cloud transient. Figure 7 shows the evolution of the remaining time prediction (blue dots) of the cloud with identification number 1 in Figure 2, since the cloud was detected for the first time in the time series (10:01:30), until it began to generate a transient in solar radiation. The left vertical axis corresponds to the forecast time, the right vertical axis shows the direct normal irradiation (DNI) during the test, and the horizontal axis represents the real time.