Abstract
The gray level run length matrix (GLRLM) whose entries are statistics recording distribution and relationship of images pixels is a widely used method for extracting statistical features for medical images, e.g., magnetic resonance (MR) images. Recently these features are usually employed in some artificial neural networks to identify and distinguish texture patterns. But GLRLM construction and features extraction are tedious and computationally intensive while the images are too big with high resolution, or there are too many small or intermediate Regions of Interest (ROI) to process in a single image, which makes the preprocess a time consuming stage. Hence, it is of great importance to accelerate the procedure which is nowadays possible with the rapid development of massively parallel Graphics Processing Unit, i.e. the GPU computing technology. In this article, we propose a new paradigm based on mature parallel primitives for generating GLRLMs and extracting multiple features for many ROIs simultaneously in a single image. Experiments show that such a paradigm is easy to implement and offers an acceleration over 5 fold increase in speed than an optimized serial counterpart.
Introduction
In medical imaging, texture analysis is a fundamental tool for tasks such as lesion detection, tissue segmentation, and disease classification. One of the most robust and widely utilized methods for this purpose is the Gray Level Run Length Matrix (GLRLM). This statistical method tracks the number of consecutive pixels of the same intensity (gray level) appearing in specific directions, providing a quantitative measure of image coarseness and homogeneity.
Despite its utility, GLRLM construction is notoriously computationally "tedious." When researchers need to extract features from high-resolution MRIs or process thousands of small Regions of Interest (ROIs) across hundreds of image slices, the preprocessing time can become a significant bottleneck in machine learning workflows. While GPUs are frequently employed to accelerate the training of neural networks, the initial feature extraction often remains a serial process on the CPU. This study introduces a new paradigm to move this bottleneck to the GPU, leveraging parallel computing to enable high-throughput medical image analysis.
Methods
The researchers proposed a paradigm based on parallel primitives—standardized, high-performance building blocks like sorting, reduction, and scanning. By utilizing the CUB library, which is optimized for NVIDIA GPUs and often outperforms the more common Thrust library, they designed a five-step pipeline to process multiple ROIs simultaneously:
- Scatter: Pixels from all target ROIs are duplicated and rearranged into GPU global memory.
- Reduce-by-key (Run Lengths): Parallel reduction is used to count consecutive identical gray levels across the image data.
- Key Combination: ROI indices, gray levels, and run lengths are merged into a single integer key for efficient processing.
- Sort: These keys are clustered so that all data corresponding to a specific ROI becomes contiguous in memory.
- Reduce-by-key (GLRLM): The final matrix is generated by counting the occurrences of each unique key.
To ensure a rigorous evaluation, this parallel approach was compared against an optimized serial baseline. The serial version utilized a "Run Length Array" (RLArr) to store run lengths for the entire image once, allowing individual ROIs to perform look-ups rather than re-calculating runs for every overlapping area.
Datasets
The study utilized the Simulated Brain Database from the McConnell Brain Imaging Centre at McGill University. This dataset provided a controlled environment to test the algorithm's performance across different MRI modalities.
The images were preprocessed to remove non-brain tissue (skull stripping), rendered in 256 gray levels, and sized at 181 × 217 pixels. Using simulated data allowed the researchers to focus strictly on computational speedup while controlling for variables like noise and intensity non-uniformity.
Key Results and Insights
The algorithm was benchmarked on high-end hardware, including the NVIDIA Tesla P100 and Titan V GPUs, against an Intel Xeon E5-2620 CPU.
- Overall Speedup: The GPU-accelerated paradigm achieved a 4.5x to 5.7x speedup over the optimized serial version.
- Feature-Specific Performance: For certain complex features, such as the 135° diagonal run length, the speedup reached as high as 11.7x on the Titan V.
- ROI Scaling: Performance remained stable as ROI sizes increased, though the speedup factor slightly decreased as the total volume of data approached the GPU's memory limits.
- Integer Dominance: Interestingly, the performance difference between single and double-precision floating-point math was negligible. This is because GLRLM construction is primarily an integer-based counting task; floating-point operations are only required in the final stage of feature calculation.
Discussion and Future Work
While the proposed paradigm significantly reduces processing time, the authors noted a challenge regarding memory redundancy. To simplify the parallel logic, overlapping ROIs are currently duplicated in global memory. This trade-off favors computational simplicity but increases memory bandwidth requirements.
Future research will focus on reducing this duplication through techniques like "segmented sorts" or initial image row scanning. By combining this general feature extraction paradigm with more specialized matrix generation techniques, the researchers believe it may be possible to achieve speedups exceeding 100x, bringing real-time texture analysis closer to clinical reality.
Summary updated