
Claude Skills by wenmin-wu
github.com/wenmin-wuDecodes MRI scan plane (axial, coronal, sagittal) from DICOM ImageOrientationPatient direction cosine vectors.
Read DICOM X-ray files with VOI LUT transformation and MONOCHROME1 inversion for correct pixel intensity rendering
Use a soft macro-F1 loss `1 − mean(2·tp / (2·tp + fp + fn))` computed from raw sigmoid probabilities (no thresholding) as a direct training objective for multi-label classification, optionally combined with BCE — closes the gap between training surrogate and the F1 metric the leaderboard scores
Recover (x, y, class) point labels from color-coded dot-annotation image pairs via absdiff + blackout masking + Laplacian-of-Gaussian blob detection + center-pixel RGB classification
Reshape dual-view stacked channels into doubled batch dimension for shared backbone, then concatenate with tabular features for classification
Load EfficientDet pretrained on COCO with the original 90-class head, then swap in a fresh HeadNet with your own num_classes — keeps the BiFPN feature pyramid pretrained and only retrains the classification head, the canonical transfer-learning recipe for the effdet PyTorch port
Tracks an Exponential Moving Average of model weights during training and evaluates both live and EMA models for more stable predictions.
GPU-accelerated k-NN regression on CLIP image embeddings using cosine distance and inverse-distance-power weighting to predict target embedding vectors
Collect test predictions each epoch via callback and combine with exponentially increasing weights favoring later epochs
Aggregate per-slice predictions into exam-level labels that satisfy a competition's mutual-exclusion hierarchy (positive vs negative vs indeterminate), using a top-down rule cascade — first decide the exam class, then conditionally rescale the dependent labels so the submission stays internally consistent
Pad variable-length per-slice sequences to a fixed batch length, carry a 0/1 mask alongside, and multiply per-slice BCE by the mask before reducing — gives correct per-exam loss with batched training and zero contamination from padding tokens
Models multiple conditions with a single flat output layer of N_labels × N_classes logits, sliced into per-condition softmax at inference.
Alpha-weighted focal loss that down-weights easy examples to focus training on hard, misclassified pixels in imbalanced segmentation tasks.
Encode motion and velocity by computing per-channel pixel differences between consecutive frames instead of stacking raw frames for RL visual observations
Average per-frame sigmoid predictions across sampled video frames to produce a stable video-level classification probability
Unfreezes backbone layers for fine-tuning while keeping BatchNorm layers frozen to preserve pretrained running statistics.
Generates 3D segmentation training targets by placing Gaussian spheres at annotated point coordinates.
Replaces global average pooling with Generalized Mean (GeM) pooling, using a learnable or fixed exponent to emphasize high-activation regions.
Clean noisy numeric strings from generative model output by removing invalid characters, fixing malformed floats, and handling multiple decimal points
Accumulates gradients over multiple mini-batches before stepping the optimizer, simulating larger effective batch sizes.
Resolve overlapping instance masks by greedily assigning contested pixels to higher-confidence predictions using a running occupancy map
Overlay real hair PNGs (masked via threshold) onto dermoscopy images to simulate body-hair occlusion as a domain-specific augmentation
Comprehensive albumentations augmentation combining geometric, photometric, noise, blur, and cutout transforms for robust CV training.
Inverts whole slide image pixel values (1 - x) so white background becomes zero, enabling standard zero-padding and making tissue regions the active signal.
Apply radiological windowing to HU images — clamp to center/width range for tissue-specific visualization (lung, bone, soft tissue)
Evaluates 3D object detection by matching predicted and ground-truth coordinates via the Hungarian algorithm, then computing F-beta score.
Grid search binarization thresholds on validation predictions to find the cutoff that maximizes mean IoU
Evaluation scorer that merges predictions with GT per frame, takes top-IoU match per GT, and computes weighted accuracy with IoU threshold gate
Resize images preserving aspect ratio then zero-pad to a square to avoid distortion artifacts in face crops or object detection inputs
Resample 3D CT volumes to uniform voxel spacing using scipy zoom, normalizing physical dimensions across scanners
Use albumentations keypoint_params to jointly augment BEV rasters and trajectory target points so the spatial transform stays consistent
Average predictions from K independently trained fold models at inference time for variance reduction without stacking complexity
Extract an image's dominant RGB color via k-means over pixel-color space and emit three dense features capturing the modal color of the subject
KNN-based retrieval with grid-searched distance threshold to convert embedding neighbors into match predictions
Use linear assignment problem (LAP/lapjv) on a score matrix to select globally optimal hard-negative pairs for metric learning
Score image sharpness with the variance of the Laplacian (Pech-Pacheco) as a single scalar feature for downstream tabular models or as a hard blur filter
Disable horizontal-flip augmentation (both train-time and TTA) when label columns encode left/right anatomy — flipping silently corrupts the targets because "Left ICA" must map to "Right ICA" after a flip, not stay as "Left ICA"
Trainable nonlinear distance metric that transforms (v1-v2) and (v1-v2)^2 through a linear layer before computing squared norm
Evaluates image-to-sequence models using mean Levenshtein edit distance between predicted and ground-truth strings.
Subtracts a Gaussian-blurred version of the image from itself to normalize local illumination and enhance fine structural details.
Lovasz hinge loss that directly optimizes IoU for binary segmentation by computing a convex surrogate via sorted prediction errors and cumulative Jaccard gradients.
Compute mean Average Precision by sweeping IoU thresholds from 0.5 to 0.95 on RLE-encoded instance masks using pycocotools
Convert binary segmentation masks to Shapely MultiPolygons using cv2 contour hierarchy to correctly handle interior holes, with Douglas-Peucker simplification
Inject scalar metadata (depth, position, clinical features) into U-Net bottleneck via RepeatVector and Reshape for metadata-aware segmentation
Mask the corners of a dermoscopy image with a random-radius black circle to mimic the dark vignette of a dermatoscope field of view
Compress a 3D medical volume into a 3-channel 2D image by stacking the middle slice, the max-intensity projection across depth, and the per-pixel std across depth — a poor-man's volumetric encoding that lets any pretrained 3-channel 2D CNN ingest a whole series in a single forward pass
Removes predicted segmentation masks below a per-class minimum pixel area threshold to eliminate small false positive regions at inference time.
Uses PyTorch AMP autocast and GradScaler for FP16 training, halving memory usage and speeding up training on modern GPUs.
Combines mixup augmentation (linear interpolation of image pairs and their labels) with label smoothing in a single training pipeline for regularization.
Route each DICOM series to a per-modality window-center / window-width pair (CT/CTA/MRA/MRI) before normalization, so the same model can ingest mixed modalities without one modality's intensity range washing out the others