skills/cv/rgby-4channel-fluorescence-loader/SKILL.md
Load fluorescence microscopy images stored as 4 separate single-channel PNGs (red microtubules, green target protein, blue nucleus, yellow ER) into a single HxWx4 tensor, preserving the biological semantics of each channel rather than collapsing to RGB
npx skillsauth add wenmin-wu/ds-skills cv-rgby-4channel-fluorescence-loaderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fluorescence microscopy datasets like the Human Protein Atlas store one PNG per dye filter — <id>_red.png, _green.png, _blue.png, _yellow.png — because the channels carry independent biological signals (target protein, microtubules, nucleus, endoplasmic reticulum). Treating them as RGB throws away one channel and confuses the model with averaged colors. The right loader stacks all four into a single [H, W, 4] tensor and feeds it directly into a 4-channel network (see channel-extension techniques for adapting ImageNet pretrained models). The same pattern applies to satellite imagery (RGB+NIR), medical multi-modal scans, and any dataset where filter channels are stored separately.
import numpy as np
from skimage.io import imread
def load_rgby(basepath, image_id, size=512):
img = np.zeros((size, size, 4), dtype=np.float32)
img[:,:,0] = imread(f'{basepath}{image_id}_red.png') # microtubules
img[:,:,1] = imread(f'{basepath}{image_id}_green.png') # target protein
img[:,:,2] = imread(f'{basepath}{image_id}_blue.png') # nucleus
img[:,:,3] = imread(f'{basepath}{image_id}_yellow.png') # endoplasmic reticulum
return img / 255.0
H,W,C; first axis for PyTorch C,H,W: align with framework convention up front to avoid silent transposes.data-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF