Cardumen
Introduction and objective
This is a personal project to learn and experiment with some simple CV and RL methods. It functions as a testing playground for a diverse range of experiments, including utilizing projective geometry for object detection, as well as training and evaluating reinforcement learning agents with inputs from multiple sources. The aim of this project is to try to simulate the behaviour of schools and shoals of fish, which are collectively known as 'cardumen' in Spanish. The results will be far from the real-world behaviour of fish, but it will be a good exercise to learn about the basics of RL and CV.
Schooling and shoaling are collective behaviours exhibited by many species of fish, birds, and other animals. We say that a group of fish of the same species is schooling when they move in a coordinated manner. Shoaling is the generalization to grouping of multiple species, each of which may have its own behaviour. The objective is to try to reproduce some of the grouping behaviour modelling the fish as agents in a multi-agent system. Different species may have different rewards or weights depending on their states and actions. Furthermore, other species will be added to the environment to try to simulate the behaviour of the fish in the presence of predators. These predators will be agents that will try to eat the fish and serve as negative reinforcement for the fish.
Procedure
The procedure will be as follows:
- Build a mini-game environment to simulate the behaviour of fish, including scene rendering and shape colliders.
- Implement a simple CV algorithm to detect the presence of other fish in the environment, using previous colliders.
- Implement a simple RL algorithm to control the behaviour of the fish.
- Define some metrics for the fish grouping and evaluate their behaviour.
- Include predators in the scene.
- Include different fish species.
Media
Here you can see some teasers and several pictures of the development process:
- Detection of another fish within the view range of the fish.
- Projection of the fish view trapezoid into a square.