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 β¦