Emergence detection using an fuzzy expert system in complex system⋆ Ali Boukehila1,*,† , Fatima Zohra Bouakrif2 and Nora Taleb2 1 Amar Telidji Laghouat University, 03000, Laghouat, Algeria 2 LISCO Laboratory,Badji Mokhtar Annaba University,23000,Annaba,Algeria Abstract Swarms of insects, schools of fish, flocks of birds, and other natural phenomena all exhibit emergent behaviors, which are among the most widely discussed subjects in the world today. When these organisms are on a mission, it is evident that they maintain their consistent direction of travel without colliding with one another. This paper suggests a fuzzy expert system-based approach to emergent behavior analysis.Besides that, the paper describes the first results of a three-step procedure and investigates how interactions can be utilized as a metric to detect emerging behaviors in the Boids model: (1) Representation and acquisition of simulation data,(2) Building a fuzzy expert system,(3)Learning process and emergence detection. Since this is a part of ongoing research, future direction is also discussed. Keywords Expert systems, Emergence, Agent-based modelling, Swarm Introductio 1. Introduction Flocking or swarm behavior is observed in many species in nature. A prominent Recent advances in modeling have led to the widespread application of agent-based simulation in complex systems across a wide range of academic fields, including organizational behavior, decision-making, and problem-solving. Emergence behavior is a result of the complexity of agent behaviors and their interactions; it can be found in a wide range of systems, from the simplest to the most complex, and can take many different forms (positive or negative). From [1] divided emergent behaviors into four categories according to the kinds of input that vary and the causal connections between a system’s micro and macro levels. In complex systems, a weak emergence [2] can be identified and comprehended. Emergence validation techniques in the field of complex systems can be divided into three primary groups: grammar-based, variable-based, and event-based. Variable-based approaches use a particular variable to characterize emergence. Variations in this variable’s values are considered to indicate the existence of emergence properties [3]. One may use the center of mass of a flock of birds, as demonstrated in [4], as an illustration of how emergence in bird flocking behavior occurs. A sequence of events that alter the state of a system or a subsystem is referred to as behavior in event-based approaches [5]. This paper is organized as follows. Section two defines the fundamental concepts, section three introduces the related works, section four presents the proposed approach, the first results are shown in section 5 and finally, section six makes a conclusion. Proceedings of the 7th International Conference on Informatics and Applied Mathematics IAM’24 , December 4-5, 2024, GUELMA,ALGERIA. ⋆ You can use this document as the template for preparing your publication. We recommend using the latest version of the ceurart style. $ al.boukehila@lagh-univ.dz (A. Boukehila); fatimazohrabouakrif@gmail.com (F. Z. Bouakrif); Talebnr@hotmail.fr (N. Taleb) © 2024 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR ceur-ws.org Workshop ISSN 1613-0073 Proceedings 2. Fundamental Concepts 2.1. Fuzzy Expert System One basic method that arises immediately from the nature of fuzzy logic is the merging of fuzzy logic and expert systems. Right present, fuzzy expert systems are the most widely used application of fuzzy logic, with numerous implementations running in a wide range of fields [6]. A professor at the University of California, Berkeley named Lotfi Zadeh first proposed the idea of fuzzy in 1970 [7].Numerous industries employ fuzzy expert systems. A few instances are software quality assessment [8], agricultural [9], [10], security systems [11], [12], and medical [13], [14]. In a fuzzy expert system, the rules often take the following form: If A is low and B is high then X = medium. Where A and B are input variables, X is an output variable. Here low, high, and medium are fuzzy sets de fined on A, B, and X respectively. 2.2. Emergence in complex systems There have been enormous efforts to define the meaning of emergence. Originating in philosophy [5], emergence has gained popularity within the study of complex systems and Multi-agent systems. The study of emergence has several potential for understanding the interactions of agents and their environments [15]. We use fromm’s [1] categorization in this study. He presents a taxonomy that categories four forms of emergence based on distinct sorts of feedback and causation.Addressing security vulnerabilities is crucial to ensure trust and reliability in IoV systems, which also impacts overall efficiency, as discussed next. 2.3. The Boids model Reynolds[9] showed that algorithmically implementing the three rules of alignment, cohesion and sepa- ration leads to flocking behavior while an individual only needs local knowledge about its surrounding neighbors (called Boids). These rules are : • Cohesion : this is the force which makes boids move close to the other boids in their neighbour- hoods. • Alignment: this is the force which makes boids move in the same direction as the otheir boids in their neighbourhoods. • Separation: This is the force which makes boids avoid collision with the other boids in their neighbourhoods. The emergence behavior in the Boid model is the presence of an unexpected grouping packing behaviour , this behaviour is often observed in this model, This is the reason why the boid model is one of the most used ABS model to study weak emergence. 3. Related Work Agent-based simulation (ABS) specifically used compared to other simulation techniques. Emergence as a result from simulation, is normally investigated with (ABS) tools. Structures with massive wide variety of parts frequently display emergence, and through ABS simulating platforms, it is common to visualize and to control the rise of unexpected behaviour. Variety of emergence definitions exists, however to facilitate the study, we simulated the technique primarily based on bedau’s[2] week emergence definition, a weak emergence can be verified via simulation, it is expected and may be controlled in certain systems. For Example, in boids model, the simulation of the flocking is controlled by three rules : separation, cohesion, and alignment. Applying those regulations will result in a grouping behaviour (emergent). Professionals can with a few parameters modifications, accelerate the rise of the flocking or, eliminate it. Many techniques have been used to track emergence. [16] defined emergent behavior as a time-series changing point and proposed the use of changing point detection techniques for the discovery of emer- gent behavior. [13] employed interaction statistics as a metric to examine the emergence of emergent behavior from agent-based simulation(abs). [14] introduced a method for semantically validating emer- gence using an ontology-based framework. The method measured the semantic differences between element attribute values using a semantic state distance metric. A summary of metric-based approaches for analyzing vision-based car behavior is provided by [17], [18], [4], [19] which employ interaction metrics to identify and categorize emergence in real-time simulations, and [3] which employed age metrics to identify and categorize emergence through swarms of unmanned aerial vehicles (UAVs). We discuss our work in the next part to address the constraints stated by [20], who presented a statistical metric to find emergence and demonstrated how data loss affects communication in contested situations. 4. Proposed Approach we analyse the boids model, which captures the motion of bird flocking and is a seminal example for studying emergence. We model this system as a multi-agent system in which each bird is an agent. In this section, we present the multi-agent simulation framework (Figure 1) that consists of two components, agent-based simulation engine and expert system engine. These two components communicate with each other to implement their functionality. The main functionality of the simulation engine during the simulation is to retrieve data which will be passed to the expert system to detect new system state which can be unknown (Emergent behaviour). Figure 1: General architecture of the detection system 4.1. The simulation engine We use Reynolds’s Boids model [21] with multi-agent system for the simulation, Netlogo[20]simulation plat-form is used. The purpose of this simulation engine is: 1. Step 1: Running the system in several ‘’normal”situations when interaction=separation. 2. Step 2: In every situation ,gathering and formalizing the simulation data. 3. Rerun step1 and step2 but with emergent situations. Fig.2. Normal simulation (50 agents) 4.2. The fuzzy expert system The designed fuzzy expert system for identifying emergent behavior consists of four parts.The parts have been defuzzed.The information derived from the fuzzy rules generated was inferred using the Figure 2: presents an example simulation in which, a several groups are forming. The agent number is 50, Ticks = 300 Mamdani fuzzy inference approach, which was utilized in this work. Numerous computer languages can be used to create a fuzzy expert system. This system is implemented using MATLAB as a tool. 4.2.1. The Knowledge-Base The fuzzy knowledge base contains fuzzy facts and rules so that the knowledge base systems will allow approximate reasoning. For easily performing knowledge representation and reasoning, all rules in the knowledge base are presented as a set of if then rules. 4.2.2. Fuzzification Convert values to fuzzy inputs by using membership functions [22]. In this research, there are three linguistic variables (input variables) used, namely:Alignment(A), separation(S),cohesion(C) and one output variable : Emergent behavior (EB). Fuzzy linguistic values of input/output variables are set as [Low, medium, high]. we use the triangular shape has been selected due to its simplcity. Triangular Membership Function: ⎧ ⎪ ⎪ ⎪0, 𝑥<𝑎 ⎨ 𝑥−𝑎 , 𝑎 ≤ 𝑥 ≤ 𝑏 ⎪ Triangular(𝑥, 𝑎, 𝑏, 𝑐) = 𝑐−𝑥 𝑏−𝑎 𝑐−𝑏 , 𝑏 ≤ 𝑥 ≤ 𝑐 ⎪ ⎪ ⎪ ⎪ ⎩0, 𝑥>𝑐 The next step in the fuzzification process is the development of fuzzy rules. 4.2.3. Inference engine The inference process is the mathematical operation used to determine the certainty degree of the emergent behaviour being in each of the three levels considered .Mamdani [23] is a well-known fuzzy logic method,fuzzy Mamdani is frequently used to create systems with reasoning that resembles human intuition. 4.2.4. Defuzzification After the inference process, the overall result is a fuzzy certainty value measuring the emergent behaviour in each of the three levels (Low,Medium,High). This result must be defuzzied to obtain a final crisp output.the commonly used defuzzification method is known as centroid.it finds a point representing the center of gravity(COG)of the aggregated fuzzy set. 5. First Result Our initial experiments for emergence identification are presented in this section. This is the Boids model, or ABS model. As stated in section 4, we intend to take the following three actions. Initially, the simulation should be run using only the "Separation" interaction. The intention is to stop a packing behavior from developing. This is referred to as "normal behavior." In every iteration, we retrieve interaction data from the simulation. Figure 3: Emergent behavior In Figure 3 we have several grouping behaviours, in this case, we run the simulation with all Boids rules. We retrieve the simulation data into an excel file using a Netlogo Spreadsheet extension. Figure 4: Simulation data extraction For simplifying the calculation : x/10 Sample Membership function is given below : Membership function equation for the separation variable is declared using equation (1), equation (2) and equation (3). ⎧ ⎨1, ⎪ 𝑥 ≤ 25 45−𝑥 20 , 25 ≤ 𝑥 < 45 𝜇Low [𝑥] = (1) ⎪ 0, 𝑥 ≥ 45 ⎩ ⎧ 𝑥−25 ⎨ 10 , 35 ≤ 𝑥 < 45 ⎪ 𝜇Medium [𝑥] = 55−𝑥10 , 45 ≤ 𝑥 < 55 (2) 𝑥 < 35 atau 𝑥 ≥ 55 ⎪ 0, ⎩ ⎧ ⎨0, ⎪ 𝑥 ≤ 45 𝜇High [𝑥] = 𝑥−45 20 , 45 ≤ 𝑥 < 65 (3) ⎪ 1, 𝑥 ≥ 65 ⎩ Sample fuzzy rule: R1: IF (S is LOW) AND (A is HIGH) AND (C is HIGH) THEN (EB is HIGH). R2: IF (S is HIGH) AND (A is LOW) AND (C is LOW) THEN (EB is NULL). R3: IF (S is LOW) AND (A is MEDIUM) AND (C is MEDIUM) THEN (EB is MEDIUM). In order to combine these fuzzy sets, which reflect the outputs of rules into a single fuzzy set for decision-making, the Mamdani method is implemented after each If-Then rule generates a changed fuzzy set as output. Defuzzification is the final stage of the fuzzy expert system, whereby the merged fuzzy set produces a single scalar number for emergent behavior detection. 6. Conclusion In recent years, the significance of emerging has increased.Emergence can happen in a range of systems and be either positive or negative. As a result, we need a system that offers a consistent technique for evaluating and controlling such actions. In this paper, the usage of expert systems in conjunction with ABS data was examined. We suggest a technique to identify flocking behavior in multi-agent systems using a fuzzy expert system in order to solve this problem. The rules database is currently being tested and expanded. We hope to evaluate our method with more sophisticated models on more ABS systems, as the initial results are promising. Acknowledgements The authors would like to thank the DGRSDT (General Directorate (General Directorate of Scien- tific Research and Technological Development )-MESRS(Ministry of Higher Education and Scientific Research),ALGERIA, for the financial support of LISCO Laboratory. Declaration on Generative AI The authors have not employed any Generative AI tools. References [1] J. Fromm, Types and forms of emergence, Complexity Digest 25 (2005). [2] M. Bedau, Weak emergence, Blackwell Publishers, 1997. [3] A. Boukehila, N. Taleb, Case-based approach to detect emergence, in: Proceedings of the 2019 3rd International Conference on Big Data Research, 2019, pp. 98–102. [4] S. Singh, et al., Detection and classification of emergent behaviors using multi-agent simulation framework (wip), in: S. Mittal, J. L. R. Martin (Eds.), Proceedings of the Symposium on Modeling and Simulation of Complexity in Intelligent, Adaptive and Autonomous Systems (MSCIAAS ’17), Society for Computer Simulation International, San Diego, CA, USA, 2017, pp. Article 3, 8 pages. [5] B. e. a. Fraser, Simulating the effect of degraded wireless communications on emergent behavior, in: Winter Simulation Conference (WSC), 2017. [6] L. R. Medsker, Hybrid intelligent systems, 2020. [7] L. A. Zadeh, Fuzzy sets, Information and Control (1965) 338–353. [8] D. Gupta, A. Ahlawat, Taxonomy of gum and usability prediction using gum multistage fuzzy expert system, The International Arab Journal of Information Technology 16 (2019). [9] K. F. Alam, T. Ahamed, Climate-adaptive potential crops selection in vulnerable agricultural lands adjacent to the jamuna river basin of bangladesh using remote a fuzzy expert system, Remote Sensing 15 (2023) 2201. [10] A. Setiawan, K. Kusmaya, I. Abadi, E. Yulianto, Expert system for diagnosing disease symptoms of rice pests using the dempster shafer algorithm and fuzzy tsukamoto algorithm, Jurnal Sisfokom (Sistem Informasi dan Komputer) 11 (2022) 407–414. [11] L. O. Batista, V. S. ArauJo, Fuzzy neural networks to create an expert system for detecting attacks by sql injection, The International Journal of Forensic Computer Science (2018). [12] R. Nourian, S. M. Mousavi, S. Raissi, A fuzzy expert system for mitigation of risks and effective control of gas pressure reduction stations with a real application, Journal of Loss Prevention in the Process Industries 59 (2019) 77–90. [13] R. Boadh, R. Grover, M. Dahiya, A. Kumar, Study of fuzzy expert system for the diagnosis of various types of cancer, Materials Today: Proceedings 56 (2022) 298–307. [14] J. Tang, X. Liu, W. Wang, Covid-19 medical waste transportation risk evaluation integrating type-2 fuzzy total interpretive structural modeling and bayesian network, Expert Systems with Applications 213 (2023) 118885. [15] R. Gore, P. J. Reynolds, An exploration-based taxonomy for emergent behaviour analysis in simulations, in: Proceedings of the 2007 Winter Simulation Conference, 2007. [16] C. C. Chen, S. B. Nagl, C. D. Clack, Complexity and emergence in engineering systems, Complex Systems in Knowledge-based Environments: Theory, Models and Applications 168 (2009) 99–128. [17] O. Arsene, I. Dumitrache, I. Mihu, Expert system for medicine diagnosis using software agents, Expert Systems with Applications 42 (2015) 1825–1834. [18] A. K. Seth, Measuring emergence via nonlinear granger causality, Artificial Life XI 324 (2008) 545–552. [19] M. Randles, H. Zhu, M. Taleb-Bendiab, A formal approach to the engineering of emergence and its recurrence, in: Proceedings of the 2nd International Workshop on Engineering Emergence in Decentralized Autonomic Systems, 2007. [20] A. Boukehila, N. Taleb, Y. Benazzouz, Interactions-based method to detect emergent behavior in ongoing simulations, International Journal of Modeling, Simulation, and Scientific Computing 12 (2021) 2150022. [21] C. W. Reynolds, Flocks, herds and schools: A distributed behavioral model, ACM SIGGRAPH computer graphics 21 (1987) 25–34. [22] C. Wang, A Study of Membership Functions on Mamdani-Type Fuzzy Inference System for Industrial Decision-Making, Ph.D. thesis, Theses and Dissertations, 2015. [23] I. Iancu, A mamdani type fuzzy logic controller (????).