Hardware Architecture Design Of Anemia Detecting ...

1 downloads 0 Views 526KB Size Report
tools. (n.d.). Retrieved from http://www.syncad.com. [11] Hemoglobin, A1c, Levels, Tests, Low, Normal, High, and Range -. MedicineNet. (n.d.). Retrieved from.
Hardware Architecture Design Of Anemia Detecting Regression Model Based On FPGA Md. Imran Khan1, Raktim Kumar Mondol2, Muhammad Ahsan Zamee3, Tanvir Ahmad Tarique4 [1, 2, 3]#

Dept. of EEE, World University of Bangladesh Dept. of ICT, Bangladesh University of Engineering and Technology Dhaka, Bangladesh. 1 [email protected],[email protected],[email protected],[email protected] 4

Abstract—This paper proposes Field Programmable Gate Array (FPGA) based architecture for simple, portable, low cost anemia detector by implementing in verilog HDL. Noninvasive diagnosis of anemia shows that color of blood can give an indication to the severity of Anemia. Moreover simplicity of this computational image processing method makes it essential to implement it in hardware level. Because of using floating point algorithm same result is found after simulation in matlab and Verilog. By using this system patients can easily check his hemoglobin level of blood. Keywords- FPGA, Verilog HDL, Floating point algorithm Hemoglobin,Anemia.

I.

INTRODUCTION

Anemia is a disease caused by the reduction of red blood cells (RBC) count and the hemoglobin (Hb) level in human blood [1] .While the extent of affliction is negligible in developed world, it is alarming in developing countries. Anemia is critical health concern as it affects growth and energy levels in human beings. In pregnancy, it is associated with premature births, low birth weight of babies and prenatal and maternal mortality [2]. In fact, pregnancy is considered a death sentence in some countries [3]. Anemia can be a result of Hb level in blood, which in turn can be due to deficiency of Iron, Vitamin B12 or Folic acid. Of these, anemia due to Iron deficiency is normally prevalent. Iron is responsible for carrying Oxygen from the lungs to various parts of body through blood. So, reduction in Iron level will result in reduced Oxygen carrying capacity of blood, which can have adverse effect on the health of the individual. There is a need for simple, accurate at the same time cost effective solution for evaluation of Hb. Of all the methods that are available for anemia detection, Cyanmethemoglobin method is considered to be the most reliable and accurate method. This calls for about 2 cc of blood drawn from the patient to be mixed with deadly chemicals such as Cyanide for analysis. Many studies conducted on other alternative methods have found them to be inadequate in addressing the reliability and accuracy of the estimation of Hb in blood, making alternative methods unsuitable. So, we have a requirement to find a suitable easy to use, economical and simple method for estimation of Hb in blood that can be operated in rural and low-resources settings. There are standardized methods recommended by WHO [4]. A Noninvasive regression based image processing method is proposed to identify the Hb level in blood [5]. A simplified

method has been identified by the authors wherein they had used a color slide of the blood sample to identify the Hb level in blood [6]. Logit regression model based Microscopic image processing method is proposed for anemia detection [8]. H. Ranganathan and N. Gunasekaran put forward a concept of invasive estimation of hemoglobin in blood using color analysis and artificial neural network [7]. Xilinx ISE [9] is a software tool produced by Xilinx for synthesis and analysis of HDL designs, which enables the developer to synthesize designs, examines RTL diagrams. The building block were designed, tested and evaluated using the ISE tool available from Xilinx and Testbench [10]. This paper is structured as follows. Section II part A describes noninvasive regression model based image processing method and part B for Anemia detection process. In Section III part A describes the bus architecture and section B is for describing modules. Section IV shows simulation and synthesized result. Finally Section V is for conclusion. II.

METHODOLOGY

A. Noninvasive Regression model A non-invasive image processing based computational method is being suggested [5]. The color information is derived by the photograph of the fingertip (typically thumb) taken first under standard conditions and later with occlusion of blood flow to the fingertip, using the same standard conditions. The standard conditions are with respect to specific illumination, specific distance between the finger and the camera, the angle of taking photograph and the standard pressure on the fingertip. Fig 1 gives the sample photographs of a fingertip before and after applying pressure [5].

Figure 1. Photograph of a fingertip of a person before andafter occlusion of blood flow. Left picture is before and right picture is after occluding this blood flow[5].

• Authors [5] use NCSS software for multivariate regression analysis for defining a relationship between Hb value and the primary colors of the images. They proposed the simplified equation: R=R1-R2

(1)

G=G1-G2

(2)

B=B1-B2

(3)

2

Nr =11.5 -3.7 R - 1.4 G -0.1 B + 0.08 R +0.03 RG + 0.02 G 2

Women after middle age: 11.7 to 13.8 gm/dL

All of these values may vary slightly between laboratories. Some laboratories do not differentiate between adult and "after middle age" hemoglobin values. Here lower threshold is taken as 10gm/dl. If the output is less than or equal to 10gm/dl then Anemia detection output port will show logic 1.

III.

PROPOSED ARCHITECTURE

2

(4)

+ 0.1 RB + 0.04 GB + 0.01 B

2

Dr = 1-0.3 R- 0.2 G + 0.02 B + 0.07 R +0.004RG 2

+0.003G + 0.02RB + 0.005GB - 0.0005B

2

Hb = Nr / Dr

(5) (6)

Where, R1, G1, B1=Red, Green and Blue color plane information of every pixel of fingertip image before applying pressure. R2, G2, B2= Red, Green and Blue color plane information of every pixel of fingertip image after applying pressure. Hb=Hemoglobin level in gm/dl. This method is comparatively simple because this is noninvasive method. Unlike others method there is no need of microscopic blood image. Even blood image is not required for anemia detection. The image of finger thumb is enough for hemoglobin measurement.

Figure 2. Block diagram of Anemia detection system.

Anemia detection system consists of CMOS Camera for image acquisition. Equation 1, 2 and 3 are performed in RGB calculator. After equating the Hemoglobin value of all pixels, the average value of Hemoglobin is obtained. Finally the output hemoglobin value is compared with a predefined threshold value and decision is made weather it is anemia or not. Figure 3 Shows Fingertip Image capturing using 5 Mega pixel CMOS camera. This camera is interfaced with ALTERA FPGA board. Output showing by seven segment display connected with FPGA is indicated in Figure 4.

B. Anemia Detection process The hemoglobin level is expressed as the amount of hemoglobin in grams (gm) per deciliter (dL) of whole blood, a deciliter being 100 milliliters. The normal ranges for hemoglobin depend on the age and, beginning in adolescence, the gender of the person. The normal ranges are [11]: •

Newborns: 17 to 22 gm/dL



One (1) week of age: 15 to 20 gm/dL



One (1) month of age: 11 to 15gm/dL



Children: 11 to 13 gm/dL



Adult males: 14 to 18 gm/dL



Adult women: 12 to 16 gm/dL



Men after middle age: 12.4 to 14.9 gm/dL

Figure 3. Image acquisition using CMOS camera interfaced with FPGA .

Figure 6. Block diagram of the system Address bus.

Figure 4. Image of the electronic gadget.

A. Bus Architecture A system bus is a single computer bus that connects the major components of a computer system. It combines the functions of a data bus to carry information and address bus to determine where it should be sent and a control bus to determine its operation .The Bus architecture of the proposed digital system is shown in Figure 5, 6 & 7. Figure 7. Block diagram of the system including control bus and internal structure

B. Description of different modules Pro-Program counter (PRO-PC): It is a one kind of clock pulse generator and also a counter. It generates clock pulse for driving the Program counter (PC) from the main clock pulse. In this design it generates a pulse with one positive edge against four main clock pulses. That is Pro-PC force PC to provide same output several times. Output of ProPC is 2bit. Program counter (PC): A program counter is counter which count the clock. The main objective of this block is to control the “control” block. Program counter take two bit input from Pro-PC and using clock signal it count 0 to 60 as control block completed whole operation in 60 sequences. So the output of Program counter is 6bit. Figure 5. Block diagram of the system including data bus.

CONTROL ROM: It is the ROM of our system. It take 8bit input from the Program Counter and give 46 bit output which is called control bus and connected almost all block to control their operation. Block diagram of control bus given in figure 7 in previous section. Now bellow table shows the control bus structure.

TABLE I.

CONTROL BUS FROM CONTROL ROM TO DIFFERENT MODULE

module

Control Bus name(Bus number)

Input

Ena(1),out(2)

RAM

TABLE II.

ADDRESS OF RAM FOR DIFFERENT PARAMETER.

PTR bit

P bit

RAM location

Value

Read(3), write(4)

10000000

00

1

R1

Ptr

Read(5),clear(6), bit1(7,8,9,10,11,12,13,14)

01000000

00

2

G1

00100000

00

3

B1

A

Write(40), ena(41) ,ena_alu(42)

00010000

00

4

R2

B

Write(43), ena(44) ,ena_alu(45)

00001000

00

5

G2

ALU

ena(16),bit(17,18,19,20,21,22,23,24)

00000100

01

6

B2

P

Ena(25),ptr_bit(26,27,28,29,30,31,32,33), p_bit1(34,35), clr(36), out(37)

00000100

10

7

R

00000001

00

8

G

00000000

00

9

B

00000000

01

10

Nr

00000000

10

11

Dr

11111111

01

12

Hb

11111111

10

13

An

Out

Write(38),out1(39), out2(46)

INPUT: In our system we use 32 bit input register to receive input sampled value from the peripheral device & store the data temporarily. It can also send the data to the block called “RAM” to save the data permanently. Register A & B: These two 32 bit registers are used for to save the data temporarily & send the data to ALU or RAM. ALU: ALU is the arithmetic logic unit which is designed for doing addition, subtraction, multiplication, division. Floating point algorithm is used here.ALU converts the normal decimal number to single precision floating point and continues all operation using single precision floating point algorithm. In our proposed design ALU can process 32 bit data and save processed value to its internal register and can send it to reg A, B and RAM.

IV.

SIMULATION RESULTS & SYNTHESIS

Synthesis is the process of constructing a gate level netlist from a register-transfer level model of a circuit described in Verilog HDL. After synthesizing in Xilinx project navigator we get RTL schematic diagram of our proposed design which is shown in figure 9. Figure 8 shows synthesized RTL schematic of the top level of our proposed design.

PTR: PTR inform P block about the initial position of its parameter (R1,R2,G1,G2,B1,B2,R,G,B,Nr,Dr,Hb,An) of the equation. Output of PTR is 8bit. P: P block select the RAM address for each parameter (R1,R2,G1,G2,B1,B2,R,G,B,Nr,Dr,Hb,An).Output of P block is 2 bit. OUTPUT: It s a register which stands for saving the output data. We use 32 bit output register in our proposed design. RAM: RAM stands for random access memory. It is volatile memory to store temporary data.RAM is an array of register bank which is accessible (read and write) according to address. We use 704 bit RAM which contain 13 memory unit each unit have 32 bit storage capability. From the data bus architecture shown in figure 5 we can see that it can send and receive data from reg A, B, INPUT, ALU. That is connection between RAM and data bus is unidirectional. Table II shows the location and value of RAM according to the PTR and P block output.

Figure 8. Block diagram of the system including control bus and internal structure

Top level schematic shown in figure 8 consists of three inputs and two output terminals. The three input terminals are input, clk, clr1_ram. clr1_ram is used to reset the RAM, internal register, PC. Clock is used to drive all block. Input port is 32 bit used to input data and output port1 is 32 bit to show hemoglobin value and output port2 is 1 bit to indicate the condition either anemia or not.

TABLE III. R1,G1, B1 120,90, 230 100,180, 250 100,250, 255 100,110, 120 90,100, 110

COMPARISON BETWEEN TESTBENCH AND MATLAB OUTPUT.

R2,G2, B2 100,80, 30 80,100, 20 80,100, 5 60,40, 88 30,70, 80

R,G, B 20,10, 200 20,80, 230 20,150, 250 40,70,32 60,30,30

V.

Figure 9. RTL schematics of proposed design.

Simulation is the process of verifying the functional characteristics of models at any level of abstraction. To test if the RTL code meets the functional requirements of the specification see if all the RTL blocks are functionally correct. To archive this we need to write testbench which generates clock, reset and required test vectors. Figure 10 shows testbench output for real time pixel value input which is listed in table III. Table III shows first five pixel input data and corresponding output hemoglobin value for Matlab and Verilog simulation. There is no deviation between testbench output and matlab output due to use of floating point algorithm.

Figure 10. Testbench Hb output for first pixel data (41091B71=8.5692)

Nr

Dr 96.1

Hb Matlab 8.5692

Hb Verilog 8.5692

823.5 1494.5

127.5

11.71

11.717

2899.5

333.7

8.68

8.6876

300.14

149.89

2.003

2.003

329.5

279.55

1.178

1.1783

CONCLUTION

To our knowledge, it is the first time that noninvasive image processing method for anemia detection has been applied to Verilog HDL for hardware level design. Besides this the proposed model is optimized for ALTERA FPGA board. We use floating point algorithm in our processor as a result we get approximately same output with respect to matlab.Using this image processing method 100% perfect prediction is not possible but due to lower complexity of hardware design and tolerable error our proposed device is suitable for anemia detection. Beside this noninvasive regression model has less computational complexity as a result this method is faster than others. Anemia is detected after suitable thresholding the hemoglobin value. The novelty of this method is no microscopic blood image is required here for anemia detection. Furthermore floating point algorithm makes the system capable for more accurate result. References [1]

MedlinePlus - Health Information from the National Library of Medicine. (n.d.). Retrieved from http://www.nlm.nih.gov/medlineplus [2] Dr. Monika Malhotra, "Severe Anemia linked to poor outcomes for pregnant women and their babies", International Journal Gynecology and Obstetrics, vol. 79 , pp. 93 – 100,2002. [3] "Pregnancy still a death sentence in many countries" - say Groups in News letter of Communities by Choice - March 2001 Available: http://www.communitiesbychoice/news. [4] Anemia detection methods in low-resource settings: a manual for health workers - December 1997,Available: http://www.path.org. [5] KS Srinivasan,D Lakshmi,H Ranganathan,NGunasekaran,"NonInvasive Estimation of Hemoglobin in Blood Using Color Analysis",International Conference on Industrial and Information Systems, ICIIS 2006.. [6] H Ranganathan, N Gunasekaran, "Simple method for estimation of hemoglobin in human blood using color analysis", Accepted for publication in IEEE transactions on Information Technology in Biomedicine". [7] H. Ranganathan and N. Gunasekaran, “Artificial Neural Network Approach in Estimation of Hemoglobin in Human Blood Using Color Analysis”, IEEE Transactions On Information Technology In Biomedicine, vol. 10, no. 4, October 2006. [8] Saif AlZahir, Han Donker,"A Novel Regression Based Model for Detecting Anemia Using Color Microscopic Blood Images",J. Software Engineering & Applications,vol.3,pp.756-760,2010. [9] All Programmable Technologies from Xilinx Inc. (n.d.). Retrieved from http://www.xilinx.com [10] SynaptiCAD: Timing diagram editors and Verilog VHDL verification tools. (n.d.). Retrieved from http://www.syncad.com. [11] Hemoglobin, A1c, Levels, Tests, Low, Normal, High, and Range MedicineNet. (n.d.). Retrieved from http://www.medicinenet.com

Suggest Documents