Low power design method of medical image display system based on FPGA

A novel low power design scheme of medical image display system is proposed, based on the research of FPGA(Field Programmable Gate Array) low power design technology and medical image display system. Firstly, the power consumption of video and image processing system based on FPGA is analyzed. Then a method to reduce the dynamic power consumption of FPGA is proposed based on the tonal and spatial characteristics of medical images. Finally, taking radiographic medical images as an example, the signal flip ratio is reduced from 37.95% to 9.68% by using software statistics, which proves that the proposed scheme can effectively reduce the dynamic power consumption of FPGA.


Introduction
With the continuous progress of global digital visualization technology of medical images, medical displays have been widely used in radiology departments, pathology departments, operating rooms and other departments in hospitals [1][2], providing the guarantee of accurate display for radiography reading, pathological diagnosis, surgery, etc. In order to ensure the accuracy of medical diagnosis, it is necessary to perfectly present the details of medical images, so medical displays are often characterized by high resolution and high refresh rate [3][4]. However, the improvement of resolution and refresh rate inevitably brings the problem of excessive power consumption to display devices [5][6], and the resulting problems of service life and product reliability of medical display [7] have become prominent.
In order to ensure the display effect of medical images, the real-time, reducibility and consistency of medical images should be guaranteed in all aspects of the collection, transmission and display of medical images [8][9][10]. FPGA(Field Programmable Gate Array) has been widely used in the field of medical image processing due to its design flexibility, such as DICOM correction [9] and color and gray scale images adaptive correction [11] for medical image in medical display. Therefore, the low power design of medical image display system based on FPGA has high theoretical value and practical value.
In view of this, this paper analyzes the power consumption of video and image processing system based on FPGA. Then, combining with the tonal and spatial characteristics of medical images, a method to reduce the dynamic power consumption of FPGA is proposed. Finally, taking radiological medical images as an example, the statistical signal flip ratio is reduced from 37.95% to 9.68% by using software, which proves that this scheme can effectively reduce the dynamic power consumption of FPGA.

Power analysis model of FPGA
The power consumption of FPGA chip is mainly divided into two parts: Dynamic power and Static power, of which the Dynamic power is further divided into switching power and short-circuit power [12]. Switching power consumption is due to the charge and discharge consumption of internal node capacitance of FPGA internal logic unit during operation. Short-circuit power consumption is caused by the transient simultaneous conduction of PMOS tube and NMOS tube during charging and discharging, and this part of power consumption takes a small proportion in the dynamic power consumption. Static power consumption is caused by various types of transistor leakage current, such as subthreshold leakage current, gate leakage current, etc.
As the static current and short-circuit current are determined by the manufacturing process of FPGA chip to a greater extent, it has little to do with the logic design of the users of FPGA chip. Therefore, for a design using FPGA chip, to reduce the power of the design, we can only start from reducing the switching power of FPGA chip.
Switching power P switch can be expressed by the following formula [12] P switch =0.5×α×C×V swing ×V dd ×f (1) Where, α is the signal flip ratio of the circuit nodes, C is the equivalent capacitance value of the circuit nodes, V swing is the voltage swing, V dd is the power supply voltage, and f is the clock frequency.
For a specific FPGA logic design, after the selection of the FPGA chip is determined, the equivalent capacitance value of the circuit nodes C, voltage swing V swing and power supply voltage V dd are all determined and cannot be changed. What the designer can control is the clock frequency f and the signal flip ratio α of the circuit nodes, and reducing the clock frequency f often compromises the performance of the product. Therefore, for a particular design using FPGA chip, in order to reduce its power consumption, we can only find a way to reduce the signal flip ratio of the circuit nodes.

Application of DDR3 SDRAM in medical image display
In the medical image display system, many processing of medical images need to operate multiple frames of images simultaneously, such as motion compensation, deinterlace, frame rate conversion, etc., while the internal cache of FPGA cannot store large capacity video data. In this case, DDR3 SDRAM(Synchronous Dynamic Random Access Memory) is generally used to complete the storage of multiple frames of video. Since DDR3 SDRAM is widely used in medical image display system, this paper will first study how to reduce the related power consumption of DDR3 SDRAM.
The controller inside FPGA will activate, refresh, read and write, calibrate and other operations of DDR3 SDRAM chip in accordance with the established timing sequence, mainly through the control of read/write request signal, address signal, data signal and various command signals. Time sequence of write operation for DDR3 SDRAM is shown in the figure below: Among the signals required by the write operation, the flip of DQ signal is related to the pixel value of the medical image, while the rest of the signals are independent of the pixel value of the medical image. Because the tonal and spatial distribution of medical images mostly have certain rules, the flip ratio of DQ signal can be reduced according to these rules, thus reducing the power consumption. In order to study how to reduce the flip ratio of DQ signal, the mapping relationship between pixel data and DQ should be determined first. The following is an example of a write operation with pixel data color depth of 10bit and burst length of 8 to illustrate the mapping relationship between pixel data and DQ. If the data is mapped without special processing and RGB[29:0] data is mapped to DQ [3:0] in turn, then the sequence diagram after mapping is as follows: Figure 2. Pixel data mapping without special processing.

Mapping according to tonal characteristics
According to the different imaging methods of medical images, the tone characteristics of the images are also different. Gray scale images have a large proportion in common medical images, such as ordinary X-ray imaging, computer tomography, nuclear magnetic resonance imaging, Ultrasonic Contrast , etc. For Gray scale images, the values of R, G, and B in the pixel data are equal, and any value of R, G, and B can represent all the information of the pixel. For color images, the values of R, G, and B in pixel data are not equal, and the three values of R, G, and B are needed to represent the pixel together. However, in the collection, transmission and display system of medical images, R, G and B are all treated equally regardless of color images or gray scale images, which inevitably leads to the waste of various resources.
For gray scale images, in the DDR3 SDRAM read and write operation, if the value of R represents the information of the whole pixel, and the values of G and B remain unchanged, then the signal flip on DQ[3:0] will be reduced to 1/3. For color images, the above method still works, because there will also be some gray scale pixels in the color image with equal R, G, and B values. For color pixels, R, G, and B are transmitted during the DDR3 SDRAM read and write operation. For gray scale pixels, during the DDR3 SDRAM read and write operation, only R is transmitted, the values of G and B remain unchanged, and at the same time, it gives a flag whether the current pixel is a gray scale pixel.
In this way, the above pixel data is mapped before DDR3 SDRAM writing inside the FPGA, and the flag of whether the pixel is gray scale pixel is given. After reading from DDR3 SDRAM, and then restoring R, G and B data in accordance with the gray scale pixel flag inside the FPGA, the low-power reading and writing operation of DDR3 SDRAM can be realized lossless.
As shown in Figure 3, a pixel data mapping method that can realize low-power read and write function is presented:  Figure 3. Pixel data mapping with low power consumption characteristics.
In figure 3, Gray_flag is the gray scale pixel flag, and when the current pixel R=G=B, Gray_flag=1. Since the mainstream color depth Settings of medical images are generally 8bit and 10bit, in order to facilitate the mapping of pixel data, the lower two digits of RGB data are mapped to DQ[0] separately.

Mapping according to spatial characteristics
The pixel data of medical image is often numerical gradual in space, and the pixel data of most pixels are numerically close to those of the surrounding pixels, so the higher significant bits of its pixel data can be reused. As shown in figure 4, the regional pixel data of a radiological image (color depth 8bit). The pixel value of the first row and first column is 78 and the pixel value of the first row and second column is 84. After converting the above two pixel data from decimal to binary, the pixel data becomes01001110 and 01010100.The highest three bits are the same(010).Therefore, when DDR3 SDRAM reads and writes, the highest three bits transmission level of the second pixel remains unchanged, thus reducing the roll-over ratio. At this point, a reuse flag is needed for mapping when DDR3 SDRAM is written and read out.
On the basis of the pixel mapping mode shown in Figure 3, the reuse flag is added to obtain the pixel data mapping mode that can further reduce the power consumption, as shown in Figure 5. In the figure above, Reuse_flag is the high bits reuse flag. The specific number of bits to be reused needs further research, and number of reused bits is defined as N.

Medical image pixel data encoding
After the pixel data of medical image is mapped according to the above tonal and spatial characteristics, it is necessary to maintain the level of the previous clock edge on a specific data bit to reduce the flip times of DDR3 SDRAM DQ line and achieve the purpose of reducing dynamic power consumption. Therefore, pixel data need to be encoded before DDR3 SDRAM write operation.
Since pixel data is mapped according to the color depth of 10bit, it is necessary to describe the conversion method of pixel data of 8bit color depth to 10bit. Let the pixel data of a medical image with a color depth of 8bit be r [7:0],g [7:0]and b [7:0]. When converted to a 10bit color depth, the pixel data is shown below: Step1:According to the tonal characteristic encoding: judge whether the current pixel is a gray scale pixel, if it is a gray scale pixel, set Gray_flag to 1, and then proceed to Step2;Otherwise, Step8.
Step2 Step3:According to the spatial characteristic coding, determine R c[i] [j] :judge whether the current pixel is in the first column. If it is in the first column, Step4 is performed; Otherwise, Step6.
Step5:If the pixel is in the first column, but not in the first row, higher significant bits reusing is determined: judge whether the N bits data of R [i] [1]  Step9:Finish. Before writing DDR3 SDRAM, the pixel data is encoded according to the above steps. The encoded pixel data R c , G c , B c , Gray_Flag and Reuse_Flag are mapped to each DQ data line according to the mapping method in Section 4.2 to reduce the ratio of signal inversion on the DQ line. In the coding process, the higher significant reused bit N needs to be determined according to the distribution law of pixel value of specific medical images. The reduction of signal flipping will be different with different value of N. After reading from DDR3 SDRAM and then decoding, the original pixel data can be restored correctly.

Experimental verification
NIH Chest X-Ray 14 is a image set of 110,000 frontal Chest X-rays available free of charge from the United States National Institutes of Health. Based on the Chest X-Ray 14 image set, this paper will validate the proposed low-power mapping and encoding method for DDR3 SDRAM.
The Chest X-Ray 14 image set had a color depth of 8 bits and a resolution of 1024*1024.The first 100 images in the image set were used as experimental subjects.
According to different values of N, the experimental results are shown in the table below: The signal flip rate in Table1 refers to the average signal flip ratio on multiple DQ data lines of DDR3 SDRAM. When the DDR3 SDRAM read and write data is transmitted effectively, just like the rising and falling edges of clocks 3, 4, 5, and 6 in Figure 5,if the DQ signals on each clock edge are all flipped, the flip rate is defined as 100%.
The experimental results show that the method proposed in this paper can effectively reduce the data line flip ratio during DDR3 SDRAM read and write operation. When the method in this paper is not used, the flip ratio of data line is 37.95% during DDR3 SDRAM read and write operation. When N=5, the signal flip ratio can be reduced to 9.68% by the proposed method, which greatly reduces the dynamic power consumption.

Conclusion
In this paper, a low power design method for medical image display system based on FPGA is proposed, and the effectiveness of the method is verified by taking DDR3 SDRAM as an example. The signal flip ratio can be reduced from 37.95% to 9.68%, which greatly reduces the dynamic power consumption of DDR3 SDRAM during read and write operation. And other modules of the medical image display system can also adopt the method similar to that in this paper, using the tonal and spatial characteristics of the medical image, through mapping and coding, reduce the level flip ratio on the signal line, so as to reduce the overall power consumption of the medical image display system.