{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.11.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":10338,"databundleVersionId":862042,"isSourceIdPinned":false,"sourceType":"competition"},{"sourceId":18613,"sourceType":"datasetVersion","datasetId":5839},{"sourceId":2542390,"sourceType":"datasetVersion","datasetId":1541666},{"sourceId":3623950,"sourceType":"datasetVersion","datasetId":2140405}],"dockerImageVersionId":31153,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"#Setup & Environment\n!pip install torch torchvision timm albumentations monai nibabel SimpleITK scikit-learn matplotlib tqdm wandb\n!pip install --quiet torch torchvision --index-url https://download.pytorch.org/whl/cu118\n","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2025-11-01T15:24:19.312102Z","iopub.execute_input":"2025-11-01T15:24:19.314727Z","iopub.status.idle":"2025-11-01T15:24:28.483609Z","shell.execute_reply.started":"2025-11-01T15:24:19.314677Z","shell.execute_reply":"2025-11-01T15:24:28.482184Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Imports Packages\nimport os, sys, math, random, time, json\nfrom pathlib import Path\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom tqdm.notebook import tqdm\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader, random_split\nimport torchvision\nfrom torchvision import transforms, models\nimport timm\n\nimport albumentations as A\nfrom albumentations.pytorch import ToTensorV2\n\nimport imageio, nibabel as nib, cv2\nfrom sklearn.metrics import roc_auc_score, accuracy_score, f1_score, precision_score, recall_score\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-11-01T15:25:25.644609Z","iopub.execute_input":"2025-11-01T15:25:25.644995Z","iopub.status.idle":"2025-11-01T15:25:42.390804Z","shell.execute_reply.started":"2025-11-01T15:25:25.644964Z","shell.execute_reply":"2025-11-01T15:25:42.389428Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pip install --upgrade --force-reinstall albumentations","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-11-01T15:35:31.61163Z","iopub.execute_input":"2025-11-01T15:35:31.612006Z","iopub.status.idle":"2025-11-01T15:36:25.579198Z","shell.execute_reply.started":"2025-11-01T15:35:31.611981Z","shell.execute_reply":"2025-11-01T15:36:25.577908Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pip install --upgrade --force-reinstall \"numpy==1.26.4\" \"scipy==1.10.1\" \"albumentations==1.3.1\"\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-11-01T15:39:40.21498Z","iopub.execute_input":"2025-11-01T15:39:40.215354Z","iopub.status.idle":"2025-11-01T15:40:17.227963Z","shell.execute_reply.started":"2025-11-01T15:39:40.215311Z","shell.execute_reply":"2025-11-01T15:40:17.226764Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import numpy, scipy, albumentations\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-11-01T15:42:01.785871Z","iopub.execute_input":"2025-11-01T15:42:01.786198Z","iopub.status.idle":"2025-11-01T15:42:02.276156Z","shell.execute_reply.started":"2025-11-01T15:42:01.786176Z","shell.execute_reply":"2025-11-01T15:42:02.274682Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Dataset Preparation","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# DataLoader + Augmentations","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# SSL Model Definition","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# SSL Training Loop (SimCLR)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Fine-Tuning (Classification)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Fine-Tuning (Segmentation)","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Evaluation & Visualization","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Save Results + Export Models","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}