# Persistence Landscapes—Implementing a Dataset Verification Method in Resource-Scarce Embedded Systems

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

#### 1.1. Contributions

- The first implementation of 0-dimensional PL analysis in an RSES.
- A post-deployment ML model data verification system using PL, which is helpful for TinyML/ Embedded Intelligence.
- A mechanism to verify whether devices are collecting the same dataset, through dataset convergence verification, which is helpful in applications such as the Internet of Things (IoT); Wireless Sensor Networks (WSN); and Cyber-Physical Systems (CPS).
- A reduction of the need for a central system (i.e., Cloud Computer) to analyze the entire dataset.

#### 1.2. Organization of the Work

## 2. Topological Data Analysis (TDA)

#### 2.1. Persistence Modules

#### 2.2. Persistence Landscapes

#### 2.3. 0-Dimensional Persistence Landscapes

#### 2.4. Related Work

## 3. Methodology

## 4. Experimental Design

## 5. Results

#### 5.1. Convergence between Devices and Datasets

#### 5.2. The Distance in Landscapes

#### 5.3. Dataset Identification

## 6. Conclusions and Future Work

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Guo, B.; Zhang, D.; Wang, Z. Living with Internet of Things: The Emergence of Embedded Intelligence. In Proceedings of the 2011 International Conference on Internet of Things and 4th International Conference on Cyber, Physical and Social Computing, Dalian, China, 19–22 October 2011; pp. 297–304. [Google Scholar]
- Guo, B.; Zhang, D.; Yu, Z.; Liang, Y.; Wang, Z.; Zhou, X. From the Internet of Things to Embedded Intelligence. World Wide Web
**2013**, 16, 399–420. [Google Scholar] [CrossRef] - Dai, W.; Nishi, H.; Vyatkin, V.; Huang, V.; Shi, Y.; Guan, X. Industrial Edge Computing: Enabling Embedded Intelligence. IEEE Ind. Electron. Mag.
**2019**, 13, 48–56. [Google Scholar] [CrossRef] - Silva, A.; Fernandes, D.; Névoa, R.; Monteiro, J.; Novais, P.; Girão, P.; Afonso, T.; Melo-Pinto, P. Resource-Constrained Onboard Inference of 3D Object Detection and Localisation in Point Clouds Targeting Self-Driving Applications. Sensors
**2021**, 21, 7933. [Google Scholar] [CrossRef] [PubMed] - Branco, S.; Ferreira, A.; Cabral, J. Machine Learning in Resource-Scarce Embedded Systems, FPGAs, and end-devices: A survey. Electronics
**2019**, 8, 1289. [Google Scholar] [CrossRef] - Boukerche, A.; Zheng, L.; Alfandi, O. Outlier detection: Methods, models, and classification. ACM Comput. Surv. (CSUR)
**2020**, 53, 1–37. [Google Scholar] [CrossRef] - Sendak, M.; Gao, M.; Nichols, M.; Lin, A.; Balu, S. Machine learning in health care: A critical appraisal of challenges and opportunities. EGEMs
**2019**, 7, 1. [Google Scholar] [CrossRef] [PubMed] - Björner, A. Topological Methods. Handb. Comb.
**1995**, 2, 1819–1872. [Google Scholar] - Carlsson, G. Topology and Data. Bull. Am. Math. Soc.
**2009**, 46, 255–308. [Google Scholar] [CrossRef] - Gowdridge, T.; Dervilis, N.; Worden, K. On Topological Data Analysis for SHM: An Introduction to Persistent Homology. In Data Science in Engineering; Springer: Cham, Switzerland, 2022; Volume 9, pp. 169–184. [Google Scholar]
- Hirzebruch, F.; Borel, A.; Schwarzenberger, R. Topological Methods in Algebraic Geometry; Springer: Berlin, Germany, 1966; Volume 175. [Google Scholar]
- Otter, N.; Porter, M.; Tillmann, U.; Grindrod, P.; Harrington, H.A. A Roadmap for the Computation of Persistent Homology. EPJ Data Sci.
**2017**, 6, 17. [Google Scholar] [CrossRef] [PubMed] - Carter, N. Data Science for Mathematicians; CRC Press/Chapman and Hall Handbooks in Mathematics Series; Chapman & Hall: London, UK, 2020. [Google Scholar]
- Branco, S.; Carvalho, J.G.; Reis, M.S.; Lopes, N.V.; Cabral, J. 0-Dimensional Persistent Homology Analysis Implementation in Resource-Scarce Embedded Systems. Sensors
**2022**, 22, 3657. [Google Scholar] [CrossRef] [PubMed] - Bubenik, P. Statistical Topological Data Analysis Using Persistence Landscapes. J. Mach. Learn. Res.
**2015**, 16, 77–102. [Google Scholar] - Bubenik, P. The Persistence Landscape and Some of its Properties. In Topological Data Analysis; Springer: Cham, Switzerland, 2020; pp. 97–117. [Google Scholar]
- Kim, K.; Kim, J.; Zaheer, M.; Kim, J.; Chazal, F.; Wasserman, L. Pllay: Efficient Topological Layer Based on Persistent Landscapes. Adv. Neural Inf. Process. Syst.
**2020**, 33, 15965–15977. [Google Scholar] - Dłotko, P.; Wanner, T. Topological Microstructure Analysis Using Persistence Landscapes. Phys. D Nonlinear Phenom.
**2016**, 334, 60–81. [Google Scholar] [CrossRef] - Stolz, B.J.; Emerson, T.; Nahkuri, S.; Porter, M.A.; Harrington, H.A. Topological Data Analysis of Task-based fMRI Data from Experiments on Schizophrenia. J. Phys. Complex.
**2021**, 2, 035006. [Google Scholar] [CrossRef] - Maria, C.; Boissonnat, J.-D.; Glisse, M.; Yvinec, M. The Gudhi library: Simplicial Complexes and Persistent Homology. In Proceedings of the International Congress on Mathematical Software, Seoul, Republic of Korea, 5–9 August 2014; Springer: Berlin/Heidelberg, Germany; pp. 167–174. [Google Scholar]
- Bauer, U.; Kerber, M.; Reininghaus, J.; Wagner, H. Phat–Persistent Homology Algorithms Toolbox. J. Symb. Comput.
**2017**, 78, 76–90. [Google Scholar] [CrossRef] - Tralie, C.; Saul, N.; Bar-On, R. Ripser. py: A lean persistent homology library for python. J. Open Source Softw.
**2018**, 3, 925. [Google Scholar] [CrossRef] - Bubenik, P.; Dłotko, P. A Persistence Landscapes Toolbox for Topological Statistics. J. Symb. Comput.
**2017**, 78, 91–114. [Google Scholar] [CrossRef] - Edelsbrunner, H.; Harer, J.L. Computational Topology: An Introduction; American Mathematical Society: Providence, RI, USA, 2022. [Google Scholar]
- Tauzin, G.; Lupo, U.; Tunstall, L.; Pérez, J.B.; Caorsi, M.; Medina-Mardones, A.M.; Dassatti, A.; Hess, K. giotto-tda:: A Topological Data Analysis Toolkit for Machine Learning and Data Exploration. J. Mach. Learn. Res.
**2021**, 22, 1834–1839. [Google Scholar] - Adams, H.; Tausz, A.; Vejdemo-Johansson, M. JavaPlex: A Research Software Package for Persistent (co)Homology. In Proceedings of the International Congress on Mathematical Software, Seoul, Republic of Korea, 5–9 August 2014; Springer: Berlin/Heidelberg, Germany; pp. 129–136. [Google Scholar]
- Chazal, F.; Fasy, B.T.; Lecci, F.; Rinaldo, A.; Wasserman, L. Stochastic Convergence of Persistence Landscapes and Silhouettes. In Proceedings of the Thirtieth Annual Symposium on Computational Geometry, Kyoto, Japan, 8–11 June 2014; pp. 474–483. [Google Scholar]
- Sá, J.; Chojer, H.; Branco, P.; Alvim-Ferraz, M.; Martins, F.; Sousa, S. Two step calibration method for ozone low-cost sensor: Field experiences with the UrbanSense DCUs. J. Environ. Manag.
**2023**, 328, 116910. [Google Scholar] [CrossRef] [PubMed] - Ayadi, A.; Ghorbel, O.; Obeid, A.M.; Abid, M. Outlier detection approaches for wireless sensor networks: A survey. Comput. Netw.
**2017**, 129, 319–333. [Google Scholar] [CrossRef] - Kang, J.J.; Luan, T.H.; Larkin, H. Enhancement of sensor data transmission by inference and efficient data processing. In Proceedings of the Applications and Techniques in Information Security: 6th International Conference, ATIS 2016, Cairns, QLD, Australia, 26–28 October 2016; Springer: Singapore, 2016; pp. 81–92. [Google Scholar]

**Figure 1.**Persistent Diagram and its respective peak functions. (

**a**) Peak function from the computed piecewise function (Equation (6)). (

**b**) Persistent Diagram for the point cloud $\chi $.

**Figure 2.**Landscape function obtained from the Persistence Diagram presented in Figure 1. For this diagram, one obtains two Persistence Landscapes, $\Lambda =\{{\lambda}_{1},{\lambda}_{2}\}$.

**Figure 3.**Peak functions and their respective $\overline{\lambda}$ values. (

**a**) Example of 0-dimensional peak functions for an infinity-sign-shaped dataset. (

**b**) $\overline{\lambda}$ for peak functions.

**Figure 4.**Graphical depiction of the point clouds used for testing. (

**a**) Infinity sign point cloud. (

**b**) Two circle point cloud. Each point cloud has 2000 points.

**Figure 5.**The training device’s ($\Pi $) landscape mean. (

**a**) Mean of 1 barcode. (

**b**) Mean of 4 barcodes. (

**c**) Mean of 16 barcodes. (

**d**) Mean of 32 barcodes. (

**e**) Mean of 64 barcodes. (

**f**) Mean of 128 barcodes.

**Figure 6.**The testing device’s ($\Psi $) landscape mean. (

**a**) Mean of 1 barcode. (

**b**) Mean of 4 barcodes. (

**c**) Mean of 16 barcodes. (

**d**) Mean of 32 barcodes. (

**e**) Mean of 64 barcodes. (

**f**) Mean of 128 barcodes.

**Figure 7.**The fake device’s ($\Omega $) landscape mean. (

**a**) Mean of 1 barcode. (

**b**) Mean of 4 barcodes. (

**c**) Mean of 16 barcodes. (

**d**) Mean of 32 barcodes. (

**e**) Mean of 64 barcodes. (

**f**) Mean of 128 barcodes.

**Figure 8.**Distance between each device’s landscape and the full point cloud landscape’s mean. (

**a**) Distance between the training devices ($\Pi $). (

**b**) Distance between the testing devices ($\Psi $). (

**c**) Distance between the fake devices ($\Omega $).

**Figure 9.**Percentage of barcodes for each flagged as not belonging to the original dataset according to the number of barcodes used in the mean. (

**a**) $\Pi $-Device’s flag rate. (

**b**) $\Psi $-Device’s flag rate. (

**c**) $\Omega $-Device’s flag rate.

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Branco, S.; Dogruluk, E.; Carvalho, J.G.; Reis, M.S.; Cabral, J.
Persistence Landscapes—Implementing a Dataset Verification Method in Resource-Scarce Embedded Systems. *Computers* **2023**, *12*, 110.
https://doi.org/10.3390/computers12060110

**AMA Style**

Branco S, Dogruluk E, Carvalho JG, Reis MS, Cabral J.
Persistence Landscapes—Implementing a Dataset Verification Method in Resource-Scarce Embedded Systems. *Computers*. 2023; 12(6):110.
https://doi.org/10.3390/computers12060110

**Chicago/Turabian Style**

Branco, Sérgio, Ertugrul Dogruluk, João G. Carvalho, Marco S. Reis, and Jorge Cabral.
2023. "Persistence Landscapes—Implementing a Dataset Verification Method in Resource-Scarce Embedded Systems" *Computers* 12, no. 6: 110.
https://doi.org/10.3390/computers12060110