π  Start Solving

π Explore Dataset

## π΅πΌββοΈ What is The Solve Sudoku Puzzle About?

Sudoku is a logic-based, combinatorial number-placement puzzle. Sudoku is a fan favourite relaxing activity for many. These number puzzles include a 9 x 9 grid containing a 3 x 3 subgrid with numbers from 1 to 9. To know more about the rules of sudoku, click here.

In this puzzle, youβll be given an image of sudoku, and you have to output the 81 character solution for the sudoku.

## πͺπΌ What Youβll Learn

In this puzzle, you will learn

1. Computer Vision techniques to identify and extract digits from an image.
2. Digital Classification

Letβs get started! π

Learn the fundamentals of computer vision by building a model that solves sudoku from images. Given an input image of a sudoku puzzle, output the correct 81 character string solution for the puzzle. Letβs get started!

The dataset contains 10001 images.

1. Training set: 5000 images
2. Test set: 50001 images

Here are some details about the dataset images:

1. Each image consists of an unsolved Sudoku puzzle.
2. Each puzzle is of a different colour, rotated by an angle with varying line widths, and the digits all look different.
3. Each image has dimensions (300, 300), but the puzzle sizes may vary due to the rotation.

The training and test dataset contains the following:

1. label: contains field id and field solution
2. id: this corresponds to the file's name inside the images directory
3. solution: this is a string of 81 characters. It is the complete solution to the sudoku puzzle.

id solution
0 769184523521937864843652719176349258385216947492875631217593486958461372634728195
1 721685394683947521945312867174258639298136475356794218569873142412569783837421956
2 489752163235614789761398254317869425694275318528431697156947832942183576873526941
3 264189735351742689798356214927861453815234976436975128572493861143628597689517342

## π Dataset Files

• train.tar.gz : (5000 samples) This file contains a folder of data with all the images of the sudoku puzzles and a label.csv with labels, i.e. solutions ( in string format ) for the corresponding puzzle.
• test.tar.gz : (5001 samples) This file contains a folder of data containing all the images of the sudoku puzzle whose solutions need to be found.
• sample_submission.csv: Sample submission format for the challenge.

## π¬ Let's Solve This Puzzle

Click here to access the basic starter kit. It contains in-depth instructions to:

2. Setup the AIcrowd-CLI environment that will help you submit directly via a notebook
4. Preprocessing the dataset
5. Creating the model
6. Setting the model
7. Training the model
8. Submitting the result

Make your first submission using the starter kit. π

## π Evaluation Criteria

The Mean Squared Error metric will be used to test the model's efficiency during the evaluation.

## π€« Hint to get started

To solve this puzzle, try to break down the puzzles in simple steps

1. Break the image into single blocks
2. Identify the block containing numbers
3. Identify the numbers
4. Use any sudoku solver to solve the puzzle

This notebook takes you through the above approach and, at the same time, makes it easy to follow through!

## π Resource Circle

1. Check out this blog to understand more about the above approach.
2. You can also check out this blog to solve the same puzzle using image segmentation.