A PyTorch-based collection of Unsupervised Domain Adaptation methods applied to strong gravitational lenses
Project description
DeepLense Domain Adaptation
A PyTorch-based collection of Unsupervised Domain Adaptation methods applied to strong gravitational lenses!
This project was created for Google Summer of Code 2021 under the Machine Learning for Science (ML4Sci) umbrella organization.
Description
A promising means to identify the nature of dark matter is to study it through dark matter halos, and strong gravitational lenses have seen encouraging results in detecting the existence of dark matter substructure. Unfortunately, there isn't a lot of data of strong gravitational lenses available, which means that, if we want to train a machine learning model to identify the different kinds of dark matter substructure, we'd need to use simulations. The problem though, is that a model trained on simulated data does not generalize well to real data, having a very bad performance. This project aims to fix this problem by using Unsupervised Domain Adaptation (UDA) techniques to adapt a model trained on simulated data to real data!
Blog post
For more about the motivation behind the project and also the Google Summer of Code experience check out this blog post.
Algorithms
There are currently four different UDA algorithms supported:
- ADDA
- Self-Ensemble
- CGDM
- AdaMatch
There is also a normal supervised training algorithm
Installation
This repo's code can be acessed through the deeplense_domain_adaptation
package. To install it simply do:
pip install --upgrade deeplense_domain_adaptation
Data
The data loading pipeline implemented here expects the image data to be in the form of a four dimensional numpy array of shape: (number_of_images, number_of_channels, height, width)
. Label data is expected to have a shape: (number_of_images, 1)
.
The dataset used for training and inference will be made available as soon as possible!
Tutorial
For a tutorial on how to use the deeplense_domain_adaptation
package check out the tutorial available ate tutorial.ipynb
. For a more user friendly experience, you can also check the Jupyter Notebook on nbviewer here.
Current results (ResNet18 model)
Training on source and testing on target:
- Accuracy = 0.6326
- AUROC = 0.8114
After applying UDA algorithms:
Algorithm | ADDA | Self-Ensemble | CGDM | AdaMatch |
---|---|---|---|---|
Accuracy | 0.8449 | 0.7480 | 0.7132 | 0.7300 |
AUROC | 0.9442 | 0.8816 | 0.8931 | 0.9179 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for deeplense_domain_adaptation-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2a2d963cfac65d23c38814b7f843954bfcfbdc022e0f8a2456553dbb0d6eb41 |
|
MD5 | 0b6371fbc43ed242debc1baf60346fef |
|
BLAKE2b-256 | d0954966742ab0b329b04aec583c45b4932fa8c6302680c95d31be5563e2f9fa |
Hashes for deeplense_domain_adaptation-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6dcfc6738ce7e696cc32af551005b6a59a6a27daa66fdfd75cba530f47d1746 |
|
MD5 | 1328e40eb97b8a67cad693309f12d11a |
|
BLAKE2b-256 | da1a12aa1c5365b61dfcd41065de0f409ec5dfa1f1f2098fc9678dfc3a3fabf2 |