Skip to content

Luxque/Pictura-Quantica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pictura Quantica

Repository Description

This repository contains the files for the Pictura Quantica project. Pictura Quantica is a gamified quantum image classifier inspired by Quick, Draw!. The project aims to provide a bridge between quantum machine learning and game-like, interactive experiences. The model uses PCA and a quantum support vector classifier (QSVC). This project was created for the QPoland Global Quantum Hackathon 2025. The demonstraiton video can be found here.

Quick Start

  1. This project targets a Windows environment. Make sure Python 3.10 or later is installed.
  2. Clone this repository by running this command.
git clone https://github.com/Luxque/Pictura-Quantica.git
  1. Change to the project directory and run the installer appropriate for your environment.
    • PowerShell (Windows):
    cd .\Pictura-Quantica
    .\installation.ps1
    • To only set up the environment without launching the app:
    .\installation.ps1 -NoRun
    • POSIX shells (Git Bash, WSL, macOS, Linux):
    cd ./Pictura-Quantica
    ./installation.sh
    • To set up without launching the app:
    ./installation.sh --no-run
  2. You will need to unzip 7z files located in dataset in order to use the sample dataset to train the model.

The repository includes both installation.ps1 (PowerShell) and installation.sh (POSIX). installation.ps1 temporarily sets the PowerShell execution policy for the current process to allow activating the virtual environment; it does not change your system policy permanently.

Usage

Before running classification tasks or playing the game, train a new model or load an existing one from model. Training a new model can take several minutes with the default settings and may temporarily make the application unresponsive. A default model (trained by the author) is provided in model; to use it, press the Load Model button.

For each round you must draw five objects that the model recognizes. Correct guesses award one point and five extra seconds. Incorrect guesses simply end that round without penalty.

Here are the explanations of each button:

  • Start Game: Starts a new game.
  • Classify: Classifies the drawing (check the answer during the game).
  • Clear: Clears the drawing pad.
  • Train Model: Train a new model using the dataset in dataset.
  • Save Model: Save the trained model to model.
  • Load Model: Load a model from model.

Features

  • ✅ Quantum-inspired classification
  • 🎨 Interactive drawing canvas (PyQt6)
  • 🤖 Model training, saving, and loading
  • ⚡ Animated background and smooth GUI
  • 🎮 Gamification: timed rounds, scoring, accuracy feedback
  • 🧩 Supports benchmark and augmentation modules

Project Structure

  • dataset: Dataset used to train the sample model.
  • figures: Benchmarking plots and screenshots.
  • model: Sample model, statistics, confusion matrix, and decision-region plots.
  • source: Source code for Pictura Quantica and the benchmarking module.
  • video: Short demonstration video of Pictura Quantica.

Screenshot

screenshot

Sample Model Showcase

confusion_matrix decision_regions

Benchmarks

num_of_categories num_images_per_catetory num_pca_components reps entanglement

Dataset

This project uses the Quick, Draw! Dataset from Google, which contains millions of hand-drawn sketches across many categories. The dataset is used to train and evaluate the quantum-based classifiers.

Download Guide

To add more categories beyond the sample model, download additional dataset files (.npy) from here and place them in dataset.

  1. Install the Google Cloud SDK (which provides gsutil).
  2. Initialize the SDK and authenticate by using this command.
gcloud init
  1. Change to the Pictura-Quantica/dataset directory.
  2. Download the dataset files using gsutil.
gsutil -m cp gs://quickdraw_dataset/full/numpy_bitmap/*.npy .

Contributing

Contributions, ideas, and bug reports are welcome. Please open an issue or submit a pull request on the repository.

Future Works

  • Improve the GUI and fix bugs.
  • Add an option to train a model on real quantum hardware.
  • Implement a quantum PCA algorithm and integrate it into the project.
  • Release a binary version.

License

MIT License.

About

A gamified quantum image classifier inspired by 'Quick, Draw!'.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors