RAFAEL DAVID JOSÉ

CNN Solvability Classifier

SOURCE CODE

DESCRIPTION

Can a neural network learn whether a game level is playable just by looking at it? This project investigates whether CNNs can classify the solvability of procedurally generated 2D game maps using only their pixel representation, no tile data, no game logic, just the image. Three different CNN architectures were implemented, trained, and tested on 66,000 rendered levels from the Cave-Doors domain of the Generated Game Level Corpus (GGLC).

SCREENSHOTS

Screenshot Screenshot Screenshot

MY ROLE & CONTRIBUTION

I designed and implemented all three CNN architectures from scratch in PyTorch: a Basic CNN, a Hybrid CNN with manually initialised classical image-processing filters (Laplacian, Sobel, Block), and a Batch-Normalised CNN. I built the full data pipeline, training loop, and evaluation framework. I also designed and implemented the robustness testing suite, which evaluates each model under structural perturbations (smart wall insertion), pixel-level noise, and horizontal flipping. Finally, I produced internal activation visualisations using forward hooks to inspect how each architecture processes game level images.

CORE CONCEPTS

This project explores procedural content generation, vision-based classification, and the limits of local pattern recognition for global structural reasoning. It applies convolutional feature learning to a domain where solvability is a strict global property, meaning a single tile change can flip the label entirely. The robustness experiments reveal a fundamental gap between high accuracy and genuine structural understanding, showing that models can overfit to spatial arrangements without learning the underlying game rules.

TECHNICAL ASPECTS

Developed in Python using PyTorch. The dataset consists of 66,000 RGB images (256×256), evenly split between solvable and unsolvable classes, with an 80/20 train/test split. All three models achieve ~99.5% test accuracy after 10 epochs. Robustness evaluation was conducted on 25 solvable test images under three controlled perturbations. A fixed random seed and deterministic cuDNN settings ensure full reproducibility across runs.

COURSE: "Machine Learning Fundamentals" – MSc in Artificial Intelligence for Games, Universidade Lusófona (1º year, 1º semester)

PLATFORM: Python / PyTorch

DEVELOPMENT TIME: ~1 Month

TEAM SIZE: 1 developer

TECHNOLOGIES USED:

💎
🏆 ACHIEVEMENT UNLOCKED!
"Portfolio Explorer"