A flood monitoring system which processes sentinel-2 images
The Sangam region in Prayagraj(U.P) has been prone to floods occurring in rainy season almost every year, causing substantial damage to the people in the region.
In this project we will be monitoring the sangam region which is the confluence of the Ganges and Yamuna rivers using multispectral images from the Sentinel-2 data, this can be useful in predicting the areas which are prone to floods.
Sentinel-2 is an Earth observation mission from the Copernicus Programme that systematically acquires optical imagery at high spatial resolution over land and coastal waters.
It has optical instrument samples in 13 spectral bands: four bands at 10 metres, six bands at 20 metres and three bands at 60 metres spatial resolution.
The data captured by the Sentinel-2 is available in the form of Level-1B, Level-1C and Level-2A data products. Each dataset of Level-2A is in the form of tiles of area 100km x 100km. These datasets are available for free at Copernicus Open Access Hub or can be downloaded using the Sentinel-2 Toolbox.
https://scihub.copernicus.eu/dhus/#/home
Firstly, we process the sentinel-2 images using SNAP Tools. We take into account several bands and their corresponding spectral images. The sentinel-2 images are processed and converted to png format before further processing using python libraries such as PILLOW and imageio. Our unsupervised method for change detection involves the automatic analysis of the change data, i.e. the difference image, constructed using the multi temporal images. A difference image is the pixel-by-pixel subtraction of the 2 images..
diff_image = abs(image1 - image2)
After cropping the images we get the final shape of the difference image as (1647x1647).
Next is the task of building the Eigen vector space.
PCA (Principal Component Analysis) takes a data set and determines its co-variance matrix after performing mean normalisation on it. The Eigen vectors and Eigen values of the co-variance matrix are computed (giving us the EVS) and then the Eigen vectors are sorted in the descending order of Eigen values.
The Eigen vectors have been sorted in the decreasing order of the Eigen values because the Eigen vector with the highest Eigen value is the principal component of the data set. That vector shows along which direction the majority of the data is inclined. Thus by PCA, we have been able to extract the lines that characterise the data.
We take non-overlapping blocks of size 5 x 5 from the difference image and flatten them into row vectors. PCA is then applied on this vector set to get the Eigen vector space. The Eigen vector space will be a 25 x 25 matrix.
Now finally we move towards building the feature vector space. Building the FVS involves again taking 5 x 5 blocks from the difference image, flattening them, and lastly projecting them onto the EVS, only this time, the blocks will be overlapping.
The feature vectors for the pixels carry information whether the pixels have characteristics of a changed pixel or an unchanged one. Having constructed the feature vector space, we now need to cluster it so that the pixels can be grouped into two disjoint classes. We will be using the K-means algorithm to do that.
We can clearly see the difference between the images of before and after the rainy season. After the rainy season the water bodies have got thicker. We will monitor this change in water area.
The change map denotes the change in water area. We have used 2 types of pixel values for our K-Means clustering that are 0 and 255 respectively. 0 represents black while 255 represents white.
python main.py
One of the most fundamental requirements of change detection is the registration between the two input images.It implies that the images should have perfect alignment between them, otherwise change detection would give many false alarms.
Water level monitoring helps to provide an early warning system of any likely flooding situation, providing valuable time to protect assets, move valuables and protect property.