量子计算在计算机视觉应用-QPIE 算法 and QHED 算法 ,本人课设论文,搬用请标明出处

Note: Because this article involves two quantum algorithms, which are complementary to each other, it must be analyzed together, so this article may be longer, I am waiting the reader's forgiveness here.

Introduction

The field of computer vision may be unfamiliar when it comes to the field of computer vision, but it's better understood when it's put another way as the optic nerve of an AI driver in a driverless system. Computer vision enables self-driving cars to make sense of their surroundings. Cameras capture video from different angles around the car and feed it into computer vision software, which then processes the images in real time to find the end of the road, read traffic signs, and detect other cars, objects, and pedestrians. This involves a lot of image processing algorithms, and today we are discussing one of the more important edge detection algorithms.

Firstly we need to have a rough idea of what a classical (traditional computer) edge detection algorithm is? In the driverless car on the road need to comply with traffic rules, for example, the speed limit of the road, the general speed limit warning signs next to the road will show the specific value. And the driverless image system must extract the valid information in the speed limit warning sign captured by the camera in real time. The edge detection algorithm is an image processing technique that simplifies the image information through filters and uses edge lines to represent the key information carried by the image, as shown in the figure. When the processed grey-scale map image features are obvious, it is easy to input into the machine learning model to match with the information in the feature library and make driving decisions accordingly.

With the development of quantum computing technology, many traditional computer fields have begun to combine the advantages of quantum computers to seek new technological breakthroughs. And in the field of computer vision, the convergence of image analysis has produced a breakthrough concept: quantum edge detection. This approach combines the precision of quantum computing with the task of identifying image boundaries. By exploiting quantum properties such as superposition and entanglement, quantum edge detection has the potential to revolutionise accuracy and efficiency compared to classical methods. And it is the algorithms Quantum Probability Image Encoding (QPIE) and Quantum Hadamard Edge Detection (QHED) that I am going to introduce today.

Since the computing principles of quantum computers are different from those of conventional computers, in order to perform quantum image processing on images used in classical image processing, we need to convert them into quantum images. There are various types of quantum image representations, one of which is quantum probabilistic image encoding (QPIE).The QPIE algorithm represents an image encoded with a much smaller number of quantum bits than the number of pixels in a warbling image. For example a conventional image of N pixels requires only log2 (N) quantum bits. For each n quantum bits, 2^n states are created by superposition. Whereas in traditional edge detection algorithms in order to determine the edges of an image we need to determine the pixel intensity gradient. This requires processing each pixel which results in a complexity of O(N) for an image of N pixels. Since the number of pixels grows exponentially with the size of the image, this causes problems for large images. With the QHED algorithm the efficiency will grow exponentially and we can determine the pixel intensity gradient with a complexity of O(1) using the superposition caused by the Hadamard gate regardless of the image size.

Principles of Quantum Probabilistic Image Encoding (QPIE) Algorithm

In order to visually introduce the principles and advantages of the QPIE algorithm, I will give a 4-pixel grey matter image coding example to compare and contrast with and analogise with traditional image coding algorithms.

Traditional computer RGB image encoding algorithm

The basic unit of an image is a pixel, like a giant electronic advertising screen from a distance is the image of the clothes, come closer you will see one by one square, the square is a colour, from a distance, can not perceive the existence of this square. Grey matter maps have only one grey value per pixel to represent intensity, and are usually represented using an 8-bit representation, i.e. each pixel occupies 8 bits (or 1 byte). This means that each pixel can represent 256 different grey levels (from 0 to 255). The 8-bit grey matter image of 4 pixels in the example is roughly schematically distributed in the computer memory as follows:

I

00

255

01

127

10

63

11

0

The grey matter map occupies 8 bits per pixel, so the memory occupied by this 4-pixel, 8-bit RGB image code value is: 4 pixels × 1 bytes per pixel = 32 bit.

Quantum Probability Image Encoding (QPIE) Algorithm

According to the QPIE algorithm 4-pixel conventional images can be represented with only log2 (4) = 2 quantum bits, which significantly reduces the memory required to store the image data. The example image consists of four pixels arranged in a matrix. Each pixel has a binary representation and has a corresponding intensity value I. The image is represented by a matrix of four pixels.

The x,y are the coordinates of the binary position of the pixel, and Iyx refers to the black and white pixel intensity of the pixel 8bit at the binary position x,y. And I refers to the intensity of the whole 4 pixels.

Representing this image according to the QPIE algorithm, the whole image representation remains pixel intensities, which we can convert to quantum state (for QPIE) probability amplitudes by normalisation. In this way, the sum of squares of the amplitudes will be equal to one.

After normalisation, the quantum state of the image can be written by assigning the normalised colour value of each pixel to its respective quantum state. For a general image with n quantum bits, the generalisation can be written as:

Now that the image has been converted from a classical image to a quantum image, we can write it as a superposition of quantum states. In particular, for this 2x2 image, the states can be summarised as:

From the above description we can see that in conventional computer image coding algorithms when representing the black and white intensity of a pixel, an 8bit binary value is required to represent the corresponding intensity. But in the QPIE algorithm the pixel intensity only needs to be represented by superposition of quantum states, i.e., different amplitude probabilities of the quantum to represent the pixel intensity value. This algorithm greatly reduces the cost of coding the representation image. We can take an example based on the figure and the binary coordinate of (0,0) pixel in the figure, in the traditional algorithm the pixel bit intensity value is:11111111=2^(8 ) but in the QPIE algorithm the pixel intensity value of the binary left side of (0,0) is C0, which is the amplitude probability value of the superposition state |00>.

Quantum Hadamard Edge Detection (QHED) Algorithm

Traditional Computer Edge Detection Algorithm

Before introducing the algorithm we need to discuss a concept filtering, which has two main purposes:

- To extract image features through filtering, and to simplify the information carried by the image as a follow-up to other image processing.

-To adapt to the needs of image processing, filtering to eliminate the noise mixed in the image digitisation.

The first of these is the basic idea used in edge detection, i.e. to simplify the information in the image and use edge lines to represent the information carried by the image.

Filtering can be understood as a filter (usually 3 * 3, 5 * 5 matrix) in the image from top to bottom, from left to right traversal, calculating the filter and the corresponding pixel value and according to the purpose of filtering numerical calculations to return the value to the current pixel point, as shown in the figure, the blue block represents the filter, the image of the dot product operation and the value of the image to the image of the specific expression of the formula is:

where R5 represents the current pixel point, RiGi represents the current pixel and the corresponding value of the filter multiplied by the value, n is the filter size, for example, if the filter value is all 1, this formula calculates the average value of the 8 connected pixels of the current pixel point, so the filtered image should be blurred, the degree of blurring depends on the size of the filter, the larger the size of the filter, the blurring effect is more The degree of blurring depends on the size of the filter.

After introducing the concept of filtering, edge detection becomes easy to understand. Because edge detection is essentially a filtering algorithm, the difference lies in the selection of filters. The edge detection of the image is to calculate the pixel intensity gradient of the gray matter map through the filter. Because the image is two-dimensional, we are looking at the differential of the two-dimensional function, that is, the partial differential equation:

From the above formula, we can see that the image gradient is the partial derivative of the current pixel on the X axis and Y axis, so the gradient in the field of image processing can also be understood as the speed of the change of the pixel gray value. Let's take a simple example below:

Figure we can see that the difference between 100 and 90 grey value of 10, that is, the current pixel in the X-axis direction of the gradient of 10, while the other points are 90, then the derivation of the gradient found to be 0. Therefore, we can find in the digital image processing, because of its pixel nature of the specificity of the calculus in the form of image processing performance for the computation of the current pixel along the direction of the difference between the partial differential, so the actual Therefore, the application does not need to use the derivation, only simple addition and subtraction operations.

Common edge detectors are: Sobel, Prewitt, Roberts operators. Due to limited space, and these operators are the same principle, just different operators, here but not too much detail.

Quantum Hadamard Edge Detection (QHED)

The QHED algorithm uses an H-gate to detect edges in an image by manipulating the binary bit strings of neighbouring pixels. The core idea of traditional image edge detection algorithms as described above is the difference between the intensities of neighbouring pixels, which is the gradient.

Where i refers to the first few bits of the binary coordinate position of the pixel.

And we know that in quantum image coding the pixel intensity is represented by the amplitude frequency of the superimposed quantum state, then we are able to compute the gradient of quantum image coding by just asking. Since we know that hadamard gate has the following operation for quantum bits, then we can implement the operation of subtracting two neighbouring sub-superposition states with the help of hadamard gate.

From the output of the second formula above we can see that we can see that the formula can only compute, here i is an even number, then the formula can only compute the horizontal boundaries between adjacent even pixel pairs. In order to calculate the horizontal boundaries between odd pixel pairs we can convert the amplitude vector by amplitude substitution, apply an H-gate, and measure the quantum registers with an LSB of I1>.

In addition an extra auxiliary quantum bit can be used to increase the resource efficiency of the process.The QHED algorithm uses quantum registers with additional auxiliary quantum bits, allowing computations to be performed on both even and odd pixel pairs. Therefore we initialise the image state, create redundant n-quantum bit image states and h-gates are applied to the auxiliary quantum bits.

In order to simplify the computation of the image gradient later, we can use the magnitude substitution you transform the redundant probability magnitude obtained in the synthetic state. The definition is as follows:

Finally, with the auxiliary qubit in the state |1>, we can calculate the gradient values of all horizontal adjacent pixel pairs in the pixel image.

Of course, QHED algorithm also has a quantum edge detector similar to the traditional ED algorithm, such as QSoble operator, because the implementation method is similar to the QHED algorithm I introduced above, only the quantum operation gate used in the processing process is different, so there is no need to go into details.

From the above we can see that the classical image edge detection algorithm is very time consuming as it needs to operate with each pixel and the time complexity may take O(2ⁿ) or O(mn .log(mn)). Whereas in quantum edge detection algorithm because QHED algorithm is using more space saving QPIE image coding algorithm, this representation makes equal pixel sized image in exponential form level going to reduce the occupied qubit. so in coding the image for image edge detection algorithm time complexity is reduced drastically to O(1). Although the time complexity of QSoble algorithm is slightly different, it is also much faster than the traditional algorithm time complexity O(n²).

QPIE algorithm and QHED algorithm operating conditions

The QPIE algorithm and the QHED algorithm are image processing algorithms based on the principles of quantum computing and need to fulfil certain physical and other requirements to work properly. The following are the conditions they require:

Quantum Computing Hardware: These two algorithms need to run on a quantum computing platform and therefore require reliable quantum computing hardware including quantum bits and quantum gates. From the simulation diagram below we can see that QHED algorithm operation mainly relies on Hadamard gates, X gates, and CNOT gates.QPIE algorithm Due to the number and accuracy of quantum bits, the noise and error of quantum computers, and other factors will have an impact on the accuracy and range of the colour representation, so nowadays the QPIE algorithm can only deal with some images coded with lower colour complexity and smaller pixels. If we want to deal with some complex images, the QPIE algorithm is extremely demanding on hardware and remains a problem waiting to be solved in the future.

Quantum Algorithm Implementation: The implementation of the QPIE algorithm and the QHED algorithm requires the aid of a quantum programming language (qiskit) or a quantum programming framework (Q# or Quipper) in order to build and run quantum circuits on a quantum computing platform.

Image Data Input: These algorithms need to receive image data as input and therefore need to be able to convert the image data into a quantum bit representation or other form suitable for quantum computation. This is designed into data preprocessing using image processing libraries (e.g., OpenCV) to preprocess the raw image, including operations such as noise reduction, smoothing, and scaling. The pre-processed image data is converted into the format required for quantum computation, for example mapping pixel values to a representation of quantum states. Finally the quantum state is initialised using a quantum programming language or quantum programming framework (creating quantum circuits that map the quantum representation of the image data to quantum bits in the quantum circuit.

When the QPIE algorithm and the QHED algorithm start to work, it means that there will be an exponential reduction in the memory occupied by the image encoding, as well as an exponential reduction in the computational time complexity of edge detection, greatly improving the efficiency and speed of edge detection. In addition the QPIE algorithm is theoretically not limited to pixel intensity values in the 2^(8 ) size range, but the probability magnitude can represent an infinite number of possible colours. The probability amplitude in quantum computing is complex and can take on any value in the complex plane, and therefore can represent colour variations at infinitely fine granularity. However, in practice, the actual range of colours that can be represented may be somewhat limited due to the physical constraints of quantum computers and the finite nature of computing resources. For example, factors such as the number and precision of quantum bits, noise and errors of the quantum computer may have an impact on the precision and range of colour representation. Therefore, in practical applications, it may be necessary to appropriately quantize or discretize the colour space in order to efficiently represent image colour information on a quantum computer. However, through the development of quantum computer technology, the measurement of quantum amplitude is gradually becoming more accurate, then a 4-pixel picture of any colour gamut can be represented with only 2 qubits.

Future Research Direction

For the application of traditional computer vision technology in the field of unmanned vehicles is already mature, there is no need to apply quantum computer vision technology in this field. Quantum computer vision technology should be applied to image processing in fields with more complex image features and higher computational complexity. One of the most valuable research directions is to apply QPIE algorithm and QHED algorithm to medical or pharmaceutical applications.

Because QPIE and QHED algorithms have inherent advantages over traditional algorithms, especially in the analysis of image features with higher complexity and larger image code. For example, when analysing an image of amino acid structure, the amino acid molecule image is of high dimensionality and extremely complex structure, the QPIE algorithm can perfectly solve the problem of high latitude image by using the two-substrate superposition state, while the QHED algorithm can identify the edges of the image more efficiently with a lower computational complexity in time. In addition quantum algorithms can usually provide higher precision and accuracy than classical algorithms. When analysing molecular structure maps of amino acids, QPIE and QHED algorithms can provide more accurate results, thus helping researchers to better understand molecular structures and properties.

As the hardware and algorithms of quantum computers are updated, quantum computer vision processing technology will be a revolution in the medical or pharmaceutical fields.

抱歉中文版我没写,只有英文版,如果感兴趣话多多支持我。我将来还会出更多的关于量子计算的文章。如果呼声高的话,我可以考虑开一个系列交大家如何入门量子计算。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值