# Machine Learning-Based Calibration of Low-Cost Air Temperature Sensors Using Environmental Data
## 4 Discussion  
This study proposed and investigated a calibration method for correcting the air temperature measurements produced by low-cost sensors under natural conditions. We used a machine learning approach to allow the effect of multiple environmental factors to be considered, including humidity, solar radiation, azimuth and elevation. These are known to negatively affect the accuracy of low-cost air temperature sensors. We first conducted an indoor experiment to confirm the accuracy of the low-cost air temperature sensor under ideal conditions. We then conducted two further analyses: calibration using data measured at a single location and calibration using data measured at nearby and distant locations in Japan. As shown in Figure 13, there were obvious differences in climatic environments  
Figure 13: Box plots of differences between air temperatures measured by the high-accuracy and low-cost sensors at different hours. Bar plots represent mean solar radiation in each hour. (**a**) sagatea-111; (**b**) tanashi-117; (**c**) tanashi-118. between the experimental sites, indicating the need to evaluate calibration methods with data collected at multiple locations, which has not been conducted in the related research. The results of the indoor experiment (shown in Figure 6), conducted under ideal conditions without any influence from factors, such as solar radiation, rain and wind, confirmed that the low-cost sensor met the specifications shown in Table 1. We concluded that any measurement errors arising in the outdoor experiments could be mainly attributed to environmental factors. The results from the cross-validation within a single location confirmed that the accuracy of the low-cost sensor was considerably improved by the proposed method, compared with the traditional method based on linear regression. However, some large errors occurred, as shown in Figure 11. Some of them are shown in Figure 12. For example, Figure 12a shows solar radiation decreasing rapidly at 16:00, before rising again. This may have been caused by a cloud briefly hiding the Sun. The model decreased the observed temperature by a small amount, as the input solar radiation was also low. On the other hand, in the case of Figure 12b, solar radiation increased rapidly at 12:00, and the observed temperature was therefore greatly decreased by our model. However, as solar radiation had been low between 11:30 and 11:50, the observed temperature was close to the reference value, and the calibration failure shown in Figure 12b occurred. The proposed model used only the environmental conditions of the time when the temperature to be calibrated was observed and did not consider the preceding environmental conditions, which could also cause the observation errors. Therefore, a particularly rapid change of environmental conditions tends to result in the failure of the calibrations. In order to solve the issue, a future study needs to include preceding environmental conditions in the ANN model, discovering the most appropriate period of prior time series observations. We also expect that the higher observation frequency may improve the calibration accuracy. There was another cause of calibration failures. In Figure 12c, the air temperatures measured by both the high-accuracy and low-cost sensors drastically decreases at around 14:00. A nearby AMeDAS station, located at 35\({}^{\circ}\)44' N and 139\({}^{\circ}\)35' E, or approximately 3.9 km from the experimental site in Tokyo, observed sudden heavy rain at this time. It is likely that heavy rain also occurred at our experimental site, producing a rapid decrease in air temperature. As our model does not consider rain levels or wind speed, calibration may have failed. Since we used an ANN for the calibration model, it is expected to be easy to add other environmental factors in a future study if the observations are available. The results from the cross-validation between locations showed that the R-squared values with reference temperature were improved in most cases.