# Automated Rain Detection by Dual-Polarization Sentinel-1 Data
## 4 Rain Detection
### Optimization of the Heterogeneity Filter(s) for Rain Detection  
The local gradient method is proposed by [PERSON] (2016) to detect heterogeneity across SAR images, which has the capability of locating multiple objects, such as land areas, fronts, oil spills, ships, even under non-uniform ocean environment conditions. To filter out small-scale ocean features and speckle noise, we first reduce the spatial resolution and thus smooth the image. Speckle noise is inherent to SAR images due to the coherent processing of radar signals. Our analysis requires further speckle noise reduction even though the speckle noise has already been decreased in ground-detected SAR images by applying multi-look SAR processing (the Equivalent Number of Looks for the Sentinel-1 IW SAR mode is 4.4). In addition to rain signatures, SAR images acquired over sea surface may include other small-scale features with scales of meters to decameters (e.g., waves) which are out of the scope of this study. In this study, we use three resolutions (200 m, 400 m and 800 m) in the analysis of co- and cross-pol Sentinel-1 SAR images to eliminate the wave impact with wavelengths on the order of 100 m. Following the study in Koch (2016), we compute four parameters (denoted \(P_{i}\)):  
* \(P_{1}\): The ratio between the standard deviation and the average computed for each pixel using a sliding bounding box of the smoothed/reduced image. It is computed using a convolutive averaging bounding box over the amplitude (square root of NRCS) and its second moment. This parameter is particularly useful to decipher open water surface from other extended areas (land, tidal zones, sea ice, etc.) * \(P_{2}\): The second parameter is built on a Laplace pyramid filter with the difference between images at adjacent levels in the pyramid. It is based on the squared ratio of the high-pass-filtered image and its local average. It has the capability of detecting narrow image features, as slicks, internal waves, or fronts. * \(P_{3}\): The third parameter is the ratio of the magnitude of the squared local Sobel-based gradient and its local average. A Sobel operator is basically involved to do spatial gradient measurement on 2-dimensional images. It is generally adapted to detect edges and point targets. * \(P_{4}\): The ratio between the reduced/smoothed version of the squared local gradient and its absolute squared gradient: it can be considered to be a measure of directional coherence. It should detect the edges such as \"slicks, internal waves, or fronts\" ([PERSON], 2016). In study of [PERSON] (2016), these four parameters are studied via a histogram analysis to optimize the separability between wind and non-wind related features, which he termed heterogeneous areas. They are linearly scaled between 0 and 1, leading to the four parameters \(f_{i}\). In this study we adapt these 4 parameters for rain detection, although they applied them to co-polarized ERS-1/-2 SAR images. The squared average of linearly scaled \(f_{i}\) parameters is then computed, leading to a single \(F\) parameter ranging from 0 and 1. \[F=\sqrt{\frac{1}{4}\sum_{i=1}^{4}f_{i}^{2}} \tag{2}\]At this stage, this parameter is calculated at different resolutions \(r\) (\(r=\{200,400,800\}\)) and for the two polarization channels \(p\) (\(p=\{\mathrm{VV,VH}\}\)), hereafter denoted \(F_{r,p}\). In Koch [25], a single threshold is applied to \(F\) to indicate the presence of heterogeneity (set as 0.6 for all proposed resolutions--ERS-1 only has single-polarization capabilities). Several quantitative indices/criteria can be employed to assess the goodness-of-fit between the rainy area provided by the reference rain mask and the \(F_{r,p}\) parameter. Applying a specific threshold \(F_{r,p}\ >\ \
u_{r,p}\) with \(\
u_{r,p}=[0,1]\) would enable a direct comparison between two binary masks with Dice coefficient or Intersection over Union (IoU) indices. An analysis based on Receiver Operating Characteristic (ROC) curve is outlined in Figure 8 with \(r=400\) and \(p=VV\).