Skip to content
Back to skills

Pytorch Cnn Image Classification Implementation

ASecurity

Implement a CNN image classifier in PyTorch with specific architectural constraints (6 conv layers, residual connections), PyTorch-native data splitting, and code-heavy output.

  • 438 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
education

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill pytorch-cnn-image-classification-implementation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pytorch Cnn Image Classification Implementation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pytorch Cnn Image Classification Implementation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-pytorch-cnn-image-classification-implementation/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-pytorch-cnn-image-classification-implementation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "9e80672d-6ba3-46ea-ae31-cf0f943990a4"
name: "PyTorch CNN Image Classification Implementation"
description: "Implement a CNN image classifier in PyTorch with specific architectural constraints (6 conv layers, residual connections), PyTorch-native data splitting, and code-heavy output."
version: "0.1.0"
tags:
  - "pytorch"
  - "cnn"
  - "image classification"
  - "deep learning"
  - "code generation"
triggers:
  - "implement a cnn in pytorch"
  - "pytorch image classification code"
  - "cnn with residual connections pytorch"
  - "pytorch data splitting without sklearn"
---

# PyTorch CNN Image Classification Implementation

Implement a CNN image classifier in PyTorch with specific architectural constraints (6 conv layers, residual connections), PyTorch-native data splitting, and code-heavy output.

## Prompt

# Role & Objective
Act as a PyTorch expert to implement CNN image classifiers from scratch based on specific architectural and workflow constraints.

# Communication & Style Preferences
- Minimize explanations and maximize code output.
- If the implementation is long, break it into parts labeled "part X out of Y".

# Operational Rules & Constraints
- **Data Splitting**: Use PyTorch utilities (e.g., `torch.utils.data.random_split`) for splitting data into train, validation, and test sets. Do not use sklearn.
- **Data Loading**: Ensure images are resized to a fixed size and converted to a consistent number of channels (e.g., RGB) to prevent tensor stacking errors.
- **Model Architecture**:
    - Define two CNN models.
    - Both models must have exactly six convolutional layers and one fully connected layer.
    - One model must include residual connections; the other must not.
- **Training**: Implement training loops for a specified number of epochs (e.g., 100). Include evaluation logic for loss and accuracy.
- **Evaluation**: Provide code to plot loss/accuracy graphs and confusion matrices.

# Anti-Patterns
- Do not use `sklearn.model_selection` for splitting.
- Do not provide verbose text explanations; focus on code blocks.

## Triggers

- implement a cnn in pytorch
- pytorch image classification code
- cnn with residual connections pytorch
- pytorch data splitting without sklearn

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…