EUROPEAN JOURNAL OF PURE AND APPLIED MATHEMATICS 2025, Vol. 18, Issue 3, Article Number 6175 ISSN 1307-5543 – ejpam.com Published by New York Business Global Enhancing Shape Analysis with Persistent Homology for Edge Detection and Topological Feature Extraction Shivam Kumar Jha Sanjay1, Mohana Natarajan1∗ 1 Department of Mathematics, School of Advanced Sciences, Vellore Institute of Technology, Chennai - 600 127, India Abstract. This article examines the application of persistent homology in analyzing the structure of various shapes, including both standard and random forms. It focuses on the computation of genus, Betti numbers, and persistent homology, demonstrating how this method simplifies the analysis of complex structures. The approach proves valuable for tasks such as edge detection, thinning, restructuring, and identifying genus deformations. Furthermore, the study outlines future directions, including the development of a model leveraging persistent homology for tumor cell detection and structural genus estimation. These findings hold significant potential for advancing image processing and biomedical analysis. 2020 Mathematics Subject Classifications: 55N31, 62R40, 68U10 Key Words and Phrases: Digital homology, Digital image, Edge detection, Genus, Persistent homology, Simplices 1. Introduction In digital topology, objects are represented as discrete or lattice sets of points as pixels (2-dimensional array) or voxels (3-dimensional array) in an Euclidean n-dimensional space. Many more beautiful papers are available, which make us understand and motivate us to proceed with digital topology. There has already been a lot of work done in this area, and we are still counting on it. All thanks to its wide variety of practical applications such as image analysis, digital geometry, computer vision, shape recognition, etc., which offer tools and techniques for analysing the structure and features of digital objects, as well as the ability to create algorithms for tasks such as image thickening and thinning, contour filling, object tracking and counting, image segmentation, boundary extraction, and shape matching. Generally topology deals with continuous function[1], and in order to make use of the digital algebraic topology where the invariants are digitilized or discreted, we will be using ∗Corresponding author. DOI: https://doi.org/10.29020/nybg.ejpam.v18i3.6175 Email addresses: shivamkumar.jhas2020@vitstudent.ac.in (S. Kumar Jha S.), mohana.n@vit.ac.in (M. Natarajan) https://www.ejpam.com 1 Copyright: © 2025 The Author(s). (CC BY-NC 4.0) S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 2 of 18 Z1 Z2 Z3 · · · κ1 2 4 6 · · · κ2 − 8 18 · · · κ3 − − 26 · · · Table 1: Adjacency relations for different dimensions (Z1, Z2, Z3). Each entry κi denotes the number of adjacencies in the respective dimension. Zero entries denotes the digital continuity which is nothing but nearer points to nearer points or neighbouring points which are next to each other, and similarly all other notions including digital homology. Further we will see the digital method to find the genus of a structure and have some beautiful result, which have some justification in the contribution of digital topology. 1.1. Basic definitions on digital algebraic topology Let Z be the set of all integers. In Euclidean n-dimensional space, Zn is the set of lattice points. A finite subset of Zn with an adjacent relation is called a (binary)digital image. Definition 1. [2] For a < b, the set [a, b]Z = {z ∈ Z|a ≤ z ≤ b} is called a digital interval where a, b ∈ Z. Digital image analysis utilizes various types of adjacency relations [3]. In Z1, two points p and q are considered 1-adjacent if they differ by exactly one coordinate. In Z2, points p and q are 4-adjacent if they are distinct and differ in exactly one coordinate, and they are 8-adjacent if they differ by at most one in each coordinate. In Z3, points p and q are deemed 26-adjacent if they are distinct and differ by no more than one coordinate; they are 18-adjacent if they are 26-adjacent and differ by at most two coordinates; and they are 6-adjacent if they are 18-adjacent and differ by exactly one coordinate. The Table[1] illustrates the different adjacency relations for their respective dimensions. A point that is κ-adjacent to a lattice point p is referred to as its κ-neighbor for κ ∈ {2, 4, 8, 6, 18, 26}. These adjacencies are generalized as follows: Consider positive numbers l and n such that 1 ≤ l ≤ n. If there exist at most l unique coordinates j for which |pj − qj | = 1, and for all other coordinates j, pj = qj , subsequently distinct points p, q ∈ Zn are said to be kl-adjacent. In this sense, the notation kl denotes the number of points q ∈ Zn that are close to a given point p ∈ Zn. Therefore, the numbers listed above are as follows: Adjacency relation =  κ1 = 2n; n ≥ 1 κ2 = n2 + 5n− 6; n ≥ 2 κ3 = 13n2 − 39n+ 26; n ≥ 3 Additionally, a few general adjacency relations are covered in [4, 5]. In digital topol- ogy, κ-connectivity describes the relationship between points in a digital image where each point is connected to its neighbors based on a specified adjacency [5, 6]. A κ-connected S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 3 of 18 image ensures that there is a path between any two distinct points, defined by a sequence of neighboring points. The concept of κ-connectivity extends to functions between dig- ital images, where a function is considered continuous if it preserves the connectivity of subsets from one image to another [6, 7]. This notion of continuity leads to the idea of κ-isomorphisms, where two images are considered structurally equivalent if there is a continuous, bijective function between them that also has a continuous inverse [8]. Addi- tionally, specific structures within images, such as simple closed κ-curves and κ-corners, help to further characterize the topology of digital spaces by examining how points are connected and how these connections can be simplified without altering the essential struc- ture. 2. Simplices and Homology in digital topology In the realm of digital simplicial complexes, the concept of faces plays a crucial role in understanding the structure and properties of these complexes. A face is essentially a subset of a simplex that forms a lower-dimensional simplex. 0-Simplex (Point) A 0-simplex, representing a single point in Zn, has no faces other than itself. For example, the simplex {p} has the face {p}. 1-Simplex (Line Segment) A 1-simplex, which corresponds to a line segment, has two 0-simplex faces. For instance, the simplex {p, q}, where p and q are κ-adjacent pixels, has faces {p} and {q}. 2-Simplex (Triangle) A 2-simplex, which corresponds to a triangle, has three 1- simplex faces and their associated 0-simplex faces. For instance, the simplex {p, q, r}, where p, q, and r are κ-adjacent pixels, has three 1-Simplex faces as {p, q}, {q, r}, {r, p} and three 0-Simplex faces namely {p}, {q}, {r} 3-Simplex (Tetrahedron) A 3-simplex, corresponding to a tetrahedron, has four 2-simplex faces, six 1-simplex faces, and four 0-simplex faces. For instance, the simplex {p, q, r, s}, where p, q, r, and s are 26-adjacent voxels, has four 2-Simplex faces, six 1- Simplex faces and four 0-Simplex faces. An m-simplex is defined as a simplex with a cardinality of m + 1. For a digital m- simplex I, if I ′ is a nonempty proper subset of P , then I ′ is considered a face of I. Definition 2. Suppose (X,κ) is a finite collection of digital m-simplices, where 0 ≤ m ≤ d for some non-negative integer d. If the following conditions hold, then (X,κ) is referred to as a finite digital ∆-complex: • If P is a member of X, then all the faces of P are also contained within X. • If P and Q are members of X, then their intersection P ∩ Q is either empty or multiple simplexes (need not to be a single or common simplex). If it has a common face of both P and Q then it is called as finite digital simplicial complex. A digital image can be considered a union of 0-simplices, meaning that every digital image forms a digital simplicial complex. Consequently, we use the same notation to S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 4 of 18 describe both a digital image and its associated simplicial complex. The dimension of a digital simplicial complex X is defined as the largest integer m for which X contains an m-simplex. The group Cκ q (X) is a free abelian group [9] that has a basis composed of all digital (κ, q)-simplices in X. If (X,κ) ⊆ Zn represents a digital simplicial complex of dimension m, then for any q > m, the group Cκ q (X) is trivial. Every digital m-simplex is naturally oriented based on its vertices. This orientation is described by the formula: ∂(< p0, p1, . . . , pq >) = q∑ i=0 (−1)i < p0, p1, . . . , p̂i, . . . , pq > where p̂i indicates that the point pi is removed. This notation allows us to define the boundary homomorphism ∂q : C κ q (X) → Cκ q−1(X) as follows: ∂q(⟨p0, p1, . . . , pq⟩) = {∑q i=0(−1)i⟨p0, p1, . . . , p̂i, . . . , pq⟩, q ≤ m 0, q > m . For example, consider a digital interval [a, b]Z where a < b and the direction is from a to b. There are two 0-simplexes, < a > and < b >, and one 1-simplex, < a, b >. Thus, the boundary homomorphism ∂1 is defined by: ∂1(u < a, b >) = u∂1(< a, b >) = u(< b > − < a >) where u is a scalar. It holds that ∂q−1 ◦ ∂q = 0 for all 1 ≤ q ≤ m. This composition is the natural composition of two homomorphisms. Definition 3. [9] Let (X,κ) be a digital simplicial complex. • Zκ q (X) = ker ∂q is the group of digital simplicial q-cycles. • Bκ q (X) = Im(∂q+1) is the group of digital simplicial q-boundaries. • Hκ q (X) = Zκ q (X)/Bκ q (X) is known as the q-th digital simplicial homology group. It has been demonstrated in [9] that if f : X → Y is a digital (κ, λ)-isomorphism, then for all q ≤ m, Hκ q (X) ∼=(κ,λ) H λ q (Y ). Theorem 1. [9] If (X,κ) ⊆ Zn is a nonempty and κ-connected digital image, then Hκ 0 (X) = Z. Let (X,κ) be a digital simplicial complex with dimension n. Consider the following filtration on X based on κ-adjacency. ∅ = K0 ⊆ I1 ⊆ I2 ⊆ · · · ⊆ In = X (1) S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 5 of 18 This filtration is constructed by successively removing points without affecting adjacency between remaining points. The sequence of inclusion maps in (1) induces maps on digital homology for any dimension q, 0 → Hκ q (I1) → Hκ q (I2) → · · · → Hκ q (In). (2) Let f i,j q : Hκ q (Ii) → Hκ q (Ij) represent the composition of maps in (2). The groups Zi,κ q and Bi,κ q , known as the group of q-cycles and q-boundaries of Ii respectively, and the j-persistent qth homology group of Ii [4], denoted H i,j,κ q (Ii), is defined as: Hj,κ q (Ii) = Zj,κ q (Ii)/B i+j,κ q (Ii) ∩ Zi,κ q (Ii). One can find some alternative definition of digital persistent homology along with examples in [4]. Definition 4. [4] For 0 ≤ i ≤ j ≤ n, the j-persistent q-th homology group of Ki is defined by Hj,κ q (Ii) = Imf i,j q . Betti numbers classify topological spaces by counting n-dimensional holes, reflecting the connectivity structure of simplicial complexes. Definition 5. [4] The p-persistent q-th Betti number, denoted by βi+p,κ q (Ii), is defined as βi+p,κ q (Ii) = rank Hp,κ q (Ii). Example 1. Let δ = 8, considering a graph-like digital image with δ-adjacency and I = {a1 = (−1,−1), a2 = (−1, 0), a3 = (−1, 1), a4 = (0, 1), a5 = (0, 0), a6 = (0,−1), a7 = (1,−1), a8 = (1, 0), a9 = (1, 1)}. Let us examine the following filtration on I: ∅ = I0 ⊆ I1 = {a1} ⊆ I2 = {a1, a2} ⊆ I3 = {a1, a2, a3} ⊆ I4 = {a1, a2, a3, a4} ⊆ I5 = {a1, a2, a3, a4, a5} ⊆ · · · ⊆ I8 = {a1, a2, a3, a4, a5, a6, a7, a8} ⊆ I9 = X. For all 0 ≤ i < j ≤ 9, f i,j q : Ii → Ij being the inclusion map, we obtain homomorphism f i,j q : Hκ q (Ii) → Hκ q (Ij) . The digital homology groups of I are given as follows [9]: Hδ q (Ii) =  0, i = 0 Z, q = 0, i ≥ 1 0, q ̸= 0, i ≥ 1 . S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 6 of 18 Therefore, we have Im(f i,j q ) =  0, i = 0, 1 ≤ j ≤ 9 Z, q = 0, 1 ≤ i < j ≥ 9 0, q ̸= 0, 1 ≤ i < j ≥ 9 . Consequently, we get Hj,δ q (Ii) = { Z, i ̸= 0 and q = 0 0, i = 0 or q ̸= 0 . Theorem 2. If (X,κ) be any κ-connected graph-like digital image with κ-adjacency then Hj,κ q (Xi) = { Z, i ̸= 0 and q = 0 0, i = 0 or q ̸= 0 . Proof. Let (X,κ) be a digital image that resembles a κ-connected graph. In order to develop a filtration of X, we need to eliminate a few points from this digital image. Assuming that the adjacency between the points remains unchanged, we may conclude that each digital image in the X filtration is κ-connected. Let us suppose two cases: Case 1 : If (X,κ) is a singleton point, then there is only one filtration on ∅ = X0 ⊆ X1 = X, which leads us to have the digital homology group of Xi as Hq(X0) = 0 and Hj,κ q (Xi) = { Z, q = 0 0, q ̸= 0 . Case 2 : If (X,κ) is a non-singleton point, then without changing the adjacency relation, we perform filtration by removing points. Following Theorem 1, we see that Hκ 0 (X) = Z for every κ-connected graph like digital image, This completes the proof. Theorem 3. Let i : (X,κ) → (X,κ) be an identity map for a graph-like digital image (X,κ). Then for each integer q, we have (iq)∗ : H κ q (Xi) → Hκ q (Xi), where Xi is a member of the filtration on X. Proof. Let X ′ is be the filtration on X, following Theorem [2], we get the digital homology group of each X ′ is to be 0 or Z depending upon i and q. Since each mapping in the filtration is the identity, they share the same digital homology group. Thus, the induced map (iq)∗ is an isomorphism from Hκ q (Xi) to Hκ q (Xi). S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 7 of 18 Figure 1: Analyzing a four-leaf clover: Original Image, edge detection, and graph representation. 3. Some digital homology applications to image processing In this section, we explore diverse applications of digital persistent homology groups within the domain of image processing, emphasizing tasks such as calculating the genus and processing various standard shapes. These applications demonstrate how persistent homology offers a mathematically grounded framework for analyzing structural features in digital images. For instance, consider the case of a four-leaf clover shape, denoted as Cn. Using our proposed method, Cn is transformed into a digital graph representation while retaining its topological characteristics. Cmin = {c0 = (−1, 0), c1 = (0,−1), c2 = (0, 1), c3 = (1, 0)}. The filtration on Cmin is given by: ∅ = ∆0 ⊆ ∆1 = {c0} ⊆ ∆2 = {c0, c1} ⊆ ∆3 = {c0, c1, c2} ⊆ ∆4 = Cmin. The minimal simple closed curve, denoted Cmin, is then computed within the frame- work of 8-adjacency. This process ensures that the structural and topological features, such as loops and connected components, are preserved accurately. Figure[1] illustrates this transformation, where the original shape is represented in a discrete digital format, and the minimal curve is identified and visualized. Thus, H8 q (∆i) =  0, for q ∈ Z and i = 0 Z, for q = 0 and 0 < i ≤ 4 Z, q = 1 and i = 4 . Using this result, we calculate the p-persistent q-th Betti number: • For q = 0 and i ̸= 0, we get βi+p,κ q (∆i) = rank(H i,κ 0 (∆i)) = rank(Z) = 1. • For q ̸= 0 and i = 0, we have βi+p,κ q (∆i) = rank(H i,κ q (∆i)) = rank(0) = 0. Let κ1 and κ2 represent the two adjacency relations in Zn, with X denoting a digital image within Zn. When κ1 > κ2, any pair of κ2-adjacent points will also be κ1-adjacent. The impact of applying different adjacency relations to the same set of points is demon- strated in the subsequent example. S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 8 of 18 Example 2. Let us again consider the same Cmin but this time with 4-adjacency, the digital homology groups of Cmin are: H4 q (Cmin) = { 0, q ̸= 0⊕i n=1 Z, q = 0 . The digital homology groups of ∆i vary based on the chosen adjacency relation, which in turn affects the digital persistent homology groups of Cmin. For example, the function f1,2 0 : H4 0 (∆1) → H4 0 (∆2) as an image of Z⊕ Z, leading to the conclusion that H2,4 0 (∆2) equals Z⊕ Z. However, as illustrated above, determined to be Z. In the following ex- amples, we will examine a variety of special structures, including spheres and toruses. These examples are carefully chosen to clearly demonstrate their unique properties and the relationships between them. 3.1. Case of a digitized sphere Smin To further elaborate on the application of digital persistent homology in analyzing topological structures, we consider the case of a digitized sphere Smin, as depicted in Figure[2]. This sphere with vertices V = {v1, v2, · · · , v6}, edges E = {e1, e2, · · · , e12} and faces F = {f1, f2, · · · , f8} is represented as a simplicial complex, the genus g of a surface can be derived from the Euler characteristic χ, which is given by χ = V − E + F . For a genus g surface, the relationship is χ = 2− 2g. Thus, the genus g can be calculated as g = 2−χ 2 . Here χ = 6− 12 + 8, that is χ = 2. Which leads to genus of a torus g = 0. In the filtration process of a sphere, we start with an empty set ∆0 = ∅. As we proceed to ∆1, we introduce the first vertex, {v1}. Moving to ∆2, we add another vertex and an edge, forming {v1, v2} ∪ {e1}. At ∆3, the set expands to include three vertices and three edges, {v1, v2, v3} ∪ {e1, e2, e3}. Continuing this progression, ∆4 comprises four vertices and five edges, {v1, . . . , v4} ∪ {e1, . . . , e5}. In ∆5, we incorporate five vertices and eight edges, {v1, . . . , v5} ∪ {e1, . . . , e8}. The complexity increases significantly at ∆6 with six vertices, twelve edges, and the introduc- tion of faces, {v1, . . . , v6} ∪ {e1, . . . , e12} ∪ {f1, . . . , f8}. With each increment in i, additional vertices, edges, and faces are incorporated, grad- ually forming a complete sphere structure. The Betti numbers, which are topological invariants, count the number of independent cycles of different dimensions. For a sphere, the Betti numbers are: β0 (number of connected components) is 1, β1 (number of 1- dimensional holes or loops) is 0, and β2 (number of 2-dimensional holes or voids) is 1. H18 q (∆i) =  Z, for q = 0 and 0 < i ≤ 8 0, for q ∈ Z and i = 0 Z, q = 2 and i = 8 . S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 9 of 18 Figure 2: From smooth surface to simplified geometry: Transformation stages of a sphere Using the homology groups H18 q (∆i), we compute the persistent q-th Betti numbers as follows: • For q = 0 and 0 < i ≤ 8, we have βi+p,κ 0 (∆i) = rank(H i 0(∆i)) = rank(Z) = 1. This indicates the presence of a single connected component for 0 < i ≤ 8. • For q = 1, we have H18 1 (∆i) = 0 for all i, implying that there are no 1-dimensional holes at any filtration step. • For q = 2 and i = 8, we have βi+p,κ 2 (∆i) = rank(H i 2(∆i)) = rank(Z) = 1, indicating the presence of a single 2-dimensional hole at i = 8. Consequently, the persistent Betti numbers are: • For q = 0 and 0 < i ≤ 8: βi+p,κ 0 (∆i) = 1. • For q ̸= 0 and i = 0: βi+p,κ q (∆i) = 0. 3.2. Case of Torus T 2 Let V = {v1, . . . , v9}, E = {e1, . . . , e18}, and F = {f1, . . . , f9} denote the sets of vertices, edges, and faces, respectively. The genus g of the surface is derived from the Euler characteristic χ, given by χ = V − E + F. For a genus g surface, χ = 2− 2g, so g = 2− χ 2 . Here, χ = 9− 18 + 9 = 0, giving g = 1, the genus of a torus. S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 10 of 18 The filtration of a torus is a sequence of subcomplexes, each successively adding vertices vi, edges ei, and faces fi, such that ∅ = ∆0 ⊆ ∆1 ⊆ ∆2 ⊆ · · · ⊆ ∆9 = T 2. In the filtration process of the torus, we start with an empty set ∆0 = ∅. As we proceed to ∆1, we introduce the first vertex, {v1}. Moving to ∆2, we add another vertex and an edge, forming {v1, v2} ∪ {e1}. At ∆3, the set expands to include three vertices and three edges, {v1, v2, v3} ∪ {e1, e2, e3}. Continuing this progression, ∆4 comprises four vertices and five edges, {v1, · · · , v4} ∪ {e1, · · · , e5}. In ∆5, we incorporate five vertices and eight edges, {v1, · · · , v5} ∪ {e1, · · · , e8}. The complexity increases significantly at ∆6 with six vertices, twelve edges, and the introduction of faces, {v1, · · · , v6} ∪ {e1, · · · , e12} ∪ {f1, f2, f3}. This pattern continues as we add more elements; ∆7 includes seven vertices, fourteen edges, and four faces, {v1, · · · , v7}∪{e1, · · · , e14}∪{f1, · · · , f4}. By ∆8, we have eight vertices, sixteen edges, and five faces, {v1, · · · , v8} ∪ {e1, · · · , e16} ∪ {f1, · · · , f5}. Finally, ∆9 completes the structure with nine vertices, eighteen edges, and nine faces, {v1, · · · , v9}∪{e1, · · · , e18}∪{f1, · · · , f9}. With each increment in i, additional vertices and edges are incorporated, gradually forming loops and eventually utilizing faces to accurately construct the complete structure, the Betti numbers are topological invariants that count the number of independent cycles of different dimensions. In this case β0(Number of connected components is 1), β1(number of 1-dimensional holes (loops) is 2) and β2( Number of 2-dimensional holes (voids) is 1). From Figure[3], let us see the digital homology group of a torus T 2: H0(T 2) ∼= Z , H1(T 2) ∼= Z⊕ Z , H2(T 2) ∼= Z . Using the homology groups H8 q (∆i), we compute the persistent q-th Betti number as follows: • For q = 0 and 0 < i ≤ 6: βi+p,κ 0 (∆i) = rank(H i 0(∆i)) = rank(Z) = 1 This result indicates the presence of a single connected component for 0 < i ≤ 6. • For q = 1 and i = 3, 4, 5 : βi+p,κ 1 (∆i) = rank(H i 1(∆i)) = { 1, for i = 3 2, for i = 4, 5 This reflects the formation of one 1-dimensional loop at i = 3 and two independent 1-dimensional loops at i = 4 and i = 5. S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 11 of 18 Figure 3: Sequential stages of a torus mesh transformation: Starting with a smooth torus shape, progress- ing through various stages of mesh refinement and simplification, culminating in a simplified geometric representation. • For q = 2 and i = 6: βi+p,κ 2 (∆i) = rank(H i 2(∆i)) = rank(Z) = 1 This indicates the presence of a single 2-dimensional hole at i = 6. Earlier examples in this section have demonstrated the genus, Betti numbers, and persistent homology for various standard shapes. Now, we turn our attention to random shapes as shown in the Figure[4]. Our method focuses on the nodes and vertices of any object to provide its digital homology, allowing us to gain a deeper understanding of any given structure. Using this method, it becomes significantly easier to comprehend complex objects and shapes. This approach is particularly beneficial for edge detection, thinning, and restructuring, which are critical processes for identifying the genus deformation of such shapes. By analyzing the digital homology, we can accurately detect and catego- rize structural changes and deformations, providing valuable insights into the underlying geometry and topology of the objects. Figure 4: Transformation of a snowflake image into a graph representation: From the original snowflake image , progressing through edge detection and keypoint extraction, to the construction and refinement of a graph representing the snowflake’s structural geometry. S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 12 of 18 Algorithm 1 Pseudo Code : 1 Require: Import required libraries for image processing, clustering, and persistent ho- mology visualization. Load an image I(x, y) as input. Edge Detection: Load I(x, y) as a grayscale image. Apply Canny edge detection: E(x, y) = Canny(I, T1, T2), where T1, T2 are thresholds. Return the edge-detected image E(x, y). Keypoint Detection and Clustering: Detect corners using the Shi-Tomasi method: λ = min(λ1, λ2), λ1, λ2 are eigenvalues of the structure tensor. Extract corner coordinates {C(xi, yi)}. Apply k-means clustering to reduce points to k clusters: min C1,C2,...,Ck k∑ i=1 ∑ x∈Ci ||x− µi||2, µi = cluster center. Return keypoint centroids {Kc = (xc, yc)}. Rips Complex Construction: Compute pairwise distances between keypoints: Dij = ||Ki c −Kj c ||, Ki c,K j c ∈ R2. For each radius r: Plot points {Kc} as vertices. Draw circles of radius r around each vertex: C(Kc, r) = {y ∈ R2 | ||Kc − y|| ≤ r}. Connect vertices i, j if Dij ≤ 2r. Persistent Homology: Use pairwise distances Dij to compute persistent homology: Birth, Death of H0 (connected components) and H1 (loops). Plot the persistence diagram for H0 and H1. Main Execution: Load image I(x, y) and detect edges E(x, y). Extract and cluster keypoints {Kc}. Construct Rips complexes for radii r ∈ Radii. Visualize Rips complexes and persistence diagram. Edge map E(x, y), Rips complex visualizations, and persistence diagram. =0 S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 13 of 18 Figure 5: Evolution of Vietoris-Rips complexes at varying radii r, showing increasing connectivity 3.3. Topological Data Analysis and Rips Complexes Topological data analysis (TDA) provides a robust mathematical framework for ex- tracting the shape and structure of datasets by analyzing their topological features. At the core of TDA lies the concept of the Rips complex, which encodes the geometric proximity of a dataset into a simplicial complex. For a given set of points P = {p1, p2, . . . , pn} in Rd, the Rips complex R(P, r) at a radius r is defined as: R(P, r) = {σ ⊆ P | ∥pi − pj∥ ≤ r for all pi, pj ∈ σ}. Here, σ represents a simplex, which could be a vertex, edge, or higher-dimensional face, depending on the proximity condition. A sequence of Rips complexes constructed for increasing radii forms a filtration: R(P, r1) ⊆ R(P, r2) ⊆ . . . ⊆ R(P, rk), allowing the computation of persistent homology. Persistent homology identifies and tracks k-dimensional topological features, such as connected components (H0) and loops (H1), across different radii. These features are summarized in a persistence diagram, where each point (b, d) represents the birth and death radii of a topological feature. Figure[5] demonstrates this process for a 2D point cloud, illustrating how the topology evolves as the radius r increases, eventually leading to full connectivity. The persistence diagram summarizes this evolution, providing a concise description of the dataset’s topological structure (see references[10–12]). 3.4. Algorithmic Implementation and Applications The construction of Rips complexes and persistence diagrams relies on an algorithmic approach that begins with computing pairwise distances between points. As the radius S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 14 of 18 Figure 6: Brain like complex structure and the corresponding persistence diagram summarizing topological features (H0 and H1) across scales. increases, the algorithm iteratively constructs Rips complexes and computes the corre- sponding k-th homology groups Hk(R(P, r)). These homology groups capture the features of different dimensions, which are recorded in the persistence diagram. This algorithmic framework enables a systematic exploration of data topology[13]. This framework is also extended to complex datasets, as shown in Figure[6]. Here, each pixel of a brain image is treated as a point in a high-dimensional space. The algorithm constructs a Rips complex that evolves across radii, and the persistence diagram captures intricate connectivity patterns within the image. The shaded circles and edges in the Rips complex visually illustrate the evolution of topological features, even in noisy and high-dimensional data. The computational steps for generating Figure[6] are explicitly detailed in the pro- vided algorithmic model[1]. This model outlines the method for preprocessing the image, constructing Rips complexes, and calculating persistent homology, providing a step-by- step explanation of how TDA is applied to complex image data. By referring to this pseudocode, readers can replicate the methodology for other high-dimensional datasets. These results emphasize the robustness of TDA in capturing meaningful topological features, making it a valuable tool across domains such as shape analysis, image processing, and data clustering[14, 15]. The computation of simplicial homology groups for 2D digital images has been explored in foundational work by Karaca and Ege [16], and further ex- tended through efficient algorithms for calculating Betti numbers and Euler characteristics in recent studies [17]. As a result shown in Figure[7]. This technique focuses on the regions identified through mapping, enabling precise marking of areas affected by tumor cells. By transitioning from the original MRI scans to edge-detected images[18] and finally to graph representations, this approach provides a comprehensive analysis of brain structures. Figure [8] illustrates the process of identifying and marking the affected area within an MRI-scanned image. S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 15 of 18 The precise delineation of this region is achieved through advanced image processing tech- niques, ensuring accurate correspondence between the affected area and its representation on a graphical map. This approach enhances the ability to visualize and analyze the extent of the impact, thereby facilitating more targeted and effective assessments. Similar work can be seen in [19], where they used the linear homotopy concept to capture fine edges and provide enhanced edge detection. This method enhances the ability to detect and understand the underlying connections and abnormalities, facilitating accurate identifica- tion and diagnosis of affected regions. The detailed graph representations are particularly useful for visualizing the connectivity within the brain, aiding in the study of its struc- tural integrity and potential pathological changes. Here’s a pseudocode of the following model[2]. Algorithm 2 Pseudo Code : 2 Require: Import required libraries for image processing and visualization Define edge- detection to load image I(x, y) Raise error if I(x, y) fails to load. while Apply Canny edge detection to find gradient magnitude do Return edge map E(x, y) where gradients are strong Define find-keypoints to detect corners using Harris-Stephens method Convert corners C(xi, yi to integer coordinates Apply KMeans to cluster key points Ki into k clusters Return centroids Kc = (xc, yc) of clusters. Define create-simplicial-complex for Delaunay triangulation Construct simplicial complex ∆(s) from points Kc Graph G(V,E) is formed, where V are vertices. Return graph G and positions P (x, y) Define draw-simplicial-complex to plot G(V,E) Plot nodes V as points in 2D space Plot edges E as connections between nodes. Adjust plot to match image dimensions (w, h) Display visualization of G(V,E) Define main to execute detection, clustering, and complex creation Call main with image path I(x, y) and max points k Display E(x, y) and simplicial complex ∆(s) end whileAnatomical connections and graphical representation. =0 S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 16 of 18 Figure 7: Analysis of MRI brain scans. Left: Original axial and sagittal MRI views. Middle: Edge detection highlighting brain structures. Right: Graph representations showing anatomical connections. Figure 8: Original scan showing the presence of an abnormality. Right: The affected area is precisely marked for further analysis. When the script is executed, it processes the given image path and specified number of keypoints, seamlessly executing the entire workflow. Looking ahead, our future work aims to develop a model that can train on datasets and utilize persistent homology to detect tumor cells and determine the genus of different structures. 4. Conclusion In this article, we demonstrated the effectiveness of persistent homology in analyzing both structured and irregular geometric forms. By examining the evolution of homology groups across filtration stages, our method captures topological features such as connected components, tunnels, and voids with high fidelity. The approach emphasizes vertex- and edge-level analysis to compute digital homology, making it suitable for tasks such as edge detection, skeletonization, and geometric restructuring—particularly in contexts where genus variations are of interest. The presented examples highlight the practical utility of this method in uncovering the underlying topology of complex shapes. Building on this foundation, future research will focus on developing hybrid models that incorporate persistent homology as a learning mechanism within training datasets. This will be particularly directed toward biomed- ical imaging applications, such as the detection of tumor cells and the classification of topological signatures associated with structural abnormalities. S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 17 of 18 Open problems that remain include the optimization of persistence-based metrics for noisy or high-dimensional data, the formalization of stability bounds under random per- turbations in simplicial structures, and the extension of the framework to non-Euclidean settings and manifold-valued data. Addressing these challenges could significantly broaden the scope and precision of topological data analysis in both theoretical and applied do- mains. Conflict of interest The authors declare no conflict of interest. Availability of data and material All the data of the study are included. References [1] E. Spanier. Algebraic topology. McGraw-Hill, 1966. [2] L. Boxer. Digitally continuous functions. Pattern Recognit. Lett., 15:833–839, 1994. [3] T. Y. Kong. A digital fundamental group. Comput. Graph., 13:159–166, 1989. [4] O. Ege and I. Karaca. Persistent homology of graph-like digital images. Annali di Matematica Pura ed Applicata, 199:2167–2179, 2020. DOI: https://doi.org/10. 1007/s10231-020-00962-x. [5] G. T. Herman. Oriented surfaces in digital spaces. CVGIP: Graph. Models Image Process., 55:381–396, 1993. [6] A. Rosenfeld. Continuous functions on digital pictures. Pattern Recognit. Lett., 4:177– 184, 1986. [7] L. Boxer. A classical construction for the digital fundamental group. J. Math. Imaging Vis., 10:51–62, 1999. [8] L. Boxer. Digital products, wedges and covering spaces. J. Math. Imaging Vis., 25:159–171, 2006. [9] H. Arslan and I. Karaca. Homology groups of n-dimensional digital images. XXI. Turk. Natl. Math. Symp. B, pages 1–13, 2008. [10] A. Zomorodian and G. Carlsson. Computing persistent homology. Discrete Comput. Geom., 33:249–274, 2005. DOI: https://doi.org/10.1007/s00454-004-1146-y. [11] H. Edelsbrunner and J. Harer. Computational topology: An introduction. Amer. Math. Soc., 2010. [12] N. Otter, M. A. Porter, and U. Tillmann et al. A roadmap for the computation of persistent homology. EPJ Data Sci., 6:17, 2017. DOI: https://doi.org/10.1140/ epjds/s13688-017-0109-5. [13] R. Ghrist. Barcodes: The persistent topology of data. Bull. Amer. Math. Soc., 45:61–75, 2008. [14] G. Carlsson. Topology and data. Bull. Amer. Math. Soc., 46:255–308, 2009. S.K. Jha Sanjay, M, Natarajan / Eur. J. Pure Appl. Math, 18 (3) (2025), 6175 18 of 18 [15] F. Chazal and B. Michel. An introduction to topological data analysis: Fundamental and practical aspects for data scientists. Front. Artif. Intell., 4:39, 2021. DOI: https: //doi.org/10.3389/frai.2021.667963. [16] I. Karaca and O. Ege. Some results on simplicial homology groups of 2d digital images. Int. J. Inform. Computer Sci., 1:198–203, 2012. [17] A. Öztel, B. Akgül, I. Karaca, and Others. Efficient computation of homology groups, betti numbers, and euler characteristics for 2d digital images. Applicable Algebra in Engineering, Communication and Computing, 2025. DOI: https://doi.org/10. 1007/s00200-025-00682-w. [18] J. Canny. A computational approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell., PAMI-8:679–698, 1986. [19] S. Shivam Kumar Jha and N. Mohana. An integrated method using linear homo- topy parametric value for enhancing image edge detection. IEEE Access, 12:107113– 107118, 2024. DOI: https://doi.org/10.1109/ACCESS.2024.3436661.