Deep learning tool for identifying blended galaxy images in survey images.
Main contributor: Samuel Farrens
Email: samuel.farrens@cea.fr
BlendHunter implements the VGG16 CNN to identify blended galaxy images in postage stamps.
The following python packages should be installed with their specific dependencies:
git clone https://github.com/CosmoStat/BlendHunter.git
Configuration setup:
from blendhunter.config import BHConfig
bhconfig = BHConfig(config_file='../data/bhconfig.yml').config
in_path = bhconfig['in_path']
out_path = bhconfig['out_path']
noise_sigma = bhconfig['noise_sigma']
n_noise_real = bhconfig['n_noise_real']
sample_range = slice(*bhconfig['sep_sample_range'])
Create 35 directories for padded parametric images and prepare data:
python create_directories.py
python prep_data.py
Run BlendHunter network and Source-Extractor as a bechmark:
python run_bh.py
python run_sep.py
python test_cosmos.py
Get simulations labels:
labels = np.load(os.path.join(out_path, 'labels.npy')).flatten()
Get accuracy on simulations:
from blendhunter.performance import get_acc
bh_mean, bh_std = get_acc('bh_pad_results', out_path, noise_sigma, n_noise_real, labels)
sep_mean, sep_std = get_acc('sep_pad_results', out_path, noise_sigma, n_noise_real, labels)
Plot results with error bars:
Get labels and accuracy on Cosmos images:
labels = np.load(os.path.join(out_path, 'cosmos_labels.npy')).flatten()
bh_mean, bh_std = get_acc('cosmos_results_pad', out_path, noise_sigma, n_noise_real, labels)
Plot results: