top of page
Quemix image.jpg


Introducing Channel Attention to Quantum Machine Learning

The concept of attention plays a pivotal role in enhancing perception and understanding. Just as closing our eyes sharpens our auditory senses, directing attention to specific elements can significantly impact the outcome of various processes. In the pursuit of advancing machine learning, scientists and researchers have integrated the capability to "pay attention" to various machine learning models.

Even without delving deeply into the realms of neuroscience and artificial intelligence, we can intuitively sense the significance of attention in our daily lives. The world is intricate and abstract, and directing our focus—equivalent to confining oneself to specific details—enables our brains to simplify the complexities of the world, enhancing efficiency in solving the tasks at hand.


Channel Attention in the Classical Machine Learning Model

In the field of machine learning, attention has become one of the key elements contributing to the success of modern and sophisticated models. The concept of attention in machine learning mirrors the human cognitive process, allowing models to focus selectively on certain features or parts of input data, improving their ability to process and understand complex information.

For example, imagine a model self-driving system positioned in front of a traffic light. In this scenario, the system faces the critical task of decision-making, determining whether to halt the car or proceed based on the color of the traffic light. 

To achieve this, the system must initially "see" or perceive each color independently. This is where the concept of a "channel" comes into play. In the context of image processing, a channel refers to a specific component of an image that represents a particular color or feature. In the widely used RGB (Red, Green, Blue) color model, each color is assigned to a separate channel. The red channel highlights the intensity of red in the image, the green channel represents the intensity of green, and similarly, the blue channel captures the intensity of blue. Essentially, channels act as distinct pathways through which the system processes and analyzes different aspects of visual information.


In the example of the self-driving system encountering a traffic light, these RGB channels become crucial. The system relies on the information extracted from each channel to discern the color of the traffic light accurately, forming the basis for its decision-making process.

Attention to these different channels comes in the form of weights of importance assigned to each channel. "Weights" are simply numerical values assigned to each channel (red, green, blue), as indicators of the importance of that particular channel in making the decision to stop or continue the car.

For example, if the weight assigned to the red channel exceeds that of the green and blue channels, the self-driving system becomes more attuned to the presence of red and puts less importance on the shade of blue in the image.


This channel attention proves to be remarkably important when training a computer vision model, particularly in scenarios where certain features or colors carry greater significance for the task at hand. By dynamically adjusting the weights assigned to different channels, the model can adapt its focus and prioritize relevant information during the training process. This adaptability enhances the model's capacity to discern intricate patterns and make informed decisions, a crucial aspect in image processing and object recognition.

Channel Attention for Quantum Neural Network

Drawing inspiration from the channel attention mechanism discussed earlier, our most recent preprint (Gekko et al., arXiv:2311.02871 (2023).) introduces a novel channel attention mechanism tailored for quantum neural networks, with a particular focus on quantum convolutional neural networks (QCNNs). In this innovation, we established channels of output states through the measurement of quantum bits within the pooling layer of the QCNN circuit, as illustrated in Figure B below.


Much like the application of computer vision for self-driving cars explained above, these channels enable the model to "perceive" distinct facets of potential output states. Modifying the weights of each channel is akin to assigning their importance in resolving the problem.


A weight, signifying importance, is assigned to each channel, and the summation of these weighted channels is performed. To preserve the final output as a probability distribution of states, the softmax function is applied.

The performance of QCNN with and without channel attention is then compared in the task of quantum phase recognition. Here, the objective is to determine whether an input quantum state belongs to the symmetry-protected topology phase (SPT), symmetry-broken phase (SB), or trivial phase.

The incorporation of channel attention into QCNN enhances precision in the classification of quantum phases, particularly in the vicinity of the trivial and SPT phase boundaries, as depicted in the figure above. Additionally, the utilization of channel attention in QCNN boosts the likelihood of accurate classification, as can be seen from the color of the datapoints.

In conclusion, in this study, we introduced a channel attention mechanism for the quantum convolutional neural networks (QCNNs). In our approach, channels of output state are created by additional measurements of qubits, and the importance of each channel is computed. Integrating this approach led to a significant increase in the performance of the QCNNs without any major alteration to the already existing models on quan- tum phase recognition problems.



bottom of page