Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2018 Jul 17;18(7):2314.
doi: 10.3390/s18072314.

Accelerating the K-Nearest Neighbors Filtering Algorithm to Optimize the Real-Time Classification of Human Brain Tumor in Hyperspectral Images

Affiliations

Accelerating the K-Nearest Neighbors Filtering Algorithm to Optimize the Real-Time Classification of Human Brain Tumor in Hyperspectral Images

Giordana Florimbi et al. Sensors (Basel). .

Abstract

The use of hyperspectral imaging (HSI) in the medical field is an emerging approach to assist physicians in diagnostic or surgical guidance tasks. However, HSI data processing involves very high computational requirements due to the huge amount of information captured by the sensors. One of the stages with higher computational load is the K-Nearest Neighbors (KNN) filtering algorithm. The main goal of this study is to optimize and parallelize the KNN algorithm by exploiting the GPU technology to obtain real-time processing during brain cancer surgical procedures. This parallel version of the KNN performs the neighbor filtering of a classification map (obtained from a supervised classifier), evaluating the different classes simultaneously. The undertaken optimizations and the computational capabilities of the GPU device throw a speedup up to 66.18× when compared to a sequential implementation.

Keywords: K-nearest neighbors filtering; brain cancer detection; graphics processing units; hyperspectral imaging instrumentation; image processing.

PubMed Disclaimer

Conflict of interest statement

The authors declare no conflict of interest. The founding sponsors had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, and in the decision to publish the results.

Figures

Figure 1
Figure 1
Hyperspectral acquisition system. (A) Schematic diagram of the HS acquisition system; (B) HS acquisition system capturing an image during a neurosurgical operation at the University Hospital Doctor Negrin of Las Palmas de Gran Canaria.
Figure 2
Figure 2
Example of an in-vivo HS human brain image dataset employed in the study (P2C1). (A) Synthetic RGB representation of the HS cube; (B) Supervised classification map obtained using the SVM classifier; (C) One-band representation of the HS cube obtained employing PCA algorithm.
Figure 3
Figure 3
Block diagram of the KNN based spatial-spectral classification.
Figure 4
Figure 4
KNN window searching method example. (A) Minimum window size of the first pixel; (B) Intermediate window size of a pixel near the upper border; (C) Maximum window size of a pixel in the center of the image; (D) Intermediate window size of a pixel near the bottom border; (E) Minimum window size of the last pixel.
Figure 5
Figure 5
Flow diagram of the serial implementation of the KNN filtering algorithm.
Figure 6
Figure 6
Flow diagram of the parallel implementation of the KNN filtering algorithm.
Figure 7
Figure 7
KNN searching new distance evaluation example.
Figure 8
Figure 8
Percentage of pixels that have been misclassified using the Euclidean distance between tumor and healthy tissues (blue), tumor and hypervascularized tissues (orange), tumor tissue and background (gray) and the other misclassifications between healthy, hypervascularized and background (yellow). The results were obtained per each window size implementations compared to the WSize14 for each image of the dataset.
Figure 9
Figure 9
Percentage of misclassified pixels using the Manhattan distance between tumor and healthy tissues (blue), tumor and hypervascularized tissues (orange), tumor tissue and background (gray) and the other misclassifications between healthy, hypervascularized and background (yellow). The results were obtained per different window sizes implementation compared to the WSize14 for each image of the dataset.
Figure 10
Figure 10
Results of the KNN filtering algorithm obtained from the P2C1 image using the Euclidean distance. The first row shows the filtered classification maps generated using different window sizes. The second row presents the binary maps where the pixel differences between the current generated map and the reference one (WSize14) are shown. In addition, the percentage of differences and the execution time results are detailed.
Figure 11
Figure 11
Results of the KNN filtering algorithm obtained from the P2C1 image using the Manhattan distance. The first row shows the filtered classification maps generated using different window sizes. The second row presents the binary maps where the pixel differences between the current generated map and the WSize14. In addition, the percentage of differences and the execution time results are detailed.
Figure 12
Figure 12
Results comparison of the KNN filtered maps from the P2C1 image using both the Manhattan and Euclidean distances. The first row shows the filtered classification maps generated using different window sizes and distance metrics. The second row presents the binary maps where the pixel differences between the current generated map and the reference one (WSize14-Euclidean) are shown. In addition, the percentage of differences and the execution time results are detailed.
Figure 13
Figure 13
Figure of metric computed comparing (A) the Euclidean versions WSize8, WSize6, WSize4 and WSize2 with the reference WSize14-Euclidean, (B) the Manhattan versions WSize8, WSize6, WSize4 and WSize2 with the reference WSize14-Euclidean.

References

    1. Calin M.A., Parasca S.V., Savastru D., Manea D. Hyperspectral Imaging in the Medical Field: Present and Future. Appl. Spectrosc. Rev. 2013;49:435–447. doi: 10.1080/05704928.2013.838678. - DOI
    1. Lu G., Fei B. Medical hyperspectral imaging: A review. J. Biomed. Opt. 2014;19:10901. doi: 10.1117/1.JBO.19.1.010901. - DOI - PMC - PubMed
    1. Chang C.-I. Hyperspectral Imaging: Techniques for Spectral Detection and Classification. Volume 1 Springer Science & Business Media; Berlin, Germany: 2003.
    1. Akbari H., Kosugi Y. Recent Advances in Biomedical Engineering. InTech; Houston, TX, USA: 2009. Hyperspectral imaging: A new modality in surgery.
    1. Vo-Dinh T. A hyperspectral imaging system for in vivo optical diagnostics. Eng. Med. Biol. Mag. IEEE. 2004;23:40–49. - PubMed

LinkOut - more resources