<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>baselines on Alán's blog</title><link>https://quasimorphic.com/tags/baselines/</link><description>Recent content in baselines on Alán's blog</description><generator>Hugo</generator><language>en-uk</language><lastBuildDate>Sat, 28 Nov 2026 16:11:00 -0500</lastBuildDate><atom:link href="https://quasimorphic.com/tags/baselines/index.xml" rel="self" type="application/rss+xml"/><item><title>A Compression Baseline for Image-Based Profiling</title><link>https://quasimorphic.com/archive/compression-baseline-image-profiling/</link><pubDate>Sat, 28 Nov 2026 16:11:00 -0500</pubDate><guid>https://quasimorphic.com/archive/compression-baseline-image-profiling/</guid><description>&lt;p>Recently I&amp;rsquo;ve been exploring the connection between data compression and deep learning, inspired by a blog post showing how &lt;a href="https://nathan.rs/posts/gzip-lm/">gzip can be used as a language model&lt;/a>. That got me wondering what a compressor could tell us about microscopy images.&lt;/p>
&lt;p>In our recent &lt;a href="https://arxiv.org/pdf/2608.07632">work&lt;/a>, we compared ways to turn microscopy images into embeddings. We used two simple baselines to ask whether the models were learning something beyond basic image features. The first was cell count, which a colleague showed can help &lt;a href="https://www.nature.com/articles/s41467-026-68725-5">predict outcomes in some assays&lt;/a>. The second was a randomly initialised vision transformer, which extracts features without training.&lt;/p>
&lt;p>Cell count requires segmentation. Can a fast, segmentation-free descriptor beat cell count on JUMP-lite?&lt;/p>
&lt;p>I reused the JPEG-XL codec from my JUMP-lite work. The Cell Painting images have five fluorescence channels highlighting different cellular structures. When neighbouring pixels make a pixel easy to predict, the codec can usually encode it with fewer bits. I divide the encoded size in bits by the number of pixels to get bits per pixel (bpp).&lt;/p>
&lt;p>For the benchmark I drop the four least significant bits before encoding. JPEG-XL runs in lossless mode on those values, with the encoder set to effort 1. Unlike cell count, bpp doesn&amp;rsquo;t require segmentation.&lt;/p>
&lt;figure>&lt;img src="https://quasimorphic.com/images/compression-baseline-example-images.png"
 alt="Figure 1: JPEG-XL bits per pixel for three microscopy images." width="100%">&lt;figcaption>
 &lt;p>&lt;span class="figure-number">Figure 1: &lt;/span>JPEG-XL bits per pixel for three microscopy images.&lt;/p>
 &lt;/figcaption>
&lt;/figure>

&lt;p>The cell-rich examples are harder to compress than the background example. But needing more bits doesn&amp;rsquo;t necessarily mean an image contains more biological signal. To see what bpp tracks, I compared it with cell count and intensity across JUMP-lite wells.&lt;/p>
&lt;div class="table-caption">
 &lt;span class="table-number">Table 1:&lt;/span>
 Spearman correlations with summed bpp.
&lt;/div>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Metric&lt;/th>
 &lt;th>Within plate (median)&lt;/th>
 &lt;th>Pooled (raw)&lt;/th>
 &lt;th>Pooled (DMSO z-score)&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>cell count&lt;/td>
 &lt;td>0.65&lt;/td>
 &lt;td>-0.29&lt;/td>
 &lt;td>0.59&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>intensity&lt;/td>
 &lt;td>0.99&lt;/td>
 &lt;td>0.89&lt;/td>
 &lt;td>0.98&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>I sum bpp across the five channels and average their log-transformed mean intensities.&lt;/p>
&lt;p>Cell count correlates positively with bpp on a typical plate, but the sign flips when I pool wells without standardising (reminds me of &lt;a href="https://en.wikipedia.org/wiki/Simpson%27s_paradox">Simpson&amp;rsquo;s paradox&lt;/a>). It turns positive again when I z-score the extracted well-level features (bpp, cell count and intensity) against DMSO control wells on each plate before pooling. The z-score is applied to the features. Intensity tracks bpp more closely in all three comparisons, which makes it an important baseline in its own right.&lt;/p>
&lt;p>I use our &lt;a href="https://www.nature.com/articles/s41467-025-60306-2">mAP framework&lt;/a> to measure phenotypic activity (PA) and phenotypic consistency (PC). Activity asks whether a profile retrieves replicates of the same perturbation over negative controls. Consistency asks whether different perturbations with the same annotated target retrieve one another. I report mean normalised average precision (nAP) for both tasks; higher is better.&lt;/p>
&lt;p>Borrowing from &lt;em>Anna Karenina&lt;/em>: do families made unhappy in the same way resemble one another more than they resemble happy families? That&amp;rsquo;s activity. Consistency takes the analogy a step further: if two families are unhappy for the same reason, do they resemble one another even if they got there in different ways?&lt;/p>
&lt;p>First, let&amp;rsquo;s quantify how much signal we capture from each of the baselines, as well as what happens if we correct for cell count, or cell count and intensity:&lt;/p>
&lt;div class="table-caption">
 &lt;span class="table-number">Table 2:&lt;/span>
 JUMP-lite retrieval: simple baselines.
&lt;/div>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Baseline (#features)&lt;/th>
 &lt;th>Activity&lt;/th>
 &lt;th>Consistency&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>random&lt;/td>
 &lt;td>-0.056&lt;/td>
 &lt;td>-0.001&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>cell count (2)&lt;/td>
 &lt;td>0.220&lt;/td>
 &lt;td>0.011&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>mean intensity (5)&lt;/td>
 &lt;td>0.296&lt;/td>
 &lt;td>0.012&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>bits/px (5)&lt;/td>
 &lt;td>0.291&lt;/td>
 &lt;td>0.013&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>bits/px − cell count (5)&lt;/td>
 &lt;td>0.248&lt;/td>
 &lt;td>0.008&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>bits/px − cell count − intensity (5)&lt;/td>
 &lt;td>0.104&lt;/td>
 &lt;td>0.005&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>I report the best normalisation for each baseline. Intensity and bpp use one feature per channel; Cellpose-SAM supplies the nuclei and cell counts.&lt;/p>
&lt;p>The random baseline here uses random vectors. Mean intensity and bpp both beat cell count on activity, but all three score similarly on consistency. Beating cell count alone doesn&amp;rsquo;t rule out a model relying on simple cues like brightness or compressibility.&lt;/p>
&lt;p>Since bpp is quick to calculate on a CPU, can we get more out of it than one number per channel? I combined three sets of features:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Multiscale bpp (20):&lt;/strong> Encode the whole image in each channel at full, half, quarter and eighth resolution.&lt;/li>
&lt;li>&lt;strong>Cross-channel residual bpp (20):&lt;/strong> At half resolution, predict one channel from another with a linear fit and encode what&amp;rsquo;s left over. Each ordered pair gives one feature.&lt;/li>
&lt;li>&lt;strong>Tile bpp statistics (25):&lt;/strong> At full resolution, compute bpp for non-overlapping 128×128 tiles. For each channel, take the mean, standard deviation and 10th, 50th and 90th percentiles across tiles.&lt;/li>
&lt;/ul>
&lt;p>For comparison, I include MorphEM and &lt;code>cp_measure&lt;/code>, which computes CellProfiler-style features. MorphEM was the best-performing learned model in &lt;a href="https://arxiv.org/html/2608.07632v3#S3.SS4">JUMP-lite&lt;/a>, and it ranked alongside the paper&amp;rsquo;s CellProfiler reference at the top of the comparison on uncompressed images.&lt;/p>
&lt;div class="table-caption">
 &lt;span class="table-number">Table 3:&lt;/span>
 JUMP-lite retrieval and runtime.
&lt;/div>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Profile (#features)&lt;/th>
 &lt;th>Activity&lt;/th>
 &lt;th>Consistency&lt;/th>
 &lt;th>CPU&lt;/th>
 &lt;th>CPU Numba&lt;/th>
 &lt;th>GPU&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>cell count (2)&lt;/td>
 &lt;td>0.220&lt;/td>
 &lt;td>0.011&lt;/td>
 &lt;td>seg&lt;/td>
 &lt;td>-&lt;/td>
 &lt;td>seg&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>mean intensity (5)&lt;/td>
 &lt;td>0.296&lt;/td>
 &lt;td>0.012&lt;/td>
 &lt;td>2.0&lt;/td>
 &lt;td>0.31&lt;/td>
 &lt;td>0.029&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>compression profile (65)&lt;/td>
 &lt;td>0.304&lt;/td>
 &lt;td>0.019&lt;/td>
 &lt;td>115&lt;/td>
 &lt;td>31&lt;/td>
 &lt;td>4.9&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>profile + intensity (70)&lt;/td>
 &lt;td>0.327&lt;/td>
 &lt;td>0.022&lt;/td>
 &lt;td>117&lt;/td>
 &lt;td>31.5&lt;/td>
 &lt;td>4.9&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>profile + intensity + cell count (72)&lt;/td>
 &lt;td>0.335&lt;/td>
 &lt;td>0.022&lt;/td>
 &lt;td>117 + seg&lt;/td>
 &lt;td>31.5 + seg&lt;/td>
 &lt;td>4.9 + seg&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://github.com/afermg/cp_measure">&lt;code>cp_measure&lt;/code>&lt;/a>&lt;/td>
 &lt;td>0.570&lt;/td>
 &lt;td>0.049&lt;/td>
 &lt;td>20,500 + seg&lt;/td>
 &lt;td>2,200 + seg&lt;/td>
 &lt;td>-&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;a href="https://huggingface.co/CaicedoLab/MorphEm">MorphEM&lt;/a>&lt;/td>
 &lt;td>0.547&lt;/td>
 &lt;td>0.053&lt;/td>
 &lt;td>-&lt;/td>
 &lt;td>-&lt;/td>
 &lt;td>25&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>Times are in ms/site. For compression features, CPU uses the JPEG-XL encoder on one core; CPU Numba and GPU estimate bpp on one core and one H100, respectively. &amp;ldquo;seg&amp;rdquo; adds Cellpose-SAM segmentation (about 127 s/site on 16 CPU threads or 2.1 s/site on one H100).&lt;/p>
&lt;p>See &lt;a href="https://arxiv.org/html/2608.07632v3#A1.SS6.SSS5">here&lt;/a> for details on how profiles are processed.&lt;/p>
&lt;p>The compression-plus-intensity profile beats cell count on both tasks without segmentation. With the same normalisation and TVN settings, adding cell count raises activity nAP from 0.327 to 0.335; consistency stays at 0.022 to three decimal places.&lt;/p>
&lt;p>I used JPEG-XL, but a different codec might pick up different image features. I found this &lt;a href="https://fsja.univagora.ro/jour/index.php/ijccc/article/view/7478">example&lt;/a> of researchers using multiscale compression alongside a learned representation. The question I&amp;rsquo;d like to test next: Does compressibility still add signal when we use single cells?&lt;/p>
&lt;h2 id="takeaways">Takeaways&lt;/h2>
&lt;ul>
&lt;li>On JUMP-lite, a profile built from brightness and compressibility gives learned profiles a stronger baseline to beat.&lt;/li>
&lt;li>The profile runs on a CPU and needs neither segmentation nor a learned encoder.&lt;/li>
&lt;li>I packaged the descriptors in &lt;a href="https://github.com/afermg/mide">Mide&lt;/a>, available on &lt;a href="https://pypi.org/project/mide/">PyPI&lt;/a>.&lt;/li>
&lt;/ul></description></item>/</channel></rss>