##plugins.themes.bootstrap3.article.main##

Artificial Intelligence (AI) and Machine Learning (ML) have the potential to revolutionize education, with applications ranging from personalized learning systems to teaching students about AI concepts. Beyond utilizing and integrating these technologies, it is crucial to comprehend the fundamental principles governing the field. Choosing an “attractive” area of AI suitable for students and engaging them is essential to introducing difficult Computer Science concepts. In particular, introducing these concepts in elementary and secondary (K-12) Education is not a simple task, as it involves complex algorithms and theories that could overwhelm young learners. To overcome this challenge, we can rely on nature-inspired or bio-inspired algorithms such as Swarm Intelligence (SI) family, and leverage block-based programming environments (like MIT Scratch or other Logo-like environments) to make AI concepts more accessible and intuitive for students. This article proposes the creation and implementation of simplified simulations inspired by the Artificial Fish Swarm Optimization Algorithm (AFSO)-namely how fish behave collectively in the ocean–as an educational tool for both elementary and secondary school students. The proposed educational methodology combines the integration of Constructionist Learning principles, as the “Creative Thinking Spiral” learning model, with the inquiry-based approach of the 5Es Instructional Model.

Introduction

Artificial Intelligence (AI) and Machine Learning (ML) are Computer Science fields focused on designing intelligent systems replicating human cognitive abilities, such as reasoning, learning, problem-solving, optimization, and decision-making. AI/ML researchers often draw inspiration from nature and its complex adaptive processes to develop these systems.

The principles of nature-inspired/bio-inspired algorithms, specifically Swarm Intelligence (SI), have gained significant attention in recent years due to their effectiveness in dealing with complex problems [1], [2]. These algorithms are inspired by the behavior of organisms in nature, such as birds, fish, ants, and bees, as well as by biological processes such as the Darwinian theory of evolution, like Genetic Algorithms [3], Genetic Programming [4], Evolutionary Algorithms techniques [5] and virus dispersal. Because they authentically mimic nature, these algorithms can be valuable and interesting carriers for introducing AI/ML/SI concepts in education.

Reynolds introduced the concept of “Boids” in 1986 [6], which is considered a pioneering simulation model in bio-inspired algorithms and Swarm Intelligence. The model aims to simulate the collective (swarm) behavior of birds to understand emergent patterns in group dynamics. “Boids” are governed by three fundamental rules–separation, alignment, and cohesion–which enable individual agents to exhibit complex behaviors like flocking, schooling, and herding. These behaviors have found applications in diverse fields, including computer graphics, animation, traffic management, and robotics. The “Boids approach” highlights how simple rules can result in sophisticated group dynamics, providing valuable insights into real-world phenomena [6], [7].

One example of such bio-inspired algorithms is the Artificial Fish Swarm Optimization (AFSO) Algorithm [6].

AFSO is an optimization technique that leverages the collective (swarm) intelligence and coordinated behavior of fish in schools. Each fish swarm represents a potential solution to a given problem, and the school collaboratively explores the solution space to find the best answer. This algorithm mimics the natural swarming behavior of fish, and its effectiveness has been demonstrated in solving complex optimization problems across various domains [6]–[8].

Introducing AFSO to students teaches them fundamental AI concepts and provides a concrete example of how nature-inspired algorithms can solve problems that are too complex for traditional optimization techniques. Using the 5Es’ educational methodology [9]—Engage, Explore, Explain, Elaborate, and Evaluate—we will guide students through the principles and implementation of AFSO in a block-based programming environment like MIT Scratch [10]. This methodology ensures a structured and effective learning experience, fostering a deeper understanding of both the algorithm and the programming environment. This approach can help students understand and appreciate the potential of AI in real-world applications.

This article delves into the key concepts of AFSO and analyzes its four primary behaviors: Prey, Swarm, Follow, and Leap. Additionally, we present a detailed analytical pseudo code for a simplified AFSO implementation, catering to the needs of an implementation in a block-based programming environment such as MIT Scratch [10].

Methods and Materials

Logo-Like, Block-Based Programming Environment

Papert’s influential work [11] in Computer Science education could be the suggested carrier of the educational model schema for introducing artificial intelligence (AI) concepts in the classroom. Papert, known for his constructionist theory and the creation of the Logo programming language, emphasized learning through active exploration, problem-solving, and discovery [11]. Based on these principles, Resnick [12] introduces the “Creative Thinking Spiral” learning model, which involves a continuous, spiral process. Students start by imagining what they want to do, then create a project based on their ideas, play with their creations, share their ideas and creations with others, and reflect on their experiences. This reflection leads them to imagine new ideas and projects. As students go through this process repeatedly, they learn to develop their own ideas, test them out, explore alternatives, seek input from others, and generate new ideas based on their experiences.

The 5Es’ Instructional Model (5Es) Concepts for Introduction AI Concepts

The 5Es’ Instructional Model [9] is a constructivist framework aimed at enhancing the efficacy of science education through active learning and a profound comprehension of scientific principles. The model comprises five interconnected phases: Engage, Explore, Explain, Elaborate, and Evaluate, each tailored to deliver a comprehensive learning experience that builds on students’ existing knowledge, fosters inquiry and discovery, and nurtures critical thinking and problem-solving skills. Furthermore, the 5Es’ Instructional Model [9] aligns well with Papert’s influential work [11] in computer science education in combination with Resnick’s [12] “Creative Thinking Spiral” learning model and could be a suggested educational model for introducing Swarm Intelligence (SI) concepts in the classroom (Table I).

5Es instructional model Creative thinking spiral Combined educational model in spiral phases
Engage Image Phase 1: Engage–Image
Explore Create Phase 2: Explore–Image, Create, Play (Spiral)
Explain Play Phase 3: Explain–Image, Create, Play, Share (Spiral)
Elaborate Share Phase 4: Elaborate–Image, Create, Play, Share, Reflect (Spiral)
Evaluate Reflect Phase 5: Evaluate–Image, Create, Play, Share, Reflect (Spiral)
Table I. Combining the 5Es Instructional Model with the “Creative Thinking Spiral” Learning Model

Engage

The Engage phase serves to captivate students’ interest and provoke their curiosity by introducing concepts or phenomena in a manner that resonates with their experiences. This initial engagement establishes connections between new knowledge and existing cognitive frameworks, laying the groundwork for deeper exploration. Teachers might employ compelling videos, simulations, thought-provoking questions, or real-world problems to stimulate students’ interest.

Explore

In the Explore phase, students engage in hands-on activities and collaborative learning to investigate and experiment with the concept at hand. This phase emphasizes shared learning experiences that enable students to construct new knowledge through active participation and inquiry. The teacher’s role is that of a facilitator, guiding students to ask questions, make observations, and gather data.

Explain

The Explain phase focuses on developing students’ understanding and ability to articulate what they have learned. Teachers assist students in connecting their exploratory experiences to scientific concepts and vocabulary, often involving more direct instruction to clarify misconceptions, introduce formal terminology, and explain underlying principles. Students are encouraged to share their findings and explanations, fostering deeper comprehension through dialogue and reflection.

Elaborate

The Elaborate phase challenges students to expand on their knowledge by applying it to new situations and problems, reinforcing their grasp of the concepts. Activities in this phase might entail more complex experiments, projects, or problem-solving tasks that require students to integrate and apply their knowledge in novel ways, crucial for demonstrating the broader applicability of scientific concepts.

Evaluate

This phase focuses on evaluating students’ comprehension and abilities through formative and summative assessments. Assessment techniques such as quizzes, tests, presentations, and portfolios are employed to gauge students’ development. Self-assessment and peer assessment play a crucial role in fostering reflective thinking and self-regulation in learning.

Analysis of Fish Swarm Optimization Algorithm Behaviors

The Fish Swarm Optimization (FSO) algorithms are inspired by the collective behaviors of fish in natural environments. These algorithms simulate the social behaviors of fish, such as preying, swarming, following, and leaping, to solve complex optimization problems. This article analyzes these behaviors in the context of optimization algorithms, drawing on foundational studies and enhancements in the field [6]–[8], [13]–[16].

Prey Behavior

Prey behavior models the way fish search for food by exploring their environment. In the context of optimization, this involves each artificial fish searching the solution space to find the most optimal solutions. This behavior is characterized by a local search mechanism, where each fish moves randomly within a certain range to evaluate new positions.

Reynolds’ work [6] on flocking behavior in birds and fish laid the groundwork for modeling such distributed behavioral systems in computer graphics. In AFSO, prey behavior can be seen as an extension of this idea, focusing on local search to improve the individual solution quality.

Li et al. [7] introduced the fish-swarm algorithm, highlighting prey behavior as a critical component. They described how each fish evaluates its position based on a fitness function, adjusting its movements to optimize the food search, thereby refining the solution space exploration.

Swarm Behavior

Swarm behavior describes how fish maintain group cohesion by moving towards the center of the group or the average position of their neighbors. This collective movement helps in exploiting the social sharing of information, leading to a more global search approach.

Kennedy and Eberhart’s [13] Particle Swarm Optimization (PSO) algorithm shares similarities with the swarm behavior in AFSO, where particles (analogous to fish) adjust their positions based on the global best and local best positions found by the swarm. This behavior ensures a balance between exploration and exploitation in the search space.

Liu et al. [8] further developed this idea by incorporating cultural evolution into the fish swarm algorithm. They proposed mechanisms where the swarm behavior could be influenced by cultural factors, leading to improved convergence rates and solution diversity.

Follow Behavior

Follow behavior is the mechanism where less successful fish follow more successful ones. This mimics the natural tendency of fish to follow leaders or those who have found a better food source. In optimization, this behavior ensures that solutions converge towards the best-found solution by leveraging the success of leading individuals.

Liang et al. [14], in their work on comprehensive learning particle swarm optimization, emphasized similar principles where particles learn from the global best solution to improve their performance. This learning mechanism enhances the optimization process by focusing the search around the best solutions found so far, reducing the chances of getting trapped in local optima.

Leap Behavior

Leap behavior allows fish to make large, random jumps to explore new areas of the search space. This behavior is crucial for escaping local optima and maintaining diversity within the swarm. It introduces a stochastic element to the search process, enabling the algorithm to explore global solutions more effectively.

Li et al. [7] described leap behavior as a way to maintain exploration and avoid premature convergence. By incorporating random jumps, the algorithm ensures a broader search area, which is particularly useful in complex multimodal optimization problems where local optima are common.

Implementation and Results

As mentioned above, Reynolds’ “Boids” model [6] is a computational approach to studying group behavior in birds, intending to understand the emergent patterns that arise from individual interactions. By using simple fundamental rules–which govern the behavior of individual agents–to generate complex group dynamics and complex behaviors such as flocking and herding, the Boids model provides valuable insights into real-world phenomena.

Particularly, Boids [6] simulate the behavior of birds in a flock using three fundamental simple rules:

  1. Separation: Each bird avoids crowding nearby birds.
  2. Alignment: Each bird adjusts its velocity to match that of its neighbors.
  3. Cohesion: Each bird moves towards the average position of its neighbors.

The rules create a captivating pattern of flocking behavior, where individual birds interact based on local information. This results in emergent properties such as flock formation and coordinated movement. We can relate these rules to AFSO behaviors and demonstrate them in a simplified manner using MIT Scratch programming environment [10]. The Separation, Alignment, and Cohesion rules are related with the variables: Fish_Vision, Fish_Velocity, and Fish_Step (and Fish_Swarm_Cohesion for Senior Secondary Education) as AFSO parameters, respectively.

Implementation for Elementary and Junior Secondary Education

The programming implementation of the Fish Swarm Concepts follows the combination of 5Es Model and “Creative Thinking Spiral” learning model [12].

Engage

To capture students’ interest, begin by introducing the concept of natural fish behaviors and their computational modeling. This can be achieved through the use of videos, animations or by presenting the final project, Fig. 1.

Fig. 1. Simplified artificial fish swarm algorithm simulation for elementary and junior secondary education [17].

Discuss the real-world applications of optimization algorithms and emphasize how nature-inspired algorithms such as AFSO can solve complex problems. This initial approach aims to ignite curiosity and stimulate interest in the subject.

Explore

In the exploration phase, students familiarize themselves with the Scratch programming environment by imagining and creating simple projects involving sprite movements and interactions. They experiment with basic fish behaviors, such as moving in random directions but like swarm and avoiding predators (sharks), which prepares them for implementing AFSO. To create a realistic simulation of a fish swarm, it is essential to utilize Scratch’s clone feature. In Scratch, clones are identical copies of a sprite that can be programmed to behave independently. Cloning allows for the creation of a school of fish, each of which can exhibit the predefined FSO behaviors.

Implementing fish as clones in Scratch, Fig. 2, involves:

  • Creating a fish sprite as the base.
  • Initializing the Fish variables: Fish_Vision, Fish_Velocity and Fish_Step.
  • Creating Fish Swarm cloning the fish sprite (repeat loop) to generate multiple fish instances.

Fig. 2. Simplified artificial fish swarm algorithm simulation for elementary and junior secondary education: initialization–cloning [17].

Explain

During the explanation phase, introduce each principle of AFSO in detail using Scratch blocks. Break down the prey, swarm, follow, and leap behaviors into manageable parts and demonstrate their implementation step-by-step. Coding the behaviors for the fish clones, considering the specific FSO behaviors. When each clone starts, it can interact with the environment, respond to threats, and influence the group’s movement, providing a simplified simulation of a Fish Swarm inspired by AFSO algorithm.

Swarm Behavior in Block-Based Environment (MIT Scratch)

After the fish creation and cloning, we create an object (an invisible dot) called “Swarm_center” that will be the center of the swarm and will move randomly within the boundaries of the swarm.

Each fish will move smoothly up to “Swarm_center”, for a time corresponding to the action screen length (of the background, i.e., 500) divided by the value of the Fish_Velocity variable.

To achieve the parametric behavior of coherence we can spread the swarm around “Swarm_center” with radius equal to the value of the Fish_Step variable. In this way by varying Fish_Step we can make the swarm denser or sparser around its center, Fig. 3.

Fig. 3. Simplified artificial fish swarm algorithm simulation for elementary and junior secondary education: creating swarm behavior [17].

Prey Behavior in Block-based Environment (MIT Scratch)

After we have created the food object (Food), which will appear in a different place every time we click on the green flag, we add the code to the Fish and to the Swarm_center objects (into the “Forever” Loop) for the Prey behavior, as shown in Fig. 4.

Fig. 4. Simplified artificial fish swarm algorithm simulation for elementary and junior secondary education: creating prey behavior [17].

Follow Behavior in Block-based Environment (MIT Scratch)

Because we have one food object (not multi-objective optimization) in this implementation–which can be propagated through Food cloning for applications in secondary education using Lists–this function is covered by the simplified swarm behavior for primary education. To reinforce the idea of cohesiveness of the school and the following of neighboring fish, we use a fish predator (Shark), which moves randomly on the seabed. Both each fish (Fish) individually and the center of the school–when within their field of view (Fish_Vision variable)–move in the opposite direction.

Leap Behavior in Block-based Environment (MIT Scratch)

Leap Behavior is simulated using a time counter. In case the time interval of not finding food exceeds a predefined value (e.g., 30 seconds), then the food object (in our case, Food) sends a jumping message to the Swarm_center object and thus to the whole fish school. When the message is received, the swarm center smoothly jumps to a new random food search position. Figs. 5 and 6, show the associated code of the food (Food) and the swarm center (Swarm_center), respectively.

Fig. 5. Simplified artificial fish swarm algorithm simulation for elementary and junior secondary education: food code with leap timer [17].

Fig. 6. Simplified artificial fish swarm algorithm simulation for elementary and junior secondary education: swarm center’s code with embedded leap behavior [17].

Elaborate

In the elaboration phase, students combine the basic behaviors to create a fully simplified functional AFSO model. They simulate a fish swarm, allowing individual fish to interact according to the principles of prey, swarm/follow, and leap. This stage emphasizes debugging and refining the code.

Evaluate

Finally, students evaluate their implementations by testing the AFSO algorithm on different optimization problems. They analyze the performance, discuss potential improvements, and reflect on the learning process. This phase encourages critical thinking and application of the concepts learned.

Implementation for Senior Secondary Education

In parallel with elementary–junior secondary study, an extension of this educational method has been prepared to introduce more complex concepts of Swarm Intelligence in Senior Secondary Education. This includes the use of more advanced mathematical concepts, such as Average of Fish positions (Fig. 7), Euclidean Distance, programming tools and structures, such as Lists (Fig. 8), plenty of Variables, Procedures (My Blocks), and other more specialised functions. The swarm of fish corresponds to multi-objective purposes, such as searching and finding more food.

Fig. 7. Simplified artificial fish swarm algorithm simulation for senior secondary education: swarm average positions [18].

Fig. 8. Simplified artificial fish swarm algorithm simulation for senior secondary education: fish clones positions in lists [18].

Also, the individual behaviors of the Fish Swarm Algorithm (Prey, Swarm, Follow, and Leap) will be more accurate than the AFSO optimization algorithm. For example, in Leap Behavior, fish move faster to the location where–most recently–food was found by another member of the fish school.

Each behavior corresponds to a Procedure (My Block) with the related behavioral operators. The following, Fig. 9, depicts the main programming concept of simplified AFSO for senior Secondary Education. This implementation, using My Blocks Extension, allows students to experiment/play with different individual behaviors (Prey, Swarm, Follow, Leap), modify these, or create new ones in the basic Move Block for the fish movement.

Fig. 9. Simplified artificial fish swarm algorithm simulation for senior secondary education [18].

The whole process follows once again the combination of the 5Es Instructional Model and the “Creative Thinking Spiral” learning model. This approach promotes an inquiry-based learning environment that empowers students to build their understanding.

Results

The proposed methodology for the introduction of the SI concepts in the educational process and the implementation in the classroom showed its acceptance by the students. It opened a productive dialogue about the role of ground rules and expected behaviors in a swarm. In particular, how complex behaviors and optimization can emerge from a few well-defined rules. The Swarm Intelligence models created remain a constant focus for testing and improvement. The whole process can also eventually lead–through formal or non-formal learning, such as Computational Thinking/STEM (Science, Technology, Engineering, Mathematics) Groups–to the introduction of Swarm Robotics using appropriate computing systems (based on open-source or closed-source hardware and software).

Conclusion

Introducing AI concepts to young students can be a daunting task. However, utilizing block-based programming environments, such as MIT Scratch or other Logo-like environments, can make it much more achievable and form a strong foundation for K-12 educators to create interactive learning experiences. By combining block-based programming environments with the concept of fish schooling, students can gain a foundational understanding of Swarm Intelligence concepts and optimization algorithms while being creative and enjoying themselves. Educators simplifying the Artificial Fish Swarm Optimization Algorithm into four primary behaviors, Prey, Swarm, Follow, and Leap, allow students to learn the fundamentals of AI and ML in a gamified way.

Furthermore, by integrating Constructionist Learning principles [6], [12] with the structured, inquiry-based approach of the 5Es model [9], educators can effectively introduce the aforementioned concepts, fostering a deep, practical understanding of this critical field in computer science education.

In conclusion, the methodology of using nature-inspired models for creating gamified simulations in Logo-like, block-based environments through constructionist educational principles with inquiry-based approaches is a promising future research topic with countless possibilities for introducing complex AI/ML/SI concepts in Education (K-12) helping students to develop a comprehensive understanding and prepares them to tackle future challenges.

References

  1. Oyekunle Oyewumi Taiwo D, Preston D. Swarm intelligence and decision-making: the role of swarm intelligence in decision. 2024. Available from: https://ssrn.com/abstract=4849581.
     Google Scholar
  2. Molina D, Poyatos J, Ser JD, García S, Hussain A, Herrera F. Comprehensive taxonomies of nature-and bio-inspired optimization: inspiration versus algorithmic behavior, critical analysis recommendations. Cogn Comput. 2020;12(5):897– 939. Available from: https://sci2s.ugr.es/sites/default/files/ficherosPublicaciones/2847_10.1007@s12559-020-09730-8.pdf.
     Google Scholar
  3. Holland JH. Adaptation in Natural and Artificial Systems. University of Michigan Press; 1975. Available from: https://mitpress.mit.edu/9780262581110/adaptation-in-natural-and-artificial-systems/.
     Google Scholar
  4. Koza JR. Genetic Programming: On the Programming of Computers by Means of Natural Selection. The MIT Press; 1992. Available from: https://mitpress.mit.edu/9780262527910/genetic-programming/.
     Google Scholar
  5. Salpasaranis K, Stylianakis V, Kotsopoulos ST. Combining diffusion models and macroeconomic indicators with a modified genetic programming method: implementation in forecasting the number of mobile telecommunications subscribers in OECD countries. Adv Oper Res. 2014;568478:20. doi: 10.1155/2014/568478. Available from: https://onlinelibrary.wiley.com/doi/10.1155/2014/568478.
     Google Scholar
  6. Reynolds CW. Flocks, herds and schools: a distributed behavioral model. ACM SIGGRAPH Comput Graph. 1987;21(4):25–34. Available from: https://dl.acm.org/doi/pdf/10.1145/37401.37406.
     Google Scholar
  7. Li XL, Shao ZJ, Qian JX. Optimizing method based on autonomous animats: fish-swarm algorithm. Syst Eng Theory Pract. 2002;22(11):32–8 (in Chinese). Available from: https://sysengi.cjoe.ac.cn/EN/10.12011/1000-6788(2002)11-32.
     Google Scholar
  8. Liu M, Li X, Zhang M, Li C. Research on artificial fish swarm algorithm with cultural evolution for subcarrier allocation. Int J Hybrid Inf Technol. 2015;8(6):301–10. Available from: https://gvpress.com/journals/IJHIT/vol8_no6/27.pdf .
     Google Scholar
  9. Bybee R, Taylor JA, Gardner A, Van Scotter P, Carlson Pow- ell J, Westbrook A, et al. The BSCS 5E Instructional Model: Origins and Effectiveness. Colorado Springs: BSCS; 2006. Available from: https://www.bates.edu/research/files/2018/07/BSCS_5E_Executive_Summary.pdf .
     Google Scholar
  10. Scratch.mit.edu. About scratch [Internet]. 2024. Available from: https://scratch.mit.edu/.
     Google Scholar
  11. Papert S. Mindstorms: Children, Computers, and Powerful Ideas. New York: Basic Books; 1980. Available from: https://dl.acm.org/doi/pdf/10.5555/1095592.
     Google Scholar
  12. Resnick M. Sowing the seeds for a more creative society. Learn Lead Technol. 2007;35(4):18–22. Available from: https://web.media.mit.edu/~mres/papers/Learning-Leading.pdf .
     Google Scholar
  13. Kennedy J, Eberhart R. Particle swarm optimization. Proceedings of the IEEE International Conference on Neural Networks (ICNN), pp. 1942–8, 1995. doi: 10.1109/ICNN.1995.488968. Available from: https://ieeexplore.ieee.org/document/488968.
     Google Scholar
  14. Liang JJ, Qin AK, Suganthan PN, Baskar S. Comprehensive learning particle swarm optimizer for global optimization of multi-modal functions. IEEE Trans Evol Comput. 2006;10(3):281–95. doi: 10.1109/TEVC.2005.857610. Available from: https://ieeexplore.ieee.org/document/1637688.
     Google Scholar
  15. Vesterstrom J, Thomsen R. A comparative study of differential evolution, particle swarm optimization, and evolutionary algorithms on numerical benchmark problems. Proceedings of the 2004 Congress on Evolutionary Computation (IEEE Cat. No.04TH8753), vol. 2, pp. 1980–7, Portland, OR, USA, 2004. doi: 10.1109/CEC.2004.1331139. Available from: https://ieeexplore.ieee.org/document/1331139.
     Google Scholar
  16. Kennedy J, Eberhart RC, Shi Y. Swarm intelligence. In Morgan Kaufmann Series in Artificial Intelligence. Morgan Kaufmann, 2001. ISBN: 9781558605954. doi: 10.1016/B978-155860595-4/50000-0. Available from: https://doi.org/10.1016/B978155860595-4/50000-0.
     Google Scholar
  17. Scratch.mit.edu, Salpasaranis K. Simplified artificial fish swarm algorithm simulation for elementary and junior secondary education [Internet]. 2024 [updated 2024 February 26; cited 2024 July 26]. Available from: https://scratch.mit.edu/projects/967330607.
     Google Scholar
  18. Scratch.mit.edu, Salpasaranis K. Simplified artificial fish swarm algorithm simulation for senior secondary education [Internet]. 2024 [updated 2024 February 26; cited 2024 July 26]. Available from: https://scratch.mit.edu/projects/967331536.
     Google Scholar