Add cell-phenotype MoA (channel-dropout multiplex) competition pipeline - #1
Open
aurascoper wants to merge 3 commits into
Open
Add cell-phenotype MoA (channel-dropout multiplex) competition pipeline#1aurascoper wants to merge 3 commits into
aurascoper wants to merge 3 commits into
Conversation
From-scratch pipeline for the 12-class mechanism-of-action classification
competition (Cell-Painting panels, public.zip). Mirrors the Eris A10G +
offline Kaggle-kernel harness pattern.
Design grounded in measured data facts (all 432 images verified):
- exactly one panel pre-masked to (0,0,0) per image, train == test dist
=> panel dropout is OFF; slot-preserving within-panel aug only
- single-compound "thin" classes = moa_02/05/09 -> indices [2,5,9], with
config.verify_against_data() re-checking the mapping against the CSV
- single-marker panels (RGB corr >=0.998) => channel-agnostic path can
reduce each surviving panel to one channel
Corrected calibration/CV vs. the earlier blueprint:
- sign-independent probability-space thin-shrink (not logit division)
- BALD mutual-information ensemble disagreement (not entropy of mean)
- compound-grouped CV pins thin compounds into every train fold (no thin
OOF); thin_shrink calibrated by LOCO on 2-compound classes as a lower bound
Backbone: frozen ImageNet convnext_tiny probe (disqualification-proof
default; OOF dense logloss 1.463 vs uniform 2.485). OpenPhenom-S/16 (CA-MAE)
wired as a license-gated drop-in behind CPM_LICENSE_OK.
Includes: src/{config,preprocess,dataset,cv,models,losses,train,calibrate,
infer}.py, data-contract tests, offline/train Kaggle notebooks + metadata,
upload_kaggle_dataset.py, setup_eris.sh, approach.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…docs Correct the submission harness: Eris/Shipd runs a self-contained solution.ipynb (reads ./dataset/public/, writes ./working/submission.csv, Kaggle-Docker libs only, <30 min on A10G) — NOT a Kaggle kernel. Remove the mis-analogized Kaggle scaffolding. - solution.ipynb: torchvision convnext_small frozen probe + MLP head, compound-grouped CV (thin compounds pinned, no thin OOF), temperature + sign-correct thin-shrink + BALD blend, rubric-narrated markdown. Validated end-to-end via nbconvert on a staged ./dataset/public layout: dense-OOF logloss 1.366 vs uniform 2.485 (macro-F1 0.495), valid 144-row submission, ~80s on CPU. Defensive weight load (pretrained -> fallback). - src/models.py: add imagenet_convnext_small/base to the registry (small won the compound-blind OOF sweep: 1.316 timm / 1.366 torchvision, vs tiny 1.463, base 1.344). - Remove notebooks/kaggle_*.ipynb, kernel-metadata-*.json, upload_kaggle_dataset.py. - Fix .gitignore (inline comments are not valid gitignore syntax -> data/weights were not actually being ignored). - Rewrite README.md + CLAUDE.md for the CPM task (were stale RNA docs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…iew/craft-review) Replace the markdown approach doc with flowing prose: plain-text section labels (no # headers), no bold/asterisks, no backticks, no em/en dashes, no AI-style headers. Passes the prose-craft pcr pre-screener with zero hard fails; prose-review advisories (contrastive-clarification tic, back-half block uniformity, declarative dominance, conclusion symmetry) applied; craft dimensions (named concepts, central- point dwelling on compound confounding, aphoristic close) satisfied. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A from-scratch pipeline for the 12-class mechanism-of-action (MoA) classification competition (Cell-Painting panels,
public.zip), mirroring the Eris A10G + offline Kaggle-kernel harness pattern. Adds a self-containedsrc/package; leaves existing RNA files untouched.Why it's shaped this way — measured, not assumed
Every design decision is grounded in facts verified across all 432 images (see
approach.md):(0,0,0)per image, train ≡ test distribution[2,5,9]config.verify_against_data()re-checks the mapping against the CSV so it can't silently desync (the earlier blueprint's off-by-one)Corrected vs. the earlier blueprint
logits/=T, which raised thin prob on non-thin images)thin_shrinkcalibrated by LOCO on the 2-compound classes as a lower boundBackbone
Frozen ImageNet
convnext_tinyprobe as the disqualification-proof default (OOF dense logloss 1.463 vs uniform 2.485). OpenPhenom-S/16 (CA-MAE, channel-agnostic — verified against arXiv:2404.10242) wired as a license-gated drop-in behindCPM_LICENSE_OK, pending a read of the competition's weight-license clauses.Verification
tests/test_cpm_pipeline.py): mask one-hot matches actual black pixels, aug is slot-preserving, CV coveragedense=216/216, thin=0/72submission.csv(144 rows, 12 cols, sums to 1)upload_kaggle_dataset.pyincludedNot included (by design / .gitignore)
Extracted data, backbone weights, trained heads, and regenerated
calib_*.json/metrics_*.json— all reconstructable viasetup_eris.sh→preprocess→train→calibrate.🤖 Generated with Claude Code