![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 41 20250304 1735 51](https://redchupa.com/wp-content/uploads/2026/04/20250304_1735_51.png)
Professor Oak, the renowned Pokémon researcher, has developed an advanced Pokédex upgrade that utilizes neural networks to classify Pokémon types. However, a mishap caused by an overexcited Pikachu has disrupted crucial data files, leaving the system in chaos. Now, trainers must step up to the challenge—training a CNN model to restore order and complete the classifier, ensuring the Pokédex can once again identify Pokémon with precision.
For further details, access the PDF. Heads up!! It’s password protected. The password is the name of the pokemon Ash first captured. Good Luck Trainer !!!
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 42 20250304 1736 18](https://redchupa.com/wp-content/uploads/2026/04/20250304_1736_18.png)
Google Search
PDF password Check
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 43 20250304 1740 35](https://redchupa.com/wp-content/uploads/2026/04/20250304_1740_35.png)
core_dump.txt
base64 decoding
PokemonCNN
├── Initial Input: (256, 256, 4)
│
├── Feature Extraction Layers
│ ├── Conv2D (4->32)
│ ├── BatchNorm2D
│ ├── ReLU Activation
│ ├── MaxPool2D(K Size = 3)
│ ├── Dropout (p=0.25)
│
├── Deeper Processing
│ ├── Conv2D(32->64)
│ ├── BatchNorm2D (64)
│ ├── ReLU Activation
│ ├── MaxPool2D(K Size = 3)
│ ├── Dropout (p=0.25)
│
├── More Feature Extraction
│ ├── Conv2D(64->128)
│ ├── BatchNorm2D
│ ├── ReLU Activation
│ ├── MaxPool2D(K Size = 3)
│ ├── Dropout (p=0.25)
│
├── Fully Connected Layers
│ ├── Flatten
│ ├── Linear (512 Neurons)
│ ├── BatchNorm1D
│ ├── Dropout (p=0.5)
│ ├── Linear
│ ├── Softmax Activation
│
└── Output: 18 classes
PDF Contents
Welcome, Pokémon Trainer! Hello there! Welcome to the world of Pokémon! ⚡ I’m Professor Oak, the leading Pokémon researcher, and I’ve been working on an advanced Pokédex upgrade that can automatically classify Pokémon types using cutting-edge neural networks. This breakthrough could revolutionize how trainers understand their Pokémon! BUT… there’s been a slight hiccup in the lab. My Pikachu got a little too excited and—well, let’s just say a few crucial data files were shocked into oblivion. ⚡? Now, the entire system is scrambled, and I need your help to restore order and complete the classifier! Your mission: Train a CNN model to classify Pokémon by type and help me get the Pokédex back on track. Are you up for the challenge, Trainer? Let’s GO! ? Notebook link: https://www.kaggle.com/code/gl3mon/apoorvquestion Dataset link: https://www.kaggle.com/datasets/gl3mon/apoorvctf
kaggle sign up
Greetings, Trainer!
I am Professor Oak, and I’m working on an exciting new upgrade for the Pokédex!
For years, the Pokédex has relied on manual data entry and preprogrammed knowledge to classify Pokémon types. But I believe it’s time for an upgrade—a smarter, more advanced system that can instantly recognize a Pokémon’s type just by looking at it!
To make this happen, I’m developing a powerful new Pokédex feature using Convolutional Neural Networks (CNNs). With this, the Pokédex will be able to analyze Pokémon images and determine their type with incredible accuracy. But I need the help of skilled trainers like you to fine-tune this cutting-edge technology!
Your mission:
Make sure you have imported the dataset required for training the model.
Train and refine the CNN model for Pokémon type classification.
Make sure you use the GPU T4x2 Accelerator to train the model.
Optimize its performance to make the Pokédex faster and smarter.
Help revolutionize Pokémon research with this groundbreaking upgrade!
Are you ready to be part of Pokédex history? Let’s get started! ??
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 44 20250304 1638 32](https://redchupa.com/wp-content/uploads/2026/04/20250304_1638_32.png)
Personal mobile phone verification
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 45 20250304 1828 10](https://redchupa.com/wp-content/uploads/2026/04/20250304_1828_10.png)
Next -> Gemma Download Use Agree
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 46 20250304 1747 11](https://redchupa.com/wp-content/uploads/2026/04/20250304_1747_11.png)
Accelerator GPU T4 x2 Active
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 47 20250304 1829 30](https://redchupa.com/wp-content/uploads/2026/04/20250304_1829_30.png)
Accelerator GPU T4 x2 Use Check
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 48 20250304 1748 44](https://redchupa.com/wp-content/uploads/2026/04/20250304_1748_44.png)
seed hint
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 49 20250304 1750 11](https://redchupa.com/wp-content/uploads/2026/04/20250304_1750_11.png)
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 50 20250304 1750 31](https://redchupa.com/wp-content/uploads/2026/04/20250304_1750_31.png)
seed setting
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 51 20250304 1751 07](https://redchupa.com/wp-content/uploads/2026/04/20250304_1751_07.png)
Question 1: 6
Next -> Data Set
class CTFDataset(Dataset):
def __init__(self, annotation_file, img_dir, transform = None, target_transform = None):
self.img_labels = pd.read_csv(annotation_file, index_col=0)
self.label_mapping = {
'Bug': 0, 'Dark': 1, 'Dragon': 2, 'Electric': 3, 'Fairy': 4,
'Fighting': 5, 'Fire': 6, 'Flying': 7, 'Ghost': 8, 'Grass': 9,
'Ground': 10, 'Ice': 11, 'Normal': 12, 'Poison': 13, 'Psychic': 14,
'Rock': 15, 'Steel': 16, 'Water': 17
}
self.img_labels['class'] = self.img_labels['type'].map(self.label_mapping)
self.img_dir = img_dir
self.transform = transform
self.target_transform = target_transform
def __len__(self):
return len(self.img_labels)
def __getitem__(self, idx):
img_path = os.path.join(self.img_dir, self.img_labels.iloc[idx]['type'], f'{self.img_labels.iloc[idx]["pkn"]}'+'.png')
image = None
try:
image = read_image(img_path).to(pt.float32)
except:
image = pt.zeros(4, 256, 256)
label = self.img_labels.iloc[idx]['class']
if self.transform:
image = self.transform(image)
if self.target_transform:
label = self.target_transform(label)
return image, label
ds = CTFDataset(
annotation_file = '/kaggle/input/d/redchupa/apoorvctf/label.csv',
img_dir = '/kaggle/input/d/redchupa/apoorvctf/images',
)
File Upload
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 52 20250304 1753 39](https://redchupa.com/wp-content/uploads/2026/04/20250304_1753_39.png)
hint: kernel_size=2
img format
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 53 20250304 1756 09](https://redchupa.com/wp-content/uploads/2026/04/20250304_1756_09.png)
Initial Input: (256, 256, 4)
class PokemonCNN(nn.Module):
def __init__(self):
super().__init__()
# 256 256 4
self.conv1 = nn.Conv2d(4, 32, kernel_size=2) # 255 255 32
self.bn1 = nn.BatchNorm2d(32)
self.relu = nn.ReLU()
self.pool = nn.MaxPool2d(kernel_size=3) # 85 85 32
self.drop1 = nn.Dropout(0.25)
self.conv2 = nn.Conv2d(32, 64, kernel_size=2) # 84 84 64
self.bn2 = nn.BatchNorm2d(64)
self.relu2 = nn.ReLU()
self.pool2 = nn.MaxPool2d(kernel_size=3) # 28 28 64
self.drop2 = nn.Dropout(0.25)
self.conv3 = nn.Conv2d(64, 128, kernel_size=2) # 27 27 128
self.bn3 = nn.BatchNorm2d(128)
self.relu3 = nn.ReLU()
self.pool3 = nn.MaxPool2d(kernel_size=3) # 9 9 128
self.drop3 = nn.Dropout(0.25)
self.flatten = nn.Flatten()
self.fc1 = nn.Linear(10368, 512)
self.bn4 = nn.BatchNorm1d(512)
self.drop4 = nn.Dropout(0.5)
self.fc2 = nn.Linear(512, 18)
self.softmax = nn.Softmax()
def forward(self, x):
x = self.pool(F.relu(self.bn1(self.conv1(x))))
x = self.drop1(x)
x = self.pool(F.relu(self.bn2(self.conv2(x))))
x = self.drop2(x)
x = self.pool(F.relu(self.bn3(self.conv3(x))))
x = self.drop3(x)
x = self.flatten(x)
x = self.fc1(x)
x = self.bn4(x)
x = self.drop4(x)
x = self.fc2(x)
x = self.softmax(x)
return x
Conv2d Analyze
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 54 edited 20250304 1757 54](https://redchupa.com/wp-content/uploads/2026/04/edited_20250304_1757_54.png)
MaxPool2d Analyze
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 55 20250304 1758 14](https://redchupa.com/wp-content/uploads/2026/04/20250304_1758_14.png)
Question 2: 9 * 9 * 128 = 10368
Training Start
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 56 20250305 1559 39](https://redchupa.com/wp-content/uploads/2026/04/20250305_1559_39.png)
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 57 20250305 1559 11](https://redchupa.com/wp-content/uploads/2026/04/20250305_1559_11.png)
Question 3,4
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 58 20250304 1800 22](https://redchupa.com/wp-content/uploads/2026/04/20250304_1800_22.png)
netcat use
![ApoorvCTF 2025 - [AI] Pokédex Neural Network Write Up 59 2](https://redchupa.com/wp-content/uploads/2026/04/2.png)
Reference
CSYClubIIITK/CTF-Writeups · GitHub
CTF-Writeups/ApoorvCTF-25-Writeups at main · CSYClubIIITK/CTF-Writeups
If there is a copyright issue with my writing, please request it in the comments and I will edit or delete it.