skills/cv/semi-supervised-pretrained-backbone/SKILL.md
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.
npx skillsauth add wenmin-wu/ds-skills cv-semi-supervised-pretrained-backboneInstall 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.
Facebook's semi-supervised and semi-weakly supervised ImageNet models were trained on up to 940M unlabeled images from YFCC100M, producing significantly better representations than standard supervised pretraining. Using these as backbones (ResNet-50, ResNeXt-50) provides 1-3% accuracy improvements on downstream tasks, especially on medical imaging and domain-shifted data where standard ImageNet features are weak. Available via torch.hub with no extra dependencies.
import torch
import torch.nn as nn
# Load semi-weakly supervised ResNeXt-50
backbone = torch.hub.load(
'facebookresearch/semi-supervised-ImageNet1K-models',
'resnext50_32x4d_swsl' # swsl = semi-weakly supervised
)
class CustomModel(nn.Module):
def __init__(self, n_classes=6):
super().__init__()
self.encoder = nn.Sequential(*list(backbone.children())[:-2])
nc = list(backbone.children())[-1].in_features # 2048
self.head = nn.Sequential(
nn.AdaptiveAvgPool2d(1), nn.Flatten(),
nn.Linear(nc, 512), nn.ReLU(),
nn.Dropout(0.5), nn.Linear(512, n_classes))
def forward(self, x):
return self.head(self.encoder(x))
model = CustomModel(n_classes=6)
torch.hub.loadresnext50_32x4d_ssl (semi-supervised), resnext50_32x4d_swsl (semi-weakly supervised — stronger)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