<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>ImageCLEF2019: Tuberculosis - Severity Scoring and CT Report with Neural Networks, Transfer Learning and Ensembling</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>ntili</string-name>
          <email>agentili@ucsd.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>San Diego VA Health Care System</institution>
          ,
          <addr-line>San Diego, CA</addr-line>
          <country country="US">USA</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of California</institution>
          ,
          <addr-line>San Diego, CA</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The diagnosis of tuberculosis is challenging. We present our approach for classifying whether a patient has high or low severity tuberculosis and for detecting which lung is involved, if there is decreased capacity, and if there are pleurisies, calcifications or cavities present. Our best results for the CT report task were obtained by converting volume images into an 8x4 montage of sagittal or coronal images and ensembling the results of separate networks trained separately on sagittal and coronal montage images. The best results for the severity scoring were obtained by ensembling the results from the CT report with the provided metadata.</p>
      </abstract>
      <kwd-group>
        <kwd>Deep Learning</kwd>
        <kwd>Convolutional Neural Network</kwd>
        <kwd>Tuberculosis</kwd>
        <kwd>CT Scans</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Tuberculosis is a common disease where fast diagnosis using CT images can often
improve treatment results. An accurate and automatic method for classifying tuberculosis
from CT images may be especially useful in regions of the world with few radiologists.
The
        <xref ref-type="bibr" rid="ref1">ImageCLEF 2019</xref>
        [1] has 2 challenges [2]: 1) scoring severity of tuberculosis from
CT images and 2) creating a report that identifies if the left lung is affected, if the right
lung is affected, if calcifications, caverns, and/or pleurisy are present, and if lung
capacity is decreased.
2.1
      </p>
      <p>Data.</p>
      <p>
        The data set provided for both the CT report subtask and severity scoring subtask of the
        <xref ref-type="bibr" rid="ref1">ImageCLEF 2019</xref>
        Tuberculosis task [2] use the same dataset containing 335 chest CT
scans of TB patients along with a set of clinically relevant metadata. 218 patients are
used for training and 117 for test. The provided metadata includes information about
disability, relapse, symptoms of TB, comorbidity, bacillary, drug resistance, education
level, incarceration history, alcohol consumption, and smoking history. A set of lung
masks was also provided for all patients[3] .
      </p>
      <p>For the CT report task, the training set distribution of pathology was somewhat
unbalanced with lung involvement being very common, and calcifications and pleurisy
rare.</p>
    </sec>
    <sec id="sec-2">
      <title>TB Pulmonary Manifestations</title>
      <p>Caverns</p>
      <p>Pleurisy</p>
      <p>Calcification
Lung Capacity Decreased</p>
      <p>Right Lung Affected
Left Lung Affected
0
50
100
150
200
250
For the severity scoring task, the training set distribution of high and low severity was
balanced. See Figure 2</p>
      <p>Present</p>
      <p>Absent</p>
    </sec>
    <sec id="sec-3">
      <title>Severity Score</title>
      <p>Score
0
20
40
60
80
100</p>
      <p>120
LOW</p>
      <p>HIGH</p>
      <p>Reviewing the metadata shows that some factors are a strong predictor of high
severity score. See Table 1</p>
      <p>The images for the ImageCLEF tuberculosis task were provided as NIfTI 3D datasets.
We used two different approaches for preprocessing images. For the first run (SVT_5,
CTR_3) we used a method similar to what we employed for the ImageCLEF 2018
challenge [4]. We converted the images using med2image, a Python3 utility that converts
medical image formatted files to more visual friendly ones, such as png and jpg. After
reconstructing them in all three planes, we decided to use the coronal plane images,
since they had the most images containing areas of abnormal lung. Although we did
not visually verify the images of this data set, tuberculosis usually involves the upper
lobes with relatively unaffected lung bases. As a result, axial images through the lung
bases could possibly be normal even in patients with severe disease in the upper lobes.
As med2image did not take in consideration slice thickness, the reconstructed coronal
images were deformed and of different height. To correct this problem, all images were
resized to a 512 x 512 matrix. Image masks for the lungs were available[3], and were
used to select the 200 images with the largest area of lung in the image. For the first
run, all image equalization and data augmentation was done at the time of training using
the fastai library [5].</p>
      <p>For further runs (SVR_1, SVR_2, SVR_3, CTR_1, CTR_2 we used a different
approach. We use nibabel library [6] to convert the NIfTI 3D datasets into numpy 3D
arrays, using the provided lung masks [3], we cropped the 3D arrays to the smallest
parallelogram that includes mostly the lungs. We equalized the array. We reshaped the
array to have 31-32 slices in either the sagittal or coronal plane with a 256x256 matrix.
Using montage, we combined the images into a single image. We did not correct for
difference in slice thickness. See Figure 1 and 2. Data augmentation was done at the
time of the training using the fastai library.</p>
      <p>For training the neural network, we used a workstation with an AMD Ryzen
Threadripper 1950X CPU with 16 CPU cores and 32 threads, a Nvidia Quadro P6000
GPU, 64 GB RAM, and a 1 TB solid state drive. We took advantage of the fastai library
to perform transfer learning of convolutional neural networks. We tried the following
architectures that were available in the fastai library: resnet18, resnet34, resnet50,
resnet101, resnet152, squeezenet1_0, squeezenet1_1, densenet121, densenet161,
densenet169, densenet201, vgg16_bn, vgg19_bn, and alexnet. Resnet50, resnet101,
densenet121, densenet161, and densenet169 gave the best results, so we decided to ensemble
them.</p>
      <p>For training the CNN, image sizes of 224x224, 299x299, and 384x384 were utilized.
The learning rate was determined after running the learning rate finder function and
plotting the learning rate vs. loss.
Orange [7] was used to create a prediction based on metadata only (SVR_4), and to
combine metadata results with neural network results (SVR_1, SVR_2). See Figure 5.
For the CTR_3 submission, for each patient we took the 200 images with the largest
lung surface, scored each of those images separately using all pre-trained CNNs
available in the fastai library, and averaged those results. Both mean AUC and minimum
AUC were low, probably because only a few images of each patient have pathology,
and averaging results decreased the probability of positive results.</p>
      <p>For the CTR_1 and CTR_2 submissions we created a 4x8 montage of sagittal or
coronal images for each patient. W separately scored sagittal and coronal images with
6 neural networks. For the CTR_2 submission, we ensembled all results, and for the
CTR_1 submission, we ensembled the 3 best results.</p>
      <p>Run
CTR_Cor_32_montage.txt
CTR_ReportsubmissionEnsemble2.csv
TB_ReportsubmissionLimited1.csv</p>
      <p>For the SVR_5 submission, we once again took the 200 images with the largest lung
surface of each patient. For each patient, we scored each of those 200 images separately
using all pretrained neural networks available in the fastai library and averaged those
results. Both AUC metrics were low, for similar reasons to the CT Report Task.</p>
      <p>Fig. 6. ROC curves of different models trained using only the metadata of the training set,
based on 10-fold cross validation, calculated with Orange3 workflow from Figure 3
For the SVR_4 submission, we trained different machine learning models available
in Orange3 (Constant, AdaBoost, Tree, CN2 rule inducer, Random Forest, SVM, kNN,
Logistic Regression, Neural Network, Naive Bayes) and based on validation results we
selected the top 4 to ensemble for the submission. See Figure 6.</p>
      <p>For SVR_3 we took the results of classifying 4x8 montages of sagittal or coronal
images as high or low severity, and ensembled them. For each 4x8 montage, we scored
each sagittal and coronal image separately by ensembling the results of 6 neural
networks.</p>
      <p>For SVR_2 we ensembled SVR_3 with the metadata.</p>
      <p>For SVR_1 we used Orange3 to create a model from the metadata using
(Comorbidity, Disability, Symptoms of TB, Relapse, Drug Resistance, Bacillary, Higher
Education, Alcoholic, Ex-Prisoner, Smoking) and training data (Left Lung Affected, Right
Lung Affected, Lung Capacity Decrease, Calcification, Cavity, Pleurisy) and for the
prediction we used the test metadata and the results from CTR_1 (Left Lung Affected,
Right Lung Affected, Lung Capacity Decrease, Calcification, Cavity, Pleurisy).
Although we tried Constant, AdaBoost, Tree, CN2 rule inducer, Random Forest, SVM,
kNN, Logistic Regression, Neural Network, and Naive Bayes models, after evaluating
the validation results, we used only SVM, Logistic Regression, Neural Network and
Naive Bayes models to ensemble for the final submission.
4</p>
      <sec id="sec-3-1">
        <title>Conclusion</title>
        <p>In this paper, we presented the use of transfer learning to quickly train a CNN to classify
the severity of tuberculosis and different pathological manifestations of tuberculosis.
5</p>
      </sec>
      <sec id="sec-3-2">
        <title>Perspectives for Future Work</title>
        <p>The training data set for the CT Report was imbalanced with only a few cases of
calcification or pleurisy, but we did not try to compensate for this imbalance. Trying to
compensate for this imbalance may improve results. We trained the neural network as
a multilabel task on the same set of equalized images. Using images with different
windows to enhance calcifications, training neural networks to detect just calcifications or
just cavities, and using windows set to visually enhance air within the lungs, may
improve results. Using Hounsfield units from the original images instead of values in the
png files may also be more accurate. As our best results for the Severity Task came
from combining the results of the CT Report Task with the metadata, improving results
of the CT Report should improve results for the Severity Task too.
1.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>ImageCLEF</surname>
          </string-name>
          <year>2019</year>
          :
          <article-title>Multimedia Retrieval in Medicine</article-title>
          ,
          <source>Lifelogging, Security and Nature in Proceedings of the Tenth International Conference of the CLEF Association (CLEF</source>
          <year>2019</year>
          ).
          <year>2019</year>
          . Lugano, Switzerland.
          <source>(LNCS) Lecture Notes in Computer Science</source>
          , Springer.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Cid</surname>
            ,
            <given-names>Y.D.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Liauchuk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Klimuk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Tarasau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Kovalev</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Muller</surname>
          </string-name>
          ,
          <source>Overview of ImageCLEFtuberculosis 2019 - Automatic CT-based Report Generation and Tuberculosis Severity Assessment. CLEF 2019 Working Notes. CEUR Workshop Proceedings (CEUR- WS.org)</source>
          ,
          <year>2019</year>
          . ISSN 1613-0073, http://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>2380</volume>
          /.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Cid</surname>
            ,
            <given-names>Y.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>O.A.</surname>
          </string-name>
          <article-title>Jiménez-del-</article-title>
          <string-name>
            <surname>Toro</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Depeursinge</surname>
            , and
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Müller</surname>
          </string-name>
          ,
          <article-title>Efficient and fully automatic segmentation of the lungs in CT volumes.</article-title>
          . In: Goksel,
          <string-name>
            <surname>O.</surname>
          </string-name>
          , et al. (eds.)
          <source>Proceedings of the VISCERAL Challenge at ISBI. No. 1390 in CEUR Workshop Proceedings . No. 1390 in CEUR Workshop Proceedings</source>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Gentili</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <article-title>ImageCLEF2018: Transfer Learning for Deep Learning with CNN for Tuberculosis Classification</article-title>
          .
          <source>CEUR Workshop Proceedings</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Howard</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          et al.,
          <source>fastai. GitHub</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Brett</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Hanke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Markiewicz</surname>
          </string-name>
          , M.
          <article-title>-</article-title>
          <string-name>
            <surname>A. Côté</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>McCarthy</surname>
          </string-name>
          , and C. Cheng, nipy/nibabel: 2.3.3 Zenodo.,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Demsar</surname>
            <given-names>J</given-names>
          </string-name>
          ,
          <string-name>
            <surname>C.T.</surname>
          </string-name>
          , et al.,
          <source>Orange: Data Mining Toolbox in Python. Journal of Machine Learning Research</source>
          ,
          <year>2013</year>
          .
          <volume>14</volume>
          : p.
          <fpage>2349</fpage>
          −
          <lpage>2353</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>