skills/cv/metadata-injection-bottleneck/SKILL.md
Inject scalar metadata (depth, position, clinical features) into U-Net bottleneck via RepeatVector and Reshape for metadata-aware segmentation
npx skillsauth add wenmin-wu/ds-skills cv-metadata-injection-bottleneckInstall 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.
Segmentation models typically only see pixel data, but scalar metadata (depth, acquisition parameters, patient age) can improve predictions. Inject metadata at the U-Net bottleneck by repeating the feature vector to match spatial dimensions, reshaping, and concatenating with the deepest feature map. This lets the decoder condition on metadata without polluting the encoder's spatial feature extraction.
from keras.layers import *
from keras.models import Model
input_img = Input((128, 128, 1), name='img')
input_meta = Input((n_features,), name='meta')
# Encoder (produces 8x8 feature map at bottleneck)
# ... encoder layers ...
p4 = MaxPooling2D((2, 2))(c4) # shape: (8, 8, 256)
# Inject metadata at bottleneck
f = RepeatVector(8 * 8)(input_meta)
f = Reshape((8, 8, n_features))(f)
p4 = concatenate([p4, f], axis=-1)
# Continue with bottleneck + decoder
c5 = Conv2D(512, (3, 3), activation='relu', padding='same')(p4)
# ... decoder layers ...
model = Model(inputs=[input_img, input_meta], outputs=[output])
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