Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Deeplens_Self_Supervised_Learning_Yashwardhan_Deshmukh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,15 @@ All results were calculated on a **separate test set**.
## Conclusion and Future Goals
So far, we can see that the results for self-supervised learning seem superior to their ResNet50 Baseline.
Future goals consist of testing models for regression, implementing vision transformers (twin networks) and testing some more self-supervised learning methods.



## BYOL Dataset Setup

The BYOL self-supervised learning notebooks require the `Model_I` dataset
from the DeepLenseSim repository.

Before running the BYOL notebooks, download the dataset using:

```bash
python scripts/setup_byol_dataset.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
imageio
numpy
pandas
tensorflow
keras
matplotlib
tqdm
pillow
scikit-learn
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os
import zipfile
import urllib.request
import shutil

ZIP_URL = "https://github.com/mwt5345/DeepLenseSim/archive/refs/heads/main.zip"
ZIP_NAME = "DeepLenseSim.zip"
EXTRACTED_DIR = "DeepLenseSim-main"
TARGET_DIR = "Model_I"

def setup_data():
if os.path.exists(TARGET_DIR):
print("[INFO] Model_I dataset already exists.")
return

print("[INFO] Downloading DeepLenseSim dataset...")
urllib.request.urlretrieve(ZIP_URL, ZIP_NAME)

print("[INFO] Extracting archive...")
with zipfile.ZipFile(ZIP_NAME, "r") as zip_ref:
zip_ref.extractall()

src = os.path.join(EXTRACTED_DIR, "Model_I")
if not os.path.exists(src):
raise RuntimeError("Model_I not found in DeepLenseSim archive")

shutil.move(src, TARGET_DIR)

# Cleanup
shutil.rmtree(EXTRACTED_DIR)
os.remove(ZIP_NAME)

print("[SUCCESS] Model_I dataset setup complete.")

if __name__ == "__main__":
setup_data()