Skip to content

Commit a290f77

Browse files
committed
add vis to docs
1 parent 92c985f commit a290f77

11 files changed

Lines changed: 69 additions & 19 deletions

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ python data/pybbbc_loader.py
7272

7373
## Usage
7474

75+
### Notebooks
76+
77+
For a very convenient way to check out our data, results and also training your own model, we created some Notebooks. you can find them in the notebooks folder. Else, you can just use the scripts that are described below:
78+
7579
### Training Models
7680

7781
**Train vanilla SimCLR:**
102 KB
Loading
778 KB
Loading
322 KB
Loading
577 KB
Loading

docs/source/api/evaluation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
## Visualization
2929

3030
```{eval-rst}
31-
.. automodule:: evaluation.visualize_embeddings
31+
.. automodule:: evaluation.visualization.visualize_embeddings
3232
:members:
3333
:undoc-members:
3434
:show-inheritance:
35-
```
35+
```

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# -- Options for HTML output -------------------------------------------------
3131

3232
html_theme = "sphinx_book_theme"
33-
# html_static_path = ["_static"] # Commented out - no custom static files needed
33+
html_static_path = ["_static"]
3434

3535
# Sphinx Book Theme options
3636
html_theme_options = {

docs/source/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ api/index
2121
:maxdepth: 2
2222
:caption: Research:
2323
24-
experiments
24+
results
2525
```
2626

2727
```{toctree}

docs/source/results.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Results
2+
3+
This section documents experimental results and analysis for compound profiling using different self-supervised learning approaches.
4+
5+
## Model Performance Comparison
6+
7+
The following plot shows the accuracy comparison between different models using cosine similarity as the distance metric:
8+
9+
![Accuracy comparison using cosine similarity](_static/plots/accuracy_comparison_cosine.png)
10+
11+
## Confusion Matrices
12+
13+
Detailed confusion matrices for model evaluation. We show how treatments of each MOA are classified:
14+
15+
![Confusion matrices with cosine similarity](_static/plots/confusion_matrices_cosine.png)
16+
17+
## Similarity Analysis
18+
19+
We compare similarity stats between same and different MOAs here:
20+
21+
![Similarity comparison between models](_static/plots/similarity_comparison.png)
22+
23+
## Dimensionality Reduction Visualization
24+
25+
t-SNE visualization comparing treatment embeddings from different models (Base ResNet, SimCLR variants, and WS-DINO):
26+
27+
![t-SNE comparison of model embeddings](_static/plots/tsne_comparison_base_resnet_simclr_vanilla_ws_neg_simclr_vanilla_simclr_ws_collapsed.png)

evaluation/visualization/model_comparison.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
from sklearn.metrics.pairwise import cosine_similarity
1616
import pandas as pd
1717
from collections import defaultdict
18+
from sklearn.neighbors import NearestNeighbors
19+
import math
1820

1921
# Add parent directory to path to import evaluator
2022
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -125,13 +127,13 @@ def plot_confusion_matrices(model_names, data_root="/scratch/cv-course2025/group
125127
output_dir (str): Directory to save plots
126128
distance_measure (str): Distance measure for evaluation
127129
"""
128-
from sklearn.neighbors import NearestNeighbors
129-
130+
130131
n_models = len(model_names)
131-
fig, axes = plt.subplots(1, n_models, figsize=(6 * n_models, 5))
132-
if n_models == 1:
133-
axes = [axes]
134-
132+
n_cols = 2
133+
n_rows = math.ceil(n_models / n_cols)
134+
fig, axes = plt.subplots(n_rows, n_cols, figsize=(6 * n_cols, 5 * n_rows))
135+
axes = axes.flatten() # Flatten in case of single row
136+
135137
for i, model_name in enumerate(model_names):
136138
try:
137139
print(f"Creating confusion matrix for {model_name}...")
@@ -187,7 +189,11 @@ def plot_confusion_matrices(model_names, data_root="/scratch/cv-course2025/group
187189
ax.text(0.5, 0.5, f'Error: {str(e)}', transform=ax.transAxes,
188190
ha='center', va='center', fontsize=12)
189191
ax.set_title(f'{model_name} - Error')
190-
192+
193+
# Hide any unused subplots
194+
for j in range(len(model_names), len(axes)):
195+
fig.delaxes(axes[j])
196+
191197
plt.suptitle(f'Confusion Matrices ({distance_measure} distance)', fontsize=16, fontweight='bold')
192198
plt.tight_layout()
193199

0 commit comments

Comments
 (0)