Edge Detection Based on Quantum Canny Enhancement for Medical Imaging

The cancer or object detection on image Computed Tomography, X-Ray, and Mammography often use segmentation methods. The most common segmentation method used is based on edge detection. The edge detection method which is proposed in this study is Quantum based with Canny operator. The quality improvement of edge detection results is emphasized on the method to generate the gradient magnitude value which is done by observing the strength of neighbour pixel values. The strength of this pixel is obtained by calculating the pixel change value and the distance of neighbour pixels to the centre pixel. The results of the implementation show that the proposed method produces a better PSNR value than the original Canny, Sobel, Robert, and Prewitt Operator.


Introduction
The various edge detection methods have been developed to obtain a clear and good edge from the image contained the object interest. Therefore, edge detection method has been modified to detect the edge properly and produce accurate information [1]. The accuracy information of edge detection will increase image processing performance such as image segmentation and image retrieval method [2].
The development of computer technology is characterized by the rapid progress of computing model from classical computing to quantum computing. A computational model of quantum computing is based on the principle of superposition. Superposition is the probability of multiple events or states indicate that data can be calculated simultaneously [3]. In classical computing data is expressed in bit. If the binary image or edge detection is represented in one of bit, then the value generated in classical computing is 0 or 1. While in quantum computing, bit represented as a quantum bit (qubit), which can produce a state of 0 and 1 simultaneously. Quantum computing has superposition properties that can perform calculations simultaneously and resulting probability of states. Quantum measurement is required to impose the system is in a state, and then produce 0 or 1 state [4].
Quantum edge detection is combined with classic operator such as the previous research by Sundani et al. [5] who carried out the Canny operator into quantum model. For this mechanism the edge detection method is able to detect more edge than classical edge detection using Robert, Sobel, Prewitt and Canny operators. In the classical method, the operator used can influence the results of edge detection. The implementation of Canny operator has been widely used in the research that involve edge detection as their part of the entire. Generally Canny operator has several stages of edge detection that are not owned by other operators and it can produce a clearer edge by optimizing the edge tracking [6].
In medical imaging problems, the edge detection method can be implemented as preprocessing step or main step. Some medical image does not have high range intensity value between pixels for different object region such as in CT-Scan, X-Ray, and Mammography image. The edge detection method uses the differences of pixels values to identify the edge based on the gradient magnitude. There is opportunity to enhance the edge detection result with focus on production gradient magnitude value based on the neighbor pixels that indicate the strength of the center pixel. The results of the implementation are compared to the other results of edge detection method such as quantum-canny developed by Sundani et al [5], edge detection that using Canny, Sobel, Robert, and Prewitt operator. This paper is organized as follows. Section 2 presents a proposed method by modifying the gradient magnitude as part of entire quantum-canny method. Section 3 shows the experimental results. Then, it will be closed by the conclusion. .

Material
This study uses data sets obtained from several repositories available online. There are three image types used i.e., Lung CT-Scan, Thorax X-Ray, and Mammography. Lung CT-Scan data was obtained from www.kaggle.com, Thorax X-Ray images were obtained from Gatot Subroto Indonesia hospital repository, and Mammography images were obtained from Mammographic Image Analysis Society (MIAS) which can be accessed at www.mammoimage.org. The image used to measure the performance of the proposed method is compared with the previous method.

Method
The Quantum Canny Method introduced by Sundani et al. [5] has a framework consisting of image enhancement stages, calculating gradients magnitude (edge strength), determining the probability of edge strength, measuring qubits, and determining a pixel or not of cubes.
In this research proposed a method that can improve performance in determining edge strength based on gradient magnitude. In the research was done by Sundani et al. [5], the value of magnitude assessment result is only based on the horizontal and vertical axes and focuses on four points, namely the three points of the neighboring pixels and the pixel center. To determine the Gradient Magnitude (GM) of the image by doing a gradient search horizontally (Gx) and vertically (Gy). The values of Gx, Gy and GM are described in the following equations 1, 2, and 3.

Calculating Gradient Magnitude
In the proposed method, Gradient Magnitude is found based on the assumption that neighbour pixels give strength to the centre pixel. The distance from the farthest is 2 pixels from the midpoint then the value of d = 2, while the pixel that is next to it has a value of d = 1. The distance value gives the dividing weight the difference in value. The farther away the effect of a neighbour pixel to the middle pixel is getting smaller. Even though these small influences need to be considered, considering the change in intensity in some types of images such as medical images from CT scans there is rarely a dramatic  figure 1, the simulation of the direction and distance used to calculate the strength of the edge value in the pixel is presented.
To get the gradient magnitude (GM), the square root formula of each gradient value in all directions is used, as shown in equation 5.
To get the edge orientation value (θ) arctangent is calculated from two values, i.e. Gx and Gy (equation 6).
The edge direction angle is rounded to one of four angles representing vertical, horizontal and the two diagonals (0°, 45°, 90° and 135°). An edge direction falling in each color region will be set to a specific angle values using conditional formula that represented in equation 7.

Non-Maximum Suppression
The aim of Non-Maximum Suppression (NonMS) is to get the sharp edge obtained from the maximum pixel value on the gradient magnitude (GM) image that has the closest position to the location of the change in pixel value on the detected pixel. To obtain the NonMS value used equation 8.

Edge Tracking by Hysteresis
After getting a sharp edge (strong), the next step is to determine the edge tracking for weak pixels by connecting weak pixels to strong pixels in NonMS, so that the edge is as close as possible to the actual edge and declared as H(i,j) variable. In the classical model, this stage is done by determining the threshold.

Probability of Edge Tracking by Hysteresis
Based on edge tracking by hysteresis obtained, then calculating the probability edge tracking by hysteresis that is defined as following equation 9. From the probability function obtained, there will be a lot of possible edge from edge weak expressed as probabilities of edge namely p1, whereas not edge is expressed as p0. The values of gx, gy and gm are described in the following equation 10 and 11.

Measurement of Edge Tracking by Hysteresis
This stage aims to get a deterministic value from the number of possible (probability) results of the edges obtained. This process is called quantum bit (qubit) measurement, where qubits indicate the probability values obtained in quantum computation models which are at values 0, 1 or 0 and 1. This process begins by taking random numbers, as variables x. If the value of x is obtained is in [0, p1] then the measurement result is expressed as an edge, and if it is in [p1,1] then it is declared not edge. The result of measurement is declared as a Q. The following is the qubit measurement algorithm:

Result and Discussion
To test the results of the implementation the proposed method, ground truth data was obtained from the marking of the edge in the medical image by the doctor as an expert. This procurement process is carried out on a tablet, then a doctor strokes a green pen on the tablet according to the edge that appears directly by the eye (see figure 2a). The marking results are converted into binary image (1.0) by using a green threshold value to obtain the edge image as shown in figure 2b. After obtaining ground truth image, value of Square Mean Error (SME) and Peak Signal Noise Ratio (PSNR) can be calculated by comparing two edge detection images, i.e., the binary image from edge detection using Quantum-Canny enhancement (3a) and the binary image from edge detection methods of expert judgment (3b). MSE and PSNR values are obtained by comparing the difference between the pixels in the two images in the same pixel position. Good quality image can be seen if the image that has been processed with edge detection method has the same pixel values with the ground truth image as a comparison. Table 1 shows the comparison of MSE and PSNR values from the results of edge detection using several methods. MSE and PSNR are formulated with equation 13 and 14. (14) In table 1, for image 1 of Lung CT-Scan, the lowest MSE value of the proposed method is 0.0247. While the highest MSE value is 0.0577 which is the result of edge detection using Robert's operator. This is because the Robert edge detection method only few edges that can be detected compared to the proposed method. However, by observing, the Quantum-Canny Sundani edge detection method produces more edges but the MSE value is greater than the proposed method. This is because a lot of noise is detected as an edge. Thus, the higher the MSE value, the image quality of the edge detection results is increasingly inaccurate along with the decrease in the PSNR value. As can be seen in Table 1 for the first image of the CT-Scan Lung the highest PSNR value was obtained using the proposed method (64.23), while the lowest PSNR value was obtained by the Robert method which is 60.55 dB.
Other than the number of edge pixels detected as a comparison, accuracy in detecting the shape of objects can also be a concern. In the image of Lung CT-Scan, the shape of the object that must detected is the part of the lung wall and the presence of cancer object inside. Thus, when the object is clearly visible, the quality of the detection method is good. For image 1 of Lung CT-Scan, all the methods that are compared have good results. This is different from the 2nd to 5th image, edge detection method using Sobel, Robert, and Prewitt does not always succeed in getting the shape of the lung object well.
Thorax X-Ray image is not only to get lung objects but also to recognize other objects in the lung area. The best method for obtaining objects is Quantum and Canny classic methods. Edge detection method with Sobel, Roberts, and Prewitt operators cannot find the edges of objects properly. This is also shown by the low value of PSNR in the three methods.
For mammography image, the edge detection step is to find the presence of cancer in the breast. Image mammography is very difficult to be analysed by edge detection method. This condition presented by the small PSNR value obtained when compared to other image types. The object of cancer is also difficult to find with edge detection, because there are small differences in the intensity of cancer objects with other parts. However, the proposed method can detect the presence of cancer even though it provides perfect edge results.

Conclusion
The edge detection based on Quantum-Canny enhance has been successfully developed and provide better results with other methods such as quantum-canny by Sundani, classic Canny, Sobel, Roberts, and Prewitt operator. This is indicated by a lower MSE value compared to other methods, but has a higher PSNR value. The next quantum methods can be developed to solve problems in mammography