skills/43-wentorai-research-plugins/skills/domains/ai-ml/computer-vision-guide/SKILL.md
Apply computer vision research methods, models, and evaluation tools
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research computer-vision-guideInstall 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.
A skill for conducting computer vision research, covering model architectures, dataset preparation, training pipelines, evaluation metrics, and common experimental protocols for image classification, object detection, and segmentation tasks.
Image Classification:
Input: Single image
Output: Class label(s)
Models: ResNet, EfficientNet, ViT, ConvNeXt
Object Detection:
Input: Single image
Output: Bounding boxes + class labels
Models: YOLO (v5-v9), Faster R-CNN, DETR, RT-DETR
Semantic Segmentation:
Input: Single image
Output: Per-pixel class label
Models: U-Net, DeepLab, SegFormer, Mask2Former
Instance Segmentation:
Input: Single image
Output: Per-pixel labels distinguishing individual objects
Models: Mask R-CNN, Mask2Former, SAM
Image Generation:
Input: Text prompt or noise
Output: Generated image
Models: Stable Diffusion, DALL-E, Imagen
CNNs (Convolutional Neural Networks):
LeNet (1998) -> AlexNet (2012) -> VGG (2014) -> ResNet (2015)
-> EfficientNet (2019) -> ConvNeXt (2022)
Vision Transformers:
ViT (2020) -> DeiT (2021) -> Swin Transformer (2021)
-> BEiT (2021) -> DINOv2 (2023)
Trend: Transformers are competitive with CNNs at scale.
Hybrid architectures combining convolutions and attention are common.
import os
from pathlib import Path
def organize_image_dataset(source_dir: str,
split_ratios: dict = None) -> dict:
"""
Organize images into train/val/test splits.
Args:
source_dir: Directory containing class subdirectories
split_ratios: Dict with 'train', 'val', 'test' ratios
"""
if split_ratios is None:
split_ratios = {"train": 0.7, "val": 0.15, "test": 0.15}
import random
random.seed(42)
stats = {}
for class_dir in sorted(Path(source_dir).iterdir()):
if not class_dir.is_dir():
continue
images = list(class_dir.glob("*.jpg")) + list(class_dir.glob("*.png"))
random.shuffle(images)
n = len(images)
n_train = int(n * split_ratios["train"])
n_val = int(n * split_ratios["val"])
stats[class_dir.name] = {
"total": n,
"train": n_train,
"val": n_val,
"test": n - n_train - n_val
}
return stats
from torchvision import transforms
def get_training_transforms(img_size: int = 224) -> transforms.Compose:
"""
Standard data augmentation pipeline for training.
Args:
img_size: Target image size
"""
return transforms.Compose([
transforms.RandomResizedCrop(img_size, scale=(0.8, 1.0)),
transforms.RandomHorizontalFlip(p=0.5),
transforms.ColorJitter(brightness=0.2, contrast=0.2,
saturation=0.2, hue=0.1),
transforms.RandomRotation(15),
transforms.ToTensor(),
transforms.Normalize(
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225]
)
])
import torch
import torch.nn as nn
from torchvision import models
def create_classifier(num_classes: int,
backbone: str = "resnet50",
pretrained: bool = True) -> nn.Module:
"""
Create an image classifier using transfer learning.
Args:
num_classes: Number of target classes
backbone: Model architecture name
pretrained: Whether to use ImageNet-pretrained weights
"""
if backbone == "resnet50":
weights = models.ResNet50_Weights.DEFAULT if pretrained else None
model = models.resnet50(weights=weights)
model.fc = nn.Linear(model.fc.in_features, num_classes)
elif backbone == "vit_b_16":
weights = models.ViT_B_16_Weights.DEFAULT if pretrained else None
model = models.vit_b_16(weights=weights)
model.heads.head = nn.Linear(
model.heads.head.in_features, num_classes
)
else:
raise ValueError(f"Unknown backbone: {backbone}")
return model
Classification:
- Top-1 Accuracy: Fraction of correct predictions
- Top-5 Accuracy: Correct class in top 5 predictions
- Precision, Recall, F1: Per-class and macro-averaged
- Confusion Matrix: Visualize class-level errors
Object Detection:
- mAP (mean Average Precision): Standard COCO metric
- [email protected]: AP at IoU threshold 0.5
- [email protected]:0.95: AP averaged over IoU thresholds 0.5 to 0.95
- AP per class: Identifies weak categories
Segmentation:
- mIoU (mean Intersection over Union): Standard metric
- Pixel Accuracy: Fraction of correctly classified pixels
- Dice Coefficient: F1 score at the pixel level
1. Architecture: Exact model name, number of parameters
2. Pretraining: Dataset and weights used for initialization
3. Training: Optimizer, learning rate schedule, batch size, epochs
4. Augmentation: Full list of augmentations with parameters
5. Hardware: GPU type, number, training time
6. Evaluation: Exact metrics, test set version, evaluation protocol
7. Code: Link to repository with training and evaluation scripts
8. Random seeds: Report seeds used; ideally report mean over 3+ seeds
When collecting or using image datasets, consider consent (especially for images of people), geographic and demographic representation, potential for bias amplification, and dual-use concerns. Document the dataset's composition and limitations. Follow the Datasheets for Datasets framework. For generative models, implement safeguards against generating harmful content.
development
Conduct rigorous thematic analysis (TA) of qualitative data following Braun and Clarke's (2006) six-phase framework. Use whenever the user mentions 'thematic analysis', 'TA', 'Braun and Clarke', 'qualitative coding', 'identifying themes', or asks for help analysing interviews, focus groups, open-ended survey responses, or transcripts to identify patterns. Also trigger for questions about inductive vs theoretical coding, semantic vs latent themes, essentialist vs constructionist epistemology, building a thematic map, or writing up a qualitative findings section. Covers all six phases, the four upfront analytic decisions, the 15-point quality checklist, and the five common pitfalls. Produces a Word document write-up and an annotated thematic map. Does NOT cover IPA, grounded theory, discourse analysis, conversation analysis, or narrative analysis — use a different method for those.
development
Guide users through writing a systematic literature review (SLR) following the PRISMA 2020 framework. Use this skill whenever the user mentions 'systematic review', 'systematic literature review', 'SLR', 'PRISMA', 'PRISMA 2020', 'PRISMA flow diagram', 'PRISMA checklist', or asks for help writing, structuring, or auditing a literature review that follows reporting guidelines. Also trigger when the user asks about inclusion/exclusion criteria for a review, search strategies for databases like Scopus/WoS/PubMed, study selection processes, risk of bias assessment, or narrative synthesis for a review paper. This skill covers the full PRISMA 2020 checklist (27 items), produces a Word document manuscript in strict journal article format, generates an annotated PRISMA flow diagram, and enforces APA 7th Edition referencing throughout. It does NOT cover meta-analysis or statistical pooling. By Chuah Kee Man.
testing
Performs placebo-in-time sensitivity analysis with hierarchical null model and optional Bayesian assurance. Use when checking model robustness, verifying lack of pre-intervention effects, or estimating study power.
data-ai
Fit, summarize, plot, and interpret a chosen CausalPy experiment. Use after the causal method has been selected, including when configuring PyMC/sklearn models and scale-aware custom priors.