Abstract
The study and prediction of space weather entails the analysis of solar images showing structures of the Sun’s atmosphere. When imaged from the Earth’s ground, images may be polluted by terrestrial clouds which hinder the detection of solar structures. We propose a new method to remove cloud shadows, based on a U-Net architecture, and compare classical supervision with conditional GAN. We evaluate our method on two different imaging modalities, using both real images and a new dataset of synthetic clouds. Quantitative assessments are obtained through image quality indices (RMSE, PSNR, SSIM, and FID). We demonstrate improved results with regards to the traditional cloud removal technique and a sparse coding baseline, on different cloud types and textures.
Data
We have released the data used in this project on Zenodo
Source Code
The source code for this project is hosted on the LIS-lab Gitlab.
Install
You can pip install directly from this repo:
pip install git+https://github.com/jaypmorgan/cloud-removal.git
or if you’ve cloned the repo to a local directory:
cd cloudremoval
pip install ./
Usage
Using the existing synthetic clouds dataset:
import dfp
from cloudremoval.dataset import SyntheticClouds, CloudsTransform
# download the data
= SyntheticClouds(download=True)
dataset
# get only a single wavelength from the data
= dataset.filter(lambda row: dfp.has_props(row, {"type": "Ca II"}))
caii
# split into train and test
= caii.split(lambda row: dfp.has_props(row, {"subset": "train"}))
train, test
# get the first instance:
= train[0]
item = item.input
inp1
item.target
item.mask
# Add a transform
= CloudsTransform(hflip_p=0.5, vflip_p=0.5)
train.transform = train[0]
item = item.input inp2
To create a model, or load one using existing model weights:
from cloudremoval.model import CloudRemover
# create a new model from scratch (i.e. random model weights)
= CloudRemover()
model
# create a model using the existing weights
= CloudRemover(pretrained=True)
model
# create a model using a different wavelength
= CloudRemover(wavelength="H-alpha", pretrained=True)
model
# test making of predictions
= SyntheticClouds(download=True, transform=CloudsTransform())
dataset = CloudRemover(pretrained=True)
model = model(dataset[0].input[None,...])*dataset[0].mask[None,...]
out
import matplotlib.pyplot as plt
0,0].detach().cpu().numpy(), cmap="Greys_r") plt.imshow(out[