
Claude Skills by wenmin-wu
github.com/wenmin-wuSegment lung regions from CT using HU thresholding, connected-component labeling, and morphological opening
Merges overlapping same-class bounding boxes from multiple annotators into a consensus box using IoU-based matching and intersection.
Combine EfficientNetB0..B6 into one Keras model with a shared image input and one sigmoid head per backbone, training all N models in a single fit() call on TPU
Generate count-regression training patches at a geometric pyramid of image scales (0.9^k) so one CNN handles within- and between-image object-size variation without explicit anchors
Stacks uniformly sampled slices from multiple MRI series (e.g., Sagittal T1, T2, Axial) into a single multi-channel tensor for one-pass inference.
Stack multiple CT window settings (brain, subdural, bone) as separate RGB channels for CNN input
Composites multi-channel imagery (microscopy, satellite) into 3-channel RGB for pretrained CNN backbones.
Computes per-class ROC-AUC then macro-averages for multi-label classification evaluation and model selection.
For multi-label classification, compute the per-class binary correlation matrix restricted to multi-label rows and the conditional class counts given a rare anchor class — reveals label groupings the model can exploit (shared classifier heads, hierarchical loss weighting, post-hoc consistency rules)
Oversample multi-label images by giving each image a duplication multiplier equal to the max per-class multiplier among its labels, so every rare class gets repetition without exploding common-class counts — the standard fix for long-tail multi-label distributions where SMOTE / per-row oversampling doesn't apply
Combine match predictions from image embeddings, text similarity, and perceptual hash via set union for maximum recall
UNet++ dense cross-depth skip connections that propagate deeper decoder features into all shallower decoder levels
Auto-detect whether a generated data series is numeric or categorical by measuring the fraction of digit characters in the concatenated values
Assign an unknown/novel class when all nearest-neighbor distances exceed a tuned cutoff threshold for open-set recognition
Uses Nelder-Mead optimization to find per-class decision thresholds that maximize Quadratic Weighted Kappa for regression-to-ordinal conversion.
Encodes ordinal classes as cumulative binary labels (class N activates labels 0..N), enabling sigmoid + BCE training for ordinal regression.
Uses pack_padded_sequence to exclude padding tokens from cross-entropy loss in variable-length sequence generation.
Compute Euclidean distance between entity pairs from tracking data and filter out pairs beyond a threshold to reduce inference candidates
Double left-join on tracking data to create pairwise features (positions, velocities, distance) for both entities in an interaction pair
Tile a large aerial image into fixed-size patches, accumulate per-class point-annotation counts into a grid tensor aligned with the tiles, and train a small CNN to regress per-class object counts per patch under MSE
Stratifies CV folds at the patient level rather than image level, preventing data leakage when multiple images exist per patient.
Apply class-specific confidence thresholds by inferring the dominant class per image and indexing into a per-class threshold array
Optimize per-class decision thresholds for macro-F1 by replacing the non-differentiable hard threshold with a sigmoid-sharpened soft-F1 surrogate and fitting the per-class threshold vector via least-squares — averaged over multiple random validation splits to suppress overfitting on rare classes
Fit a per-label probability calibrator on out-of-fold scores using Platt scaling (logistic regression on raw scores) and fall back to isotonic regression for labels where the logistic doesn't converge — pickle the dict of fitted calibrators and apply at inference for a small but free leaderboard lift on multi-label classification
Train separate models per imaging modality (FLAIR/T1w/T1wCE/T2w) and average their predictions for final ensemble
Trains one specialized model per imaging modality or series type, routing inputs by metadata at inference for modality-specific feature learning.
Single CNN backbone with one shallow Dense neck per organ and mixed sigmoid (binary) + softmax (multi-class severity) heads, trained with a dict of losses so each organ is calibrated independently while sharing visual features
Aggregate per-slice CNN predictions into a single patient-level injury score by mean-pooling across TTA copies first, then max-pooling across slices — the worst-slice wins, which matches the medical reality that one bad slice is enough to grade the patient
Normalize high-dynamic-range satellite or medical imagery to [0,1] using per-channel percentile clipping to suppress outliers while preserving relative contrast
Grid-searches the optimal classification threshold to maximize probabilistic F-beta score on validation predictions.
Group near-duplicate images by perceptual hash (pHash) as a zero-cost baseline signal for product or image matching
Convert (x, y, class) point annotations into a CNN classification training set by cropping fixed-size square patches centered on each point, using a numpy shape check to silently reject border-clipped crops
Stitch overlapping tile predictions into a full-resolution output by accumulating probabilities and dividing by per-pixel overlap counts
Apply lower dropout in shallow/final U-Net layers and higher dropout in deep layers to preserve spatial detail while regularizing abstract features
Custom training callback that computes Quadratic Weighted Kappa on validation data each epoch and checkpoints the best model.
Samples a fixed number of slices from variable-length CT/MRI stacks using quantile indexing to produce consistent input depth.
Sets the binary classification threshold as a prediction quantile matching the expected positive prevalence rate, avoiding manual threshold tuning.
Extract dense per-pixel motion fields between consecutive video frames using a pretrained RAFT model, producing an HxWx2 flow tensor that can be channel-stacked with RGB or used as a standalone motion feature for action / impact / event detection
Converts a raster image to a size-bounded SVG via K-means color quantization, contour extraction, importance-ranked polygon assembly, and progressive simplification.
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
Encodes binary segmentation masks into compressed RLE format for efficient storage and submission.
Brute-force a 2D rotation angle over a coarse grid to align field-coordinate points with image-plane detections when the camera angle is unknown
Test-time augmentation via 4 rotation angles (0/90/180/270), applying inverse rotation to each prediction before averaging
Uses Facebook's semi-weakly supervised ImageNet-pretrained models (trained on 940M unlabeled images) as CNN backbones for stronger transfer learning than standard supervised pretraining.
Encode text prompts into fixed-length dense vectors using SentenceTransformer for cosine-similarity evaluation in image-to-text retrieval tasks
2D CNN with asymmetric kernels — temporal convolutions (Nx1) then spectral convolutions (1xM) — to decouple time and feature extraction
Track dice score separately for positive (mask-present) and negative (empty-mask) images to avoid division distortion
Siamese network head that compares two embeddings via element-wise multiply, add, abs-diff, and squared-diff features for verification tasks
Sigmoid-transformed normalized RMSE that maps error from [0,inf) to a bounded (0,1] similarity score using R2-score ratio
Resample a 3D medical volume to a fixed depth N (e.g. 32) and feed the N slices as input *channels* to a 2D CNN with `in_chans=N` instead of using a 3D conv backbone — gets the volumetric context for a fraction of the memory and lets you use any timm 2D pretrained model