A logic-based AI system for solving Abstraction and Reasoning (ARC) tasks without training data. Implements rule inference, geometric transformations, and shape analysis to mimic human reasoning. Earned a 5th place finish in the Zindi ARC Challenge Africa competition.
# 🧠 ARC Challenge Africa: Abstraction & Reasoning with Logic-Based AI
Welcome to my solution for the Zindi ARC Challenge Africa — a competition inspired by the ARC-AGI benchmark that tests **true reasoning** over traditional training. This repo contains the exact pipeline that earned me a **5th place finish** 🏅!
---
## 📦 Repository Structure
```
📁 ARC-Challenge/
├── ARC_Solution.ipynb ← My final logic-based solution notebook
├── train.json ← Training tasks (input/output pairs)
├── test.json ← Test tasks to predict
├── SampleSubmission.csv ← Submission format to resemble
├── requirements.txt ← Required libraries
├── README.md ← This file!
```
---
## 🎯 Problem Overview
The ARC (Abstraction and Reasoning Corpus) challenge presents grid-based puzzles, where each task contains:
- ✅ **Training examples** (input/output grid pairs)
- ❓ **Test input**, where the goal is to produce a matching output grid
Each grid uses integers 0–9 to represent colors. There’s no model training — the system must reason directly from examples.
---
## 🚀 My Approach: Human-Like Reasoning with Visual Feedback
Instead of machine learning, I built a **logic-driven pipeline** that mimics how a human would solve puzzles.
### 🧩 Step-by-Step Logic Chain
1. **Visualize training and test grids** interactively
2. **Infer the expected output shape** from sample submission
3. **Detect 1-to-1 color mappings** and apply to test input
4. **Apply geometric transformations** (flip, rotate, transpose)
5. **Check shape transformations** (dilation, erosion, outline detection)
6. **Fallback heuristics** (tiling, color shifts, border padding)
7. **Resize output** to match target shape
8. **Flatten and save** as CSV
---
## 👁️ Visualization
Two interactive viewers were used:
- 🧠 **Training Viewer**: See how input→output transforms
- 🔍 **Prediction Viewer**: Inspect test input and generated output
This helped quickly debug a …