## 4 Methodology
### Data Preprocessing and Symbols  
The AQI values \(X^{A}\) collected from monitoring sensors sometimes have missing values that might decrease the performance of the model predictions. To solve this problem, a previous study [13] proposed replacing the missing values by computing the mean value in a six-hour sliding window. For example, after imputation, the missing value \"NaN\" in a time series of AQIs \([\,\ldots,\,34,\,37,\,46,\,\text{``NaN''},\,40,\,31,\,33,\,\ldots\,]\) will be replaced by 37. Note that samples with at least two consecutive missing values are excluded from the training and testing because the artificial data might affect the effectiveness of prediction. Finally, we apply standard normalization to the AQI data.  
The time series of meteorological features \(X^{M}\) in this study have five categories: (1) temperature, (2) pressure, (3) humidity, (4) wind direction, and (5) wind speed. Among these features, only the wind direction is a categorical feature with categories, while the others are numerical. We apply one-hot encoding to the wind direction data and standard normalization to the values of numerical data.  
For POI features POIs \(X^{P}\), 14 POI categories include Company, Culture, Daily Life, Entertainment, Institution, Transportation Spots, Medical, Vehicle Service, Shopping Mall, Sports, Food and Beverage, Hotels, Education, and Financial. The POI features are the total numbers of each POI categories within the grid. After computing the POI features of all grids, the POI features are then normalized by the sum of each category among all grids so that all values are in the range of \([0,1]\). For Road Networks \(X^{R}\) and Land Use s \(X^{L}\) features, the values are normalized to the range of \([0,1]\) by the total length and area of each type, respectively.  
In addition, we calculate the distance between the unlabeled grid and all labeled grids by using their central latitudes and longitudes. For instance, IDW and K-NN are the common baselines for inferring fine-grained AQI from monitoring stations, and the most important key point for prediction is the distance between target regions and each monitoring station. In Equation (1), we normalize the distance between \(G_{U}\) and \(G_{S}\) as the Distance feature \(X^{D}\) and yield the Inversed Distance feature \(X^{ID}\) simultaneously. Normalization on the Inversed Distance feature is not performed, since the minimum Distance feature is \(1\).  
\[\begin{array}{l}X^{D}=Normalize(Distance(G_{U},S)),\,\,for\,S\,in\,G_{S}\\ X^{ID}=1/Distance(G_{U},S),\,\,for\,S\,in\,G_{S}\end{array} \tag{1}\]  
Figure 1: The overall architecture of our proposed model. (**a**) Our feature extractors for processing grid-based features. The color green represents dynamic features. The color blue represents static features. The color cream represents grid extractors. (**b**) The inversed distance attention (color red) calculates the influences of labeled grids on unlabeled target grids. (**c**) Our proposed hybrid predictor(color grey) makes the final prediction.  
After data preprocessing, we have static features and sequential features in each grid. However, there are a few differences between input features between each grid due to the existence of monitoring stations. We extract the feature set \(F_{Sn}\), which includes Meteorological \(X_{U}^{M}\), POIs \(X_{U}^{P}\), Road Net \(X_{U}^{R}\), Land Use \(X_{U}^{L}\), Distance \(X_{U}^{D}\), and Inversed Distance \(X_{U}^{ID}\) for unlabeled grids \(G_{U}\). For a set of grids with a monitoring station, we denote them as labeled grids and use AQI \(X_{Sn}^{A}\), Meteorological \(X_{Sn}^{M}\), POIs \(X_{Sn}^{P}\), Road Net \(X_{Sn}^{R}\), Land Use \(X_{Sn}^{L}\), Distance \(X_{Sn}^{D}\), and Inversed Distance \(X_{Sn}^{D}\) as labeled grids features \(F_{Sn}\).