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
Editorial
. 2020 May 20;2(3):e200012.
doi: 10.1148/ryai.2020200012. eCollection 2020 May.

Magician's Corner: 6. TensorFlow and TensorBoard

Affiliations
Editorial

Magician's Corner: 6. TensorFlow and TensorBoard

David C Vogelsang et al. Radiol Artif Intell. .

Abstract

A simple classifier in TensorFlow (version 2) is developed and how to use TensorBoard to monitor training progress, to recognize overfitting, and to display other useful information like images in the training set and the confusion matrix is demonstrated.

PubMed Disclaimer

Conflict of interest statement

Disclosures of Conflicts of Interest: D.C.V. disclosed no relevant relationships. B.J.E. Activities related to the present article: disclosed no relevant relationships. Activities not related to the present article: on the board of FlowSIGMA, which does workflow for AI, but neither author nor institution are paid. Other relationships: disclosed no relevant relationships.

Figures

The TensorBoard user interface. There are two tabs at the top: Scalars and Graphs. Scalars will graph scalar data such as the loss and accuracy values that are written to the logging directory. You can force the interface to read through the logging directory and redraw by clicking the update circular arrow in the upper right and also adjust the preferences by clicking the gear icon. On the left, you can select what is displayed and how it is displayed. By default, the user interface will perform some smoothing and display all data.
Figure 1:
The TensorBoard user interface. There are two tabs at the top: Scalars and Graphs. Scalars will graph scalar data such as the loss and accuracy values that are written to the logging directory. You can force the interface to read through the logging directory and redraw by clicking the update circular arrow in the upper right and also adjust the preferences by clicking the gear icon. On the left, you can select what is displayed and how it is displayed. By default, the user interface will perform some smoothing and display all data.
The lower part of the TensorBoard display is where to uncheck the ‘just_right’ logs, so that only the overfit are shown (green arrow). The characteristic sign of overfitting is seen here, where the validation set loss starts to go up, even as the training set loss continues to drop (improve). It is very important to review your training and validation set loss curves to help identify overfitting.
Figure 2:
The lower part of the TensorBoard display is where to uncheck the ‘just_right’ logs, so that only the overfit are shown (green arrow). The characteristic sign of overfitting is seen here, where the validation set loss starts to go up, even as the training set loss continues to drop (improve). It is very important to review your training and validation set loss curves to help identify overfitting.

References

    1. Erickson BJ, Cai J. Magician’s corner: 4. image segmentation with U-Net. Radiol Artif Intell 2020;2(1):e190161. - PMC - PubMed
    1. Erickson BJ. Magician’s corner: how to start learning machine learning. Radiol Artif Intell 2019;1(4):e190072. - PMC - PubMed
    1. Kingma DP, Ba J. Adam: a method for stochastic optimization. ArXiv [cs.LG]. [preprint] http://arxiv.org/abs/1412.6980. Posted 2014. Accessed October 12, 2018.

Publication types

LinkOut - more resources