A single tissue image can hold tens of thousands of cells, and when they press close together, an AI system may merge neighbors, count one cell twice or miss it altogether. Researchers at Koç University in Istanbul have developed a way to train these systems to pay attention not just to individual cell shapes, but also to the way cells are arranged around one another.

That arrangement matters in digital pathology, where cell counts and their spatial distribution can help pathologists assess disease and plan treatment. Counting cells by hand across large images takes time, and results can vary from one observer to another. AI may help automate the work, but crowded tissue makes it hard for a model to tell where one cell ends and the next begins.

The Koç University team’s method, called topology-guided hard example mining, or TG-HEM, changes what the AI focuses on while it learns. The study, published in Medical Image Analysis, was led by Professor Çiğdem Gündüz Demir and Ph.D. student Onur Çakı, with colleagues from the university’s Department of Computer Engineering and KUIS AI Center and collaborators in mathematics and pathology.

During training, TG-HEM compares a model’s predicted cell distribution with an annotated reference in selected image regions. It uses topological data analysis, a mathematical way to describe patterns and structure, to measure how much the predicted arrangement differs from the reference. Regions with bigger structural differences receive more attention. The method then emphasizes difficult pixels within those regions, helping the model learn from both local mistakes and broader errors in the layout of cells.

This approach changes the training strategy rather than making the AI network larger or more complex. The researchers tested it with eight AI models, using their KUCell dataset and the publicly available BRCA-M2C breast cancer dataset. Across the tests, TG-HEM improved cell counting and localization compared with baseline models and other hard example mining methods. Localization means identifying where cells are in an image.

The improvement did not add computational work when the trained models analyzed new images, and the effect on training time was negligible. The team has also released the KUCell dataset and the code for its method, giving other researchers a way to check the results and build on the work.

More reliable cell measurements could support digital pathology research and make tissue assessments more consistent. But the study tested performance on research datasets; it did not show that the method improves diagnostic accuracy or patient outcomes. The findings offer a practical step toward AI that can read crowded tissue more carefully, while further work will be needed to establish how such tools perform in clinical care.