Fun-GAI: Hallucinating mushrooms with Generative AI

Fungi

TL;DR:

  • Brought together by biology enthusiasts and tech wizards, my team and I ventured into the mysterious realm of mushrooms and their undiscovered morphologies.
  • Using a computational model (VAE), we created visualisations of hypothetical, 'unknown' mushrooms using mushroom image data.
  • Our project opens up new possibilities for exploring the fascinating world of fungi and expanding our knowledge using creative, out-of-the-box methods.

Earlier this month, I had the incredible opportunity to participate in BioHack 🧬 London, a hackathon that brought together the worlds of biology and generative AI. With a fantastic team consisting of Joshua Cesare Placidi, Vincenzo Incutti, and Ka Yeon Kim, we embarked on an exciting journey of exploration and innovation. Our team secured 2nd place for our final product, which delved into the fascinating realm of mushrooms and hypothetical morphologies.

My fascination with fungi initially stemmed from reading and researching fungal physiology and their remediation application. With the desire to build something outside of the 'wet lab' product sphere, coupled with the confronting realisation that over 90% of all fungi species remain undiscovered by science[1], we aimed to creatively explore these unknown species. The public domain currently lacks the tools and datasets to expand our understanding of the diverse world of fungi. Our vision was to train a computational model on mushroom image data that could generate hypothetical, 'unknown' mushrooms.

Mushrooms are the visible fruiting body of fungi and offered a more accessible means of differentiating mushroom-producing species compared to solely examining mycelium/mycelial networks. Some distinctive physical characteristics such as the shape, colour, and gill type are valuable markers for identifying and categorising different species.

However, relying solely on morphology for fungal classification may overlook substantial biological information inherent in these organisms. Therefore, acknowledging the limitations of morphology-based classification, we recognise that incorporation of genomic, environmental and other rich datasets would provide a more accurate means of classifying mushrooms, and exploring viable hypothetical species in the latent space.

Training our model


To train our model, we used two datasets: the Mushroom Common Genus dataset, consisting of images from seven mushroom genera, and the Danish Fungi Dataset, a vast collection of over 100,000 images of Danish mushrooms. We initiated a pre-training cycle using the Danish Fungi dataset and subsequently fine-tuned the model using the Mushroom Common Genus datasets.

To bring our vision to life (quite literally), we trained a variational auto-encoder (VAE) which combines the power of neural networks to learn complex patterns with the ability to represent data in a probabilistic latent space. The model's encoder-decoder structure, featuring a bottleneck in the middle, compelled the encoder to compress the input into a latent representation. This latent representation was then passed to the decoder, aiming to reconstruct the original input.

The gif at the top of the article demonstrates the decoder component of our model, generating new images from latent representations. This proof of concept exemplifies the feasibility of employing the latent space representation of morphology for innovative and out-of-the-box exploration. Our inspiration stemmed from a remarkable demo, which you can find here: demo link.

I invite you to explore the relevant information and code for this project through the following link: project link. Through this project, we sought to push the boundaries of exploration and inspire new perspectives on the remarkable world of fungi.


References

[1] Cheek, M., Nic Lughadha, E., Kirk, P., Lindon, H., Carretero, J., Looney, B., … Niskanen, T. (2020). New scientific discoveries: Plants and fungi. PLANTS, PEOPLE, PLANET, 2(5), 371–388. doi:10.1002/ppp3.10148