Electrical impedance imaging acceleration method, storage medium and electrical impedance imaging device
By computing the difference values in the electrical impedance imaging algorithm in parallel on a general-purpose graphics processor, the problem of low CPU calculation efficiency in the existing technology is solved, and efficient calculation and time complexity reduction of electrical impedance imaging are achieved.
Patent Information
- Application Number
- CN202211625367.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-12-16
AI Technical Summary
Existing electrical impedance imaging algorithms rely on the CPU for calculations, resulting in low computational efficiency and long running time. They are also limited by the computing performance of the CPU and have limited room for improvement.
The electrical impedance imaging algorithm is run on a general-purpose graphics processor (GPGPU), and the difference between the measured amplitude and the standard amplitude on multiple channels is calculated in parallel, and the resistivity change value is calculated using a preset reconstruction matrix. Improve computing efficiency.
The calculation efficiency of electrical impedance imaging is significantly improved, the running time is reduced, and the time complexity of the algorithm is reduced.
Smart Images

Figure CN117617939B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electrical impedance tomography, and in particular to an electrical impedance tomography acceleration method, a storage medium and an electrical impedance tomography device. Background Art
[0002] In the prior art electrical impedance imaging algorithm, the central processing unit (CPU) in the device is usually used directly for calculation. The specific steps are: all instructions are executed in sequence, and the impedance value on each pixel is calculated in sequence according to the measured input. This calculation scheme has the problems of low calculation efficiency and long running time, and it will occupy more CPU threads during the calculation process, thereby reducing the resources that can be called by the application. In addition, due to the limitation of the CPU's computing performance, the algorithm itself has limited room for improvement. Summary of the invention
[0003] The present application provides an impedance imaging acceleration method, a storage medium and an impedance imaging device. The acceleration algorithm runs on a general-purpose computation on graphics processing units (GPGPU) to efficiently calculate resistivity change values for imaging in the impedance imaging device.
[0004] In a first aspect, an embodiment of the present application provides an impedance imaging acceleration method, which specifically includes: demodulating the sampled digital signals sampled on multiple channels to obtain a measured amplitude; calculating in parallel the difference between the measured amplitude and the standard amplitude on each channel to obtain a number of difference values; and calculating in parallel the resistivity change value at each pixel in the reconstructed image based on the several difference values and a preset reconstruction matrix, wherein the number of rows in the reconstruction matrix is the number of channels, and the number of columns in the reconstruction matrix is the number of pixels in the reconstructed image.
[0005] In a second aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is executed to implement the above-mentioned electrical impedance imaging acceleration method.
[0006] In a third aspect, an embodiment of the present application provides an impedance imaging device, which includes a general-purpose graphics processor, and the general-purpose graphics processor includes: a memory for storing a computer program; and a processor for executing the computer program to implement the above-mentioned impedance imaging acceleration method.
[0007] The electrical impedance imaging acceleration method, computer-readable storage medium and electrical impedance imaging device obtain resistivity change values on GPGPU by improving the calculation process to image in the electrical impedance imaging device, thereby improving calculation efficiency and reducing the time complexity of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0009] Figure 1 A flow chart of the electrical impedance imaging acceleration method provided in an embodiment of the present application.
[0010] Figure 2 A flowchart of sub-steps of step S104 provided for an embodiment of the present application.
[0011] Figure 3 A flowchart of sub-steps of step S304 provided for an embodiment of the present application.
[0012] Figure 4 A flowchart of sub-steps of step S106 provided for an embodiment of the present application.
[0013] Figure 5 A flowchart of sub-steps of step S604 provided for an embodiment of the present application.
[0014] Figure 6 This is a structural block diagram of the electrical impedance imaging device provided in the first embodiment of the present application.
[0015] Figure 7 This is a structural block diagram of the electrical impedance imaging device provided in the second embodiment of the present application.
[0016] Figure 8 A schematic diagram of the structure of thread blocks and threads provided in an embodiment of the present application.
[0017] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0019] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar planning objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate. In other words, the described embodiments are implemented according to an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations may also include other content. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to only those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0020] It should be noted that the descriptions involving "first", "second", etc. in this application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0021] Please see Figure 1 and Figure 6 , Figure 1 It is a flow chart of the electrical impedance imaging acceleration method provided in the embodiment of the present application. Figure 6The block diagram of the electrical impedance imaging device provided for the first embodiment of the present application. The electrical impedance imaging acceleration method runs on the graphics processing chip of the electrical impedance imaging device, and the graphics processing chip includes a graphics processing unit (Graphics Processing Units, GPU) and / or a GPGPU. Preferably, the graphics processing chip is a GPGPU. The EIT device includes a plurality of channels. In the present embodiment, the electrical impedance imaging device 100 includes a CPU 10, a GPGPU 20, and a memory 30. The memory 30 includes a global memory 11 and a shared memory 12. Among them, the global memory 11 is accessible to the CPU 10 and the GPGPU 20, and the shared memory 12 is only accessible to the GPGPU 20. The electrical impedance imaging acceleration method specifically includes the following steps.
[0022] Step S102, demodulating the sampled digital signals sampled on multiple channels to obtain measurement amplitudes.
[0023] For the target image, the corresponding analog signals are first collected on multiple channels, and then converted into digital signals through an analog-to-digital converter (ADC), and each channel corresponds to an amplitude. Specifically, the digital signal is demodulated using the first formula to obtain the corresponding amplitude. The first formula is specifically expressed as follows:
[0024] V=(v1,v2,v3,…,v m )Formula (1)
[0025] Wherein, in formula (1), V is the amplitude vector, which includes the amplitudes on all channels, m is the number of channels, v1 is the amplitude on the first channel, v2 is the amplitude on the second channel, and so on.
[0026] Step S104, calculating the difference between the measured amplitude and the standard amplitude on each channel in parallel to obtain a plurality of difference values.
[0027] Specifically, the difference values are calculated in parallel using the second formula. The second formula is specifically expressed as follows:
[0028]
[0029] In formula (2), ΔV i is the ith difference value, v i is the i-th measured amplitude, is the i-th standard amplitude, and n is the number of columns of the reconstruction matrix.
[0030] In some feasible embodiments, when the above difference value is in logarithmic form, the difference value can also be calculated using the third formula. The third formula is specifically expressed as follows:
[0031]
[0032] Step S106, calculating the resistivity change value at each pixel point in the reconstructed image in parallel according to the plurality of difference values and a preset reconstruction matrix.
[0033] The reconstruction matrix is a two-dimensional matrix generated by the CPU. The number of rows in the reconstruction matrix is the number of channels, and the number of columns in the reconstruction matrix is the number of pixels in the reconstructed image. In step S106, the reconstruction matrix is dot-producted with a number of difference values in parallel to calculate the resistivity change value at each pixel in the reconstructed image to form an image in the electrical impedance imaging device.
[0034] Please see Figure 2 , Figure 2 The flowchart of step S104 sub-steps provided in the embodiment of the present application. The difference between the measured amplitude and the standard amplitude on each channel is calculated in parallel to obtain a number of difference values. Specifically, step S104 specifically includes the following steps.
[0035] Step S302: assigning corresponding first threads according to the number of channels.
[0036] Since GPGPU can run multiple threads concurrently in one process during the calculation process. And since the calculation process of the difference between the measured amplitude and the standard amplitude on each channel does not interfere with each other. Therefore, in this embodiment, according to the number of channels, a first thread is allocated to the difference between the measured amplitude and the standard amplitude on each channel, so that each first thread calculates the difference between the measured amplitude and the standard amplitude on each channel. Since each channel needs to calculate a value, the number of allocated first threads is the number of channels.
[0037] Step S304: Utilize each first thread to calculate in parallel the difference between the measured amplitude and the standard amplitude on each channel.
[0038] It is understandable that multiple threads can be concurrent in one process, and each thread executes different tasks in parallel. In this embodiment, when calculating the difference between the measured amplitude and the standard amplitude on each channel, they do not interfere with each other, so parallel calculation can be achieved. That is to say, when a sufficient number of first threads are allocated, multiple first threads are concurrent in the process of calculating the difference between the measured amplitude and the standard amplitude on each channel, and each first thread calculates a difference between the measured amplitude and the standard amplitude on each channel, so that all differences are calculated in parallel, which improves the calculation efficiency and reduces the running time.
[0039] The measured amplitude is stored in the global memory of the EIT device. Figure 3 , Figure 3The flowchart of step S304 sub-steps provided in the embodiment of the present application. The difference between the measured amplitude and the standard amplitude on each channel is calculated in parallel by using each first thread. Specifically, step S304 specifically includes the following steps.
[0040] Step S402: Divide all first threads into thread blocks to obtain multiple first thread blocks.
[0041] In step S402, each first thread block includes a plurality of first threads. Since threads in the same thread block can access the same shared memory, the first threads are divided into a plurality of different first thread blocks. Figure 8 , which is a structural diagram of thread blocks and threads provided in an embodiment of the present application. In this embodiment, all first threads are divided into a plurality of first thread blocks according to requirements, each first thread block includes a plurality of first threads, and each first thread calculates a difference between a measured amplitude and a standard amplitude in the shared memory 12.
[0042] Step S404: configure a first shared memory for each first thread block, and each first shared memory is used to store a first preset number of the measurement amplitudes read from the global memory.
[0043] In step S404, the measured amplitude is stored in the global memory when no calculation is performed, and when calculation is required, the corresponding measured amplitude in the global memory is written into the first shared memory. Since the reading speed of the shared memory is faster than that of the global memory, but the capacity of the shared memory is small, the first thread is matched with the shared memory in thread blocks, so that each thread block only needs to read data from the corresponding first shared memory for calculation, which greatly improves the processing efficiency.
[0044] Step S406: Control the first threads in the first thread block to read the corresponding measured amplitudes from the corresponding first shared memory in parallel for calculation.
[0045] In step S406, when demodulation is required, each first thread in the first thread block simultaneously reads the corresponding measured amplitude from the corresponding first shared memory for demodulation. Since the first threads in each first thread block can be processed in parallel, and each thread block corresponds to a corresponding first shared memory, all threads can be processed in parallel.
[0046] Before calculating the resistivity change value at each pixel in the reconstructed image, it is necessary to determine whether the number of measured amplitudes calculated in the first shared memory is a multiple of the first preset number to update the first shared memory. When the number of measured amplitudes calculated in the first shared memory is a multiple of the first preset number, the first preset number of measured amplitudes are read again from the global memory to update the first shared memory. When the measured amplitude calculation is completed and needs to be transmitted again, the new measured amplitude will overwrite the original measured amplitude to achieve the effect of updating the first shared memory. In some feasible embodiments, when the number of measured amplitudes calculated in the first shared memory is not a multiple of the first preset number, the transmitted measured amplitude has not been calculated yet, and the unfinished measured amplitude will continue to be calculated until all the transmitted measured amplitudes are calculated.
[0047] Please see Figure 4 , Figure 4 The flowchart of step S106 sub-steps provided in the embodiment of the present application. The resistivity change value at each pixel point in the reconstructed image is calculated in parallel according to a number of difference values and a preset reconstruction matrix. Specifically, step S106 specifically includes the following contents.
[0048] Step S602: Allocate corresponding second threads according to the number of channels.
[0049] Since GPGPU can run multiple threads concurrently in one process during the calculation process. And since the calculation processes of the resistivity change values at each pixel do not interfere with each other. Therefore, in this embodiment, according to the number of channels, a second thread is allocated to each resistivity change value at each pixel, so that each second thread calculates a resistivity change value. Since each channel needs to calculate a value, the number of allocated second threads is the same as the number of channels.
[0050] Step S604: Utilize each second thread to calculate the resistivity change value at each pixel point in parallel, and record the accumulated result of the resistivity change value at each pixel point.
[0051] It can be understood that multiple threads can be concurrent in one process, and each thread performs different tasks in parallel. In this embodiment, when calculating the resistivity change value at each pixel point, they do not interfere with each other, so parallel calculation can be achieved. That is to say, when a sufficient number of second threads are allocated, multiple second threads are concurrent in the process of calculating the resistivity change value at each pixel point, and each second thread calculates a resistivity change value at each pixel point, so that all resistivity change values are calculated in parallel, which improves the calculation efficiency and reduces the running time.
[0052] Specifically, the resistivity change value is calculated on the second thread using the fourth formula. The fourth formula is specifically expressed as follows:
[0053]
[0054] In formula (4), Δρ i is the i-th resistivity change value, ΔV is the difference value, w i T is the reconstruction matrix, ΔV j is the jth difference value, W (j,i) is the reconstruction matrix of the jth row and ith column.
[0055] In the process of calculating the resistivity change value, each time a resistivity change value is calculated, the resistivity change value calculated this time will be added to the resistivity change value calculated last time, and the result of the above addition will be recorded. Specifically, the result of the addition is obtained using the fifth formula. The fifth formula is specifically expressed as follows:
[0056] Δρ=Δρ i +Δρ i-1 ,(i=1,2,3…n)Formula (5);
[0057] In formula (5), Δρ is the accumulated resistivity change value, Δρ i is the resistivity change value calculated this time, Δρ i-1 is the resistivity change value calculated last time.
[0058] The difference value is stored in the global memory of the EIT device. Figure 5 , Figure 5 The flowchart of step S604 sub-steps provided in the embodiment of the present application. Each second thread is used to calculate the resistivity change value at each pixel point in parallel. Specifically, step S604 specifically includes the following steps.
[0059] Step S702: Divide all second threads into thread blocks to obtain a plurality of second thread blocks.
[0060] In step S702, each second thread block includes a plurality of second threads. Since threads in the same thread block can access the same shared memory, the second threads are divided into a plurality of different second thread blocks. Figure 8 , which is a schematic diagram of the structure of thread blocks and threads provided in an embodiment of the present application. In this embodiment, all second threads are divided into multiple second thread blocks according to requirements, each second thread block includes multiple second threads, and each second thread calculates a resistivity change value corresponding to each difference value in the shared memory 12.
[0061] Step S704: configure a second shared memory for each second thread block, and each second shared memory is used to store a second preset number of the difference values read from the global memory.
[0062] In step S704, the difference value is stored in the global memory when the resistivity change value does not need to be calculated, and when the resistivity change value needs to be calculated, the corresponding difference value in the global memory is written into the second shared memory.
[0063] Step S706: Control the second threads in the second thread block to read the corresponding difference values from the corresponding second shared memory in parallel to calculate the resistivity change value at each pixel in the reconstructed image.
[0064] In step S706, when it is necessary to calculate the resistivity change value, each second thread in the second thread block simultaneously reads the corresponding difference value from the corresponding second shared memory for calculation.
[0065] After calculating the resistivity change value at each pixel in the reconstructed image, it is necessary to determine whether the number of difference values processed in the second share is a multiple of the second preset number to obtain the latest output result and image in the electrical impedance imaging device. When the number of difference values processed in the second share is a multiple of the second preset number, the second preset number of difference values are re-read from the global memory to update the above-mentioned second shared memory. When all difference values are calculated, the accumulated result obtained is the latest output result. In some feasible embodiments, when the number of difference values processed in the second share is not a multiple of the second preset number, it is determined again whether the number of measured amplitudes calculated in the first shared memory is a multiple of the first preset number.
[0066] Please see Figure 7 , which is a structural block diagram of the electrical impedance imaging device provided in the second embodiment of the present application.
[0067] In the second embodiment, the electrical impedance imaging device includes a general-purpose graphics processor 11. The general-purpose graphics processor 11 includes a memory 901 and a processor 902. The processor 902 is used to run a computer program in the memory 901.
[0068] The memory 901 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The memory 901 may be an internal storage unit of a computer device in some embodiments, such as a hard disk of a computer device. The memory 901 may also be a storage device of an external computer device in other embodiments, such as a plug-in hard disk configured in a computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 901 may also include both an internal storage unit of a computer device and an external storage device. The memory 901 may not only be used to store application software and various types of data installed in a computer device, such as the code for realizing an acceleration method for electrical impedance imaging, but may also be used to temporarily store data that has been output or is to be output.
[0069] In the above embodiment, by improving the calculation process, the resistivity change value is obtained on the GPGPU to form an image in the electrical impedance imaging device, thereby improving the calculation efficiency and reducing the time complexity of the algorithm.
[0070] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
[0071] The above examples are only preferred embodiments of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.
Claims
1. An electrical impedance imaging acceleration method, characterized in that: The electrical impedance imaging acceleration method is run on a graphics processing chip of an EIT device, wherein the EIT device includes a plurality of channels, and the electrical impedance imaging acceleration method includes: Demodulating the sampled digital signals sampled on the multiple channels to obtain measurement amplitudes, wherein the measurement amplitudes are stored in the global memory of the EIT device; Calculate the difference between the measured amplitude and the standard amplitude on each channel in parallel to obtain a plurality of difference values; and The resistivity change value at each pixel point in the reconstructed image is calculated in parallel according to a plurality of difference values and a preset reconstruction matrix, wherein the number of rows in the reconstruction matrix is the number of channels, and the number of columns in the reconstruction matrix is the number of pixels in the reconstructed image; the difference between the measured amplitude and the standard amplitude on each channel is calculated in parallel to obtain a plurality of difference values, including: Allocating corresponding first threads according to the number of channels; and The difference between the measured amplitude and the standard amplitude on each channel is calculated in parallel using each first thread, specifically including: Dividing all first threads into thread blocks to obtain a plurality of first thread blocks, each first thread block including a plurality of first threads; configuring a first shared memory for each first thread block, each first shared memory being used to store a first preset number of the measurement amplitudes read from the global memory; and The first threads in the first thread block are controlled to read the corresponding measured amplitudes from the corresponding first shared memory in parallel for calculation.
2. The electrical impedance imaging acceleration method according to claim 1, characterized in that: The reconstruction matrix is a two-dimensional matrix.
3. The electrical impedance imaging acceleration method according to claim 1, characterized in that: The electrical impedance imaging acceleration method further comprises: Determining whether the number of measured amplitudes calculated in the first shared memory is a multiple of a first preset number; When it is determined that the number of measured amplitudes calculated in the first shared memory is a multiple of a first preset number, the first preset number of measured amplitudes are re-read from the global memory to update the first shared memory.
4. The electrical impedance imaging acceleration method according to claim 1, characterized in that: The resistivity change value at each pixel in the reconstructed image is calculated in parallel based on a number of difference values and a preset reconstruction matrix, including: Allocate corresponding second threads according to the number of channels; Each second thread is used to calculate the resistivity change value at each pixel point in the reconstructed image in parallel, and the accumulated result of the resistivity change value at each pixel point is recorded.
5. The electrical impedance imaging acceleration method according to claim 4, characterized in that: The difference value is stored in the global memory of the EIT device; Each second thread is used to parallely calculate the resistivity change value at each pixel in the reconstructed image, including: Dividing all second threads into thread blocks to obtain a plurality of second thread blocks, each second thread block including a plurality of second threads; configuring a second shared memory for each second thread block, each second shared memory being used to store a second preset number of the difference values read from the global memory; and The second threads in the second thread block are controlled to read the corresponding difference values from the corresponding second shared memory in parallel to calculate the resistivity change value at each pixel point in the reconstructed image.
6. The electrical impedance imaging acceleration method according to claim 5, characterized in that: The electrical impedance imaging acceleration method further comprises: Determining whether the number of processed difference values in the second share is a multiple of a second preset number; When it is determined that the number of difference values processed in the second shared memory is a multiple of a second preset number, the second preset number of difference values are re-read from the global memory to update the second shared memory.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is executed to implement the electrical impedance imaging acceleration method according to any one of claims 1 to 6.
8. An electrical impedance imaging device, characterized in that: The electrical impedance imaging device includes a general-purpose graphics processor, and the general-purpose graphics processor includes: a memory for storing a computer program; and A processor executes a computer program to implement the electrical impedance imaging acceleration method as described in any one of claims 1 to 6.
