Hormone Intelligence

Researchers in the field of artificial intelligence aim to find ways for computers to respond to questions and make personalised recommendations. This goal becomes more tractable when applied to a specific area of expertise. I have been involved with a team that has developed an artificial intelligence system to help women understand the variation in their female hormones. This is available as Female Hormone MappingTM.

Complex systems

The hormone networks that control female menstrual cycles represent the most complex aspect of the endocrine system. Intricate feedback pathways between the hypothalamus, pituitary and the ovaries trigger a succession of fluctuations in hormone levels resulting in ovulation. Although healthy women should expect these cycles to repeat regularly for 30 to 40 years, female hormones are sensitive to external stress factors, such physical exercise, suboptimal nutrition, disrupted sleep or mental pressures. These cause variations between cycles. Furthermore, female hormones are picked up by receptors all around the body, including brain, bone and heart cells. For some women, these effects are more troublesome than for others.

Barometer of health

In addition to being essential for fertility, a well-functioning menstrual cycle provides women with a more general barometer of health. Some women try to track their hormonal fluctuations using proxy measurements, like body temperature or secondary metabolites in saliva or urine. But the gold standard is to determine the actual serum levels of hormones circulating in the blood. A pin-prick sample can measure all four key female hormones: oestradiol, progesterone, follicle stimulating hormone (FSH) and luteinising hormone (LH).

Although taking a blood sample every day would be troublesome and expensive, measuring the hormones in just two pin-pricks over a month is certainly manageable. This is where Bayesian inference can help.

Bayesian inference

In his brilliant book, Probability Theory: The Logic of Science, Edwin Jaynes explains the power of the Bayesian approach. It provides the fundamental way to draw statistical inferences from data, based on our prior knowledge. In the case of hormone intelligence, science provides a good understanding of the endocrine networks and the degree of variation seen across the population. If we are limited to just two measurements per month, days 14 and 21 provide the most information because these are likely to be close to the main hormone peaks that occur over a cycle.

For any particular woman, Bayesian inference can be used to select the most likely sets of hormone curves that are consistent with her blood test results and other information she has provided.

A clever mathematical algorithm that draws a set of hormone curves is not much use to a woman without the interpretation and advice of a specialist endocrinologist. But special expertise is limited and expensive. This is where an expert system can help.

Expert system

Computer systems that emulate human expertise have been around for nearly 50 years. I had the good fortune to work closely with Dr Nicky Keay in order to ensure that the system acquired sufficient knowledge to generate personalised, expert reports. In a process reminiscent of Borges, we explored the tree of all possible paths, giving an interpretation for each outcome. Dr Keay was insistent that all advice was backed up by appropriate evidence and scientific references.

One of the most interesting aspects of female hormone profiles is that they change as a woman approaches menopause: the ovarian hormones decline, whereas the control hormones become elevated. This allowed us to create an innovative score to evaluate a woman’s ovarian responsiveness. The score was designed to be particularly useful for women in the perimenopausal stage of life.

Female Hormone MappingTM

Combining Bayesian inference with an expert system has created a genuine artificial intelligence system. It takes as inputs, blood test results and self-reported data, including personal wellbeing scores, and it generates an expert report with personalised advice. It is available on a mobile app.

I hope that Female Hormone MappingTM will empower women with a better understanding of their personal hormones and help improve their wellbeing.

Supercompensating with Strava

Supercompensation sounds like a reference to an investment banker’s salary, but in fact it describes the body’s ability to adapt positively to a training stimulus. The idea is to attain a higher level of fitness, following a training session, than you had before. In fact, that is generally the point of training. This concept is closely linked to Strava’s Fitness and Freshness charts.

The development of athletic performance requires a delicate balance between an adequate stimulus that drives adaptation and the provision of sufficient recovery time to allow these adaptations to take place

Endocrinology of Physical Activity in Sport, Third Edition

Much has been written about supercompensation, but, as the quotation above highlights, improving your own personal performance depends on
– applying the optimal amount of training stimulus and
– allowing the correct amount of recovery time.

How does supercompensation work?

A hard training session puts your body under stress. An athlete who is perspiring profusely and complaining of aching limbs experiences similar symptoms to a patient with a severe fever. The stress induced by both of these situations is picked up in the brain by the hypothalamus, which triggers a range of hormonal responses, putting the body into recovery mode.

Physical exercise challenges the muscular-skeletal, cardiovascular and neurological systems. The hormonal response elicits a range of actions around the body, including muscle repair, replenishment of glycogen stores, increase in mitochondria and reinforcement of neural pathways. These processes do not begin until activity has ceased, so, in fact, you become fitter during the rest and recovering phase, rather than while you are actually exercising.

The recovery processes take time and energy. In addition to fuelling before and during exercise, it is important to refuel after a hard training session, particularly during the first 20 minutes.

Optimal training stimulus

Training stimulus is a function of duration and intensity. Strava measures this as Training Load, which shows up as Training Impulse on your Fitness & Freshness chart. This is similar to other commonly used measures. You should also have in mind what aspect of fitness you need to develop for your target events (endurance, power, sprint etc.).

I recently rode over 200km from London to Brighton and back, which Strava calculated as a Training Load of 400. Unfortunately this probably did not make me much fitter, because it left me greatly fatigued. During the next two days that I spent recovering, my body probably just about reattained its previous base line level of fitness and failed to achieve supercompensation. It was a great ride, but it was also an example of excessive training stimulus .

On the other hand, going for a gentle ride without any strong effort is unlikely to put the body under enough stress to give rise to the desired hormonal response. Any supercompensation is likely to be minimal. Some people might call this “junk training”, because higher duration or intensity is needed, in order to become fitter.

So what is the optimal training stimulus should you aim for? A simple answer is to check your Strava Fitness & Freshness page and set a target Training Load equal to about 1.3 to 1.5 times your current Fitness (quite a hard session). This all links back to how to ramp up your fitness.

The right recovery time

As mentioned above, you get fitter while you are recovering. Ideally your next training session should be timed to match the peak of supercompensation. The colour coding of the chart provides a traffic light system. If you train again too early, your body will not have time to recover. But if you leave it too long, you miss the opportunity. As a general rule, it is sensible to follow a hard training day with an easier day. It is also very important to take one full rest day per week, where activity is limited to nothing more than a short walk or some stretching. When is comes to recovery, remember that sleep is “Chief nourisher in life’s feast”.

Functional overreaching (FOR)

Good periodisation of training stimulus and recovery results in beneficial performance adaptation, known as functional overreaching. This stimulates anabolic (muscle building) hormones, such as IGF1 and testosterone, while stress hormones, like cortisol remain low. The athlete sees a steady improvement in performance.

Nonfunctional overreaching (NFOR)

Nonfunctional overreaching occurs when an athlete is too eager to train again. Without sufficient recovery, the body is only just back to base line when it is hit with another bout of exercise. No time is allowed for the anabolic response. This is throwing away the potential benefits of supercompensation and leads to a stagnation of performance.

Overtraining syndrome (OTS)

Overtraining syndrome occurs when the next training session begins before the body has fully recovered from the last one. This can be a problem for athletes juggling a high number of training hours with a full-time job. When the endocrine system is put under this level of stress, cortisol, prolactin and creatine kinase tend to rise, while sex steroids become depressed. This results in an accumulation of fatigue and a progressive deterioration of performance.

When were you last in a fully recovered state?

You can tell which of these situations applies to you, by asking how long has it been since you were in a fully recovered state? If it is days, you should be able to get fitter. If it is weeks, you may be in a state of nonfunctional overreaching. If you have not been in a fully recovered state for months, you have overtraining syndrome. The period taken to recover to a healthy state often has the same timescale.

How do I know if I am in a fully recovered state?

Various apps use heart rate variability (HRV) as an indicator of recovery. Alternatively, you can activate the sliders for Fatigue and Form on your Strava Fitness & Freshness page and look for positive Form. This is when Fitness is greater than Fatigue. My chart below shows a sustained period of high Fatigue and negative Form in April, suggesting that some of the training in that heavy block may have been somewhat counterproductive, but at least I took a rest week in early May.

Super compensation

Supercompensation is the underlying mechanism of periodised training. It works on a number of timescales from the days in a weekly plan, to the weeks in a monthly plan and up to the months in the season’s plan. I hope that this read has provided you with super compensation.

Related posts

Milan Sanremo in a Random Forest

Last time I tried to predict a race, I trained up a neural network on past race results, ahead of the World Championships in Harrogate. The model backed Sam Bennett, but it did not take account of the weather conditions, which turned out to be terrible. Fortunately the forecast looks good for tomorrow’s Milan Sanremo.

This time I have tried using a Random Forest, based on the results of the UCI races that took place in 2020 and so far in 2021. The model took account of each rider’s past results, team, height and weight, together with key statistics about each race, including date, distance, average speed and type of parcours.

One of the nice things about this type of model is that it is possible to see how the factors contribute to the overall predictions. The following waterfall chart explains why the model uncontroversially has Wout van Aert as the favourite.

Breakdown of prediction for Wout van Aert

The largest positive contribution comes from being Wout van Aert. This is because he has a lot of good results. His height and weight favour Milan Sanremo. He also has a strong positive coming from his team. This distance and race type make further positive contributions.

We can contrast this with the model’s prediction for Mathieu van der Poel, who is ranked 9th.

Breakdown of prediction for Mathieu van der Poel

We see a positive personal contribution from being van der Poel, but having raced fewer UCI events, he has less of a strong set of results than van Aert. According to the model the Alpecin Fenix team contribution is not a strong as Jumbo Visma, but the long distance of the race works in favour of the Dutchman. The day of year gives a small negative contribution, suggesting that his road results have been stronger later in the year, but this could be due to last year’s unusual timing of races.

Each of the other riders in the model’s top 10 is in with a shout.

It’s taken me all afternoon to set up this model, so this is just a short post.

Post race comment

Where was Jasper Stuyven?

Like Mads Pedersen in Harrogate back in 2019, Jasper Stuyven was this year’s surprise winner in Sanremo. So what had the model expected for him? Scrolling down the list of predictions, Stuyven was ranked 39th.

Breakdown of prediction for Jasper Stuyven

His individual rider prediction was negative, perhaps because he has not had many good results so far this year, though he did win Omloop Het Nieuwsblad last year and had several top 10 finishes. The model assessed that his greatest advantage came from the length of the race, suggesting that he tends to do well over greater distances.

The nice thing about this approach is that that it identifies factors that are relevant to particular riders, in a quantitative fashion. This helps to overcome personal biases and the human tendency to overweight and project forward what has happened most recently.

Hexagons in the Arctic Circle

An attractive aspect of hexagonal patterns is that they can repeat in interesting ways across a cycling jersey. This is partly due to the fact that a hexagon can be divided up into three equal lozenge shapes, as seen near the neck of the top right jersey. These shapes can be combined in imaginative ways, as displayed in the lower two examples.

This three-way division of a hexagon can create a 3D optical illusion called a “Necker cube”, which can appear to flip from convex to concave and back again. The orange patch can appear to be the top of a cube viewed from above or the ceiling in a corner, viewed from below. See if this happens if you stare at the image below.

Looking down on a cube or up into the corner of a room?

Spoiler alert: from here things gets a bit mathematical

Tessellations

A tessellation, or tiling, is a way of covering a plane with polygons of various types. Tessellations have many interesting mathematical properties relating to their symmetries. It turns out that there are exactly 17 types of periodic patterns. Roger Penrose, who was awarded the 2020 Nobel Prize in Physics for his work on the formation of black holes, discovered many interesting aperiodic tilings, such as the Penrose tiling.

While some people were munching on mince pies before Christmas, I watched a thought-provoking video on a related topic, released by the Mathologer, Burkard Polster. He begins by discussing ways of tiling various shapes with dominoes and goes on describe something called the Arctic Circle Theorem. Around the middle of the video, he shifts to tiling hexagon shapes with lozenges, resulting in images with the weird 3D flipping effect described above. This prompted me to spend rather a lot of time writing Python code to explore this topic.

After much experimentation, I created some code that would generate random tilings by stochastically flipping hexagons. Colouring the lozenges according to their orientation resulted in some really interesting 3D effects.

Algorithm flips a random hexagon to create a new tiling.

Neckered

The video shows random tilings of a hexagonal area. These end up looking like a collection of 3D towers with orange tops. But if you focus on a particular cube and tilt your screen backwards, the whole image can flip, Necker-style into an inverted version where the floor becomes the ceiling and the orange segments push downwards.

I used my code to create random tilings of much bigger hexagons. It turned out that plotting the image on every iteration was taking a ridiculous amount of time. Suspending plotting until the end resulted in the code running 10,000 time faster! This allowed me to run 50 million iterations for a hexagon with 32 lozenges on each size, resulting in the fabled Arctic Circle promised by the eponymous theorem. The central area is chaotic, but the colours freeze into opposite solid patches of orange, blue and grey outside the circumference of a large inscribed circle.

Arctic Circle emerged on a hexagon of side 32 after 50 million iterations

Why does the Arctic Circle emerge?

There are two intuitive ways to understand why this happens. Firstly, if you consider the pattern as representing towers with orange tops, then every tower must be taller than the three towers in front of it. So if you try to add or remove a brick randomly, the towers at the back are more likely to become taller, while those near the front tend to become shorter.

Two examples of paths from left to right

The second way to think about it is that, if you look carefully, there is a unique path from each of the lozenges on the left hand vertical side to the corresponding lozenge on the right hand vertical side. At every step, each path either goes up (blue) or down (grey). The gaps between the various paths are orange. Each step of the algorithm flips between up-down and down-up steps on a particular path. On the large hexagon, the only way to prevent the topmost cell from being orange is for the highest path to go up (and remain blue) 32 times in a row. This is very unlikely when flips are random, though it can happen more often on a smaller size-6 hexagon like the one shown in the example.

Resources

A Jupyter notebook demonstrating the approach and Python code for running longer simulations are available on this GitHub page.

Back to cycling jerseys

The Dutch company DSM is proudly sponsoring a professional cycling team in 2021. And a hexagon lies at the heart of the DSM logo, that will appear on the team jerseys.

Science for dance performance

Professional dancers are like elite athletes

This web site is about using science to improve performance. Although my focus has generally been on sport, science can also help artistic performance. Professional dancers face many of the same challenges as elite athletes, but a cultural divide separates the two communities. A recent paper helps to bridge this gap, by showing that scientific advances in managing relative energy deficiency in sport (RED-S) may be of great benefit in the dance world.

Dance and sport

Professional dancers spend many hours a day training in order to deliver top level performances in high pressure situations. On stage, they are quite literally under the spotlight. They also start young, developing bodies that are able to meet the high level of technical demands required to reach the top. In spite of the similarities with the lives of those in elite sport, artistic performance is viewed differently from athletic performance. A prima ballerina would not consider herself an athlete any more than a sprinter would consider herself a dancer. Strictly Ballroom is dance, whereas figure skating is sport. This separations stretches from the individual participants up to the level of governing bodies.

Athletes in many sports adapt their body composition to gain an advantage, often seeking to achieve “race weight” ahead of competition. In many ways, the situation is more extreme for dancers, particularly those pursuing classic forms such as ballet, who aim for a body shape that meets aesthetic ideals, while maintaining the strength and flexibility to perform.

Relative energy deficiency in dance

In the paper, dancers were invited to complete an online survey that had been based on previous studies of athletes who were potentially at risk of low energy availability, specifically RED-S. Responses included anthropomorphic data, training and performance hours, injuries and illness, indicators of hormone status and attitudes to eating and weight control.

A RED-S risk score was derived from each dancer’s responses. Of the 247 participants, 57% of females and 29% of males had negative scores, consistent with low energy availability.

Psychological factors proved to be important. Many dancers felt anxious about missing class or rehearsals, in a similar way to athletes who suffer from exercise addiction. These dancers also tended to be more obsessive about controlling their weight and what they eat. Most considered the chances of gaining a leading role to be higher if they lost weight. These kinds of attitudes were observed in an earlier study of male cyclists.

Among the female dancers, some interesting correlations showed up between these mental attitudes and both physical and physiological factors. The more obsessive individuals tended to have a lower body mass index (BMI) particularly when calculated using their lowest weight for their current height. They also tended to have experienced various forms of menstrual disfunction, indicating a disruption to normal hormonal function that has been observed in female athletes in low energy availability.

The large majority of dancers had not heard of Relative Energy Deficiency in Sport, probably because they do not self-identify as sportsmen/sportswomen. Yet the peer pressure of dance schools and dance companies, combined with ever present social media, can lead some dancers to restrict energy intake to levels that are insufficient to meet the high demands of training and performance.

Fit to dance

The authors hope that the publication of this study will help raise awareness in the dance community of the importance of fuelling for the work required. The fact that physical outcomes are connected, via hormones, to mental attitudes is particularly relevant during the COVD crisis, which has impacted the dance world in such a tragic way. The hope is that dancers will be fully fit and healthy to return to the stage, when the theatres eventually open.

References

Indicators and correlates of low energy availability in male and female dancers
Nicola Keay, AusDancers Overseas, Gavin Francis

Energy Availability: Concept, Control and Consequences in relative energy deficiency in sport (RED-S)

Low energy availability assessed by a sport-specific questionnaire and clinical interview indicative of bone health, endocrine profile and cycling performance in competitive male cyclists, Nicola Keay, Gavin Francis, Karen Hind

Pro cycling team networks

The COVID-19 pandemic has further exposed the weakness of the professional cycling business model. The competition between the teams for funding from a limited number of sponsors undermines the stability of the profession. With marketing budgets under strain, more teams are likely to face difficulties, in spite of the great advertising and publicity that the sport provides. Douglas Ryder is fighting an uphill struggle trying to keep his team alive after the withdrawal of NTT as a lead sponsor. One aspect of stability is financial, but another measure is the level of transfers between teams.

The composition of some teams is more stable than others. This is illustrated by analysing the history of riders’ careers, which is available on ProCyclingStats. The following chart is a network of the transfers between teams in the last year, where the yellow nodes are 2020 teams and the purple ones are 2019. The width of the edges indicates how many riders transferred between the teams, with the thick green lines representing the bulk of the riders who stuck with the same team. The blue labels give the initials of the official name of each team, such as M-S (Mitchelton-Scott), MT (Movistar Team), T-S (Trek-Segafredo) and TS (Team Sunweb). Riders who switched teams are labelled in red.

Although there is a Dutch/German grouping on the lower right, the main structure is from the outside towards the centre of the network.

The spikes around the end of the chart show riders like Geoffrey Soupe or Rubén Fernández, who stepped down to smaller non World Tour teams like Team Total Direct Energie (TTDE), Nippo Delko One Provence (NNDP), Euskaltel-Euskadi (E-E), Androni Giocattoli-Sidermec (AG-S ) or U-XPCT (Uno-X Pro Cycling Team).

The two World Tour outliers were Mitchelton-Scott (M-S) and Groupama FDJ (GF), who retained virtually all their riders from 2019. Moving closer in, a group of teams lies around the edge of the central mass, where a few transfers occurred. Moving anti-clockwise we see CCC Team (CT), Astana Pro Team (APT), Trek-Segafredo (T-S), AG2R Le Mondial (ALM), Circus-Wanty Gobert (C-WG), Team Jumbo Visma (TJV), Bora-Hansgrohe (B-H) and EF Pro Cycling (EPC).

Deeper in the mêlée, Ineos (TI_19/IG_20), Deceuninck – Quick Step (D-QS), UAE-Team Emirates (U-TE), Lotto Soudal (LS), Bahrain – McLaren (B-H) and Movistar Team(MT) exchanged a number of riders.

Right in the centre Israel Start-Up Nation (IS-UN) grabbed a whole lot of riders, including 7 from Team Arkéa Samsic (TAS). Meanwhile likes of Victor Campenaerts and Domenico Pozzovivo are probably regretting joining NTT Pro Cycling (TDD_19/NPC_20).

Looking forward

A few of the top riders have contracts for next year showing up on ProCyclingStats. So far 2020/2021 looks like the network below. Many riders are renewing with their existing teams, indicated by the broad green lines. But some big names are changing teams, including Chris Froome, Richie Porte, Laurens De Plus, Sam Oomen, Romain Bardet and Wilco Keldeman, Bob Jungels and Lilian Calmejane.

What about networks of riders?

My original thought when starting this analysis was that over their careers, certain riders must have been team mates with most of the riders in today’s peloton, so who is the most connected? Unfortunately this turned out to be ridiculously complicated, as shown in the image below, where nodes are riders with links if they were ever teammates and the colours represent the current teams. The highest ranked rider in each team is shown in red.

It is hard to make much sense of this, other than to note that those with shorter careers in the same team are near the edge and that Philippe Gilbert is close to the centre. Out of interest, the rider around 9 o’clock linking Bora and Jumbo Visma is Christoph Pfingsten, who moved this year. At least we can conclude that professional cyclists are well-connected.

Lord of the (cycling) rings

Which Lord of the Rings characters do they look like? Ask an AI.

After building an app that uses deep learning to recognise Lord of the Rings characters, I had a bit of fun feeding in pictures of professional cyclists. This blog explains how the app works. If you just want to try it out yourself, you can find it here, but note that may need to be fairly patient, because it can take up to 5 minutes to fire up for the first time… it does start eventually.

Identifying wizards, hobbits and elves

The code that performs this task was based on the latest version of the excellent fast.ai course Practical Deep Learning for Coders. If you have done bit of programming in Python, you can build something like this yourself after just a few lessons.

The course sets out to defy some myths about deep learning. You don’t need to have a PhD in computer science – the fastai library is brilliantly designed and easy to use. Python is the language of choice for much of data science and the course runs in Jupyter notebooks.

You don’t need petabytes of data – I used fewer than 150 sample images of each character, downloaded using the Bing Image Search API. It is also straightforward to download publicly available neural networks within the fastai framework. These have been pre-trained to recognise a broad range of objects. Then it is relatively quick to fine-tune the parameters to achieve a specific task, such as recognising about 20 different Tolkien characters.

You don’t need expensive resources to build your models – I trained my neural network in just a few minutes, using a free GPU available on Google’s Colaboratory platform. After transferring the essential files to a github repository, I deployed the app at no cost, using Binder.

Thanks to the guidance provided by fastai, the whole process was quick and straightforward to do. In fact, by far the most time consuming task was cleaning up the data set of downloaded images. But there was a trick for doing this. First you train your network on whatever images come up in an initial search, until it achieves a reasonable degree of accuracy. Then take a look at the images that the model finds the most difficult to classify. I found that these tended to be pictures of lego figures or cartoon images. With the help of a fastai tool, it was simple to remove irrelevant images from the training and validation sets.

After a couple of iterations, I had a clean dataset and a great model, giving about 70% accuracy, which as good enough my purposes. Some examples are shown in the left column at the top of this blog.

The model’s performance was remarkably similar to my own. While Gollum is easy to identify, the wizard Saruman can be mistaken for Gandalf, Boromir looks a bit like Faramir and the hobbits Pippin and Merry can be confused.

Applications outside Middle Earth

One of the important limits of these types of image recognition models is that even if they work well in the domain in which they have been trained, they cannot be expected do a good job on totally different images. Nevertheless, I thought it would be amusing to supply the pictures of professional cyclists, particularly given the current vogue for growing facial hair.

My model was 87% sure that Peter Sagan was Boromir, but only 81.5% confident in the picture of Sean Bean. It was even more certain that Daniel Oss played the role of Faramir. Geraint Thomas was predicted to be Frodo Baggins, but with much lower confidence. I wondered for a while with Tadej Pogacar should be Legolas, but perhaps the model interpreted his outstretched arms as those of an archer.

I hoped that a heavily bearded Bradley Wiggins might come out as Gimli, but that did not not seem to work. Nevertheless it was entertaining to upload photographs of friends and family. With apologies for any waiting times to get to it running, you can try it here.

In earlier blogs, I have described similar models to identify common flowers or different types of bike.

Tour de France and COVID-19

A report in VeloNews on the eve of the Tour de France stated that the French government had insisted that the “two strikes and you are out” policy must be enforced by the ASO. This means that if two positive COVID-19 test arise within a team or its support staff, the team will be removed from the race. This raises the possibility of the yellow jersey rider being ejected from the race if, for example, two mechanics record positive tests. This would be particularly unjust if it turns out that a test result was a false positive. So what are the chances that this might happen?

False positives

One of the great frustrations of the reporting on COVID testing has been the lack of clarity about what type of testing is being discussed. Tests fall in to two categories. Antigen tests use a sample from a nasal or pharyngeal swab to detect patients who currently have the disease, whereas antibody tests use a blood sample to identify patients who have developed antibodies as a result of exposure to the disease in the past – more than 28 days earlier.

There are two general types of antigen test. Real time polymerase chain reaction (RT-PCR) tests looks for specific viral fragments and need to be conducted in a laboratory, typically requiring at least 24 hours for a result. Less reliable rapid tests look for proteins associated with the COVID-19 virus, producing results in as little as 15 minutes.

The UCI requires riders and staff to be tested using RT-PCR, which is a very reliable method, having both high sensitivity (ability to detect those with the disease) and high specificity (ability to clear those without the disease). The relevant question for the Tour de France is the probability of a false positive RT-PRC test. Indeed Larry Warbass recently said he thought his result was a false positive, as he had experienced no symptoms and had maintained strict self isolation during training.

The evidence indicates that the machines performing the RT-PRC test are extremely unlikely to generate a false positive, because the test needs to find significant levels of three different targets to confirm the presence of COVID-19. In FDA experiments, 100% of negatives where correctly identified – there were no false positives. However, it remains possible that, in the moving circus of the Tour de France, a sample could become contaminated before it is tested or that samples might somehow be mislabelled. A high level of responsibility falls on the shoulders of team doctors to minimise these risks, but we can never be sure that it is zero.

One in a thousand

As a thought experiment, suppose that a negative RT-PCR test is 99.9% reliable, i.e. that one COVID-free person in a thousand somehow produces a false positive result. What is the chance that a team is unjustly sent home from the Tour?

Each team has eight riders plus support staff. Although teams might want to reduce the number of staff in the team bubble, it may be necessary to have extra catering staff in order to remain self sufficient. Let us assume an average of 17 staff on each of the 21 teams and that everybody has passed the required two negative tests prior to the start of the race. Assume further that nobody contracts COVID-19 throughout the race.

It has been indicated that everyone will be tested on the two rest days. Reassuringly, the probability of two or more false positives in a single team bubble of 25 people would be 0.03% (1-0.999^(25*2)). However, the probability that every team rider receives a negative result would be only 85% (0.999^168), meaning that there would be a 15% chance that at least one rider is unjustly ejected from the race. In fact, since at total of 1,050 tests would be taken by everyone in a team bubble, the chance of at least one person receiving a false positive would be surprisingly high: 65% (1- 0.999^1050).

Perhaps the assumption of 1 in a thousand false positives was a bit alarmist. Reducing it to 1 in thousand still produces a probability of 10% that somebody would be sent home during the Tour.

Blind eyes

In some situations, draconian sanctions might deter team members or staff from reporting symptoms. One could imagine a soigneur or mechanic having to go home quietly after mysteriously spraining a wrist. However, this could create very negative press coverage if word got out that this person was infected.

Furthermore, the UCI rules place responsibility on the teams and specifically the team doctors to apply strict daily monitoring and controls to detect suspected COVID-19 cases.

Champs Elysées

While in the above scenarios no one actually contracted COVID-19, there is, of course a not inconsiderable chance that one of the 525 people in the team bubbles does actually become infected. If the virus spreads to more than one team, the whole race could become a fiasco.

But let’s keep our fingers crossed and hope Tour makes it to the Champs Elysées.

Evenepoel and a fractured pelvis

My hip – post operation

It was shocking to see footage of Remco Evenepoel’s horrific crash in Il Lombardia. Reports indicate that he broke his pelvis after falling from a bridge into a ravine. This follows the injuries sustained by his Deceuninck-QuickStep team mate Fabio Jakobsen in the Tour of Poland.

The video above shows the repairs to my pelvis carried out by the specialist team at St George’s Hospital. My accident was less spectacular than Remco’s, I just hit a large pothole, while riding in the Kent lanes last March. It took the ambulance two and a half hours to arrive, as this was just at the beginning of the COVID-19 crisis. In fact, lock-down was announced on the evening of my crash. There was a lot of uncertainty about the virus back then, so it was a pretty scary time to be in hospital. Nevertheless I have immense respect and gratitude for the NHS staff who looked after me.

I was given crutches the day after the operation and returned home the day after that, with strict instructions to remain non-weight-bearing on the injured leg for six weeks and then only partial weight-bearing for the next six weeks. An NHS physiotherapist contacted me and regularly provided a progression of exercises. I set myself additional challenges, like doing extra press-ups.

After six weeks of doing no proper exercise, I had lost 4kg. The circumference of my left thigh was 5cm less than the right. However, following a review at the hospital, I was given permission to start gentle exercise on my static turbo trainer. I began by removing the left pedal and performing single leg drills, but after a couple of days it was easier to put my injured leg on the pedal as a passenger. This also gave the hip some mobility.

After a week on the turbo, I was up to one hour a day at about 160 watts. It took a long time to increase this above 200 watts. I watched a lot of old cycling films, without any particular urge to go on Zwift. I started riding outside in mid-June, 12 weeks post op. My Garmin pedals allowed me to monitor the left-right balance as well as average power.The following chart shows that 21 weeks after my accident, balance is hovering around 48:52 and five minute power is back over 300 watts.

Left/Right Balance and 5 minute Peak Power, since crash date

The psychological aspect of rehabilitation has been very important. I have focussed on targets and deadlines, marking each little achievement as a milestone. I am now walking without a limp, though running is still off limits. I even went kitesurfing a couple of weeks ago (don’t tell my surgeon about that one). I have been busy learning Italian, composing music and programming in Python.

Since heading back out on the roads, I have been riding cautiously, as my hip will not regain full strength until next spring. I plan to enter a couple of time trials to rekindle a sense of competition, without the danger of riding in a peloton. Racing again next season remains a goal.

Probably the most important mental aspect has been to stay positive at all times and never to spend time feeling sorry for oneself. This has been difficult as, inevitably, there have been a couple of set-backs when progress has seemed to reverse. But on the whole, my recovery has been astounding and, like Chris Froome, I remain optimistic about regaining my peak.

Remco will be back on the road next season, with the potential to pick up some results later in the year.

Efficient COVID testing on a hypercube

A strategy for finding people infected with SARS-CoV-2: optimizing pooled testing at low prevalence, Mutesa et al

In previous blogs, I described how mathematical modelling can help understand the spread of the COVID-19 epidemics and provide privacy-preserving contact tracing. Looking forward at how the world will have to deal with COVID-19 in the coming months, it is likely that a significant percentage of the population will need to be tested multiple times. In a recent BBC science podcast, Neil Turok, Leon Mutesa and Wilfred Ndifo describe their highly efficient method of implementing large-scale testing that takes advantage of pooling samples. This is helping African governments save millions on the cost of testing. I offer an outline of their innovative approach, which is described in more detail in a paper published on arxiv.org.

The need for large-scale testing

The roll-out of antigen testing in some countries, like the US and the UK, has been painfully slow. Some suggest that the US may need to carry out between 400,00 and 900,000 tests a day in order to get a grip on the epidemic. When antigen tests cost 30-50 US dollars (or 24-40 UK pounds), this could be very expensive. However, as long as a relatively small percentage of the population is infected, running a separate test for everyone would be extremely inefficient compared with approaches that pool samples.

Pooling offers a huge advantage, because a negative test for a pooled sample of 100 swabs, would clear 100 people with a single test. The optimal size of the pools depends on the level of incidence of the disease: larger pools can be used for lower incidence.

The concept of pooling dates back to the work of Dorfman in 1943. His method was to choose an optimal pool size and perform a test on each pooled sample. A negative result for a pool clears all the samples contained in it. Then the infected individuals are found by testing every sample in the the positive pools. Mutesa and Ndifo’s hypercube method is more efficient, because, rather than testing everyone in an infected pool, you test carefully-selected sub-pools.

The idea is to imagine that all the samples in a pool lie on a multidimensional lattice in the form of a hypercube. It turns out that the optimal number of points in each direction is 3. Obviously it is hard to visualise high dimensions, but in 3-D, you have 27 samples arranged on a 3x3x3 grid forming a cube. The trick to identifying individual infected samples is to create sub-pools by taking slices through the lattice. In the diagram above, there are 3 red slices, 3 green and 3 blue, each containing 9 samples.

Consider, for simplicity, only one infected person out of the 27. Testing the 9 pools represented by the coloured slices will result in exactly 3 positive results, representing the intersection of the three planes passing through the infected sample. This uniquely identifies the positive individual with just 9 tests, whereas Dorfman would have set out to test all 27, finding the positive, on average after doing half of these.

Slicing a hypercube

Although you can optimise the pool size to ensure that the expected number of positives in any pool is manageable, in practice you won’t know how many infected samples are contained in any particular pool. The hypercube method deals with this by noting that a slice through a D-dimensional hypercube is itself a hypercube of dimension D-1, so the method can be applied recursively.

The other big advantage is that the approach is massively parallel, allowing positives to be identified quickly, relative to the speed of spread of the pandemic. About 3 rounds of PCR tests can be completed in a day. Algorithms that further reduce the total number of tests towards the information theoretical limit, such as binary search, require tests to be performed sequentially, which takes longer than doing more tests in parallel.

In order to make sure I really understood what is going on, I wrote some Python code to implement and validate the hypercube algorithm. In principle, it was extremely simple, but dealing with low probability edge cases, where multiple positive samples happen to fall into the same slice turned out to be a bit messy. However, in simulations, all infected samples were identified with no false positives nor false negatives. The number of tests was very much in line with the theoretical value.

Huge cost savings

My Python program estimates the cost savings of implementing the hypercube algorithm versus testing every sample individually. The bottom line is that the if the US government needed to test 900,000 people and the background level of infection is 1%, the algorithm would find all infected individuals with around 110,000 tests or 12% of the total samples. At $40 a test, this would be a cost saving of over $30million per day versus testing everyone individually. Equivalent calculations for the UK government to test 200,000 people would offer savings of around £5million pounds a day.

It is great to see leading edge science being developed in Africa. Cost conscious governments, for example in Rwanda, are implementing the strategy. Western governments lag behind, delayed by anecdotal comments from UK officials who worry that the approach is “too mathematical”, as if this is somehow a vice rather than a virtue.

References

A strategy for finding people infected with SARS-CoV-2:optimizing pooled testing at low prevalence, Mutesa et al