[Paper Review] Automatic Classification of Pathology Reports using TF-IDF Features
This study proposes a TF-IDF-based machine learning approach to automatically classify cancer pathology reports into ICD-O diagnosis categories using SVM, XGBoost, and logistic regression. It achieves 92% accuracy with XGBoost, demonstrating that TF-IDF effectively highlights key diagnostic terms for computational pathology and cancer surveillance.
A Pathology report is arguably one of the most important documents in medicine containing interpretive information about the visual findings from the patient's biopsy sample. Each pathology report has a retention period of up to 20 years after the treatment of a patient. Cancer registries process and encode high volumes of free-text pathology reports for surveillance of cancer and tumor diseases all across the world. In spite of their extremely valuable information they hold, pathology reports are not used in any systematic way to facilitate computational pathology. Therefore, in this study, we investigate automated machine-learning techniques to identify/predict the primary diagnosis (based on ICD-O code) from pathology reports. We performed experiments by extracting the TF-IDF features from the reports and classifying them using three different methods---SVM, XGBoost, and Logistic Regression. We constructed a new dataset with 1,949 pathology reports arranged into 37 ICD-O categories, collected from four different primary sites, namely lung, kidney, thymus, and testis. The reports were manually transcribed into text format after collecting them as PDF files from NCI Genomic Data Commons public dataset. We subsequently pre-processed the reports by removing irrelevant textual artifacts produced by OCR software. The highest classification accuracy we achieved was 92\% using XGBoost classifier on TF-IDF feature vectors, the linear SVM scored 87\% accuracy. Furthermore, the study shows that TF-IDF vectors are suitable for highlighting the important keywords within a report which can be helpful for the cancer research and diagnostic workflow. The results are encouraging in demonstrating the potential of machine learning methods for classification and encoding of pathology reports.
Motivation & Objective
- Address the challenge of manual, time-consuming classification of unstructured pathology reports by cancer registries.
- Enable automated, scalable extraction of primary diagnosis (ICD-O code) from free-text pathology reports.
- Evaluate the effectiveness of TF-IDF features combined with machine learning models for diagnosis classification.
- Develop a new, publicly available dataset of 1,949 manually transcribed pathology reports across four primary cancer sites.
- Demonstrate that TF-IDF can highlight clinically relevant keywords for diagnostic and research use.
Proposed method
- Extracted TF-IDF features from 1,949 manually transcribed pathology reports collected from the NCI Genomic Data Commons.
- Pre-processed reports by removing OCR-generated artifacts and standardizing text to improve feature quality.
- Trained and compared three classifiers—SVM (linear and RBF), logistic regression, and XGBoost—on the TF-IDF feature vectors.
- Used LDA to extract latent topics and color-code top 50 TF-IDF weighted keywords for interpretability and clinical relevance.
- Evaluated models using micro and macro F-score metrics, with stratified train-test splits to ensure robustness.
- Performed qualitative inspection of keyword-topic alignment to validate clinical interpretability of extracted terms.
Experimental results
Research questions
- RQ1Can TF-IDF features effectively represent the diagnostic content of unstructured pathology reports for machine learning classification?
- RQ2Which machine learning classifier—SVM, logistic regression, or XGBoost—achieves the highest accuracy in predicting ICD-O diagnosis codes from pathology reports?
- RQ3To what extent can TF-IDF and LDA jointly highlight clinically relevant keywords and biomarkers in pathology reports?
- RQ4How does model performance vary between linear and non-linear kernels in SVM for this classification task?
- RQ5Can the proposed method reduce manual effort in cancer registry reporting while maintaining high diagnostic accuracy?
Key findings
- The XGBoost classifier achieved the highest micro F-score of 0.92 and macro F-score of 0.31, outperforming all other models.
- SVM with a linear kernel achieved 87% test accuracy, significantly outperforming the RBF kernel, which scored 75%.
- Logistic regression achieved 78% test accuracy, while the linear SVM scored 87%, indicating strong performance for linear models.
- TF-IDF features successfully highlighted key diagnostic terms such as 'epithelial', 'presence', 'necrosis', and 'tumor' with high weights.
- LDA-assisted color-coding of keywords revealed clinically meaningful topics, such as 'tumor necrosis' and 'lymph node involvement', enhancing interpretability.
- The study created a new, publicly available dataset of 1,949 pathology reports across 37 ICD-O categories, supporting future research in automated pathology report analysis.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.