SlideShare a Scribd company logo
1 of 18
Classification of EEG P300 ERPs
using quantum computation
Anton Andreev (Gipsa-lab France), Gregoire Cattan (IBM Poland)
1
Overview
• Quantum computing advantages
• in terms of computational time and outcomes
• for pattern recognition or when using limited training sets
• Objective: classify two states (P300 ERPs) from a BCI experiment using
a Quantum Classifier
EEG dataset
Riemannian Geometry +
Tangent Space
Quantum
classifier
2
Projects and Tools
• MOABB - helper project
• pyRiemann - state of the art ERP classification
• QISKIT - IBM Python wrapper around Quantum Computing
• pyRieamann-qiskit - PyRiemann + QISKIT + MOABB
3
MOABB
• Github project page:
https://github.com/NeuroTechX/moabb
• Reproducible research
• same performance evaluation code and datasets
• EEG/MEG datasets and specifically P300 ERPs
• Automatic download
4
PyRiemann (1)
• Github project page:
https://github.com/pyRiemann/pyRiemann
• Python ML framework
• Provides very good classification for BCI (P300, motor imagery)
• No preprocessing is needed
• Multi channel and Multiclass
• Works well between different sessions and subjects
• It won several BCI challenges
5
PyRiemann (2)
• Uses Riemannian Geometry
• Can use a matrix as in input
• Methods:
1. Covariance matrices + Tangent Space + standard classifier
2. Own MDM (Minimum Distance to Mean) classifier
• similar to K-means classifier, but supervised
• centroids are calculated for each class
• specific “distance” and “mean” used
• no manual parameter tuning
3. Other methods
6
Covariance matrices + Tangent
Space + standard classifier
7
P300
Epochs
Covariance
matrices
Point on the
manifold
Definition of
Riemannian
manifold
Definition of
Tangent space
Mapping to
Tangent space
Good representation
of the input data
Any Classifier
The workflow can be used by a Quantum Classifier
Riemannian representation of the ERP data
8
Good feature vector
EGG signal epoch
Qiskit (1)
• Github project page: https://github.com/Qiskit/qiskit
• Launched in 2017 by IBM Research
• Provides access to IBM’s cloud quantum computing service
• Where can it be used?
• Qiskit Finance
• Qiskit Optimisation
• Qiskit Nature
• Qiskit Machine Learning (<- we are here)
• Emulated vs Real Quantum computer
9
Qiskit (2)
• Quantum circuit
• Quantum bits
• Operations
• Registers:
• Quantum (q1,q2)
• Classical (c1)
• Code generated:
• Python
• QASM
• Result is the
measurement of q1
available c1 https://quantum-computing.ibm.com
10
Quantum-enhanced Support Vector Machine (QSVM)
• Quantum Kernel
• Generated based on the input data and the Quantum Feature Map (QFM)
• QFM
• Maps classical data to Quantum states in Quantum Hilbert space
• Implemented as Quantum Circuit
• Can be used in SVM, Kernel Spectral Clustering or Kernel Ridge Regression
• QSVM
• QSVM inherits from ScikitLearn.svm.SVC (conventional SVM)
• Uses the Quantum Kernel
• Size of input vectors = n of qubits
11
Diagram with real Quantum Computer
ZZFeatureMap
Input data
Precomputed Quantum
Kernel Matrix
Scikit Learn
SVC
Quantum
Computer
12
PyRiemann-qiskit
• Github project page: https://github.com/pyRiemann/pyRiemann-qiskit
• Facilitates the classification of ERP signals with Quantum Computing
• Trying to get the best of both PyRiemann and Qiskit
13
Classification
• Dataset: bi2012 – P300, Gipsa-lab BCI game Brain Invaders, MOABB
• Two ML pipelines:
• Both using Riemannian Geometry and Tangent Space
• Quantum bits = PCA components
• But the final classifier is different
• Evaluation
• Provided by MOABB
• k-fold cross-validation
• Per session
• Experience on a real IBM quantum computer
14
RG + Tangent
Space
LDA
classifier
RG + Tangent
Space
QSVM
classifier
Evaluation using Quantum Emulation
Dataset: bi2012
Subjects: 25
Classes: 2
Accuracy:
- RG+LDA: 0.88
- RG+QuantumSVM: 0.72
Quantum emulation is
3 times slower
15
Experience on real IBM Quantum computer
• Training is slow due to usage restrictions
• Many quantum jobs are needed
• Each quantum job is queued
• Classification score can be low due to:
• Low number of “shots”
• Too small feature vector (depends on available quantum bits)
• Noise in quantum computers
• Not sufficient data
16
Resources
• [1] A. Blance and M. Spannowsky, ‘Quantum machine learning for particle physics
using a variational quantum classifier’, J. High Energ. Phys., vol. 2021, no. 2, p.
212, Feb. 2021, doi: 10.1007/JHEP02(2021)212.
• [2] P. Rebentrost, M. Mohseni, and S. Lloyd, ‘Quantum Support Vector Machine
for Big Data Classification’, Phys. Rev. Lett., vol. 113, no. 13, p. 130503, Sep. 2014,
doi: 10.1103/PhysRevLett.113.130503.
• [3] ‘Classification of covariance matrices using a Riemannian-based kernel for BCI
applications’ Alexandre Barachant, Stéphane Bonnet, Marco Congedo, Christian
Jutten
• [4] ‘Riemannian geometry for EEG-based brain-computer interfaces; a primer and
a review’ Marco Congedo, Alexandre Barachant, Rajendra Bhatia
• [5] ‘Supervised learning with quantum enhanced feature spaces’ Vojtech
Havlicek1 , ∗ Antonio D. C´orcoles1 , Kristan Temme1 , Aram W. Harrow2 ,
Abhinav Kandala1 , Jerry M. Chow1 , and Jay M. Gambetta1
17
Questions?
International Forum on Neural Engineering & Brain Technologies 17-18 may 2022 18

More Related Content

Similar to Classification of EEG P300 ERPs using Riemannian Geometry and Quantum Computing

[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...
[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...
[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...DataScienceConferenc1
 
Strengths and limitations of quantum computing
Strengths and limitations of quantum computingStrengths and limitations of quantum computing
Strengths and limitations of quantum computingVinayak Sharma
 
Quantum Computing and Qiskit
Quantum Computing and QiskitQuantum Computing and Qiskit
Quantum Computing and QiskitPooja Mistry
 
Deep_Learning_Frameworks_CNTK_PyTorch
Deep_Learning_Frameworks_CNTK_PyTorchDeep_Learning_Frameworks_CNTK_PyTorch
Deep_Learning_Frameworks_CNTK_PyTorchSubhashis Hazarika
 
Expanding HPCC Systems Deep Neural Network Capabilities
Expanding HPCC Systems Deep Neural Network CapabilitiesExpanding HPCC Systems Deep Neural Network Capabilities
Expanding HPCC Systems Deep Neural Network CapabilitiesHPCC Systems
 
Quantum Computing with Amazon Braket
Quantum Computing with Amazon BraketQuantum Computing with Amazon Braket
Quantum Computing with Amazon BraketChris Fregly
 
A framework and approaches to develop an in-house CAT with freeware and open ...
A framework and approaches to develop an in-house CAT with freeware and open ...A framework and approaches to develop an in-house CAT with freeware and open ...
A framework and approaches to develop an in-house CAT with freeware and open ...Tetsuo Kimura
 
Object Detection Beyond Mask R-CNN and RetinaNet I
Object Detection Beyond Mask R-CNN and RetinaNet IObject Detection Beyond Mask R-CNN and RetinaNet I
Object Detection Beyond Mask R-CNN and RetinaNet IWanjin Yu
 
Python in the real world : from everyday applications to advanced robotics
Python in the real world : from everyday applications to advanced roboticsPython in the real world : from everyday applications to advanced robotics
Python in the real world : from everyday applications to advanced roboticsJivitesh Dhaliwal
 
Paris Quantum Computing & Technologies Meetup #1
Paris Quantum Computing & Technologies Meetup #1Paris Quantum Computing & Technologies Meetup #1
Paris Quantum Computing & Technologies Meetup #1Christophe Jurczak
 
Programming Existing Quantum Computers
Programming Existing Quantum ComputersProgramming Existing Quantum Computers
Programming Existing Quantum ComputersAnton Karazeev
 
Performance Analysis of Lattice QCD with APGAS Programming Model
Performance Analysis of Lattice QCD with APGAS Programming ModelPerformance Analysis of Lattice QCD with APGAS Programming Model
Performance Analysis of Lattice QCD with APGAS Programming ModelKoichi Shirahata
 
Efficient execution of quantized deep learning models a compiler approach
Efficient execution of quantized deep learning models a compiler approachEfficient execution of quantized deep learning models a compiler approach
Efficient execution of quantized deep learning models a compiler approachjemin lee
 
Overview of quantum computing and it's application in artificial intelligence
Overview of quantum computing and it's application in artificial intelligenceOverview of quantum computing and it's application in artificial intelligence
Overview of quantum computing and it's application in artificial intelligenceBincySam2
 
Maj_Project_Review-1.pptxiuuhjhgjglkhuhghniuh
Maj_Project_Review-1.pptxiuuhjhgjglkhuhghniuhMaj_Project_Review-1.pptxiuuhjhgjglkhuhghniuh
Maj_Project_Review-1.pptxiuuhjhgjglkhuhghniuhsanthosharumugam9
 
Quantum computing for CS students: open source software
Quantum computing for CS students: open source softwareQuantum computing for CS students: open source software
Quantum computing for CS students: open source softwareBruno Fedrici, PhD
 
Demystifying Quantum Computing
Demystifying Quantum ComputingDemystifying Quantum Computing
Demystifying Quantum ComputingNiki Gastinel
 
"The Arrival of Quantum Computing" by Will Zeng
"The Arrival of Quantum Computing" by Will Zeng"The Arrival of Quantum Computing" by Will Zeng
"The Arrival of Quantum Computing" by Will ZengImpact.Tech
 

Similar to Classification of EEG P300 ERPs using Riemannian Geometry and Quantum Computing (20)

[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...
[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...
[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...
 
dev_int_96
dev_int_96dev_int_96
dev_int_96
 
Strengths and limitations of quantum computing
Strengths and limitations of quantum computingStrengths and limitations of quantum computing
Strengths and limitations of quantum computing
 
Quantum Computing and Qiskit
Quantum Computing and QiskitQuantum Computing and Qiskit
Quantum Computing and Qiskit
 
Deep_Learning_Frameworks_CNTK_PyTorch
Deep_Learning_Frameworks_CNTK_PyTorchDeep_Learning_Frameworks_CNTK_PyTorch
Deep_Learning_Frameworks_CNTK_PyTorch
 
Expanding HPCC Systems Deep Neural Network Capabilities
Expanding HPCC Systems Deep Neural Network CapabilitiesExpanding HPCC Systems Deep Neural Network Capabilities
Expanding HPCC Systems Deep Neural Network Capabilities
 
Quantum Computing with Amazon Braket
Quantum Computing with Amazon BraketQuantum Computing with Amazon Braket
Quantum Computing with Amazon Braket
 
A framework and approaches to develop an in-house CAT with freeware and open ...
A framework and approaches to develop an in-house CAT with freeware and open ...A framework and approaches to develop an in-house CAT with freeware and open ...
A framework and approaches to develop an in-house CAT with freeware and open ...
 
Object Detection Beyond Mask R-CNN and RetinaNet I
Object Detection Beyond Mask R-CNN and RetinaNet IObject Detection Beyond Mask R-CNN and RetinaNet I
Object Detection Beyond Mask R-CNN and RetinaNet I
 
Python in the real world : from everyday applications to advanced robotics
Python in the real world : from everyday applications to advanced roboticsPython in the real world : from everyday applications to advanced robotics
Python in the real world : from everyday applications to advanced robotics
 
Paris Quantum Computing & Technologies Meetup #1
Paris Quantum Computing & Technologies Meetup #1Paris Quantum Computing & Technologies Meetup #1
Paris Quantum Computing & Technologies Meetup #1
 
Programming Existing Quantum Computers
Programming Existing Quantum ComputersProgramming Existing Quantum Computers
Programming Existing Quantum Computers
 
Performance Analysis of Lattice QCD with APGAS Programming Model
Performance Analysis of Lattice QCD with APGAS Programming ModelPerformance Analysis of Lattice QCD with APGAS Programming Model
Performance Analysis of Lattice QCD with APGAS Programming Model
 
Efficient execution of quantized deep learning models a compiler approach
Efficient execution of quantized deep learning models a compiler approachEfficient execution of quantized deep learning models a compiler approach
Efficient execution of quantized deep learning models a compiler approach
 
Overview of quantum computing and it's application in artificial intelligence
Overview of quantum computing and it's application in artificial intelligenceOverview of quantum computing and it's application in artificial intelligence
Overview of quantum computing and it's application in artificial intelligence
 
2011.jtr.pbasanta.
2011.jtr.pbasanta.2011.jtr.pbasanta.
2011.jtr.pbasanta.
 
Maj_Project_Review-1.pptxiuuhjhgjglkhuhghniuh
Maj_Project_Review-1.pptxiuuhjhgjglkhuhghniuhMaj_Project_Review-1.pptxiuuhjhgjglkhuhghniuh
Maj_Project_Review-1.pptxiuuhjhgjglkhuhghniuh
 
Quantum computing for CS students: open source software
Quantum computing for CS students: open source softwareQuantum computing for CS students: open source software
Quantum computing for CS students: open source software
 
Demystifying Quantum Computing
Demystifying Quantum ComputingDemystifying Quantum Computing
Demystifying Quantum Computing
 
"The Arrival of Quantum Computing" by Will Zeng
"The Arrival of Quantum Computing" by Will Zeng"The Arrival of Quantum Computing" by Will Zeng
"The Arrival of Quantum Computing" by Will Zeng
 

Recently uploaded

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 

Recently uploaded (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 

Classification of EEG P300 ERPs using Riemannian Geometry and Quantum Computing

  • 1. Classification of EEG P300 ERPs using quantum computation Anton Andreev (Gipsa-lab France), Gregoire Cattan (IBM Poland) 1
  • 2. Overview • Quantum computing advantages • in terms of computational time and outcomes • for pattern recognition or when using limited training sets • Objective: classify two states (P300 ERPs) from a BCI experiment using a Quantum Classifier EEG dataset Riemannian Geometry + Tangent Space Quantum classifier 2
  • 3. Projects and Tools • MOABB - helper project • pyRiemann - state of the art ERP classification • QISKIT - IBM Python wrapper around Quantum Computing • pyRieamann-qiskit - PyRiemann + QISKIT + MOABB 3
  • 4. MOABB • Github project page: https://github.com/NeuroTechX/moabb • Reproducible research • same performance evaluation code and datasets • EEG/MEG datasets and specifically P300 ERPs • Automatic download 4
  • 5. PyRiemann (1) • Github project page: https://github.com/pyRiemann/pyRiemann • Python ML framework • Provides very good classification for BCI (P300, motor imagery) • No preprocessing is needed • Multi channel and Multiclass • Works well between different sessions and subjects • It won several BCI challenges 5
  • 6. PyRiemann (2) • Uses Riemannian Geometry • Can use a matrix as in input • Methods: 1. Covariance matrices + Tangent Space + standard classifier 2. Own MDM (Minimum Distance to Mean) classifier • similar to K-means classifier, but supervised • centroids are calculated for each class • specific “distance” and “mean” used • no manual parameter tuning 3. Other methods 6
  • 7. Covariance matrices + Tangent Space + standard classifier 7 P300 Epochs Covariance matrices Point on the manifold Definition of Riemannian manifold Definition of Tangent space Mapping to Tangent space Good representation of the input data Any Classifier The workflow can be used by a Quantum Classifier
  • 8. Riemannian representation of the ERP data 8 Good feature vector EGG signal epoch
  • 9. Qiskit (1) • Github project page: https://github.com/Qiskit/qiskit • Launched in 2017 by IBM Research • Provides access to IBM’s cloud quantum computing service • Where can it be used? • Qiskit Finance • Qiskit Optimisation • Qiskit Nature • Qiskit Machine Learning (<- we are here) • Emulated vs Real Quantum computer 9
  • 10. Qiskit (2) • Quantum circuit • Quantum bits • Operations • Registers: • Quantum (q1,q2) • Classical (c1) • Code generated: • Python • QASM • Result is the measurement of q1 available c1 https://quantum-computing.ibm.com 10
  • 11. Quantum-enhanced Support Vector Machine (QSVM) • Quantum Kernel • Generated based on the input data and the Quantum Feature Map (QFM) • QFM • Maps classical data to Quantum states in Quantum Hilbert space • Implemented as Quantum Circuit • Can be used in SVM, Kernel Spectral Clustering or Kernel Ridge Regression • QSVM • QSVM inherits from ScikitLearn.svm.SVC (conventional SVM) • Uses the Quantum Kernel • Size of input vectors = n of qubits 11
  • 12. Diagram with real Quantum Computer ZZFeatureMap Input data Precomputed Quantum Kernel Matrix Scikit Learn SVC Quantum Computer 12
  • 13. PyRiemann-qiskit • Github project page: https://github.com/pyRiemann/pyRiemann-qiskit • Facilitates the classification of ERP signals with Quantum Computing • Trying to get the best of both PyRiemann and Qiskit 13
  • 14. Classification • Dataset: bi2012 – P300, Gipsa-lab BCI game Brain Invaders, MOABB • Two ML pipelines: • Both using Riemannian Geometry and Tangent Space • Quantum bits = PCA components • But the final classifier is different • Evaluation • Provided by MOABB • k-fold cross-validation • Per session • Experience on a real IBM quantum computer 14 RG + Tangent Space LDA classifier RG + Tangent Space QSVM classifier
  • 15. Evaluation using Quantum Emulation Dataset: bi2012 Subjects: 25 Classes: 2 Accuracy: - RG+LDA: 0.88 - RG+QuantumSVM: 0.72 Quantum emulation is 3 times slower 15
  • 16. Experience on real IBM Quantum computer • Training is slow due to usage restrictions • Many quantum jobs are needed • Each quantum job is queued • Classification score can be low due to: • Low number of “shots” • Too small feature vector (depends on available quantum bits) • Noise in quantum computers • Not sufficient data 16
  • 17. Resources • [1] A. Blance and M. Spannowsky, ‘Quantum machine learning for particle physics using a variational quantum classifier’, J. High Energ. Phys., vol. 2021, no. 2, p. 212, Feb. 2021, doi: 10.1007/JHEP02(2021)212. • [2] P. Rebentrost, M. Mohseni, and S. Lloyd, ‘Quantum Support Vector Machine for Big Data Classification’, Phys. Rev. Lett., vol. 113, no. 13, p. 130503, Sep. 2014, doi: 10.1103/PhysRevLett.113.130503. • [3] ‘Classification of covariance matrices using a Riemannian-based kernel for BCI applications’ Alexandre Barachant, Stéphane Bonnet, Marco Congedo, Christian Jutten • [4] ‘Riemannian geometry for EEG-based brain-computer interfaces; a primer and a review’ Marco Congedo, Alexandre Barachant, Rajendra Bhatia • [5] ‘Supervised learning with quantum enhanced feature spaces’ Vojtech Havlicek1 , ∗ Antonio D. C´orcoles1 , Kristan Temme1 , Aram W. Harrow2 , Abhinav Kandala1 , Jerry M. Chow1 , and Jay M. Gambetta1 17
  • 18. Questions? International Forum on Neural Engineering & Brain Technologies 17-18 may 2022 18

Editor's Notes

  1. Literature on quantum computing suggests it may offer an advantage as compared with classical computing in terms of computational time and outcomes, such as for pattern recognition or when using limited training sets.
  2. pyRieamann-qiskit combines the 3 projects above,so that we can easily apply Quantum computing on EP EEG signals.
  3. PyRiemann provides state of the art classification of ERP signals.
  4. K-means is unsupervised in general, but here in MDM we use labeled data to build the two clusters for the classes: with or without P300 ERP. We need to properly define the distance and mean we are going to use. “distance” as defined using Riemannian Geometry. Inherited from the geometric distance, the geometric mean is an appropriate descriptor of the central tendency (expected value) for the variance, while, inherited from the Euclidean distance, the arithmetic mean is not.
  5. From each P300 epoch we calculate a “covariance matrix”. We want to preserve the spatial information in the covariance matrix. Usually the covariance matrix is vectorized (all rows of the matrix are put one after another) to form a single input vector to be used by any classifier, but here this is avoided. The spatial covariance matrix Cp is calculated using the single trail Xp (channels x samples): Cp = 1 / (T-1) * Xp * Xp(transposed). Cp is symmetric by definition With sufficient data Cp becomes positive definitive, otherwise it must be regularized (there are known algorithms for that) Next the space of SPDs creates a manifold (based on the training data) This manifold becomes Riemannian manifold M by adopting an Affine Invariant Metric Now we can apply Riemannian Geometry for M Each Cp can be represented in M For each point on the manifold M a tangent space T can be defined We need to select a reference point C as to where to construct the tangent space T. Usually this reference point is the Geometric Mean. The Geometric Mean might not be the best reference point, but usually is a very good choice. The Geometric mean is calculated iteratively Each point on the manifold (each covariance matrix) can be projected on T using log mapping (and back using exponential mapping). A kind of optimization is C to become the identity matrix and to use parallel transport (parallel translation) So the Riemannian distance in M is well approximated by Euclidean distance in T – so T (which is 2 dimensional) acts as a very good approxomation of M Any classifier can be used in T
  6. By using PyRiemann we get a good a feature vector that can be used for Classical or Quantum Classification.
  7. We are in the exploration phase of Quantum computers. But the fact that anyone can access a real quantum computer is impressive and will help progress the domain. Qiskit framework can be used on two levels: at a low level for Quantum models (as shown on the next slide) or at a higher level where a Quantum classifier is already provided (and we can focus on the hyper parameters). Qiskit has 3 ML algorithms: QSVM (Quantum-enhanced Support Vector Machine) and VQC (Variational Quantum Classifier) and QGAN (Quantum Generative Adversarial Network).
  8. With Qiskit we are doing Quantum Programming. Qiskit compiles an algorithm to a quantum circuit. Quantum bits can be manipulated in ways that can only be described by quantum physics. Each quantum bit can seen as a “quantum register”. Classical bits form “classical register”. Quantum circuit is a combination of operations on these registers. Here the quantum circuit is comprised from the quantum bits q0, q1, q2 and a normal bit c1. Quantum operations include quantum gates, such as the Hadamard gate, as well as operations that are not quantum gates, such as the measurement operation. From the Web interface you can generate either Qiskit python code or QASM (Open Quantum Assembly Language). Qubits are always initialized to give the output 0. Quantum operations: https://qiskit.org/textbook/ch-states/atoms-computation.html H – is a Hadamard gate + - is a CX (CNOT) gate on control qubit 0 and target qubit 1 (a classical XOR gate). It looks at its two input bits to see whether they are the same or different. Next, it overwrites the target qubit with the answer. The target becomes 0 if they are the same, and 1 if they are different. Another way of explaining the CNOT is to say that it does a NOT on the target if the control (the first quantum bit) is 1, and does nothing otherwise. X – is a NOT gate (circle with + inside, exactly after Hadamard gate) Textbook on Qiskit: https://qiskit.org/textbook/preface.html
  9. Going to the higher dimensional space called “Feature Space” is done using a “kernel”. The job of the kernel is to transform linearly inseparable data to linearly separable space. A Quantum Feature Map V(Φ(𝑥⃗)) converts classical data to quantum data. It maps to quantum Hilbert space with specific property of the dot product. The reason of choosing a QFM is to get the quantum advantage. Based on the QFM we construct a quantum kernel (during the training phase). The QFM is modeled using a quantum circuit and quantum operations as shown in the previous slide. A different QFM will produce a different kernel. The default Quantum Feature Map (QFM) is ZZFeatureMap: https://qiskit.org/documentation/stubs/qiskit.circuit.library.ZZFeatureMap.html Links and extras: The Quantum Kernel python class in Qiskit is: qiskit_machine_learning.kernels.quantum_kernel Check also on IBM web-site: qiskit-tutorials/qiskit-machine-learning/03_quantum_kernel.ipynb QSVC code: https://github.com/Qiskit/qiskit-machine-learning/blob/1f01764186ad5e6fd4b88deb4dfec1e5cbb05d03/qiskit_machine_learning/algorithms/classifiers/qsvc.py Article Quantum Feature Map: https://shubham-agnihotri.medium.com/quantum-machine-learning-102-qsvm-using-qiskit-731956231a54
  10. The algorithm starts on your laptop, then the model representing the kernel and the data are sent to a real quantum computer. The result is a kernel that is compatible with Scikitlearn’s implementation of Support Vector Machines.
  11. The following pipeline “Xdawn spatial filter, Riemannian Geometry, Tangent Space, PCA” is used to generate the same feature vectors before applying a simple LDA or QSVM. One subject can have several recorded sessions playing the BCI game Brain Invaders. “Within-session” evaluation uses k-fold cross-validation to determine train and test sets for each separate session for each subject http://moabb.neurotechx.com/docs/generated/moabb.evaluations.WithinSessionEvaluation.html
  12. Evaluation of the two pipelines. Both finish in 5 minutes on a regular laptop.
  13. Training is slow because many users are “fighting” for the same “quantum computer”. Building the Quantum Feature Map is done by performing many “Quantum jobs” (a unit of work executed on a Quantum computer). “Shots” – the number of times the circuit is executed. More shots gives more confidence in the result, but it also takes much longer to process. The size of the generated feature vector (based on RG + Tangent Space) is limited to the number of available quantum bits. A real quantum computer should perform less accurately than an emulated one. Although an emulated quantum computer can include emulation of quantum noise. Adding more data (P300 ERP epochs) means more quantum jobs and more time to complete. But limiting the input data however means less training of the QSVM.
  14. [1,2] Advantages of Quantum Computing [3.4] Classification with the state of art method using Riemannian geometry [5] Quantum Support Vector Classifier