top of page
  • Writer's pictureR&D center Winstars.AI

Hacking the Human Body | AI Tissue Image Analysis

Successful Participation of Winstars in the Kaggle Competition: HuBMAP + HPA — Hacking the Human Body



The human body is a miracle of nature, complex and multifaceted in its structure. It consists of many tissues, each with its own unique role and structure. Every tissue is irreplaceable and has a specific function, from the nerve fibers that transmit impulses to the muscle tissues that allow us to move.

With the development of medicine and biology, the relevance of accurate identification and analysis of tissues using microscopic images is increasing. Distinguishing between different tissues can be key to diagnosing various diseases, studying physiological processes, or developing new treatments.

Therefore, the study of tissue microstructures, their properties, and characteristics continues to be one of the most prominent fields of modern science.

That’s why Winstars participated in a Kaggle competition focused on image segmentation of functional tissue units (FTUs) from tissue section images of five organs.

Our Data Science team proudly achieved a respectable 95th place, earning a bronze medal among 1175 participants. In this article, we would like to present our solution and highlight all the essential techniques we used.


Competition Overview:


The objective of this Kaggle competition is to develop a model that can segment functional tissue units (FTUs) from tissue section images of five different organs, namely, kidney, large intestine, spleen, lung, and prostate.

Left is the tissue sample image; the right is the same image with the highlighted FTUs

Figure 1: Left is the tissue sample image; the right is the same image with the highlighted FTUs.

Data Set Insights:

The training dataset for this competition was sourced from the Human Protein Atlas (HPA). However, a significant challenge in this competition was the inherent visual differences in FTUs across the different organs.

To add to the complexity, the test dataset was sourced from a different program called the Human BioMolecular Atlas Program (HuBMAP). This test dataset varied in several parameters, such as pixel size, tissue thickness, and staining protocols. Such variations demanded a model with strong generalization capabilities.

Left: spleen slice from HPA; right: spleen slice from HuBMAP

Figure 2: Left: spleen slice from HPA; right: spleen slice from HuBMAP


Winstars' Solution Approach about Tissue Image Analysis:

Data Structuring:

Our team adopted a 5-fold cross-validation approach on the available training data. The most effective model was a combination of two different models, which scored 0.77.

Data Augmentations:

To overcome the challenges of an imbalanced dataset and differences in image properties between HPA and HuBMAP, the team employed various augmentations, such as flips, rotations, rescalings, and color adjustments.

Examples of different augmentations applied to the same image

Figure 3: Examples of different augmentations applied to the same image

The augmentations mentioned earlier are general computer vision techniques that can be applied to any task without using domain-specific information. However, for working with tissue samples, we also utilized a technique called stain augmentation, which is specifically designed for this purpose. This process is explained in detail in the articles Structure-Preserving Color Normalization, and Sparse Stain Separation for Histological Images and a python library stain tools implement it. Here are some examples of how this technique is used:

9 examples of the Vahadane stain augmentations of the same image

Figure 4: 9 examples of the Vahadane stain augmentations of the same image


Model Architecture:

Encoder Framework:

Winstars utilized a Co-Scale Conv-Attentional Image Transformer, with CoaT Lite Medium being the most suitable variant. The team employed ImageNet pre-trained weights for improved training efficiency.

CoaT Lite architecture

Figure 5: CoaT Lite architecture

Design of a Serial Block

Figure 6: Design of a Serial Block

Design of the conv-attentional module

Figure 7: Design of the conv-attentional module

Decoder Design:

The decoder played a crucial role in the image segmentation process. It was made up of a collection of MLP (Multi-Layer Perceptron) blocks that meticulously analyzed and processed the outputs from the encoder. These blocks worked together to extract and refine the necessary features, eventually fusing them through a specific layer.

Design of our model

Figure 8: Design of our model

The design of an MLP block

Figure 9: The design of an MLP block

The result of this complex process was the production of the desired segmentation map, which accurately identified and separated different objects within the image.

Illustration of the pixel shuffle operation (sub-pixel convolution layer)

Figure 10: Illustration of the pixel shuffle operation (sub-pixel convolution layer)

Design of Fuse layer

Figure 11: Design of Fuse layer


Training Protocols:

Loss Mechanism:

The team combined the Lovasz hinge loss with binary cross entropy for optimal training convergence.

Optimization Techniques:

The team used Ranger, which is a combination of Rectified Adam (RAdam) and the Lookahead mechanism, as their optimizer of choice. To ensure stability in the training process, they utilized gradient accumulation over eight batches.

Additionally, they incorporated the Stochastic Weight Averaging (SWA) method over five epochs to improve the model's performance.

Learning Rate Management:

Winstars Data Scientists implemented a cosine warm up, followed by a steady decay phase, and then transitioned to a constant learning rate for the final epochs.



Analyzing images of tissues under a microscope allows us to explore the microscopic world of structures that make up our bodies. From a technical point of view, the detailed study and recognition of different tissues based on their microscopic characteristics is an essential task that requires precision and care.

Beyond the confines of the contest, the Winstars team's approach offers much more. Such studies have a huge application potential in various fields. Medicine, for example, can use these techniques to diagnose diseases, investigate tissue problems, or develop new treatments. In biology and scientific research, tissue recognition can be the key to studying new species or understanding evolutionary relationships.

This is a way to have a deep understanding of our body and an opportunity to apply this knowledge to improve the quality of life, providing more accurate diagnoses and more effective treatment methods.


Related Posts

See All
bottom of page