Tensors all around us

Advanced artificial intelligence (AI) technologies have become so integrated in our daily lives that they no longer fascinate us. Online database search engines, image search engines with embedded recognition systems, device management by voice, have all become normal and common. However, every time I use Shazam, I am amazed at its speed in identifying music, its version and author. Sometimes in less than a second!


Tensors all around us
Advanced artificial intelligence (AI) technologies have become so integrated in our daily lives that they no longer fascinate us. Online database search engines, image search engines with embedded recognition systems, device management by voice, have all become normal and common. However, every time I use Shazam, I am amazed at its speed in identifying music, its version and author. Sometimes in less than a second! It seems impossible to keep up with all the trends when it comes to the technology of data processing. But maybe we should not bother. The computers will follow the trends for us, using AI algorithms. I do not know how many people have noticed it but making just a few Google searches on a certain topic leads to notifications on that topic appearing on other pages. For example, if you google "non-steroidal analgesics, " do not be surprised to see messages and ads about these products on social networks or blogs.
In the same way, our computers will track very closely the kind of data we have, the kind of results we need, and the methods we use. The time is coming rapidly when, based on trend screening, computers will optimize the methodology and suggest the best for us. A positive aspect to AI is the openness and availability of its core technologies. Machine and deep learning, two basic technologies necessary for the development of AI systems, are no longer a curiosity but have become standards in the processing of large data amounts. Predictive, as well as analytical, systems based on neural networks are a common thing. Such a dizzying development of AI technology has been made possible by the code openness and simplifying the complicated programming methods.
The programming language Python and statistical environment R (RStudio) are today indispensable tools in data processing. While these two free software tools are a subject of controversy, it cannot be denied that they have experienced a surge in popularity and are significantly represented in all areas that use data processing. However, this phenomenon may be a topic of another column. The openness of Python and R enabled the rapid implementation of AI technology, as well as its utilization in a range of applications. A crucial step that allowed this to happen occurred in 2015, when Google Brain, Google's AI research team, released a free and open-source software library named TensorFlow. In 2017, its first stable version became available. The most important parts of the library, computational ones, are written in C ++, while Python is used as an excellent higher-level language management platform.
The emergence of TensorFlow has facilitated and accelerated the development of applications whose functioning requires machine, ie, deep learning. Just as the development of machine and deep learning theory has accelerated the development of AI theory, so has the emergence of the TensorFlow library accelerated the development of AI applications. However, TensorFlow is not the only framework for implementing machine and deep learning. The name "tensor" refers to an edited set of data, usually numbers. We call the zero-order tensor a scalar. Each individual number is a zero-order tensor. First-order tensors are vectors. We can say that every finite set of numbers is a first-order tensor. Third-order tensors are arrays, etc. Ten-sorFlow works with data organized into tensors, but the dimension of the tensor is not important. There is no limit to data complexity. TensorFlow does not perform operations with tensors immediately but stores them by Branimir K. Hackenberger in special data structures, called graphs. This allows the so-called datastream programming, and each computation can be displayed as a graph, which facilitates model analysis and correction. Figure 1 shows a graph containing two input variables and three operations giving one output. In other words, this graph shows the flow of calculating output = (6 + 3) / (6 * 3). In this simplified example, graph input data are constants, however, input data may be variables, and machine/deep learning requires a specific form of frames of input data -placeholders. Placeholders are actually empty nodes of a graph that can be used to enter data from the outside, such as from a database, as needed. The variables entered and the data flowing between the nodes do not have to be simple scalars as in this example but can be tensors of any dimension. The first advantage of this computation concept is apparent from Figure 1. Namely, it is more than obvious that two operations (multiplication and addition) can be performed simultaneously, ie, in parallel. This is why most machine/deep learning frameworks extensively use parallel computing hardware. This is also the reason why, in addition to Python and C ++, many frameworks use CUDA. CUDA is a parallel computing platform, created by Nvidia, that allows the use of CUDA-enabled graphics processing units (GPUs). Another important advantage of this concept is portability. Namely, a model written in Python can be easily converted to any other language, such as C ++.
The entire work with machine/deep learning systems is based on two steps. The first step is the construction of a model, ie, a computational graph, and the second step is the so-called session. A session is nothing else than a runtime in which the data flow through nodes, ie, operations, is initiated. A simplified flowchart of an artificial neural network (ANN) is shown in Figure 2.
In 2017, Google decided to support Keras in TensorFlow's core library. It was a significant decision that extended Keras' life as a kind of interface to TensorFlow. At the same time, the combination of TensorFlow and Keras resulted in a whole machine/deep learning framework, which makes programming much easier. Arguably, Keras has become a high level management environment (application programming interface, API) for TensorFlow.
If you want to use the statistical environment R to work with TensorFlow and Keras, there are at least five different models available at the moment: 1. Convoluted Neural Networks, 2. Multi-Layer Perceptrons, 3. Recurrent Neural Networks, 4. Skip-Gram Models, and 5. pre-trained models. Working directly in Python has almost no restrictions.
Currently, TensorFlow (including Keras) is the biggest competitor to the following three machine learning frameworks: PyTorch, MXNet, and Microsoft Cognitive Toolkit. PyTorch and TensorFlow, in addition to being written in Python, share many similarities. First of all, there is a lot of interactivity in application development and a predefined hardware acceleration component. PyTorch is the ideal frame for smaller projects and simpler workflows, while TensorFlow is far better for larger and more complex projects. MXNet is an extremely flexible machine/deep learning framework that allows the addition of new hardware components to an already functional ready-made system (in IT jargon, this framework can scale to multiple CPUs and GPUs and multiple machines). Although MXNet supports many languages (Python, C ++, R, JavaScript, Julia, etc.), working with its APIs is more complicated than working with TensorFlow's APIs. Microsoft Cognitive Toolkit, previously known as CNTK, is more focused on deep learning than TensorFlow. Although in some aspects it is much faster and although there are APIs for a whole range of languages (Python, Java, C ++, C #), the learning curve in this framework is far less steep than in TensorFlow. An overview of the commonly used and actively developed and maintained frameworks is given in Table 1.
Anyone who chooses to use one of these machine/deep learning frameworks or test their models has open databases or data sets available. Table 2 shows some of the most interesting free data sets with medical data. In addition to these databases, there is a range of free data sets useful for calibrating or testing models for processing images, sounds, biometrics, etc. In programming languages, the Modified National Institute of Standards and Technology database data sets are often used as an example. In addition to the data sets, there is a number of tutorials and online courses that allow beginners to very quickly find and create their own models.
Of course. More and more every day. Not only that, the use of TensorFlow in medical research has led to further improvements to this machine/deep learning framework. Below are a few fresh examples.
Zhang and Kagen (1) constructed a single-layer artificial neural network in TensorFlow to classify healthy individu-   als vs Parkinson's disease patients based on 1513 Digital Imaging and Communications in Medicine (DICOM) standard images. The authors expanded and refined the Ten-sorFlow API to make it compatible with the DICOM standard, which allowed the further use of TensorFlow in the work with image sets of that standard. Grover et al (2) predicted the severity of Parkinson's disease by a deep neural network (DNN) constructed using the TensorFlow/Keras framework. Based on 5875 instances, they showed that DNN produced much better results in severity assessment than other techniques. In addition, a classification based on the Unified Parkinson's Disease Rating Scale (UPDRS) motor score was better than the classification based on the UPDRS total score and, therefore, it could be used as a better metric for severity prediction.
There is an extremely strong motivation for finding better and more reliable diagnostic methods for breast cancer. Cogan  TensorFlow was also used in the work by Dimauro et al 2019 (7) for CNN creation and classification of rhino-cytograms. Although they had only fourteen slides available, they created a data set of 12 298 (587 fields were taken from all available slides). A total of 3423 cells were manually selected and labeled after an image cleaning process in order to generate the basic data set. Based on this data set of relatively poor origin, the authors demonstrated the appropriateness of CNN use in the analysis of rhino-cytograms.
A DNN created using the TensorFlow framework was used to predict asthma severity as well as the likelihood of an asthmatic attack (8). Augusta et al (14) showed how to use deep learning for the classification of spatial epidemics. For this purpose, the authors used the Keras library within the statistical environment R rather than Python.
There are many more examples of the increasing use of machine/deep learning methods in medical laboratory and clinical research, primarily due to the efforts of software developers to improve APIs in high-level computer languages. Currently, perhaps the best example is the Keras high-level framework with the low-level Tensor-Flow background.
The mentioned examples of the use of the TensorFlow and Keras machine/deep learning framework show that this concept is applicable to all sizes of data sets -from a relatively small number of patients to hundreds or hundreds of thousands of patients. At first glance, it may seem that machine/deep learning methods are most widely used in neurology, ie, in those areas of medicine where image analysis is important. However, the examples from oncology, pulmonology, ophthalmology, cardiology, clinical molecular biology, immunology, and epidemiology show that AI data processing techniques are applicable in all branches of medicine that deal with a greater amount of data. This is one of the reasons why the organization of databases and their storage is crucial at all levels of clinical structures, from cytology and biochemistry laboratories to clinic and hospital wards.
Finally, we should cite Fourcade and Khonsari (15), who concluded that medical doctors now have a historic opportunity to participate in a scientific revolution by understanding deep learning, by participating in the design and assessment of new devices and tools, and by contributing to the creation of a framework for regulating this new form of medical practice. references