--- title: "Fly algorithm" chunk: 1/3 source: "https://en.wikipedia.org/wiki/Fly_algorithm" category: "reference" tags: "science, encyclopedia" date_saved: "2026-05-05T09:57:41.802183+00:00" instance: "kb-cron" --- The Fly Algorithm is an approach in 3D reconstruction that utilizes clusters of points ("flies") corresponding to different nearby objects via genetic algorithms and stereovision principles. The resulting reconstruction is partial, but can be used to recognize obstacles in robot navigation and other applications. This technique has a high computational load due to numerous inputs and parameters, making performance optimization difficult. == History == The Fly Algorithm is a type of cooperative coevolution based on the Parisian approach. The Fly Algorithm has first been developed in 1999 in the scope of the application of Evolutionary algorithms to computer stereo vision. Unlike the classical image-based approach to stereovision, which extracts image primitives then matches them in order to obtain 3-D information, the Fly Algorithm is based on the direct exploration of the 3-D space of the scene. A fly is defined as a 3-D point described by its coordinates (x, y, z). Once a random population of flies has been created in a search space corresponding to the field of view of the cameras, its evolution (based on the Evolutionary Strategy paradigm) used a fitness function that evaluates how likely the fly is lying on the visible surface of an object, based on the consistency of its image projections. To this end, the fitness function uses the grey levels, colours and/or textures of the calculated fly's projections. The first application field of the Fly Algorithm has been stereovision. While classical `image priority' approaches use matching features from the stereo images in order to build a 3-D model, the Fly Algorithm directly explores the 3-D space and uses image data to evaluate the validity of 3-D hypotheses. A variant called the "Dynamic Flies" defines the fly as a 6-uple (x, y, z, x’, y’, z’) involving the fly's velocity. The velocity components are not explicitly taken into account in the fitness calculation but are used in the flies' positions updating and are subject to similar genetic operators (mutation, crossover). The application of Flies to obstacle avoidance in vehicles exploits the fact that the population of flies is a time compliant, quasi-continuously evolving representation of the scene to directly generate vehicle control signals from the flies. The use of the Fly Algorithm is not strictly restricted to stereo images, as other sensors may be added (e.g. acoustic proximity sensors, etc.) as additional terms to the fitness function being optimised. Odometry information can also be used to speed up the updating of flies' positions, and conversely the flies positions can be used to provide localisation and mapping information. Another application field of the Fly Algorithm is reconstruction for emission Tomography in nuclear medicine. The Fly Algorithm has been successfully applied in single-photon emission computed tomography and positron emission tomography . Here, each fly is considered a photon emitter and its fitness is based on the conformity of the simulated illumination of the sensors with the actual pattern observed on the sensors. Within this application, the fitness function has been re-defined to use the new concept of 'marginal evaluation'. Here, the fitness of one individual is calculated as its (positive or negative) contribution to the quality of the global population. It is based on the leave-one-out cross-validation principle. A global fitness function evaluates the quality of the population as a whole; only then the fitness of an individual (a fly) is calculated as the difference between the global fitness values of the population with and without the particular fly whose individual fitness function has to be evaluated. In the fitness of each fly is considered as a `level of confidence'. It is used during the voxelisation process to tweak the fly's individual footprint using implicit modelling (such as metaballs). It produces smooth results that are more accurate. More recently it has been used in digital art to generate mosaic-like images or spray paint. Examples of images can be found on YouTube == Parisian evolution == Here, the population of individuals is considered as a society where the individuals collaborate toward a common goal. This is implemented using an evolutionary algorithm that includes all the common genetic operators (e.g. mutation, cross-over, selection). The main difference is in the fitness function. Here two levels of fitness function are used: A local fitness function to assess the performance of a given individual (usually used during the selection process). A global fitness function to assess the performance of the whole population. Maximising (or minimising depending on the problem considered) this global fitness is the goal of the population. In addition, a diversity mechanism is required to avoid individuals gathering in only a few areas of the search space. Another difference is in the extraction of the problem solution once the evolutionary loop terminates. In classical evolutionary approaches, the best individual corresponds to the solution and the rest of the population is discarded. Here, all the individuals (or individuals of a sub-group of the population) are collated to build the problem solution. The way the fitness functions are constructed and the way the solution extraction is made are of course problem-dependent. Examples of Parisian Evolution applications include: The Fly algorithm. Text-mining. Hand gesture recognition. Modelling complex interactions in industrial agrifood process. Positron Emission Tomography reconstruction. == Disambiguation ==