1 of 92

��������������������������������������������������������Modern computers methods for image processing using mathematical algorithms�doc. Mgr. Mária Ždímalová, PhD.

 Slovak University of Technology, Bratislava, Slovakia

mzdimalova@mail.com

https://www.math.sk/wiki/zdimalova

https://www.facebook.com/ARCHMATHEMATICS

2 of 92

Slovakia

3 of 92

4 of 92

5 of 92

Mathematics, Data Science

Image processing, Image Segmentation

6 of 92

Image Processing and Image Segmentation

Introduction

  • Image analyzing data based on computers analyes

  • Image processing: Segmentation process

  • Implementation of own programs

  • Free softwares for imageanalyses

  • Arficial Intelligence in medicine

  • Bridge:

between mathematics, informatics, medicine, biology, telemedicine, bio physics, SAR techniques,

geodesy applications, urban applications, cracks in the buildings, civil engineering applications,

face recognitions, pattern recognitions, fingers print recognitions,

and many others…..

7 of 92

Introduction: What is an �image segmentation?

  • The process of separating an image into foreground and background parts.
  • Foreground = object of interest
  • Background = the rest of the image

8 of 92

  • Image analysis plays an important role in computers diagnostic process and image analyses.

  • Mathematical modeling is a very good and strong tool for the analysis and modeling of this data.

  • The main point brings perspective from discrete mathematics and discrete algorithms, dealing with graph theory, statistics, clustering aggregation functions for image data analyses.

9 of 92

2D Segmentation of Images

Aim: deviding of digital image on parts, segments

The 2 most common types of search segments:Segments with similar properties (e.g. color, intensity, "texture")

Object and background

Use: medicine, biology, satellite image processing, machine-learning (e.g. object recognition), digital art, computed guided operations

Traditional methods

Threshold methos

Cluster methods

''Fuzzy'' cluster methods

Histogram methods

''Region-growing'' methods ("Magic Wand")

Edge detectors

Methods based on finding the shortest path

(Intelligent Scissors)

(GraphCut) Methods based on finding the maximum flow and the minimum cut

Mixed methods (GrabCut)

Al techniques

10 of 92

  • Comparision of different techniques in image processing

  • Different methods require different amounts and types of user input and produce different results.

  • It is up to the user to determine which method is most suitable for the given type of image and the desired segmentation result.

a) Magic Wand, b) Intelligent Scissors, c) GraphCut, d) GrabCut

11 of 92

Methods

  • Several computers independent software tools were created for analysis of biological, MRI and CT data.
  • We implemented mathematical and informatically algorithms called Graph cut, Grab cut, Intelligent Scissors and Neural metworks (discrete algorithms, based on discrete mathematics).
  • Digital images, digital.
  • Segmentation:

partitioning the image into pixels of an object and pixels of a

background.

12 of 92

  • We focus on the analyses of the techniques, using image processing and segmentation of the detected objects.

  • We can mention improving of diagnostic process by clinicians doctors, by bones, organs, tumors, cysts, fractures, secondary tumors, unclear areas of bleeding, unclear areas of fractures and abrasions, various types of growths on organs, stones in the kidneys and liver, tumors in the liver, observation of neurons and their pathways in different structures.

13 of 92

AIM: Mathematical algorithm, application in medical and SAR data:

image processing of biological and medical data focused

Results:

- Software using of graph cuts and grapb cuts methods in GrabCut v C++ and Qt, Graph Cut, Grab cut, Intelligent Scisors

  • -common work with Bac. Kristína Boratková, Marián Vrábel Slovakia, Nikita Fedorinm Sova Ondrej, Anuprava Chaterjee …
  • Dr. Mridul Ghosh, India, Prof. Sk Md Obaidullah, India, prof. Kopani Martin, prof. Dr. Poornima Vissanthi, …..

14 of 92

1. Graph Cut Method�

  • Application of min-cut algorithms on graphs to a problem of a segmentation of images.

  • Segmentation - formulated as a minimization problem.

  • Graph cuts: a powerful energy minimization tool producing globally optimal solutions.

  • Graph cuts: algorithms finding max flow in a graph (network) (augmenting paths algorithms, push - relabel algorithms).

15 of 92

Max - Min theorem:

The maximal flow in a graph (network)

corresponds to a minimal cut in a graph

(network)

  • Dual problems.
  • Minimal cut: a semi-automatic segmentation of N-dimensional image obtained in a polynomial time.
  • Image is considered as a graph for which we find the minimal cut.
  • Segmentation of the image is then determined by this cut: partitioning the image into pixels of an object and pixels of a background.

16 of 92

Motivation

  • Application of min-cut algorithms on graphs to a problem of a segmentation of images.

  • Segmentation - formulated as a minimization problem.

  • Graph cuts: a powerful energy minimization tool producing globally optimal solutions.

  • Graph cuts: algorithms finding max flow in a graph (network) (augmenting paths algorithms, push relabel algorithms).

17 of 92

  • The segmentation:

  • Assignment of every pixel to an object or to a background.

  • Represented by a binary vector:

A=(A1, A2, ........, AM)

with values from the set

{“object”, ”background”}.

18 of 92

  • In our case: to find the segmentation means to solve the minimization problem:

To find a vector A with a minimal cost.

  • Method: finding the minimal cut in an oriented graph.

  • Min cut C corresponds to the border between objects and

a background.

  • Ford-Fulkerson algorithm and its slight modification Edmonds-Karp algorithm for finding a maximal flow in a directed weighted network.

19 of 92

Construction of the oriented graph, network

  • Graph G = (V, E, w)

  • V - set of vertices E - set of edges

  • Every edge is assigned a nonnegative cost w (capacity).

  • The vertices correspond to pixels p in V.

  • Two new vertices: an „object vertex“ (source, input S) and a „background vertex” (sink, output T), terminals: V=P u {S,T} .

20 of 92

21 of 92

S-T - graph

Grid of pixels

22 of 92

23 of 92

Segmented pixels

S - T minimal cut

24 of 92

Introduction

  • Aim of a segmentation is to subdivide an image into regions and thus simplify its representation.

  • Two kinds of regions:

object regions and background regions

25 of 92

Experiment 1��

  • Common work with Zuzana Kriva, Tomas Bohumel

  • Benchmark data: LENA.

  • The segmentation is global.

26 of 92

27 of 92

Expment 2

28 of 92

29 of 92

Experiment 2

  • This experiment shows that the algorithm is able to process also data disturbed by a multiplicative noise, e.g., the data obtained by a radar imaging (SAR).

30 of 92

SAR DATA

31 of 92

32 of 92

33 of 92

34 of 92

35 of 92

  • Detection iron in the brain of rabbits

  • Cooperation with Comenius University in Bratislava, Medical Faculty, Institute of Medical Physics, Biophysics, Informatics and Telemedicine, Bratislava

  • Doc. RNDr. Martin Kopani, PhD., Ing. Jozef Major

  • Data: real images of brain cells examining a production of iron in cells of living organism after irradiation with GSM signal. The theory says that in a certain part of a brain with Purkyne cells appears more iron cells than in other part

36 of 92

Analyses of the biological data Iron

Data: real images of brain cells examining a production of iron in cells of living organism after irradiation with GSM signal. The theory says that in a certain part of a brain with Purkyne cells appears more iron cells than in other part

AIM:

  • to select iron cells
  • to show in which part is more density of iron cells appear
  • to prove by vector analysis, histogram, percentual representing
  • we acquired brain cells of rabbits and coloured images obtained by microscope. The images containing brain cells of rabbits after irradiation with GSM signal.

37 of 92

  • We created a program satisfying the conditions for this specific problem and working with these specific sort of images.

  • We use segmentation, histogram counting and percent ratio of segmented area to confirm this statement.

  • Pre-processing techniques: histogram equalization, contrast adjustment and shading correction.

38 of 92

The original image

39 of 92

The selected part of original image after application of enhancement

40 of 92

Results in form of binary image

41 of 92

Histogram counted according to direction vector (57, -16)

42 of 92

The selected part of original image after application of enhancement

Results in form of binary image

  1. Original data

  • Cutting of the area and segmentation by green colour

  • Binary segmentation

  • In the lower part of the image is concentrated 52,50 % of all segmented pixels…numerical percentual evaluation

43 of 92

Grab cut and

Cluster analyses

-with Kristína Boratková

Cluster analysis deals with the issue of dividing data into a finite number of clusters. Clusters are subsets of the entire data set, where elements of the set belong to one cluster that are close to each other in some way, and by uniting all the clusters we get the entire original set of elements again.

It is divided into:

Hierarchical

Non-hierarchical

Center-oriented clustering (k-means)Distribution-oriented clustering, Density-based clustering

44 of 92

  •  

MIXED MODELS

  1. Clustering using GMM
  2. Estimation of cluster parameters
  3. Finding the highest probability for each elements
  4. Optimization of the model (iterated)

45 of 92

  • Gaussian mixture models + Graphcut (mixed method)
  • Iterative method: Input – rectangle around the object + seed pixels (mostly not necessary)

2. GRABCUT

46 of 92

Estimation of Gaussian mixture models using k-means

Initial clustering using k-means

Weighting constant of the component π(k):

the ratio of the size of the cluster to the whole set

  • Initialing deviding of the clusters with k means:

Mean Value of µ(k):

Covariance matrix Σ(k):

GRABCUT

GMM

47 of 92

  • C++
  • Qt library
  • User environment

IMPLEMENTATION

48 of 92

Glioblastoma multiforme

  • A tumor disease affecting up to 2-3 out of 100 thousand adults and children manually.
  • Diagnostics using MRI.
  • The problem of determining the sharply border.
  • Appropriate image segmentation methods are being sought to distinguish them from the rest of the brain.
  • Today, in some facilities, this is still done manually {golden approach}, using simple measuring tools (poor accuracy).

THE AIM AND PROBLEM: DETECTION OF GLIOBLASTOMA MULTIFORM

Our aim:

Software, which would be able to detect and classify the tumor. This way could be more easy to help and detect the edges of the tumor on the image. As well as the doctors sould have better imagination about its area, not just about íts width measures.

49 of 92

Medical data: brain tumors

50 of 92

Brain tumors and tumors segmentation��Skull MRI (t2 flair) of a brain metastasis with accompanying edema. ��Source:https://commons.wikimedia.org/wiki/File:HirnmetastaseMR001.jpg��(a)original data (b)selected part of the image; (c)segmented edem in red color; (d)segmented edem. 

51 of 92

Roentgen image a) original data with noise and wrong bacround, ��b)segmented images wihout noise and clear bacround, ��c)original image of bones joint with noise and noisy backround ��d)segmented image of the bone joint without nosie and with clear backround.��

  •   a) b) c) d)

  •  

52 of 92

RESULTS TUMORS IN BRAIN

53 of 92

Cancer cells, brain of humans, original data example of segmentation

Cancer cells, brain of humans, original data filtering data, example of segmentation

54 of 92

  • Cancer cells,
  • brain of humans

  • Users Interface

  • Common work with Ondrej Sova

55 of 92

Intelligent scissors:

  • common work with Richard Roznovjak, Peter Weissman, Hisham El Faloughy, Erika Kubikova�
  • Comenius University, Medical Faculty, Institute of Anatomy�
  • Dijkstra algorithm-finding shortest paths in the graph or network

56 of 92

��

Simple example:

MRI scan of lumbosacral spine with para-median disc (L4/L5) herniation on the left side.

a) original image, b) image after applying our segmentaion, which is based on Intelligent Scissors, on the dural sac, c) unssucceful applying of thresholding method on the dural sac

57 of 92

58 of 92

59 of 92

Medical data

60 of 92

Maschine learning approach into biological image analyses

  • Coopertaion with Indiam couathors: Dr. Mridul Ghosh, prof. Obaidullah, Ms. Assifuyzzyman

  • A machine learning-based segmentation technique is required to get good performance to deal with biological images. Through semantic segmentation, regions of interest can be identified for cell assessment.

  • Clinicians can use segmentation results to identify abnormal cell and improve therapy planning. The creation of high-quality labelled and annotated datasets is a critical part of achieving the algorithmic goal of automated medical image segmentation. It is often difficult to collect clean annotations for cell segmentation at pixel level.

61 of 92

  • In this work, we have proposed a semantic segmentation framework which is based on the U-net architecture.
  • An encoder-decoder network and a skip connection.
  • Experimenting on 300 samples we obtained the IoU (Intersection of Union) score of 75.28% and accuracy of 82.64%.

Unet architecture

  • U-Net is a convolutional neural network that was developed for biomedical image segmentation.

  • The network is based on the fully convolutional network and its architecture was modified and extended to work with fewer training images and to yield more precise segmentations.

62 of 92

Example of Data biological cells and process of dying of cells

63 of 92

Proposed U-Net based architecture for segmentation of brain cells

64 of 92

  • First Step: Original image to masking image using thresholding image processing technique
  • Second Step: Prepare original image folder and masking folder for Unet process.
  • Third step: Train semantic segmentation Unet model.

.

65 of 92

We used component labeling to extract statistical information about a region of interest and conduct structural analysis. Here, we represent three different statistical information of segmented cells such as area, diameter, and solidity.

66 of 92

67 of 92

Random walker for cracks in buildings and materials��Random walk steps: �discrete, random movements in a sequence.The probability of the next step depends only on the current position. �Example: one-dimensional walk where a "walker" moves left or right with equal probability at each step. �

68 of 92

69 of 92

3D SEGMENTATION �

70 of 92

Motivation

71 of 92

2D vs 3D segmentation

  • Voxels
  • Pixels

Axial aspect ratio = ps[1] / ps[0]

Sagital aspect ratio = ps[1] / st

Coronal aspect ratio = st / ps[0]

72 of 92

DICOM – Medical Image Standard

  • Digital Imaging and Communications in Medicine
  • A list of attributes
  • Also contains information about the patient, study and other non-image related things
  • DICOM attributes consist of tag and value

73 of 92

3D visualization of the results

  • 3D Slicer – Open source
  • Volume rendering from DICOM slices

74 of 92

75 of 92

76 of 92

77 of 92

78 of 92

79 of 92

Sources

  • Breast Scans:

QIN Breast DCE-MRI

Huang, W., Tudorica, A., Chui, S., Kemmer, K., Naik, A., Troxell, M., Oh, K., Roy, N., Afzal, A., & Holtorf, M. (2014). Variations of dynamic contrast-enhanced magnetic resonance imaging in evaluation of breast cancer therapy response: a multicenter data analysis challenge (QIN Breast DCE-MRI) (Version 2) [Data set]. The Cancer Imaging Archive. https://doi.org/10.7937/k9/tcia.2014.a2n1ixox

RIDER Breast MRI

Meyer, C. R., Chenevert, T. L., Galbán, C. J., Johnson, T. D., Hamstra, D. A., Rehemtulla, A., & Ross, B. D. (2015). RIDER Breast MRI [Data set]. The Cancer Imaging Archive. https://doi.org/10.7937/K9/TCIA.2015.H1SXNUXL

  • Brain Scans:

ReMIND

Juvekar, P., Dorent, R., Kögl, F., Torio, E., Barr, C., Rigolo, L., Galvin, C., Jowkar, N., Kazi, A., Haouchine, N., Cheema, H., Navab, N., Pieper, S., Wells, W. M., Bi, W. L., Golby, A., Frisken, S., & Kapur, T. (2023). The Brain Resection Multimodal Imaging Database (ReMIND) (Version 1) [dataset]. The Cancer Imaging Archive. https://doi.org/10.7937/3RAG-D070

80 of 92

Bounding box

  • Specifying area with the object of interest
  • Concept from Grabcut
  • Tumors in breasts and in the brain

81 of 92

82 of 92

 

83 of 92

84 of 92

 

85 of 92

86 of 92

87 of 92

Discussion and Conclusion

  • Deeply analyses and segmentation of biological and radiology data.
  • Improving the diagnostic of pathological objects of human organs and biological data.
  • Graph Cut, Grab Cut, Intelligent Scissors, Aggregations Techniques, Maschine Learning,

a)CT, MRI data b) Biological microscopic data

88 of 92

From Commutative Algebra to Topological Structures and Graph Cuts�

  • Bridging Abstract Algebra and Image Segmentation

The Core Challenge of Image Segmentation

  • The Goal: Partitioning a digital image into multiple meaningful segments (objects vs. background).

  • The Traditional Limitation: Pixel-by-pixel methods lack structural and geometric context.

  • The Algebraic Solution: Transforming a discrete grid of pixels into structured mathematical objects (rings, ideals, and graphs) to calculate perfect boundaries.

89 of 92

Commutative Algebra & Pixel Neighborhoods

  • Image as a Polynomial Ring: Pixels on a grid coordinate (x, y) can be modeled as multi-variable polynomials in a ring, e.g., [x, y]).

  • Ideal & Ring Operations:
    • Distinct regions or objects form algebraic sets.
    • Ring addition and ideal intersections mathematically define how regions merge, grow, or split.

  • Feature Detection: Polynomial multiplication over adjacent pixel blocks acts as a precise edge detector by highlighting sudden algebraic shifts.

90 of 92

Algebraic Topology & Persistent Homology

  • Modeling the Grid: Images are discrete sets of squares (2D pixels) or cubes (3D voxels) represented as cubical complexes.
  • Counting Features: Algorithms use homology groups to algebraically compute structural invariants:
    • beta _0 (Betti number 0): Counts connected components.
    • beta _1 (Betti number 1): Counts holes or loops.

  • Persistent Homology: Tracks these features across scales. Long-lived algebraic features represent true boundaries; short-lived ones are discarded as noise.

The Intersection: Graph Cut Segmentation

  • What is a Graph Cut? A global optimization technique that maps an image onto a weighted, directed graph (G = (V, E)).

  • The Structure:

Vertices V: Every pixel becomes a node, connected to two special terminal nodes: Source S (Object) and Sink T (Background).

Edges E: Links between neighboring pixels, weighted by how similar their color or intensity is.

  • The Goal: Find the "minimum cut" that separates S from T with the lowest total edge weight penalty.

91 of 92

Why Combine Algebra with Graph Cuts?

  • Energy Minimization: The segmentation problem is written as a strict algebraic energy minimization formula:�

E(A)=E_{data}(A)+E_{smooth}(A)

  • Data Term E_{data}: Measures how well a pixel fits the object or background model (calculated via polynomial/probabilistic distributions).
  • Smoothness Term E_{smooth}:

Penalizes sharp changes between neighbors unless they are true mathematical edges.

  • Result: Solvable in polynomial time using max-flow/min-cut algorithms, guaranteeing a globally optimal segmentation.

Summary & Future Outlook

  • Rigorous Foundations: Commutative algebra and topology provide the geometric rules, while graph cuts deliver the computational muscle.

  • AI Integration: Modern neural networks utilize algebraic "topological loss functions" to ensure deep learning models output unbroken, structurally logical graph cuts.
  • Applications: Crucial for high-precision tasks like autonomous driving, satellite mapping, and tumor detection in medical imaging.

92 of 92

Thank you for your attention

https://www.math.sk/wiki/zdimalova

mzdimalova@gmail.com