Reading books is good, and reading good books is even better. With technical literature there is the added need for a book to stay up to date as long as possible and to actually carry knowledge, since these are not cheap goods. For that reason, whether we like it or not, it is worth buying books that cover the theoretical foundations. On the other hand, it is well known that the easiest way to get familiar with a topic is often through examples, which usually means introducing tools that tend to age. So what if we combined these two areas and had a book containing both theory (even mathematical) and practice? That is what "Practical Deep Learning: A Python-Based Introduction" was meant to be. At least in theory. Let's see whether it holds up in practice too. Yes, I am proud of this pun.

Right now it is worth gathering some information about neural networks or expanding what you know. The reason, of course, is the ever-growing share of machine learning methods, or more broadly artificial intelligence, in commercial applications. That makes specialists in these fields, able to choose, prepare and successfully train a model, worth their weight in gold. And even if a developer specializes in another area or does not deal with similar functionality every day, it is worth picking up this knowledge, or refreshing it if you already have the basics from university. With this attitude I looked around for a suitable book and found the hero of today's text. Here is its review.

I will not hide that I was especially drawn in by the promise of combining theory with practice in the form of code examples, specifically in Python. Anyone who has been programming for more than a day knows that a very large pool of libraries for machine learning, statistics and other "scientific" topics was built in this language. That is why this technology is so popular in research centers and beyond, because Python is, admittedly, very versatile. For those who need specifics, the book's fun revolves around packages like NumPy, scikit-learn and Keras. It is worth mentioning that none of this means similar calculations cannot be done in other languages, where you will also find the libraries you need. That matters for people who do not like the Python used in the book, which also does not present its code very clearly. You can spot some shortcuts, fragments glued together in ways that demand attention (although that was hard to avoid), use of syntax nuances, and as for code aesthetics, I would probably have a few remarks during a review. On the other hand, if you do not know this technology or are not fluent in it, you need not worry: one whole chapter is devoted to Python constructs and another to the NumPy library. If you are familiar with these topics, you can safely skip those parts and get to the "meat" faster.

This is not strictly a book about coding but about machine learning, so let's discuss it from that angle. It must be said that the author (Ronald T. Kneusel, a scientist specializing in the topic) tried to write a book for beginners, albeit ambitious ones. And he almost succeeded, but first let's go through what we have here:

  • a refresher on topics from statistics and linear algebra (vectors, matrices) that are used in this area,
  • information on building a dataset for training and testing,
  • classic machine learning methods: centroids, k-nearest neighbors, naive Bayes, decision trees, random forests, support vector machines (SVM),
  • supervised neural networks: a mathematical treatment of the basics and of the learning principles,
  • measures for assessing how useful models are, that is, statistics based on the confusion matrix (true positive and other, more complex indicators derived from it),
  • convolutional neural networks, used mainly for image recognition,
  • classifying audio samples.

Let's get one thing out of the way first: the author devotes a great deal of space to properly preparing datasets, and to experiments. In my view this is very important, because machine learning is not about picking a method (ideally the one whose name we like best), feeding data into it and getting a perfect classifier. A lot depends on the "input", which has to be prepared and split into training, validation and test sets. Of course, there should be plenty of records, but attributes, cleanliness and nature of the data matter too, because they later affect the choice of a specific method. Moreover, the author describes how to expand a dataset, which helps the model learn. I was a bit surprised that hundreds of samples can be turned into thousands this way and the model really does work better. The book presents the methods for doing it.

Experiments are interesting too, because the author devotes several chapters to showing how changing methods for individual problems (datasets) and choosing the right parameters can raise or lower a model's effectiveness. Yes, lower: in this respect the book is "not boring" and shows that changing all the settings in a way that lengthens training time does not always improve the result. It is worth using the conclusions and charts presented by Dr. Kneusel to save yourself work in real-life cases.

As for the explanation of the methods themselves, I have the impression that it is rather uneven. For the classic (so-called shallow) approaches, the author covers them decently, in an easy-to-follow way, though sometimes in a slightly too abbreviated form. I will not hide that if I had not taken a suitable course at university, it would have been harder for me to understand, for example, the idea of a decision tree. Each method practically begs for a step-by-step example to show how a given classification path works. With neural networks, on the other hand, the author clearly made it a point of honor to explain the topic truly from the ground up, including the mathematical parts, which are not equally clear to everyone. And I have the impression he overdid it a bit. I miss (or accidentally skipped) an explanation, using a simple example, of how a network works as it learns successive pieces of information, even on a very small dataset, and what changing the weights means. Instead the author focuses on the gradient, derivatives, functions and manipulating symbols. Yes, that should be there, and it is certainly useful for computer science students or people who want to take up the topic seriously. But I fear that programmers who want to understand the basics of networks from a practical side, so they can later use a library, will bounce off this book unless they grit their teeth or jump straight to the chapters describing the experiments. At some point I myself started flipping through rather than reading closely, which I am not proud of, but I assumed everything would become clear in the experiments.

It is also worth mentioning that this book deals mainly with classification problems, and binary ones at that (two opposing classes), but multiclass approaches are covered as well. That is a strength of this book: it shows how to approach the problem (from a practical side) and how to judge whether we have trained such a model well. For example, it presents classifying images of digits and audio samples, accompanied by a discussion of the author's second "hobbyhorse", convolutional networks. Here too there is some math, but this time it is fairly understandable. Still, I think a clearer example was missing, though that may just be my own high expectations.

It should be noted that the book does not cover recurrent, unsupervised or reinforcement learning networks. Each of these topics gets a mention of 1-2 paragraphs, and that is all. That is a bit of a pity, because reinforcement learning is the most interesting in the context of the new AI tools that are all the rage. At the same time, understanding them still requires knowledge of the basics of neural network training, which the author provides. Besides, if the book included chapters on every type of network, it would have closer to 600 pages rather than about 470. Of course, at least half of the volume covers general information such as using Python, input data and classic learning methods, but that is the charm of a book for beginners.

As for the writing style, despite some very technical passages and strict terminology, the author definitely avoids academic pomposity. When needed he brings in a "lecture atmosphere", but he also allows himself colloquial phrasing (especially when a model does not work as well as expected) and in some places even small jokes. The translator, too, rose to the occasion, and it is clear that this was someone who knows not only the language well but also the field of artificial intelligence. The book has quite a lot of charts, graphics and code listings, so despite the 470 pages mentioned, it is not a long read.

To sum up, I think the book under review is a decent textbook for learning the basics of machine learning and neural networks, but mainly for computer science students who had some basics at university or picked them up another way. Some parts are described too briefly, others too mathematically. A big advantage, though, is that it really relies on example code in Python, presents ready-made programs and experiment results, and discusses how useful the individual methods are. I would say it is a 6/10 book, maybe 7/10: certainly worth your attention, though it will not suddenly make everyone fluent in the fundamentals of something that may well flood the world.

Best regards, and thank you - Jakub Rojek.