wenmin-wu/ds-skills/bigru-slice-feature-aggregator
Claude Code and agent skill by wenmin-wu/ds-skills
- community
Checking that the SKILL.md file is still in the repository.
Two-stage CT classifier where a 2D CNN dumps per-slice features once, then a bidirectional GRU runs over the slice sequence to produce both per-slice predictions (TimeDistributed head) and an exam-level prediction (avg+max pooled head) — turns expensive 3D CNN training into cheap sequence modeling
Install
npx vskill@latest install wenmin-wu/ds-skills/bigru-slice-feature-aggregatorSKILL.md
Overview
Volumetric CT classification with a true 3D CNN is expensive: every epoch you re-encode the same slices that haven't changed. The cheaper, often-better alternative is two-stage. Stage 1 trains a 2D CNN on slices, then dumps a fixed-size feature vector per slice once and freezes. Stage 2 trains a tiny bidirectional GRU over the per-slice feature sequence, with two heads: a TimeDistributed Linear that produces per-slice predictions and a cat(avg_pool, max_pool) Linear that produces the exam-level prediction. Adding the inter-slice Z-gap as an extra input feature gives the GRU spatial context. Stage 2 is so cheap you can sweep dozens of hyperparameters in the time stage 1 takes for one epoch.
Quick Start
Workflow
- Train a 2D CNN end-to-end on per-slice classification (or load a pretrained backbone)
- For every CT series, run the 2D CNN once and dump
(num_slices, n_feats)to disk as a single.npy - Compute the inter-slice Z gap from
ImagePositionPatient[2]deltas; first slice gets gap = 0 - Train the GRU with both losses summed: per-slice BCE (with masking for padding) + per-exam BCE
- Use
cat(mean_pool, max_pool)for the exam-level head — single-pool is consistently worse - Keep the GRU tiny (hidden=64, 2 layers) — it's a sequence aggregator, not a feature extractor
Key Decisions
- Freeze stage 1 before dumping: any backbone update invalidates the feature cache; freeze + dump + train stage 2 is the right order.
- Bidirectional, not unidirectional: PE / lesion / nodule context is symmetric; left-right context matters as much as right-left.
- avg+max concat for exam head: max captures "worst slice", avg captures "overall burden"; they're complementary.
- z-gap as input feature: lets the GRU compensate for variable slice spacing across studies.
- Train both heads jointly: per-slice loss provides dense supervision the per-exam head couldn't learn alone.
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cv/bigru-slice-feature-aggregator/SKILL.md
Popularity
- Repository stars
- 62
- Repository forks
- 4
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wenmin-wu/ds-skills/bigru-slice-feature-aggregator)