Mar 05 2020

Book Review: The Egg & Sperm Race by Matthew Cobb

egg_and_spermI follow quite a few writers on Twitter, and this often leads me to read their books. The Egg & Sperm Race by Matthew Cobb is one such book. It traces the transition in thinking on the reproduction of animals, including humans, which occurred during the second half of the 17th century.

Prior to this we had some pretty odd ideas as to how animals reproduced, much of it carried over from the Ancient Greeks. Ovid and Virgil both claimed that you could make bees by burying a bull with its horns protruding from the ground, waiting and then cutting off the horns to release the bees! This confusion is not surprising, the time between mating and the appearance of young is quite long, and the early stages of the process are hidden by being very small, and deep inside animals.

A random “fact” I cannot help but repeat is that Avicena wrote that “a scorpion will fall dead if confronted with a crab which a piece of sweet basil basil has been tied”. I wonder sometimes with quotes such as these whether they are a result of mistranslation, or a bored scribe. The point really is such ideas were not discounted out of hand at the time. The Egg & Sperm Race starts with a description of da Vinci’s copulating couple which is beautiful but wrong – da Vinci connects the testicles to the brain – these structures do not exist.

The heart of the action in The Egg and Sperm Race is in the Netherlands, in England the Royal Society showed relatively little interest in generation aside from some experiments on the spontaneous generation of cheese mites. The Chinese and Arab scholars who had worked in various fields showed little interest in generation.

The central characters are Jan Swammerdam, Niels Stensen (known as Steno) and Reinier de Graaf, who met in Leiden at the university in the early 1660s when they were in their early twenties. Swammerdam and Steno were a little older than de Graaf and were close friends. Soon after meeting in Leiden they visited Paris where they continued to build contacts in the scientific community.

In understanding generation a first step was to realise that all animals came from other animals of the same species, and that this meant mating between two animals of the same species. Steno went to Italy and worked with Francesco Redi’s whose experiments were key to this, he checked exhaustively that insects did not arise from the putrefaction of material. Swammerdam was also interested in insects, classifying four different types of invertebrate development and showing that in moths traces of the adult form are found in the caterpillar. At the time it was not clear that the larval stage and the adult were the same species.

A second step was to realise that all animals came from eggs of some sort, William Harvey –  of blood circulation fame – did experiments in this area but although he stated this conclusion but it was not well-supported by his experiments. In the period at the beginning of this book, the role of the ovary was not understand. Steno carried out dissections on fish both those that laid eggs, and those that gave birth to live young from this he concluded that the ovaries were the source of eggs and asserted that this was the case for humans as well. This idea rapidly gained acceptance.

The discovery of the human egg, and its origins in the ovary, was the subject of a dispute between de Graaf and Swammerdam on priority. The Royal Society decided in favour of van Horne with whom Swammerdam had worked on the dissection and illustration of female reproductive anatomy. To modern eyes the written record of the dispute, in letters, and publications is surprisingly personal. De Graaf died at the age of 32 just prior to the Royal Society decision. It was a difficult time in the Netherlands with the country at war with England and France with France troops invading parts of the country.

Leeuwenhook cast a spanner into the works with his microscopical studies, he observed spermatozoa but not the female egg and as a result became a “spermist”, believing that life came from the sperm in contrast to the “ovists” who believed life came from the egg. We now know that they are both right. The human egg was not observed until 1826 by von Baer. And I have to mention Spallazani’s experiments on frogs wearing taffeta shorts, demonstrating that male sperm was required to fertilise the female egg.

The final chapter covers events from the end of the 17th century or a little later to present day. Linneaus’s classification work, and Darwin’s theory of evolution follow on from some of the core realisations of this earlier period. Neither Linneaus’ work nor Darwin’s work make much sense if you don’t believe that animals (and plants) grow from eggs/seeds which came from the same species. It wasn’t until von Baer’s work in the early 19th century that the female egg was observed.

Jan 30 2020

Book review: How the States got their Shapes by Mark Stein

how_the_statesHow the States got their Shapes by Mark Stein is that book that does exactly what it says on the cover: explain the origin of the shapes of the states of the United States. The book starts with some broad brush strokes that underpin the shaping of many states before going through each State in alphabetical order.

States are not strictly comparable with European nations but it is interesting to compare the never-straight borders of Europe with the regularity of particularly Western states. To a British European the events described in the book are all terribly recent – much of the action occurs during the 19th century! I considered extending this statement to all Europeans but there has been quite a bit of change in national borders in Europe over the last 200 years.

The large scale features of the USA arise from a number of sources. The earliest of these originate from the French and Indian War in the mid-18th century which saw the England and the colonists take the territory around the Great Lakes from the French and subsequently take further land from the French in the Louisiana Purchase. Further to the west territory came from the Spanish and then a newly independent Mexico. The border with Canada was agreed largely at the 49th parallel with the British in 1818. Later the Dutch would cede their territory along the Hudson river and the Spanish the last of their territory in what is Florida.

There are some recurring themes determining the shapes of states, one that comes up repeatedly is the desire for Congress to create States of equal size, in the West there are sets of states with the same height (3o) and width (7o). This concept extended to access to resources, so the ports on the Great Lakes are shared amongst the surrounding States. A second big driving force is slavery, the Missouri Compromise placed a boundary at a latitude of 36o 30′ below which slavery was allowed, and above which it was not. This motivated boundaries of states, and led to a battle to create equal numbers of states above and below the line.

There are irregularities. Boston Corner looks like it should belong in  Massachusetts but is actually in New York state, this is because the terrain made access to Boston Corner from the rest of Massachusetts difficult. In the early days this type of inaccessibility led to lawlessness, so states were willing to cede territory to avoid it. Whole states were created to address potential lawlessness, when gold was discovered in what is now Idaho it was felt too distant from Oregon to be ruled from there with the influx of unruly gold miners. There was also a concern that they would displace the coastal Oregonians from government.

Sometimes a river makes a good boundary although when the river has tributaries things get a bit tricky, it is even worse when borders are defined with reference to “head waters” which are notoriously difficult to locate. The other problem with rivers is that they meander – meaning that chunks of a State may find themselves on the “wrong” side of a river when the river moves. In some cases surveying errors and mistakes in negotiations led to oddly formed borders.

The supersize California and Texas states are a result of their own origins in virtual nationhood. Texas was, for a brief period, an independent country which subsequently joined the Union. California formed with the influx of the miners who came for gold, the Union was more concerned that they join than try to enforce borders upon the new State.

The charters of the original US colonies which later evolved into states typically gave them territories that stretched all the way from the Atlantic to the Pacific coast, during the 17th and 18th centuries this was largely moot – colonies scarcely had the wherewithal to maintain small populations on the  Eastern seaboard. The British monarchs granting these charters were not necessarily consistent, or particularly well-advised. So some boundaries are defined by “headwaters” which are notoriously ill-defined.

It is inevitable that the book is a bit repetitive, after all every border has two sides. This is occasionally jarring but usually handled quite well with cross referencing.

Missing from this book is much reference to the Native Americans, they are mentioned as an aside in a few places but little more than that. There is another book in the territories of the Native Americans prior to the European colonisation of the country – I just don’t know where it is! This article on The best books on Native Americans and Colonisers looks like a good place to start.

Overall I quite enjoyed this book, I read most of it on a long train ride. I suspect maps and boundaries are a bit of a niche interest but I feel I also picked up the broad shape of the creation of the USA.

Jan 14 2020

Book review: You look like a thing and I love you by Janelle Shane

You look like a thing and I love you by Janelle Shane is a non-technical overview of machine learning. This isn’t to say it doesn’t goYou look like a thing and I love you book cover into some depth, and that if you are experienced practitioner in machine learning you won’t learn something. The book is subtitled “How Artificial Intelligence Works and Why It’s Making the World a Weirder Place” but Shane makes clear at the outset that it is all about machine learning – Artificial Intelligence is essentially the non-specialist term for the field.

Machine learning is based around training an algorithm with a set of data which represents the task at hand. It might be a list of names (of kittens, for example) where essentially we are telling the algorithm “all these things here are examples of what we want”. Or it might be a set of images where we indicate the presence of dogs, cats or whatever we are interested in. Or, to use one of Shane’s examples, it might be sandwich recipes labelled as “tasty” or “not so tasty”.  After training, the algorithm will be able to generate names consistent with the training set, label images as containing cats or dogs or tell you whether a sandwich is potentially tasty.

The book has grown out of Shane’s blog AI Weirdness where she began posting about her experiences of training recurrent neural networks (a machine learning algorithm) at the beginning of 2016. This started with her attempts to generate recipes. The results are, at times, hysterically funny. Following attempts at recipes she went on to the naming of things, using neural networks to generate the names of kittens, guinea pigs, craft beers, Star Wars planet names and to generate knitting patterns. More recently she has been looking at image labelling using machine learning, and at image generation using generative adversarial networks.

The “happy path” of machine learning is interrupted by a wide range of bumps in the road which Shane identifies, these include:

  • Messy training data – the recipe data, at one point, had ISBN numbers mixed in which led to the neural network erroneously trying to include ISBN-like numbers in recipes;
  • Biased training data – someone tried to analyse the sentiment of restaurant reviews but found that Mexican restaurants were penalised because the Word2vec training set (word2vec is a popular machine learning library which they used in there system) associated Mexican with “illegal”;
  • Not detecting the thing you thought it was detecting – Shane uses giraffes as an example, image labelling systems have a tendency to see giraffes where they don’t exist. This is because if you train a system to recognise animals then in all likelihood you will not include pictures with no animals. Therefore show a neural network an image of some fields and trees with no animals in it will likely “see” an animal because, to its knowledge, animals are always found in such scenes. And neural networks just like giraffes;
  • Inappropriate reward functions – you might think you have given your machine learning system an appropriate “reward function” aka a measure for success but is it really the right one? For example the COMPAS system, which recommends whether prisoners in the US should be recommended for parole, was trained using a reward based on re-arrest, not re-offend. Therefore it tended to recommend against parole for black prisoners because they were more likely to be arrested (not because they were more likely to re-offend);
  • “Hacking the Matrix” – in some instances you might train your system in a simulation of the real world, for example if you want to train a robot to walk then rather than trying to build real robots you would build virtual robots and try them out in a simulated environment. The problem comes when your virtual robot works out how to cheat in the simulated environment, for example by exploiting limitations of collision detection to generate energy;
  • Problems unsuited to machine learning – some tasks are not amenable to machine learning solutions. For example, in the recipe generation problem the “memory” of the neural network limits the recipes generated because by the time a neural network has reached the 10th ingredient in a list it has effectively forgotten the first ingredient. Furthermore, once trained in one task, a neural network will “catastrophically forget” how to do that task if it is subsequently trained to do another task – machine learning systems are not generalists;

My favourite of these is “Hacking the matrix” where algorithms discover flaws in the simulations in which they run, or flaws in their reward system, and exploit them for gain. This blog post on AI Weirdness provides some examples, and links to original research.

Some of this is quite concerning, the examples Shane finds are the obvious ones – the flight simulator which found that it could meet the goal of a “minimum force” landing by making the landing force enormous and overflowing the variable that stored the value, making it zero. This is catastrophic from the pilot’s point of view. This would have been a very obvious problem which could be identified without systematic testing. But what if the problem is not so obvious but equally catastrophic when it occurs?

A comment that struck me towards the end of the book was that humans “fake intelligence” with prejudices and stereotypes, it isn’t just machines that use shortcuts when they can.

The book finishes with how Shane sees the future of artificial intelligence, essentially in a recognition that these systems have strengths and weaknesses and that the way forward is to combine artificial and human intelligence.

Definitely worth a read!

Dec 26 2019

Book review: Higher and Colder by Vanessa Heggie

higher_and_colderHigher and Colder by Vanessa Heggie is a history of extreme physiological research in the later nineteenth and twentieth century. It is on the academic end of the spectrum I read, it is not a tale of individual heroics, although I found it quite gripping.

The action takes place largely in extreme environments such as very high mountains, and the polar regions. There are some references to high temperature environments but these are an aside. One of the themes of the book is the tension between laboratory physiological experiments, such as the barometric chamber work of Bert in 1874, and experiments and experiences in the field. It turns out it is hard to draw useful conclusions on survival in extreme environments from laboratory studies. Much of this work was done to support exploratory expeditions, mountaineering, military applications and more recently athletic achievement. The question is never “Can a human operate at an altitude of over 8000 metres?”, or the like, it is “Can Everest be scaled by a human with or without supplementary oxygen?”. So factors other than the “bare” physiology are also important.

Some of the discussion towards the end o the book regarding death, and morbidity in expeditions to extreme environments brought to mind the long distance marine expeditions of the 18th century. Its not discussed in the book but it seems like these extreme physiology field programmes go beyond simple field research, they are often parts of heroic expeditions to the ends of the earth.

The book opens with a discussion of mountain sickness and whether its cause is purely down to low oxygen or whether other factors are important. One section is titled “Only rotters would use oxygen?” – the idea being that climbing Everest was retarded by a reluctance to use supplementary oxygen. In fact oxygen apparatus only really became practical for climbers in the 1950s, so the reluctance is more to do with technology than honour. The climbing problem is different from a military aircraft where weight is relatively unimportant. Fundamentally there is no short term acclimatisation to altitude. Himalayan populations show some long term adaptations but Andean populations are quite different in terms of evolution scale adaption – populations in the Himalayas have been there much longer. Mentioned towards the end of the book is the fact that humans foetuses spend their time in a low oxygen environment, so these physiological experiments have applications well beneath the mountains and the skies.

The selection of participants into the field, both as experiment and subject, was based on previous experience, gender, class and connections. This means they were almost entirely white and male, particularly those to Antarctica where the US military refused to transport women for a considerable spell. The extreme physiology community is quite close-knit and difficult for outsiders to penetrate, there is a degree of nostalgia and heritage to their discussions of themselves. Although women played a part in missions dating back into the earlier 20th century their presence is hidden, publication culture would typically not name those considered to be assistants. The first woman to overwinter in the British Antarctica base was in 1996.

Native people are similarly elided from discussion although they were parts of a number of experiments and many missions. An interesting vignette: the conventional ergometer which measures human power output was found not to be well-suited to Sherpas since it was based on a bicycle, utterly unfamiliar to a population living in the high Himalayas where bicycles are uncommon. Also the oxygen masks used by Western climbers need to be adapted to suit the differing face shapes of Sherpas. Heggie introduces the idea of thinking of native technology as part of bioprospecting. I was intrigued to learn that “igloo” originally meant something very specific, one of a class of structures from compacted snow, but it was corrupted to mean any building made of compacted snow. Pemmican is another technology drawn from the natives of Arctic lands. These technologies are usually adapted and there is a degree to which they are not adopted until they have been “scientifically proven” by Western scientists.

It turns out that participants in polar expeditions don’t experience much cold – they are two well equipped and often expending a lot of energy. Cold is different to altitude, altitude is relatively un-escapable whilst cold can be mitigated by technologies dating back centuries.

I was broadly familiar with some of the material in this book from reading about attempts on Everest and Antarctic and Arctic expeditions but this work is much more focussed on the experiments than the men. I am contaminated with the knowledge that Heggie has worked with Simon Schaffer and felt that Higher and Colder has something of the style of Leviathan and the Air pump particularly the language around objects and artefacts, and their movement being about communication.

I found this a gentle introduction to the practice of historiography, it is related to the tales of adventure and individual heroism around scaling Everest and reaching the South Pole but quite different in its approach.

Nov 04 2019

Book review: Deep learning with Python by François Chollet

Deep learning with Python by Francois Chollet is the third book I have reviewed on deep learning neural networks. Despite these reviews only spanning a couple of years it feels like the area is moving on rapidly. The biggest innovations I see from this book are in the use of pre-trained networks, and the dominance of the Keras/Tensorflow/Python ecosystem in doing deep learning.

Deep learning is a type of artificial intelligence based on many-layered neural networks. This is where the “deep” comes in – it refers to the numbers of layers in the networks. The area has boomed in the last few years with the availability of massive datasets on which to train, improvements in numerical algorithms for training neural networks and the use of GPUs to further accelerate deep learning. Neural networks have been used in production since the 1990s – by the US postal service for reading handwritten zip codes.

Chollet works on artificial intelligence at Google and is the author of the Keras deep learning library. Google is also the home of Tensorflow, a lower level library which is often used as a backend to Keras. This is a roundabout way of saying we should expect Chollet to be expert and authoritative in this area.

The book starts with some nice background to machine learning. I liked Chollet’s description of machine learning (deep learning included) being about finding a representation of data which makes the problem at hand trivial to solve. Imagine taking two pieces of coloured paper, placing them one on top of the other and then crumpling them into a ball. Machine learning is the process of un-crumpling the ball.

As an introduction to the field Deep Learning in Python runs through some examples of deep learning applied to various classes of problem, including movie review sentiment analysis, classifying newswire articles and predicting house prices before going back to discuss some issues these problems raise. A recurring theme is the problem of overfitting. Deep learning models can learn their training data really well, essentially they memorise the answers to questions and so when they are faced with questions they have not seen before they perform badly. Overfitting can be addressed with a range of techniques.

One twist I had not seen before is the division of the labelled data used in machine learning into three, not two parts: training, validation and test. The use of training and validation parts is commonplace, the training set is used for training – the validation set is used to test the quality of a model after training. The third component which Chollet introduces is the “test” set, this is like the validation set but it is only used when your model is about to go into production to see how it will perform in real life. The problem it addresses is that machine learning involves a large number of hyperparameters (things like the type of machine learning model, the number of layers in a deep network, the form of the activation function) which are not changed during training but are changed by the data scientist quite possibly automatically and systematically. The hyperparameters can be overfitted to the validation set, hence a model can perform well on validation data (that it has seen before) but not on test data which represents real life.

A second round of examples looks at deep learning in computer vision, using convolution neural networks (convnets). These are related to the classic computer vision process of convolution and image morphology. Also introduced here are recurrent neural networks (RNNs) for applications in processing sequences such as time series data and language. RNNs have memory across layers which dense and convolution networks don’t, this makes them effective for problems where the sequence of data is important.

The final round of examples is in generative deep learning including generating text, the DeepDream system, image style transfer and generating images of faces.

The book ends with some thoughts of the future. Chollet comments that he doesn’t like to use the term neural networks which implies the ability to reason and abstract in the way that humans do. One of the limitations of deep learning is that, as currently used, does not have the ability to abstract or generate programmatic descriptions of solutions. You would not use deep learning to launch a rocket – we have detailed knowledge of the physics of rockets, gravity and the atmosphere which makes a physics-based approach far better.

As I read I realised that keeping up with what was new in machine learning was a critical and challenging task, Chollet answers this question exactly suggesting three approaches to keeping abreast of new developments:

  1. Kaggle – the machine learning competition site;
  2. ArXiv – the preprint server, in particular http://www.arxiv-sanity.com/ which is a curated view of the machine learning part of arXiv;
  3. Keras – keeping up with developments in the Keras ecosystem;

If you’re going to read one book on deep learning this should probably be the one, it is readable, covers off the field pretty well, Chollet is an authority in this area and in my view has particularly acute insight into deep learning.

Older posts «