Abstract
This app uses quantum annealing, a type of quantum computing, to reduce noise in binary images. For this purpose, a model called an Ising model, which consists of the interrelationships of pixels after adding noise, is constructed, and sent to the Annealing WEB service using App Inventor's web function. Noise reduction is displayed on the smartphone screen based on the spin information corresponding to the pixels returned from the web service. This app, which runs on familiar smartphones, lets you experience the processing of a quantum annealing machine that is different from existing computers.
This app is published here: source code
source code: MIT App Inventor Gallery
(If you need pre-built .apk file, please contact me.)
This app won the "2022 September's MIT APP INVENTOR OF THE MONTH" award.
Noise reduction using Annealing web service
Here, we will use Hitachi's CMOS Annealing cloud web service. Designate the original image on your smartphone, add a small amount of random noise to it, and use it as the input image. In preparation for removing that noise, we map each black and white pixel to a spin up or down (in quantum mechanics). And we also describe the connection relations between those spins. After that, we construct an energy function (or cost function) that describes the properties that neighboring pixels (spins) should have after noise reduction. In other words, this creates an Ising model. Sending it to the web service will give you the spin direction that minimizes the energy function value. Based on that, it generates a noise-reduced image. A more detailed explanation of this method can be found on the Hitachi web page below:
https://annealing-cloud.com/en/tutorial/1.html
Noise reduction application created with MIT App Inventor
Figure 1 shows an application created with MIT App Inventor based on this method. The procedure for its use is shown at the bottom of the figure. First of all, in order to use this Annealing Web service, please obtain an access token from the Hitachi website below. You can get it for free. The expiration date is one month, but you can renew the expiration date if necessary. You will need to paste this token into the input field at the top of the app.
https://annealing-cloud.com/en/web-api/token-request.html
There are several parameters to control this annealing. Some of them can be changed from this screen. For the meaning of the parameters, see the Hitachi website above. Here we use a simple preset image (a simple illustration of a dog), but you can easily replace it with your own image. You can also observe by changing the size of the image and the number of noises (number of pixels).
It may take some time for the web service to respond, so please be patient!
If the noise reduction results seem strange or you get an error, please wait a while and try again!
Results of noise reduction in this method
This app is not aimed at practical noise reduction, but is a demo app that shows the possibilities of the quantum annealing method. Therefore, it will not cope well with images that are too complex or too much noise. Some execution results are shown in Figure 2. From these results, we can see the characteristics of this method. In other words, it can be confirmed that isolated noise within white or black areas is easy to remove, but noise near black and white borders is difficult to remove.
Main blocks of this app
The main MIT App Inventor blocks for this app are shown in Fig.3. There are two parts. Part (a) is for starting the Annealing Web service. An energy function (Ising model) required for noise reduction is set in the variable "model_list". The energy function contains two formulas. One is for the number of pixels in which black and white are reversed in the input image and the denoised image. The second is for the number of pairs of pixels in which adjacent pixels have the same value in the image after noise removal. Also, part (b) processes the result (information about spin) received as Json text from the web service.
Acknowledgments
This application is based on the explanation on the website of Hitachi, Ltd. below:
https://annealing-cloud.com/en/index.html
We would like to thank Dr. Masanao Yamaoka of Hitachi, Ltd., who developed the CMOS annealing machine, for answering various technical questions.
0 件のコメント:
コメントを投稿