
Explore six bio-inspired artificial intelligence algorithms, with hands-on implementations and case studies on flight optimization, nutrition planning, handwriting classification, antibody and antigen adaptation, timetable, and shortest path.
Explore a case study in bio-inspired artificial intelligence on flight schedule optimization using a genetic algorithm to minimize waiting time and costs for six travelers meeting in Rome.
Explore a case study of genetic algorithms in Google Colab, learn to represent the problem, and create variables to model people and airports for round-trip flights to Rome.
Load the flights dataset into a dictionary keyed by origin–destination, with values [departure, arrival, price], and build and query the schedule using for loops and setdefault for later optimization.
Print a structured flight schedule, including origin, destination, times, and prices, and prepare data for a genetic algorithm to optimize the best set of flights.
Learn to convert hours and minutes to total minutes and implement a minutes-getting function to estimate airport waiting time, guiding later genetic algorithm optimization.
Implement a fitness function to evaluate flight schedules, computing total price and waiting time using last arrival and first departure values.
Finish implementing the fitness function to minimize total price and waiting time for airline trips. Use a genetic algorithm to evaluate solutions by total weight and price across flights.
Learn how genetic algorithms generate an initial population, evaluate fitness, select parents using roulette or elitism, and apply crossover and mutation to create new generations toward a stopping criterion.
Develop and implement a mutation function as a genetic operator, selecting a random gene within the domain, applying a probability threshold, and ensuring bounds are respected.
Implement the crossover function by selecting a middle cut point and merging segments from two solutions, parameterized by a domain for flexible usage.
Implement a complete genetic algorithm by setting domain, population size, elitism, generations, and mutation probability; initialize the random population and select top solutions for the next generation.
Explore completing a complete genetic algorithm by selecting parents with elitism, applying crossover and mutation, and guiding a population toward minimizing airport wait times and ticket prices.
Finish the genetic algorithm by applying crossover and mutation to a 100-solution population with elitism of 20, producing 80 new individuals toward the best solution.
Explore differential evolution, a bio-inspired optimization algorithm for real-valued vectors. Use a single variation operator with arithmetic vector updates and three hyperparameters: crossover probability, differential weight, and population size.
The lecture explains the structure of differential evolution: random generation of candidate vectors and forming trial vectors by combining three population vectors, replacing parents when the trial is fitter.
Learn how the variation operator in differential evolution creates a trial vector by combining a parent vector with three random vectors, and replaces the parent only if fitness improves.
Compare genetic algorithms and differential evolution, detailing GA's crossover and mutation versus DE's trial vector from a parental vector and A, B, C, with one-by-one fitness-based replacement.
Apply the inferential evolution algorithm to a nutrient allocation problem, using an objective function to match 30% protein, 15% fat, and 55% carbohydrates with five foods.
Create a candidate nutrient solution by implementing a function that generates random nutrient combinations for five foods, while setting hyperparameters like crossover rate and plotting results.
Create a function that generates a population of vectors, i.e., candidate solutions, with a specified number of individuals and random solutions, then prepare to evaluate their fitness in next lecture.
Learn to design a fitness function that evaluates dish combinations against target percentages for protein, lipids, and carbohydrates, computing deviations to guide optimization.
Build a function to select three distinct random vectors from a population, excluding the parental vector, using random selection and removal to ensure uniqueness.
Create the variation operator for differential evolution by combining parental vectors a, b, and c with cr and mutation, using absolute values to form trial vectors.
Selects the best vector from a population by returning the base vector with the lowest fitness. Tests with ten individuals reveal the best vector and its 6.78 fitness.
Run the algorithm by initializing a population of five individuals, generating a trial vector via mutation, and replacing parents when fitter, while printing the best vector and fitness per iteration.
Build a solution graph for the differential evolution algorithm, plotting best fitness across iterations to show convergence, and visualize a nutrient allocation of 54.97% carbohydrates, 30% proteins, and 50% lipids.
Explore the biological fundamentals of human neural networks, including over 100 billion interconnected neurons and how information flows via electrical signals and chemical substances.
Learn how a single layer perceptron uses inputs and a step function to produce outputs, trains by updating weights with error, and distinguishes linearly separable logic like and/or.
Explore how multilayer neural networks extend perceptrons with a hidden layer, feedforward processing, and sigmoid activation to solve nonlinearly separable problems using weighted connections.
Learn how to calculate error (loss) in neural networks by comparing predictions to outputs, using a perceptron approach with sigmoid activation, and how reducing this error guides weight updates.
Explore gradient descent and derivative calculations to optimize neural network weights, minimize the cost function, and reach the global minimum.
Explore the delta parameter in adjusting neural network weights using sigmoid activation and partial derivatives, computing output and hidden layer deltas to guide updates from output to input.
Backpropagate to adjust weights in a multi-layer neural network, propagating errors from output to input and updating via gradients, learning rate, momentum, and epochs.
Explore bias units and intercepts, error metrics like mean squared error and RMSE, gradient descent types batch, stochastic, and mini-batch, and activation functions step, sigmoid, relu, and softmax.
Implement a case study of artificial neural networks using the digits dataset, training a TensorFlow model in Google Colab, and preprocess 28 by 28 images into 784-feature vectors.
Pre-process the images by converting pixel values from 0–255 to 0–1 for efficient neural network calculations. Apply one-hot encoding for digits 0–9 and use softmax activation in multi-class output layer.
Train a neural network with a 784-input layer, a 397-unit hidden layer with relu, and a 30-unit softmax output, using categorical cross-entropy and Adam for digits, batch 128, 50 epochs.
Evaluate a neural network by analyzing loss and accuracy across epochs, comparing training and testing data, and inspecting predictions on 28x28 images to assess performance.
Load the image with opencv, convert to grayscale, reshape to 28 by 28 with one channel, normalize to 0–1, and use softmax to predict the digit (example: three).
Explore the clonal selection algorithm, inspired by the immune system, evolving antibody populations through affinity-driven cloning and hyper mutation for classification, pattern detection, anomaly detection, and optimization.
Generate an antibody population, select top antibodies by affinity, clone them proportionally to affinity, and apply hyper mutation inversely to affinity across iterations guided by a fitness function.
Explore calculating the cloning factor for antibody populations, selecting top antibodies, substituting others, and cloning best antibodies to form the new generation using the provided formula.
Calculate the hyper mutation rate by tying antibody affinity to mutation probability, illustrated with 60% and 80% affinities and a mutation factor beta.
Apply the clonal selection algorithm to a digit recognition project that evolves binary pixel antibodies in an 11x11 image to match a given antigen and maximize affinity.
Explore antibody function through a clonal selection approach to digit creation and recognition, generating random 121-character antibodies of zeros and ones, and implementing a function to produce them.
Create a function that generates a population of candidate antibody solutions for the quantum selection algorithm. It demonstrates a population with a chosen size and multiple random antibodies.
Define the affinity fitness function to evaluate candidate solutions by comparing antibody and antigen positions and computing a score that can reach 121.
Build an antigen antibody affinity list for the clonal selection algorithm. Generate affinities for a population of antibodies and prepare for the next lecture on selecting the best antibodies.
Select the best antibodies from a population by sorting affinities in descending order and returning the top n defined by the user, illustrated with a 20-member population.
Build a function to clone the best antibodies according to cloning count and affinity, using list comprehensions to generate clones and evaluate affinities.
Implement a hyper mutation function for antibodies, where mutation probability scales with affinity, mutating low-affinity antibodies more than high-affinity ones using clones and a mutation factor.
Run the bio-inspired AI algorithm to find the best antibodies and solutions with a 30-member population, 800 iterations, cloning and hyper mutation, verifying increasing affinities toward the antigen.
We build a solution graph for digital generation or recognition using the clonal selection algorithm, showing the first antibody’s fitness across iterations and noting logarithmic growth with inverse hyper mutation.
Explore particle swarm optimization, inspired by collective animal behavior, to solve nonlinear continuous function problems and optimize antenna design, energy systems, and animations.
Explore the particle swarm optimization algorithm, including initializing a random swarm, evaluating fitness, tracking personal bests and global best, updating velocity and position, and stopping criteria.
Explore how a swarm of particles is represented for optimization, with each particle storing previous position, current position, and velocity, and learn about personal best and global best particles.
Identify each particle's personal best (pbest) and the swarm's global best (gbest) to guide velocity and position updates across iterations.
Compute the new velocity using inertia, cognitive and social weights, and random factors, guided by personal best and global best, then update the particle’s position by adding this velocity.
Show graphical representation of updating a particle's position and velocity via inertia, memory, and swarm influence, with random factors shaping the update. See how the new velocity and position emerge.
Explore a case study of particle swarm optimization solving a three-class time allocation problem, distributing 13 course hours across six time slots to maximize watched time and fitness values.
Introduce the particle swarm optimization algorithm, set hybrid inertia and cognitive and social weights, and define a particle function with position and velocity across six dimensions.
Define a function population that takes quant as the number of particles and returns the particle population. Demonstrate with a 20-individual population showing the first and second particles.
Define a per-position fitness function for a particle, evaluating hours for three classes, normalizing by dividing by 39 to a 0–1 score, and set to 0.01 if hours exceed 13.
Define a personal best position (pbest) function for particles using previous and current positions and velocity, compare fitness values, and prepare for the global best.
Implement a global best (gbest) finder by aggregating personal bests, selecting the best among them, and testing with a 20-particle population, preparing for velocity updates.
Implement a velocity update function for a particle by combining v with cognitive and social terms using pbest and gbest to compute and apply the new velocity.
Update particle positions by adding the computed velocity to each particle’s current position within a population, creating a new particle state using the new velocity.
Run a 100-iteration loop on a 20-member population to optimize time allocation by tracking the best solution and its fitness, which nears 0.89 and about 13 hours.
The final lecture on particle swarm optimization builds and plots the solution graph, updates the population and best fitness, and visualizes how solution quality evolves across iterations.
Explore ant colony optimization inspired by ants' foraging behavior, pheromone trails, and evaporation to model and solve problems like the traveling salesman.
Ants explore randomly, then reinforce shorter food paths with stronger pheromone trails as evaporation fades longer routes, creating a positive feedback that guides edge choice in a traveling salesman problem.
Explore the ferryman update in colony optimization for the TSB problem, detailing how pheromone deposition and evaporation update edge strengths using the inverse path length as the deposit.
Calculate the probability of choosing each edge from a node by multiplying the edge's pheromone deposit by the inverse edge length, then normalize across all edges.
Discover how ant colony optimization uses pheromones, edge lengths, and attractiveness to guide path choices. Observe pheromone updates and evaporation across iterations toward the shortest path.
Explore a directed shortest-path case study on a four-node graph (A, B, C, D) with edge lengths to find the shortest path from A to B in Google Collect.
Explore seven edges with names, adjacency, length, and thermal levels to model a graph for optimizing the best pair, including non-object-oriented representation.
Develop a function to compute the probability of choosing each edge from pheromones and edge quality. Show how to use those probabilities to select among adjacent edges, with example distributions.
Learn to implement a roulette wheel selection to choose an edge from adjacent options using a probability list and thresholds.
Implement a parameterless function to generate an ant-like path by using starters as the first edges, building a path through adjacent edges with random choices, and terminating when path completes.
Develop a path length function that iterates edges, sums pheromone-weighted distances, and returns the total length. Demonstrate with an example that the path A–B–D equals 60.
Derive two functions to update pheromone levels on edges using evaporation, the current concentration, and pheromones deposited by ants in the current iteration.
Run the ant-inspired algorithm by looping iterations, applying evaporation, and using five ants per cycle to reinforce edges with pheromones. AB and BD dominate paths, guiding the shortest path.
Explore a five-node graph with more than ten edges, modeling directed edges and pheromone levels starting at one to advance a bio-inspired optimization algorithm.
Run the optimization algorithm with five nodes and extra edges, adjust the end function to target E, and observe pheromone reinforcement highlighting AB, BD, and E as the shortest route.
Recap the course highlights: genetic algorithm and differential evolution, neural networks theory with hand-written digit classification, colonial selection algorithm, particle swarm optimization for class scheduling, and shortest-path optimization.
Join AI Expert Academy to access machine learning, deep learning, computer vision, natural language processing, and algorithms through online courses with certificates. Benefit from monthly new content and practical demonstrations.
Nature offers a wide range of inspirations for biological processes to be incorporated into technology and computing. Some of these processes and patterns have been inspiring the development of algorithms that can be used to solve real-world problems. They are called bio-inspired algorithms, whose inspiration in nature allows for applications in various optimization and classification problems.
In this course, you will learn the theoretical and mainly the practical implementation of the main and mostly used bio-inspired algorithms! By the end of the course you will have all the tools you need to build artificial intelligence solutions that can be applied to your own problems! The course is divided into six sections that cover different algorithms applied in real-world case studies. See below the projects that will be implemented step by step:
Genetic Algorithms (GA): It is one of the most used and well-known bio-inspired algorithm to solve optimization problems. It is based on biological evolution in which populations of individuals evolve over generations through mutation, selection, and crossing over. We will solve the flight schedule problem and the goal is to minimize the price of air line tickets and the time spend waiting at the airport.
Differential Evolution (DE): It is also inspired in biological evolution and the case study we will solve step by step is the creation of menus, correctly balancing the amount of carbohydrates, proteins and fats.
Neural Networks (ANN): It is based on how biological neurons work and is considered one of the most modern techniques to solve complex problems, such as: chatbots, automatic translators, self driving cars, voice recognition, among many others. The case study will be the creation of a neural network for image classification.
Clonal Selection Algorithm (CSA): It is based on the functioning of the optimization of the antibody response against an antigen, resembling the process of biological evolution. These concepts will be used in practice for digit identification and digit generation.
Particle Swarm Optimization (PSO): It relies on the social behavior of animals, in which the swarm tries to find the best solution to a specific problem. The problem to be solved will be the timetable: there is a course, people who want to take it and different timetables. In the end, the algorithm will indicate the best times for each class to take the course.
Ant Colony Optimization (ACO): It is based on concepts of how ants search for food in nature. The case study will be one of the most classic in the area, which is the choice of the shortest path.
Each type of problem requires different techniques for its solution. When you understand the intuition and implementation of bio-inspired algorithms, it is easier to identify which techniques are the best to be applied in each scenario. During the course, all the code will be implemented step by step using the Python programming language! We are going to use Google Colab, so you do not have to worry about installing libraries on your machine, as everything will be developed online using Google's GPUs!