The Wayback Machine - https://web.archive.org/web/20240901173140/https://www.geeksforgeeks.org/cat-swarm-optimization/
Open In App

Cat Swarm Optimization

Last Updated : 28 Nov, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Nature is replete with social compartments to carry out various jobs. Even if the final goal of all persons and collective conduct is survival, for various reasons: hunting, protection, navigation and foraging animals work and interact in groups, herds, schools, colonies and flocks. It is very interesting that creatures find the optimal situations and perform tasks efficiently in groups. It is clear that such optimal and efficient conduct has been evolved throughout the millennia. So we inspire them to fix our issues is fairly logical. This is the main aim of a study field called swarm intelligence (SI). Many algorithms have been proposed in the field of swarm intelligence (SI) e.g. Ant Colony Optimization (ACO), Particle Swarm Optimization (PSO), Grey Wolf Optimizer (GWO) etc. 

In this article, we shall discuss the Cat Swarm Optimization technique which is a swarm-based optimization.

Inspiration:

Cat Swarm Optimization is clearly inspired by the behaviour of cats in the real world. According to biology, there are about 32 different cat species from lions to cheetahs and from tigers to domestic cats. Even though they live in quite different environments many behavioural attributes are similar. Despite being in most times inactive, cats have a strong curiosity.

Before defining the mathematical model of the algorithm, one must know that there are two different states of being for any cat.

  1. Seeking mode: Cats are inactive in this state i.e. resting, looking around or in a state to move to another location.
  2. Tracking mode: Cats are active in this state i.e. they change their current position.

Mathematical Model:

Let’s define the model of cat swarm optimization. Every cat in a solution space has its own N dimensions dN, velocity for each dimension v_{i,d}        , a flag that suggests whether the cat is in either of the two modes (seeking or tracking) and finally a fitness value that represents the accommodation of cats to the fitness function.

We desire to find the optimal position for a cat.

Seeking mode: As already mentioned cats in this state are inactive. This mode has four essential factors namely: seeking memory pool (SMP), seeking a range of the selected dimension (SRD), counts of dimension to change (CDC), and self-position considering (SPC).

  • SMP: Defines the memory for each cat indicating the points pursued by a cat.
  • SRD: declares the mutative ratio for the selected dimensions.
  • CDC: How many dimensions will be varied is indicated by this factor.
  • SPC: Whether the position at which the cat is already placed will be a candidate point for a cat to move to. It is a Boolean value (either true or false).

NOTE: Regardless of the value of SPC the value of SMP is not influenced.

1. If SPC is True Then
        j=SMP
    Else
        j=SMP-1
2. Present position of cat Ck is copied j times.
3. Depending on the value of CDC the value of SRD is either decremented or incremented.
4. Calculate the Fitness value (FV) of all candidate points.
5. If all the FV are not equal, FV are converted to selection probability:
    P_i = \frac{|FV_i - FV_b|}{FV_{max}-FV_{min}}     where i ranges in (0,j)     FV_b can be set to FV_{max} or FV_{min} depending on the goal of fitness function either     maximize or minimize. 6. Randomly select the candidate points and replace the current position of cat Ck.

Tracing mode: Once a cat is in tracing mode, the cat is assigned with its velocity as v_{i,d}        .

1. Update the velocities of each cat according to:
    v_{k,d} = v_{k,d} + c_1.r_1(X_{best,d}-X_{k,d})where d ranges in [1,N]    X_{k,d} = X_{k,d} + v_{k,d}    c1 is a constant, r1 ranges in [0,1] and X_{k,d} and X_{best,d} are the position of cat Ck in     dimension d and the position of a cat with the best FV respectively.2. If v_{k,d} > v_{max} Then        v_{k,d} = v_{max}    Else        v_{k,d} = v_{k,d}

CSO algorithm

In order to merge both the modes, we must keep in mind that the cats spend most of the time in seeking mode. Therefore, we define a mixture ratio (MR) that suggests how much of either of the modes to take into account while performing CSO. It is quite evident that we must keep the value of MR very low to account for cats spending the most time in seeking mode.

1. Create M cats.
2. Randomly drop the M cats in N dimensional solution space. Assign the velocities of each cat in 
   accordance to v_{max}.3. Distribute the cats to tracing mode according to MR and rest to seeking mode.4. Apply the position of the cat X_{k,d} into the fitness function and calculate the fitness value FV.5. Move the cats according to their flag value. If Ck is in tracing mode apply the tracing mode    process to it, if not then apply seeking mode process.6. Redistribute the cats according to MR.7. Repeat from step 4 to 6 until termination condition is met.

By applying the CSO we get the X_{best,d}         which is the position of a cat with the best FV.

This is how the CSO algorithm works.

Reference:

https://link.springer.com/chapter/10.1007/978-3-540-36668-3_94



Similar Reads

Particle Swarm Optimization (PSO) - An Overview
The process of finding optimal values for the specific parameters of a given system to fulfill all design requirements while considering the lowest possible cost is referred to as an optimization. Optimization problems can be found in all fields of science. Conventional optimization algorithms (Deterministic algorithms) have some limitations such a
3 min read
Implementation of Particle Swarm Optimization
Previous article Particle Swarm Optimization - An Overview talked about inspiration of particle swarm optimization (PSO) , it’s mathematical modelling and algorithm. In this article we will implement particle swarm optimization (PSO) for two fitness functions 1) Rastrigin function 2) Sphere function. The algorithm will run for a predefined number o
7 min read
How To Make Counts Appear In Swarm Plot For Seaborn?
Swarm plots, a type of dot plot, effectively visualize data distribution within categories. Unlike standard dot plots, swarm plots avoid overlapping points, making it easier to see individual values. However, including the count of data points in each category can further enhance the plot's clarity. This article will guide you through the process o
3 min read
Bee Swarm with SHAP Values for Random Forest in R
SHAP values offer a potent technique for the interpretability of predictions and shed light on where each feature is guiding the outcome. One can better understand the importance and interactions of features by visualizing these SHAP values using bee swarm plots. The following article is a step-by-step guide on how to use SHAP values in the interpr
5 min read
Uni-variate Optimization vs Multivariate Optimization
Wikipedia defines optimization as a problem where you maximize or minimize a real function by systematically choosing input values from an allowed set and computing the value of the function. That means when we talk about optimization we are always interested in finding the best solution. So, let say that one has some functional form(e.g in the for
4 min read
Hyperparameter Optimization Based on Bayesian Optimization
In this article we explore what is hyperparameter optimization and how can we use Bayesian Optimization to tune hyperparameters in various machine learning models to obtain better prediction accuracy. Before we dive into the how's of implementing Bayesian Optimization, let us learn what is meant by hyperparameters and hyperparameter optimization. H
7 min read
Optimization techniques for Gradient Descent
Gradient Descent is a widely used optimization algorithm for machine learning models. However, there are several optimization techniques that can be used to improve the performance of Gradient Descent. Here are some of the most popular optimization techniques for Gradient Descent: Learning Rate Scheduling: The learning rate determines the step size
4 min read
ML | ADAM (Adaptive Moment Estimation) Optimization
Prerequisite: Optimization techniques in Gradient Descent Gradient Descent is applicable in the scenarios where the function is easily differentiable with respect to the parameters used in the network. It is easy to minimize continuous functions than minimizing discrete functions. The weight update is performed after one epoch, where one epoch repr
2 min read
Introduction to Ant Colony Optimization
The algorithmic world is beautiful with multifarious strategies and tools being developed round the clock to render to the need for high-performance computing. In fact, when algorithms are inspired by natural laws, interesting results are observed. Evolutionary algorithms belong to such a class of algorithms. These algorithms are designed so as to
6 min read
Uni-variate Optimization - Data Science
Optimization is an important part of any data science project, with the help of optimization we try to find the best parameters for our machine learning model which will give the minimum loss value. There can be several ways of minimizing the loss function, However, generally, we use variations of the gradient method for our optimization. In this a
6 min read
Multivariate Optimization and its Types - Data Science
Wikipedia defines optimization as a problem where you maximize or minimize a real function by systematically choosing input values from an allowed set and computing the value of the function. That means when we talk about optimization we are always interested in finding the best solution. So, let say that one has some functional form(e.g in the for
4 min read
Multivariate Optimization - KKT Conditions
What's a multivariate optimization problem? In a multivariate optimization problem, there are multiple variables that act as decision variables in the optimization problem. z = f(x1, x2, x3.....xn) So, when you look at these types of problems a general function z could be some non-linear function of decision variables x1, x2, x3 to xn. So, there ar
4 min read
Multivariate Optimization - Gradient and Hessian
In a multivariate optimization problem, there are multiple variables that act as decision variables in the optimization problem. z = f(x1, x2, x3.....xn) So, when you look at these types of problems a general function z could be some non-linear function of decision variables x1, x2, x3 to xn. So, there are n variables that one could manipulate or c
3 min read
Unconstrained Multivariate Optimization
Wikipedia defines optimization as a problem where you maximize or minimize a real function by systematically choosing input values from an allowed set and computing the value of the function. That means when we talk about optimization we are always interested in finding the best solution. So, let say that one has some functional form(e.g in the for
4 min read
Multivariate Optimization with Equality Constraint
Wikipedia defines optimization as a problem where you maximize or minimize a real function by systematically choosing input values from an allowed set and computing the value of the function. That means when we talk about optimization we are always interested in finding the best solution. So, let say that one has some functional form(e.g in the for
5 min read
How to Implement Various Optimization Algorithms in Pytorch?
Optimization algorithms are an essential aspect of deep learning, and PyTorch provides a wide range of optimization algorithms to help us train our neural networks effectively. In this article, we will explore various optimization algorithms in PyTorch and demonstrate how to implement them. We will use a simple neural network for the demonstration.
6 min read
Grey wolf optimization - Introduction
Optimization is essentially everywhere, from engineering design to economics and from holiday planning to Internet routing. As money, resources and time are always limited, the optimal utilization of these available resources is crucially important. In general, an optimization problem can be written as optimize [Tex]f_1(x), ..., f_i(x), ..., f_N(x)
5 min read
Whale Optimization Algorithm (WOA)
The step-by-step procedure to obtain an optimum value (maximum or minimum) of an objective function is called an Optimization Algorithm. Meta-heuristic optimization algorithms are becoming more and more popular in engineering applications because they: rely on rather simple concepts and are easy to implementdo not require gradient informationcan by
3 min read
Henry gas solubility optimization
The method of identifying optimal settings for the specific parameters of a particular process of fulfilling all design objectives while considering the lowest feasible cost is referred to as an optimization. Problems with optimization can be seen in all areas science, so it is vital to design new optimization algorithms. Otherwise, standard optimi
4 min read
Brain storm optimization
Optimization is usually tasked to identify the best solution(s) for some specific problem. A problem with optimization in Rn or simply a problem with optimization is [Tex]f: R_n \rightarrow R_m [/Tex] , whereby Rn and Rm represent decision space and objective space respectively. The fitness value or fitness value vector in the target area are conne
5 min read
Implementation of Teaching Learning Based Optimization
The previous article Teaching Learning Based Optimization (TLBO) talked about the inspiration of teaching learning-based optimization, it's mathematical modeling and algorithms. In this article we will implement Teaching learning-based optimization (TLBO) for two fitness functions 1) Rastrigin function 2) Sphere function. The algorithm will run for
7 min read
Dragon fly Optimization
Due to its simplicity, easy operation, capacity to protect against local optima, and the problem of derivatives free, Metaheuristic was frequently employed throughout the previous three decades. Exploration and exploitation are two fundamental metaheuristic features. The first one shows how the algorithm is capable of detecting new search areas, wh
4 min read
A Brief Introduction to Proximal Policy Optimization
Proximal Policy Optimisation (PPO) is a recent advancement in the field of Reinforcement Learning, which provides an improvement on Trust Region Policy Optimization (TRPO). This algorithm was proposed in 2017, and showed remarkable performance when it was implemented by OpenAI. To understand and appreciate the algorithm, we first need to understand
4 min read
Pathfinder Optimization Algorithm
Nature is full of social behaviours for performing different tasks. Although the ultimate goal of all individuals and collective behaviours is survival, creatures cooperate and interact in groups, herds, schools, colonies, and flocks for several reasons: hunting, defending, navigating, and foraging. In order to mimic these characteristics of animal
3 min read
Implementation of Henry gas solubility optimization
Article Henry gas solubility optimization (HGSO) talked about the inspiration of Henry gas solubility optimization, its mathematical modelling and algorithm. In this article, we will implement Henry gas solubility optimization (HGSO) for the Sphere fitness function. Sphere Fitness function Sphere function is a standard function for evaluating the p
5 min read
CatBoost Bayesian optimization
Bayesian optimization is a powerful and efficient technique for hyperparameter tuning of machine learning models and CatBoost is a very popular gradient boosting library which is known for its robust performance in various tasks. When we combine both, Bayesian optimization for CatBoost can offer an effective, optimized, memory and time-efficient ap
10 min read
CatBoost Optimization Technique
In the ever-evolving landscape of machine learning, staying ahead of the curve is essential. One such revolutionary optimization technique that has been making waves in the data science community is CatBoost. Developed by Yandex, a leading Russian multinational IT company, CatBoost is a high-performance, open-source library for gradient boosting on
7 min read
Optimization in Neural Networks and Newton's Method
In machine learning, optimizers and loss functions are two components that help improve the performance of the model. A loss function measures the performance of a model by measuring the difference between the output expected from the model and the actual output obtained from the model. Mean square loss, hinge loss, and log loss are some examples o
12 min read
Hyperparameters Optimization methods - ML
In this article, we will discuss the various hyperparameter optimization techniques and their major drawback in the field of machine learning. What are the Hyperparameters?Hyperparameters are those parameters that we set for training. Hyperparameters have major impacts on accuracy and efficiency while training the model. Therefore it needed to be s
7 min read
Optimization Rule in Deep Neural Networks
In machine learning, optimizers and loss functions are two components that help improve the performance of the model. By calculating the difference between the expected and actual outputs of a model, a loss function evaluates the effectiveness of a model. Among the loss functions are log loss, hinge loss, and mean square loss. By modifying the mode
13 min read
Article Tags :
Practice Tags :