# Exploring Diffusion Models for
Unsupervised Video Anomaly Detection

###### Abstract

This paper investigates the performance of diffusion models for video anomaly
detection (VAD) within the most challenging but also the most operational
scenario in which the data annotations are not used. As being sparse, diverse,
contextual, and often ambiguous, detecting abnormal events precisely is a very
ambitious task. To this end, we rely only on the information-rich spatio-
temporal data, and the reconstruction power of the diffusion models such that
a high reconstruction error is utilized to decide the abnormality. Experiments
performed on two large-scale video anomaly detection datasets demonstrate the
consistent improvement of the proposed method over the state-of-the-art
generative models while in some cases our method achieves better scores than
the more complex models. This is the first study using a diffusion model and
examining its parameters’ influence to present guidance for VAD in
surveillance scenarios. ††© 2023 IEEE. Personal use of this material is
permitted. Permission from IEEE must be obtained for all other uses, in any
current or future media, including reprinting/republishing this material for
advertising or promotional purposes, creating new collective works, for resale
or redistribution to servers or lists, or reuse of any copyrighted component
of this work in other works.

Index Terms—  Anomaly Detection, unsupervised learning, video understanding,
imbalanced data

##  1 Introduction

Automated video anomaly detection (VAD) has become an essential task in the
computer vision community as a consequence of the exponential increase in the
number of videos being captured. VAD is relevant to several applications in
intelligent surveillance, and behavior understanding [1, 2, 3, 4, 5, 6], to
name a few. Anomaly is commonly defined as a rare or unexpected or unusual
entity, that diverges significantly from normality, which is defined as
expected and common. Despite being sparse and diverse, the abnormal events are
also very contextual, and often ambiguous, thus they challenge the performance
of the VAD models [7].

Data labeling is already a notoriously expensive and time-consuming task and
considering the aforementioned characteristics of the abnormal events, it is
almost infeasible to collect all possible anomaly samples to perform _fully-
supervised_ learning methods. Therefore, a typical approach in VAD, is to
train a _one-class_ classifier that learns from the _normal_ training data [8,
9, 10]. However, the data collection problem occurring for fully-supervised
learning almost remains for the one-class classifier, since it is unfeasible
to have access to every variety of normal training data, given the dynamic
nature of real-world applications and the wide range of normal classes [4, 5].
In a one-class classifier setting, it is highly possible that an unseen normal
event can be misclassified as abnormal since its representation is remarkably
different from the representations learned from normal training data.

The data availability problem led some researchers to define the weakly
supervised VAD, which does not rely on fine-grained per-frame annotations but
wields the video-level labels [11, 12]. In detail, in fully-supervised VAD
each _individual frame_ has an annotation as normal or abnormal. Instead, in
weakly supervised VAD, a _video_ is labeled as anomalous even if only one
frame of it is anomalous, and labeled as normal when all frames of it are
normal. Even though performing such annotations seems relatively cheaper, it
is important to notice that, in the weekly supervised setting, (a) labeling a
video as normal still requires inspection of whole frames (similar to the
fully-supervised setting), and (b) such methodologies often fail to localize
the abnormal portion of the video, which can be impractical, e.g., when the
video footage is long.

Fig. 1: The proposed method takes a batch of unlabeled video clips as the
input and learns to determine whether each frame is anomalous or exhibits
normal behavior. Our model is a generative one, which leverages the
reconstruction capability of diffusion models for unsupervised VAD. Mean
Squared Error ($MSE$) distribution over a batch is used in conjunction with a
data-driven threshold to decide which frames are anomalous. For the purpose of
clarity, we show only one video clip.

Recently, Zaheer et al. [13] defined _unsupervised_ VAD, which takes
_unlabelled_ videos as the input and learns to make the decision of anomaly or
normality for each frame. Such a fashion is undoubtedly more challenging
compared to fully, weakly, and one-class counterparts, but it literally brings
in the advantage of not requiring data annotations at all. It is worth
differentiating the definition of unsupervised VAD [13] from one-class VAD
since the latter is being referred to as unsupervised in some studies [14, 15,
10, 16, 17, 18]. In the case of one-class VAD, the training data distribution
represents only the normality, meaning that there still exists a notion of
labeling. Whereas the implementation of _unsupervised_ VAD [13] does not make
any assumption regarding the distribution of the training data, and never uses
the labels for model training, instead, it relies only on the spatiotemporal
features of the data.

In this study, we perform _unsupervised VAD_ by leveraging the information-
rich unlabelled videos. To do so, we only depend on the reconstruction
capability of the diffusion models [19] (see Fig. 1 for the proposed method’s
description). This is the first attempt that the effectiveness of the
diffusion models is being investigated for VAD in surveillance scenarios. The
aim of this work is to present an exploratory study: (a) to understand whether
diffusion models can be effectively used for unsupervised VAD, and (b) to
discover the behavior of the diffusion model [19] in terms of several
parameters of it for VAD. Experimental analysis performed on two large-scale
datasets: UCF-Crime [2] and ShanghaiTech [3], demonstrate that the proposed
approach always performs better than the state-of-the-art (SOTA) generative
model of VAD. Moreover, in some cases, the proposed method is able to surpass
more complex SOTA methods [13, 20]. The code of our method and the SOTA [13]
is publicly available HERE.

##  2 Related Work

Anomaly detection is a widely studied topic that regards several tasks such as
medical diagnosis, fault detection, animal behavior understanding, and fraud
detection. Interested readers can refer to a recent survey: [4]. Below, our
review focuses on VAD in _surveillance scenarios_. We also present the
definition and notations of diffusion models and state the methodology we
follow for VAD.

Video Anomaly Detection in Surveillance Scenarios. VAD has been typically
solved as an outlier detection task (i.e., one-class classifier), in which a
model is learned from the normal training data (requiring data annotations),
and during testing, an abnormality is detected with the approaches such as
distance-based [21], reconstruction-based [8] or probability-based [22]. Such
approaches might result in an ineffective classifier since they exclude the
abnormal classes during training. This might occur particularly when a
sufficient amount of data representing each variety of the normal class cannot
be used in training. An alternative approach is using _unlabelled_ training
data without assuming any normalcy [13], referred to as _(fully) unsupervised
VAD_. Unlike one-class classifiers, unsupervised VAD does not require data
labeling and can potentially generalize well by not excluding the abnormal
data from training. Zaheer et al. [13] proposed a Generative Cooperative
Learning composed of a generator and a discriminator mutually being trained
together with the negative learning paradigm. The generator which is an
autoencoder reconstructs the normal and abnormal representations while using
the negative learning approach to help the discriminator to estimate the
probability of an instance being abnormal with a data-driven threshold. That
approach [13] conforms that anomalies are less frequent than normal events and
events are often temporally consistent. In this study, we follow the
unsupervised VAD definition in [13]. Unlike [13], our method relies only on a
generative architecture, which is based on a diffusion model. We, first time
in this study, investigate the effectiveness of the diffusion models for VAD
in surveillance scenarios, by reporting how individual parameters affect the
model performance, and by comparing them with the SOTA.

Diffusion Models. Diffusion models (DMs) [23, 24] are a type of generative
model that gains the ability to generate diverse samples by corrupting
training samples with noise and learning to reverse the process. These models
have achieved SOTA performance in tasks such as text-to-image synthesis [25],
semantic editing [26], and audio synthesis [27]. They have also been used in
representation learning for discriminative tasks like object detection [28],
image segmentation [29], and disease detection [30]. This study is the first
attempt to apply DMs for video anomaly detection.

DMs are formulated as a progressive addition of Gaussian noise of standard
deviation $\sigma$ to an input data point $x_{T}$ sampled from a distribution
$p_{data}(x)$ with standard deviation $\sigma_{data}$. The noised distribution
$p(x,\sigma)$, for $\sigma\gg\sigma_{data}$, becomes isotropic Gaussian and
allows to sample a point $x_{0}\sim\mathcal{N}(0,\sigma_{max}\mathbf{I})$.
This point is gradually denoised with noise levels
$\sigma_{0}=\sigma_{max}>\sigma_{T-1}>\dots>\sigma_{1}>\sigma_{T}=0$ into new
samples distributed according to the dataset distribution. DMs are trained
with Denoising Score Matching [31], where a denoiser function
$D_{\theta}(x;\sigma)$ minimizes the expected $L_{2}$ denoising error for
samples drawn from $p_{data}$ for every $\sigma$:

$\mathbb{E}_{x\sim
p_{data}}\mathbb{E}_{\epsilon\sim\mathcal{N}(0,\sigma\mathbf{I)}}||D_{\theta}(x+\epsilon;\sigma)-x||^{2}_{2},\vspace{-0.1cm}$
(1)

and the score functions used in the reverse process become:

$\vspace{-0.1cm}\nabla\log
p(x;\sigma)=(D_{\theta}(x;\sigma)-x)s/\sigma^{2}.\vspace{-0.1cm}$ (2)

In this paper, we adapt the diffusion model of [19], whose details are
described in the next section.

Table 1:  The design choice of _k-diffusion_. $T$ is the Number of Function
Evaluations (NFEs) executed during sampling. The corresponding sequence of
time steps is $\\{t_{0},t_{1},\dots,t_{T}\\}$, where $t_{T}=0$. $F_{\theta}$
represents the raw neural network.

Sampling |
---|---
ODE solver | LMS
Time steps | $({\sigma_{max}}^{\frac{1}{\rho}}+\frac{i}{T-1}({\sigma_{min}}^{\frac{1}{\rho}}-{\sigma_{max}}^{\frac{1}{\rho}}))^{\rho}$
Network and preconditioning |
Architecture of $F_{\theta}$ | Any, MLP in our case
Skip scaling $c_{\text{skip}}(\sigma)$ | $\sigma_{data}^{2}/\left(\sigma^{2}+\sigma_{data}^{2}\right)$
Output scaling $c_{\text{out}}(\sigma)$ | $\sigma\cdot\sigma_{data}/\sqrt{\sigma_{data}^{2}+\sigma^{2}}$
Input scaling $c_{\text{in}}(\sigma)$ | $1/\sqrt{\sigma^{2}+\sigma_{data}^{2}}$
Noise cond. $c_{\text{noise}}(\sigma)$ | $\frac{1}{4}\ln(\sigma)$
Training |
Noise distribution | $\ln(\sigma)\sim\mathcal{N}(P_{\text{mean}},P_{\text{std}}^{2})$
Loss weighting | $\left(\sigma^{2}\\!+\\!\sigma_{data}^{2}\right)/(\sigma\cdot\sigma_{data})^{2}$

##  3 Method

Given a video clip, we first extract features from a 3D-CNN ($F$) both in
training and testing. These features are supplied to the generator, which is a
diffusion model, to reconstruct them without using the labels. We follow the
diffusion model variant proposed in [19] and refer to it as k-diffusion. It
disentangles the design choices of previous diffusion models and provides a
framework where each component can be adjusted separately, as shown in Table
1. In particular, Karras et al. [19] exposes the issue of expecting the
network $D_{\theta}$ to work well in high noise regimes, i.e. when
$\sigma_{t}$ is high. To solve this, k-diffusion proposes a $\sigma$-dependent
skip connection, allowing the network to perform $x_{0}$ or
$\epsilon$-prediction, or something in between based on the noise magnitude.
The denoising network $D_{\theta}$, therefore, is formulated as follows:

$D_{\theta}(x;\sigma)=c_{\text{skip}}(\sigma)~{}x+c_{\text{out}}(\sigma)~{}F_{\theta}\big{(}c_{\text{in}}(\sigma)~{}x;~{}c_{\text{noise}}(\sigma)\big{)}\text{,}\vspace{-0.1cm}$
(3)

where $F_{\theta}$ becomes the effective network to train, $c_{skip}$
modulates the skip connection, $c_{in}(\cdot)$ and $c_{out}(\cdot)$ scale
input and output magnitudes, and $c_{noise}(\cdot)$ scales $\sigma$ to become
suitable as input for $F_{\theta}$.

Algorithm 1 Anomaly detection with denoising diffusion

1:Batch of video clips $x$, feature extractor network $F$, denoising network
$D$, denoising step $t$, threshold sensitivity $k$

2:fea = $F(x)$ # Feature extraction with the backbone $F$

3:$\epsilon\sim\mathcal{N}(0,\textbf{I})$ # Noise sampling for _k-diffusion_

4:$\text{fea}_{t}=\text{fea}+\epsilon*\sigma_{t}$ # Diffusion input corruption

5:$\hat{\text{fea}}=sampling(\text{D}(\text{fea}_{t},\sigma_{t}))$ #
Reconstruction of a feature vector with _k-diffusion_ algorithm

6:$L_{b}=MSE(\text{fea},\hat{\text{fea}})$ # Reconstruction loss computation

7:$L_{th}=\mu_{p}+k\sigma_{p}$ # Data-driven threshold $L_{th}$

8:$\text{If }L_{th}<L_{b}$ then abnormal, otherwise normal  # $L_{b}$ is the
loss in a batch

9:Return Normal or Abnormal

Several hyperparameters control the diffusion process in k-diffusion, and we
extensively explore the role of training noise – distributed according to a
log-normal distribution with parameters $(P_{mean},P_{std})$ – and sampling
noise with boundary values of $\sigma_{min}$ and $\sigma_{max}$. These
distributions are crucial choices depending on the task and on the dataset
[32]. Given we use diffusion models on an unprecedented task and on new
datasets we do not rely on parameters from literature, instead, we perform an
extensive study of the correlation between noise and performance on the task
in Sec. 4.2.

The reverse process of a DM does not need to start from noise with variance
$\sigma^{2}_{max}$ but it can place at any arbitrary step $t\in(0,T)$, with
$\sigma^{2}_{max}=\sigma^{2}_{0}$ as shown in [26]. Given a real data point
$x$, we can sample $x_{t}\sim\mathcal{N}(x,\sigma_{t}\mathbf{I})$ and then
apply the reverse process to $x_{T}$. This allows for retaining part of the
information of the original data point – the low-frequency component – and
removing the high-frequency component. We exploit this property to remove the
components associated with abnormal parts of the clip by adding Gaussian
noise. Then, we measure the goodness of reconstruction using mean squared
error (MSE), meaning that a high reconstruction error might indicate the
presence of abnormal activity. The choice of the starting point $t$ for this
procedure is a crucial hyperparameter of the method, as it controls the
realism-faithfulness tradeoff as described in [26]. Refer to Sec. 4.2
presenting a study to understand the influence of this tradeoff on VAD.

We adopt [13] to decide whether a video frame is anomalous. In detail, the
decision for a single video frame is made by keeping the distribution of the
reconstruction loss ($MSE$) of each instance over a batch. The feature vectors
resulting in higher loss refer to anomalous and smaller loss refers to normal
while this decision is made through a data-driven threshold ($L_{th}$),
defined as $L_{th}$ $=$ $\mu_{p}$ $+$ $k$ $\sigma_{p}$ where $k$ is a
constant, $\mu_{p}$ and $\sigma_{p}$ are the mean and standard deviations of
the $MSE$ loss for each batch. The anomaly detection phase is given in
Algorithm 1.

Table 2: Performance comparisons with the SOTA on (a) UCF-Crime [2] and (b)
ShanghaiTech [3] datasets. The best results are in bold. The second best
results are underlined. The full model of [13] includes generator, negative
learning, and discriminator. ⋆ indicates our implementation since the
corresponding code is not publicly available. The results indicated with ⋄
were taken from [13].

Method | Feature | AUC (%)
---|---|---
Kim et al. [20]⋄ | 3D-ResNext 101 | 52.00
Autoencoder [13] | 3D-ResNext 101 | 56.32
Autoencoder [13]⋆ | 3D-ResNext 101 | 56.27
Full model [13] | 3D-ResNext 101 | 68.17
Full model [13]⋆ | 3D-ResNext 101 | 58.30
Proposed w/ [33] | 3D-ResNext101 | 59.42
Proposed | 3D-ResNext 101 | 62.91
Autoencoder [13]⋆ | 3D-ResNet18 | 49.78
Full model [13]⋆ | 3D-ResNet18 | 56.86
Proposed w/ [33] | 3D-ResNet18 | 60.52
Proposed | 3D-ResNet18 | 65.22

(a) Results on UCF-Crime [2]

Method | Feature | AUC (%)
---|---|---
Kim et al. [20]⋄ | 3D-ResNext 101 | 56.47
Autoencoder [13] | 3D-ResNext 101 | 62.73
Autoencoder [13]⋆ | 3D-ResNext 101 | 62.05
Full model [13] | 3D-ResNext 101 | 72.41
Full model [13]⋆ | 3D-ResNext 101 | 65.62
Proposed w/ [33] | 3D-ResNext101 | 62.41
Proposed | 3D-ResNext 101 | 68.88
Autoencoder [13]⋆ | 3D-ResNet18 | 69.02
Full model [13]⋆ | 3D-ResNet18 | 71.20
Proposed w/ [33] | 3D-ResNet18 | 74.23
Proposed | 3D-ResNet18 | 76.10

(b) Results on ShanghaiTech [3]

##  4 Experimental Analysis and Results

As the evaluation metric, we use the area under the Receiver Operating
Characteristic (ROC) curve (AUC), which is computed based on frame-level
annotations of the test videos of the datasets, in line with the prior arts.
To evaluate and compare the performance of the proposed method, experiments
are conducted on two large-scale unconstrained datasets: UCF-Crime [2] and
ShanghaiTech [3]. The UCF-Crime dataset [2] is collected from various CCTV
cameras, having different field-of-views. It is composed of in total 128 hours
of videos with the annotation of 13 different real-world anomalous events such
as road accidents, stealing, and explosion. We use the standard training (810
abnormal and 800 normal videos, without using the labels) and testing (130
abnormal and 150 normal videos) splits of the dataset to provide fair
comparisons with SOTA. ShanghaiTech dataset [3] is captured in 13 different
camera angles with complex lighting conditions. We use the training split that
contains 63 abnormal and 174 normal videos and the testing split composed of
44 abnormal and 154 normal videos curated in line with SOTA.

We use 3D-ResNext101 and 3D-ResNet18 as feature extractors $F$ due to their
popularity in VAD [4, 5, 13]. 3D-ResNext101 has a dimensionality of 2048, and
3D-ResNet18 has 512 dimensions. The denoising network $D$ is an MLP with an
encoder-decoder structure. The encoder is composed of 3 layers of size {1024,
512, 256} while the decoder has the structure of {256, 512, 1024}. The
learning rate scheduler and EMA of the model are taken as the default values
of k-diffusion, with an initial learning rate of $2\times 10^{-4}$ and
InverseLR scheduling; weight decay is set at $1\times 10^{-4}$. Segment size
for feature extraction is set to 16 non-overlapping frames and the training is
performed up to 50 epochs with a batch size of 8192 in line with [13]. The
timestep $\sigma_{t}$ is transformed via Fourier embedding and integrated into
the network through FiLM layers [34] both in the encoder and the decoder
segments of the network. The hyperparameters (e.g., $P_{mean}$, $P_{std}$,
$t$) used to realize _k-diffusion_ are given in Sec. 4.2.

###  4.1 Comparisons with State-Of-The-Art (SOTA)

The performance of the proposed method is compared with the SOTA [20, 13] in
Table 2. Kim et al. [20] proposed a one-class VAD method, which was then
adopted to perform _unsupervised_ VAD in [13]. In our comparisons, we use the
unsupervised version of [20]. The proposed approach surpasses [20] within a
large margin of: 10.91-12.41% AUC. The comparisons between the proposed method
and the autoencoder of [13] demonstrate that as a generative model, the
proposed method is more favorable than [13] by better performing VAD within a
margin of: 6.15-14.44% AUC. When the features extracted from 3D-ResNext101 are
used, the full model of [13] achieves better results than the proposed method.
This is rather not surprising given that the full model of [13] is more
complex than a generative model (i.e., autoencoder or diffusion model) since
it additionally includes a discriminator and a negative learning component.
Importantly, when 3D-ResNet18 is used as the backbone, the proposed method
exceeds the full model of [13] within a large margin of: 4.9-8.36% AUC. Such
results confirm the remarkable effectiveness of _k-diffusion_ to perform VAD.

###  4.2 Diffusion Model Analysis

Below, the effect of different hyperparameters of _k-diffusion_ model and a
comparative study regarding timestep embeddings are given.
Noise. The training and sampling noise distributions are not independent in
_k-diffusion_ model, and we computed the relation between $(P_{mean},P_{std})$
and $(\sigma_{min},\sigma_{max}$) to be governed by the following formula:
$\sigma_{max},\sigma_{min}=e^{P_{mean}\pm 5P_{std}}$. This allows us to
restrict our search to two parameters instead of four. We also extracted the
formula using the default parameters of k-diffusion:
$P_{mean}=-1.2,P_{std}=1.2,\sigma_{min}=0.02$ and $\sigma_{max}=80$. The
corresponding results are given in Fig. 2 when the $k$ of $L_{th}$ is taken as
1 for ShanghaiTech dataset [3] with 3D-ResNet18. One can observe that, in
general, a smaller value of $P_{mean}$ leads to higher results. This shows
that we perform diffusion in a latent space that is well-behaved, and
therefore a lower amount of noise is needed to reach an isotropic Gaussian
distribution.
Starting point of the reverse process. Similar to SDEdit [26] and their
realism-faithfulness tradeoff, we explore the effect of different $t$ as the
starting point of the reverse process. Recall that $\sigma_{t}>\sigma_{t+1}$
means that a $t$ close to zero indicates a noised $x_{t}$ closer to isotropic
Gaussian, instead for $t$ closer to $T$ means, the features used are closer to
the original data distribution. We target to find the best value of $t$ such
that sufficient information about the structure of the clip is retained while
the information about the possible anomaly is destroyed. In this way, one can
obtain a higher reconstruction error, leading to deciding the associated video
frame as anomalous. The corresponding results are given in Fig. 2 when $k$ of
$L_{th}$ is 1. $t=best$ refers to the best results obtained from $t=0$ to
$t=9$, given a fixed $P_{mean},P_{std}$ combination. For ShanghaiTech with
3D-ResNet18 backbone, the majority of the time the starting point $t=4$
results in the best performances. The best of all results was observed when
$t=6$. For all other datasets, and backbone combinations, the best results
were obtained with $t=9$. Overall, increasing the $t$ value for a fixed
combination of $P_{mean},P_{std}$ improves the VAD results.
Threshold $L_{th}$. Given the abnormality threshold $L_{th}$ $=$ $\mu_{p}$ $+$
$k$ $\sigma_{p}$, the effect of $k$ was investigated by setting its value to:
0.1, 0.3, 0.5, 0.7, and 1. For 3D-ResNext101, the best results correspond to
$k$=0.5 for both ShanghaiTech and UCF Crime. For 3D-ResNet18, $k$=0.7 and 0.1
for ShanghaiTech and UCF Crime, respectively, result in the best scores. The
difference between the highest and lowest performances upon changing the value
of $k$ is up to 3% AUC when the values of all other hyperparameters are kept
the same.
Timestep embeddings. As mentioned before, our method includes transforming the
timestep $\sigma_{t}$ via Fourier embedding and integrating it into the
network through FiLM layers [34]. We also adopted the implementation of [33],
which concatenates the timestep embeddings together with its sinus and cosinus
values (shown as Proposed w/ [33] in Table 2). The results confirm the better
performance of our proposal _wrt_ to adapting [33] for all cases while both
surpassing the SOTA with the 3D-ResNet18 features.

Fig. 2: The effect of noise and the starting point of the reverse process
while performing _k-diffusion_ for VAD. The results (AUC %) belong to
ShanghaiTech dataset [3] with 3D-ResNet18 backbone. Fig. 3: Predicted frame-
level anomaly scores (black), predicted starting frames of an anomaly interval
(red arrow), predicted highest anomaly score in an interval (blue arrow),
ground-truth anomalies (yellow shadows), spatial reasoning of the anomaly
(orange boxes).

###  4.3 Qualitative Results

Fig. 3 shows the anomaly scores produced by our approach for example video
clips. As seen, independent of the type of anomaly, the anomaly scores
increase immediately when ground-truth anomalies start and decrease right
after the ground-truth anomalies finish, showing that the proposed method is
favorable for VAD.

##  5 Conclusion

Unsupervised video anomaly detection (VAD) presents the advantage of not
requiring data annotation for learning. This solves the problems posed by the
heterogeneity of normal and anomalous instances and the scarcity of anomalous
data. This paper is the first attempt to investigate the capability of
diffusion models for VAD in video surveillance in which we have specifically
investigated the use of high reconstruction error as an indicator of
abnormality. The experiments performed on popular benchmarks show that the
proposed model achieves better performance compared to SOTA generative model:
autoencoders independent of the feature extractor used. Our model, although
relying only on the reconstruction of the spatial-temporal data, is able, in
some cases, to surpass the performance of more complex methods, e.g. the ones
performing collaborative learning of generative and discriminative networks.
We have also presented a guideline on how the diffusion models (particularly
the _k-diffusion_ [19] formulation) should be utilized in terms of its several
parameters for VAD. The future work includes investigating the generalization
ability of our method in cross-dataset settings.

##  6 Acknowledgment

We acknowledge the support of the MUR PNRR project FAIR - Future AI Research
(PE00000013) funded by the NextGenerationEU. E.R. is partially supported by
the PRECRISIS, funded by the EU Internal Security Fund (ISFP-2022-TFI-AG-
PROTECT-02-101100539). The work was carried out in the Vision and Learning
joint laboratory of FBK and UNITN.

## References

  * [1] Sabah Abdulazeez Jebur, Khalid A Hussein, Haider Kadhim Hoomod, Laith Alzubaidi, and José Santamaría,  “Review on deep learning approaches for anomaly event detection in video surveillance,”  Electronics, vol. 12, no. 1, pp. 29, 2022.
  * [2] W. Sultani, C. Chen, and M. Shah,  “Real-world anomaly detection in surveillance videos,”  in CVPR, 2018, pp. 6479–6488.
  * [3] W. Liu, D. Lian W. Luo, and S. Gao,  “Future frame prediction for anomaly detection – a new baseline,”  in Proc. CVPR, 2018.
  * [4] V. Chandola, A. Banerjee, and V. Kumar,  “Anomaly detection: A survey,”  ACM CSUR, vol. 41, no. 3, pp. 1–58, 2009.
  * [5] Bahram Mohammadi, Mahmood Fathy, and Mohammad Sabokrou,  “Image/video deep anomaly detection: A survey,”  arXiv preprint arXiv:2103.01739, 2021.
  * [6] Cigdem Beyan and Robert B Fisher,  “Detecting abnormal fish trajectories using clustered and labeled data,”  in ICIP, 2013, pp. 1476–1480.
  * [7] Jing Ren, Feng Xia, Yemeng Liu, and Ivan Lee,  “Deep video anomaly detection: Opportunities and challenges,”  in ICDM workshops, 2021, pp. 959–966.
  * [8] Mahdyar Ravanbakhsh, Moin Nabi, Enver Sangineto, Lucio Marcenaro, Carlo Regazzoni, and Nicu Sebe,  “Abnormal event detection in videos using generative adversarial nets,”  in ICIP, 2017, pp. 1577–1581.
  * [9] M. Sabokrou, M. Fayyaz, M. Fathy, and R. Klette,  “Deep-cascade: Cascading 3d deep neural networks for fast anomaly detection and localization in crowded scenes,”  IEEE TIP, vol. 26, no. 4, pp. 1992–2004, 2017.
  * [10] Muhammad Zaigham Zaheer, Jin-ha Lee, Marcella Astrid, and Seung-Ik Lee,  “Old is gold: Redefining the adversarially learned one-class classifier training paradigm,”  in CVPR, 2020, pp. 14183–14193.
  * [11] Snehashis Majhi, Srijan Das, and François Brémond,  “Dam: Dissimilarity attention module for weakly-supervised video anomaly detection,”  in AVSS, 2021, pp. 1–8.
  * [12] Yu Tian, Guansong Pang, Yuanhong Chen, Rajvinder Singh, Johan W Verjans, and Gustavo Carneiro,  “Weakly-supervised video anomaly detection with robust temporal feature magnitude learning,”  in ICCV, 2021, pp. 4975–4986.
  * [13] M Zaigham Zaheer, Arif Mahmood, M Haris Khan, Mattia Segu, Fisher Yu, and Seung-Ik Lee,  “Generative cooperative learning for unsupervised video anomaly detection,”  in CVPR, 2022, pp. 14744–14754.
  * [14] Dong Gong, Lingqiao Liu, Vuong Le, Budhaditya Saha, Moussa Reda Mansour, Svetha Venkatesh, and Anton van den Hengel,  “Memorizing normality to detect anomaly: Memory-augmented deep autoencoder for unsupervised anomaly detection,”  in CVPR, 2019, pp. 1705–1714.
  * [15] Hyunjong Park, Jongyoun Noh, and Bumsub Ham,  “Learning memory-guided normality for anomaly detection,”  in CVPR, 2020, pp. 14372–14381.
  * [16] Muhammad Zaigham Zaheer, Jin-Ha Lee, Arif Mahmood, Marcella Astrid, and Seung-Ik Lee,  “Stabilizing adversarially learned one-class novelty detection using pseudo anomalies,”  IEEE TIP, vol. 31, pp. 5963–5975, 2022.
  * [17] Pascal Schneider, Jason Rambach, Bruno Mirbach, and Didier Stricker,  “Unsupervised anomaly detection from time-of-flight depth images,”  in CVPR workshops, June 2022, pp. 231–240.
  * [18] ZhenJiang Li, Wenbo Yang, Guangli Wu, and Liping Liu,  “Unsupervised video anomaly detection based on sparse reconstruction,”  in BDCPS. Springer, 2021, pp. 994–1001.
  * [19] T. Karras, M. Aittala, Timo Aila, and Samuli Laine,  “Elucidating the design space of diffusion-based generative models,”  in NeurIPS, 2022.
  * [20] J.-H. Kim, D.-H. Kim, S. Yi, and T. Lee,  “Semi-orthogonal embedding for efficient unsupervised anomaly segmentation,”  arXiv preprint:2105.14737, 2021.
  * [21] Bharathkumar Ramachandra, Michael Jones, and Ranga Vatsavai,  “Learning a distance function with a siamese network to localize anomalies in videos,”  in WACV, 2020, pp. 2598–2607.
  * [22] Ryota Hinami, Tao Mei, and Shin’ichi Satoh,  “Joint detection and recounting of abnormal events by learning deep generic knowledge,”  in ICCV, 2017, pp. 3619–3627.
  * [23] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli,  “Deep unsupervised learning using nonequilibrium thermodynamics,”  in ICML, 2015, pp. 2256–2265.
  * [24] J. Ho, A. Jain, and P. Abbeel,  “Denoising diffusion probabilistic models,”  NeurIPS, vol. 33, pp. 6840–6851, 2020.
  * [25] Chitwan Saharia, William Chan, and Saurabh et al. Saxena,  “Photorealistic text-to-image diffusion models with deep language understanding,”  arXiv preprint arXiv:2205.11487, 2022.
  * [26] C. Meng, Y. He, Y. Song, J. Song, J. Wu, J.-Y. Zhu, and S. Ermon,  “Sdedit: Guided image synthesis and editing with stochastic differential equations,”  in ICLR, 2021.
  * [27] Curtis Hawthorne, Ian Simon, and Adam et al. Roberts,  “Multi-instrument music synthesis with spectrogram diffusion,”  arXiv preprint arXiv:2206.05408, 2022.
  * [28] S. Chen, P. Sun, Y. Song, and P. Luo,  “Diffusiondet: Diffusion model for object detection,”  arXiv preprint:2211.09788, 2022.
  * [29] Zhangxuan Gu, Haoxing Chen, Zhuoer Xu, and Lan et al.,  “Diffusioninst: Diffusion model for instance segmentation,”  arXiv preprint:2212.02773, 2022.
  * [30] Julia Wolleb, Florentin Bieder, Robin Sandkühler, and Philippe C Cattin,  “Diffusion models for medical anomaly detection,”  in MICCAI. Springer, 2022, pp. 35–45.
  * [31] Aapo Hyvärinen and Peter Dayan,  “Estimation of non-normalized statistical models by score matching.,”  JMLR, vol. 6, no. 4, 2005.
  * [32] Ting Chen,  “On the importance of noise scheduling for diffusion models,”  arXiv preprint arXiv:2301.10972, 2023.
  * [33] Shitong Luo and Wei Hu,  “Diffusion probabilistic models for 3d point cloud generation,”  in Proc. CVPR, 2021, pp. 2837–2845.
  * [34] Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville,  “Film: Visual reasoning with a general conditioning layer,”  in Proc. AAAI, 2018, vol. 32.


# Egret Swarm Optimization Algorithm: An Evolutionary Computation Approach for
Model Free Optimization

Zuyan Chen, Adam Francis, Shuai Li, Bolin Liao, Dunhui Xiao Zuyan Chen, Adam
Francis, and Shuai Li are with School of Engineering, Faculty of Science and
Engineering, Swansea University, Swansea, SA1 8EN, UK. E-mails:
<EMAIL_ADDRESS>(Zuyan, Chen<EMAIL_ADDRESS>(Adam
Francis<EMAIL_ADDRESS>(Shuai Li); Bolin Liao is with School of
Information Science and Engineering, Jishou University, Jishou, 416000, Hunan,
China; Dunhui Xiao is with School of Mathematical Sciences,Tongji University,
Shanghai, P.R. China,200092; E-mail<EMAIL_ADDRESS>
###### Abstract

A novel meta-heuristic algorithm, Egret Swarm Optimization Algorithm (ESOA),
is proposed in this paper, which is inspired by two egret species’ (Great
Egret and Snowy Egret) hunting behavior. ESOA consists of three primary
components: Sit-And-Wait Strategy, Aggressive Strategy as well as Discriminant
Conditions. The performance of ESOA on 36 benchmark functions as well as 2
engineering problems are compared with Particle Swarm Optimization (PSO),
Genetic Algorithm (GA), Differential Evolution (DE), Grey Wolf Optimizer
(GWO), and Harris Hawks Optimization (HHO). The result proves the superior
effectiveness and robustness of ESOA. The source code used in this work can be
retrieved from
https://github.com/Knightsll/Egret_Swarm_Optimization_Algorithm;
https://ww2.mathworks.cn/matlabcentral/fileexchange/115595-egret-swarm-
optimization-algorithm-esoa.

###### Index Terms:

Egret Swarm Optimization Algorithm, Meta-Heuristic Algorithm, Constrained
Optimization, Swarm Intelligence.

##  I Introduction

Figure 1: The main framework of ESOA.

General engineering applications involving manipulator control, path planning,
and fault diagnosis can be described as optimization problems. Since these
problems are almost non-convex, conventional gradient approaches are difficult
to apply and frequently result in local optima [1]. In recent years, due to
the global optimal, gradient-free, and high-efficiency properties, meta-
heuristics algorithms have been utilized to solve practical engineering
problems.

Meta-heuristic algorithms imitate natural phenomena through simulating animal
and other environmental behaviours. These algorithms are broadly inspired by
three concepts: species evolution, biological behavior, and physical
principles [2]. Evolution-based algorithms generate various status solution
spaces via mimicking species evolution’s diversity, cross-mutation, and
Survival of the fittest. The Darwinian evolution-inspired Genetic Algorithm
(GA) has remarkable global search capabilities and has been applied in a
variety of disciplines [3]. Comparable to GA, Differential Evolution (DE) has
also demonstrated strong adaptiveness in a variety of optimizations [4].
Physics-based approaches apply the physical law as a way to achieve an optimal
solution. The Simulated Annealing (SA) [5], Gravitational Search Algorithm
(GSA) [6], Black Hole Algorithm (BH) [7], and Multi-Verse Optimizer (MVO) [8]
are the common methods of this type.

The biological behavior-based algorithms mimic organisms’ behavior such as
predation, pathfinding, growth, and aggregation in order to solve numerical
optimization problems. Particle Swarm Optimation (PSO), a swarm intelligence
algorithm inspired by bird flocking behavior, is the typical representative
[9]. PSO leverages the exchange of information among individuals in a
population to develop the entire population’s motion from disorder to order in
the problem-solving space, resulting in an optimal solution. Moreover, [10]
was inspired by the behaviour of ant colonies, proposing the Ant Colony
Optimization (ACO) algorithm. ACO indicates a feasible solution to the
optimization problem in terms of the ant pathways, with shorter paths
depositing more pheromones. The concentration of pheromone collecting on the
shorter pathways steadily rises over time, and the entire ant colony will
focus on the optimal path due to the influence of positive feedback.

With the widespread application of PSO and ACO in areas such as robot control,
route planning, artificial intelligence, and combinatorial optimization,
heuristic algorithms have spawned a plethora of excellent research. [11]
presented Grey Wolf Optimizer (GWO) based on the hierarchy and hunting
mechanism of grey wolves. [12] applied GWO to restructure a maximum power
extraction model for a photovoltaic system under a partial shading situation.
GWO also was utilized in nonlinear servo systems in order to tune the Takagi-
Sugeno parameters of the proportional-integral-fuzzy controller [13]. [14]
introduced the sparrow search algorithm (SSA) inspired by sparrows’ collective
behavior, foraging, and anti-predation activities. [15] suggested a novel
incremental generation model based on a chaotic sparrow search algorithm to
handle large-scale data regression and classification challenges. An
integrated optimization model for dynamic reconfiguration of active
distribution networks was built with multi-objective SSA by [16]. [17]
constructed a tiny but efficient meta-heuristic algorithm named Beetle
Antennae Search Algorithm (BAS), through modeling the beetle’s predatory
behavior. [18] integrated BAS with a recurrent neural network to create a
novel robot control framework for redundant robotic manipulator trajectory
planning and obstacle avoidance. [19] applied BAS to optimize the initial
parameters of the convolutional neural network for medical imaging diagnosis,
demonstrating excellent accuracy and the short period of tuning time.

Although meta-heuristics algorithms have achieved marvelous performance in
various engineering applications, as Wolpert analyses in [20], there is no
near-perfect method that can deal with all optimization problems. To put it
another way, if an algorithm is appropriate for one class of optimization
problems, it may not be acceptable for another. Alternatively, the search
efficiency of an algorithm is inversely related to its computational
complexity, and a certain amount of computational consumption needs to be
sacrificed in order to enhance search efficiency. The No Free Lunch (NFL)
theorem has assured that the field has flourished, with new structures and
frameworks for meta-heuristics algorithms constantly emerging.

This paper proposes a novel meta-heuristic algorithm (Egret Swarm Optimization
Algorithm, ESOA) to examine how to improve the balance between the algorithm’s
exploration and exploitation. The rest of the paper is structed as follows:
Section 2 depicts the observation of egret migration behavior as well as the
development of the ESOA framework and mathematical model. The comparison of
performance and efficiency in CEC1997 and CEC2017 between ESOA and other
algorithms is demonstrated in Section 3. The result and convergence of two
engineering optimization problems utilizing ESOA are discussed in Section 4.
Section 5 represents the conclusion of this paper as well as outlines further
work.

##  II Egret Swarm Optimization Algorithm

This section reveals the inspiration of ESOA. Then, the mathematical model of
the proposed method is discussed.

###  II-A Inspiration

The egret is the collective term for four bird species: the Great Egret, the
Middle Egret, the Little Egret, and the Yellow-billed Egret, all of which are
known for their magnificent white plumage. The majority of egrets inhabit
coastal islands, coasts, estuaries, and rivers, as well as lakes, ponds,
streams, rice paddies, and marshes near their shores. Egrets are usually
observed in pairs, or in small groups, however vast flocks of tens or hundreds
can also be spotted [21, 22, 23]. Maccarone observed that Great Egret fly at
an average speed of 9.2m/s and balance their movements and energy expenditure
whilst hunting [24]. Due to the high consumption of energy when flying, the
decision to prey typically necessitates a thorough inspection of the
trajectory to guarantee that it may obtain more energy through the location of
food than what would be expended through flight. Compared to Great Egrets,
Snowy Egrets tend to sample more sites, and they will observe and select the
location where other birds have already discovered food [25]. Snowy Egrets
often adopt a sit-and-wait strategy, a scheme that involves observing the
behavior of prey for a period of time and then anticipating its next move in
order to hunt with the least energy expenditure [28]. Maccarone indicated in
[27] that not only do Snowy Egrets which apply the strategy consume less
energy, but they are also 50% more efficient at catching prey than other
egrets. However, although the Great Egret adopt a higher exertion strategy to
pursue its prey aggressively, they are capable of capturing more plentiful
prey since it is rare for larger prey to travel through an identical place
multiple times [26]. Overall, Great Egrets with aggressive strategies exchange
high energy consumption for potentially greater returns, whereas Snowy Egrets
with a sit-and-wait approach, lower energy expenditure is able to be swapped
for more reliable profits [27].

###  II-B Mathematical Model And Algorithm

Inspired by the Snowy Egret’s Sit-And-Wait strategy and the Great Egret’s
Aggressive strategy, ESOA has combined the advantages of both strategies and
constructed a corresponding mathematical model to quantify the behaviors. As
shown in the Fig. 1, ESOA is a parallel algorithm with three essential
components: the Sit-And-Wait Strategy, the Aggressive Strategy, and the
Discriminant Condition. There are three Egrets in one Egret squad, Egret A
applied guiding forward while Egret B and Egret C adopt random walk and
encircling mechanisms respectively. Each part is detailed below.

####  II-B1 Sit-And-Wait Strategy

Observation Equation: Assuming that the position of the i-th egret squad is
$\mathbf{x}_{i}\in\mathbb{R}^{n}$, $n$ means the dimension of problem,
$A(\ast)$ presents Snowy Egret’s estimate approach of the possible presence of
prey in its own current location. $\hat{y}$ means the estimate value of prey
in current location.

$\hat{y}_{i}=A(\mathbf{x}_{i}),$ (1)

then the estimate method could be parameterized as,

$\hat{y}_{i}=\mathbf{w}_{i}\cdot\mathbf{x}_{i},$ (2)

where the $\mathbf{w}_{i}\in\mathbb{R}^{n}$ is the weight of estimate method.
The error $e_{i}$ could be described as below,

$e_{i}=\left\|\hat{y}_{i}-y_{i}\right\|^{2}/2.$ (3)

Meanwhile, $\hat{\mathbf{g}}_{i}\in\mathbb{R}^{n}$, the practical gradient of
$\mathbf{\omega}_{i}$, could be retrieved via taking the partial derivative of
$\mathbf{\omega}_{i}$ for the error Eq. (3), and its direction is
$\hat{\mathbf{d}}_{i}$.

$\displaystyle\hat{\mathbf{g}}_{i}$
$\displaystyle=\frac{\partial\hat{e}_{i}}{\partial\mathbf{w}_{i}}$ (4)
$\displaystyle=\frac{\partial\left\|\hat{y}_{i}-y_{i}\right\|^{2}/2}{\partial\mathbf{w}_{i}}$
$\displaystyle=(\hat{y}_{i}-y_{i})\cdot\mathbf{x}_{i},$
$\displaystyle\hat{\mathbf{d}}_{i}$
$\displaystyle=\hat{\mathbf{g}}_{i}/\left|\hat{\mathbf{g}}_{i}\right|.$

Figure 2: Following behaviour of egret Swarms as a effective way for gradient
estimation.

Fig.2 demonstrates egret’s following behavior, where egrets refer to better
egrets during preying, drawing on their experience of estimating prey behavior
and incorporating their own thoughts. $\mathbf{d}_{h,i}\in\mathbb{R}^{n}$
means the directional correction of the best location of the squad while
$\mathbf{d}_{g,i}\in\mathbb{R}^{n}$ presents the the directional correction of
the best location of all squad.

$\mathbf{d}_{h,i}=\frac{\mathbf{x}_{ibest}-\mathbf{x}_{i}}{\left|\mathbf{x}_{ibest}-\mathbf{x}_{i}\right|}\cdot\frac{f_{ibest}-f_{i}}{\left|\mathbf{x}_{ibest}-\mathbf{x}_{i}\right|}+\mathbf{d}_{ibest}.$
(5)

$\mathbf{d}_{g,i}=\frac{\mathbf{x}_{gbest}-\mathbf{x}_{i}}{\left|\mathbf{x}_{gbest}-\mathbf{x}_{i}\right|}\cdot\frac{f_{gbest}-f_{i}}{\left|\mathbf{x}_{gbest}-\mathbf{x}_{i}\right|}+\mathbf{d}_{gbest}.$
(6)

The integrated gradient $\mathbf{g}_{i}\in\mathbb{R}^{n}$ could be represented
as below, and $r_{h}\in[0,0.5)$, $r_{g}\in[0,0.5)$:

$\mathbf{g}_{i}=(1-r_{h}-r_{g})\cdot\hat{\mathbf{d}}_{i}+r_{h}\cdot\mathbf{d}_{h,i}+r_{g}\cdot\mathbf{d}_{g,i}.$
(7)

An adaptive weight update method is applied here [29], $\beta_{1}$ is 0.9 and
$\beta_{2}$ is 0.99:

$\displaystyle\mathbf{m}_{i}$
$\displaystyle=\beta_{1}\cdot\mathbf{m}_{i}+(1-\beta_{1})\cdot\mathbf{g}_{i},$
(8) $\displaystyle\mathbf{v}_{i}$
$\displaystyle=\beta_{1}\cdot\mathbf{v}_{i}+(1-\beta_{1})\cdot\mathbf{g}^{2}_{i},$
$\displaystyle\mathbf{w}_{i}$
$\displaystyle=\mathbf{w}_{i}-\mathbf{m}_{i}/\sqrt{\mathbf{v}_{i}}.$

According to Egret A’s judgement of the current situation, the next sampling
location $\mathbf{x}_{a,i}$ could be described as,

$\mathbf{x}_{a,i}=\mathbf{x}_{i}+\exp({-t/(0.1\cdot t_{max})})\cdot 0.1\cdot
hop\cdot\mathbf{g}_{i},$ (9)

$y_{a,i}=f(\mathbf{x}_{a,i}),$ (10)

where $t$ and $t_{m}ax$ presents the current iteration times and the maximum
iteration times, while $hop$ means the gap between the low bound with the up
bound of solution space. $y_{a,i}$ is the fitness of $\mathbf{x}_{a,i}$.

####  II-B2 Aggressive Strategy

Egret B tends to randomly search prey and its behavior could be depicted as
below,

$\mathbf{x}_{b,i}=\mathbf{x}_{i}+\tan{(\mathbf{r}_{b,i})}\cdot hop/(1+t),$
(11)

$y_{b,i}=f(\mathbf{x}_{b,i}),$ (12)

where $\mathbf{r}_{b,i}$ is a random number in $(-\pi/2,\pi/2)$,
$\mathbf{x}_{b,i}$ is Egret B’s expected next location and $y_{b,i}$ means the
fitness.

Egret C prefer to pursue the prey aggressively, so the encircling mechanism is
utlized as the update method of its position:

$\displaystyle\mathbf{D}_{h}$
$\displaystyle=\mathbf{x}_{ibest}-\mathbf{x}_{i},$ (13)
$\displaystyle\mathbf{D}_{g}$
$\displaystyle=\mathbf{x}_{gbest}-\mathbf{x}_{i},$
$\displaystyle\mathbf{x}_{c,i}$
$\displaystyle=(1-\mathbf{r}_{i}-\mathbf{r}_{g})\cdot\mathbf{x}_{i}+\mathbf{r}_{h}\cdot\mathbf{D}_{h}+\mathbf{r}_{g}\cdot\mathbf{D}_{g},$

$y_{b,i}=f(\mathbf{x}_{b,i}).$ (14)

$\mathbf{D}_{h}$ is the gap matrix between current location and the best
position of this egret squad while $\mathbf{D}_{g}$ compares with the best
location of all egret squads. $\mathbf{x}_{c,i}$ means the expected location
of Egret C. $r_{h}$ and $r_{g}$ are random numbers in $[0,0.5)$.

####  II-B3 Discriminant Condition

After each member of the Egret squad has decided on its plan, the squad would
select the optimal option and takes the action together. $\mathbf{x}_{s,i}$ is
the solution matrix of i-th Egret squad:

$\mathbf{x}_{s,i}=\left[\mathbf{x}_{a,i}\qquad\mathbf{x}_{b,i}\qquad\mathbf{x}_{c,i}\right],$
(15)

$\mathbf{y}_{s,i}=\left[y_{a,i}\qquad y_{b,i}\qquad y_{c,i}\right],$ (16)

$c_{i}=argmin(\mathbf{y}_{s,i}),$ (17)

$\mathbf{x}_{i}=\begin{cases}\mathbf{x}_{s,i}|_{c_{i}}\quad
if\quad\mathbf{y}_{s,i}|_{c_{i}}<y_{i}\quad or\quad r<0.3,\\\
\mathbf{x}_{i}\qquad\qquad\quad else\end{cases}.$ (18)

If the minimal value of $\mathbf{y}_{s,i}$ is better than current fitness
$y_{i}$, the Egret squad would accept the choice. Or if the random number
$r\in(0,1)$ is less than 0.3, which means there is 30% possibility to accept a
worse plan.

###  II-C Pseudo Code

Based on the discussion above, the pseudo-code of ESOA is constructed as
Algorithm 1, which contains two main functions to retrieve the Egret squad’s
expected position matrix and a discriminant condition to choose a better
scheme. ESOA requires an initial matrix
$\mathbf{x}^{0}\in\mathbb{R}^{P\text{x}N}$ of the $P$ size Egret Swarm
position as input, while it returns the optimal position $\mathbf{x}_{best}$
and fitness $y_{best}$.

Algorithm 1 Egret Swarm Optimization Algorithm

1:$\mathbf{x}^{0}$: the $P$ size Egret Swarm position
$\in\mathbb{R}^{P\text{x}N}$;

2:$\mathbf{x}_{best}$: Optimal or approximate optimal solution; $y_{best}$:
Optimal or approximate optimal fitness;

3:function Sitandwait($\mathbf{x}$)

4: Update the integrated gradient $\mathbf{g}$ via Eq. (4 to 7)

5: Update the weight of observation method $\omega$ by Eq. (8)

6: Get the expected position $\mathbf{x}_{a}$ of Egret A by Eq.(9)

7: return $\mathbf{x}_{a}$

8:end function

9:function Aggressive($\mathbf{x}$)

10: Get the expected position $\mathbf{x}_{b}$ of Egret B by Eq. (11)

11: Get the expected position $\mathbf{x}_{c}$ of Egret C by Eq. (13)

12: return $\mathbf{x}_{b},\mathbf{x}_{c}$

13:end function

14:while $t<t_{max}$ do

15: $\mathbf{x}^{t}_{a}$ $\leftarrow$ Sitandwait($\mathbf{x}^{t}$)

16: $\mathbf{x}^{t}_{b},\mathbf{x}^{t}_{c}$ $\leftarrow$
Aggressive($\mathbf{x}^{t}$)

17: Get next position $\mathbf{x}^{t+1}$ via Eq. (15) to (18)

18:end while

19:return $\mathbf{x}_{best},y_{best}$

##  III Experimental results and discussions

TABLE I: Unimodal test function Function | Dim | Range | $F_{min}$
---|---|---|---
$F_{1}(x)={\textstyle\sum_{i=1}^{n}x^{2}_{i}}$ | 30 | $[-100,100]$ | 0
$F_{2}(x)=\sum_{i=1}^{n}|x_{i}|+\prod_{i=1}^{n}|x_{i}|$ | 30 | $[-10,10]$ | 0
$F_{3}(x)=\sum_{i=1}^{n}(\sum_{j=1}^{i}x_{j})^{2}$ | 30 | $[-100,100]$ | 0
$F_{4}(x)=max_{i}\\{|x_{i}|,1\leq i\leq n\\}$ | 30 | $[-100,100]$ | 0
$F_{5}(x)=\sum_{i=1}^{n-1}[100(x_{i+1}-x^{2}_{i})^{2}+(x_{i}-1)^{2}]$ | 30 | $[-30,30]$ | 0
$F_{6}(x)=\sum_{i=1}^{n}(\left\lfloor x_{i}+0.5\right\rfloor^{2})$ | 30 | $[-100,100]$ | 0
$F_{7}(x)=\sum_{i=1}^{n}ix_{i}^{4}+random[0,1)$ | 30 | $[-1.28,1.28]$ | 0
TABLE II: Summary of the CEC’17 Test Functions | No. | Functions $(\mathbb{F}_{i})$ | $\mathbb{F}_{min}$
---|---|---|---
Unimodal Functions | 1 | Shifted and Rotated Bent Cigar Function | 100
2 | Shifted and Rotated Zakharov Function | 200
Simple Multimodal Functions | 3 | Shifted and Rotated Rosenbrock’s Function | 300
4 | Shifted and Rotated Rastrigin’s Function | 400
5 |  | Shifted and Rotated Expanded Scaffer’s F6
---
Function
500
6 |  | Shifted and Rotated Lunacek Bi_Rastrigin
---
Function
600
7 |  | Shifted and Rotated Non-Continuous Rastrigin’s
---
Function
700
8 | Shifted and Rotated Levy Function | 800
9 | Shifted and Rotated Schwefel’s Function | 900
Hybrid Functions | 10 | Hybrid Function 1 (N=3) | 1000
11 | Hybrid Function 2 (N=3) | 1100
12 | Hybrid Function 3 (N=3) | 1200
13 | Hybrid Function 4 (N=4) | 1300
14 | Hybrid Function 5 (N=4) | 1400
15 | Hybrid Function 6 (N=4) | 1500
16 | Hybrid Function 6 (N=5) | 1600
17 | Hybrid Function 6 (N=5) | 1700
18 | Hybrid Function 6 (N=5) | 1800
19 | Hybrid Function 6 (N=6) | 1900
Composition Functions | 20 | Composition Function 1 (N=3) | 2000
21 | Composition Function 2 (N=3) | 2100
22 | Composition Function 3 (N=4) | 2200
23 | Composition Function 4 (N=4) | 2300
24 | Composition Function 5 (N=5) | 2400
25 | Composition Function 6 (N=5) | 2500
26 | Composition Function 7 (N=6) | 2600
27 | Composition Function 8 (N=6) | 2700
28 | Composition Function 9 (N=3) | 2800
29 | Composition Function 10 (N=3) | 2900

(a) F1 in CEC 1997

(b) F4 in CEC 1997

(c) $\mathbb{F}_{6}$ in CEC 2017

(d) $\mathbb{F}_{8}$ in CEC 2017

(e) $\mathbb{F}_{22}$ in CEC 2017

(f) $\mathbb{F}_{24}$ in CEC 2017

(g) $\mathbb{F}_{26}$ in CEC 2017

(h) $\mathbb{F}_{28}$ in CEC 2017

Figure 3: (a) and (b) are Unimodal Functions, (c) and (d) are Simple
Multimodal Functions, (e), (f), (g) as well as (h) are Composition Functions
TABLE III: Comparison Of Optimization Results Under The Unimodal Functions
Dimension = 30, Maximum Iterations = 500 F |  | ESOA | PSO[9] | GA[3] | DE[4] | GWO[11] | HHO[32]
---|---|---|---|---|---|---|---
|  | $ave$ | $std$ | $ave$ | std | $ave$ | $std$ | $ave$ | $std$ | $ave$ | $std$ | $ave$ | $std$
$F_{1}$ |  | 0.00E+00 | 0.00E+00 | 1.89E+04 | 1.10E+04 | 8.87E+00 | 1.69E+01 | 7.94E-05 | 1.99E-05 | 8.85E-37 | 5.70E-37 | 1.09E-74 | 1.89E-74
$F_{2}$ |  | 4.92E-184 | 0.00E+00 | 1.12E+03 | 1.61E+02 | 1.76E+00 | 9.19E-01 | 3.25E-02 | 6.06E-03 | 1.64E-22 | 2.84E-22 | 9.03E-43 | 1.56E-42
$F_{3}$ |  | 0.00E+00 | 0.00E+00 | 3.72E+04 | 1.10E+04 | 1.21E+04 | 3.07E+03 | 1.88E+04 | 3.08E+03 | 2.54E-22 | 2.75E-22 | 2.58E-39 | 4.46E-39
$F_{4}$ |  | 3.53E-173 | 0.00E+00 | 2.98E+01 | 6.32E+00 | 2.80E+01 | 2.79E+00 | 2.73E+00 | 1.82E-01 | 5.16E-22 | 3.86E-22 | 2.58E-39 | 4.46E-39
$F_{5}$ |  | 2.81E+01 | 3.46E-01 | 1.01E+10 | 6.31E+09 | 2.55E+03 | 4.34E+03 | 1.75E+02 | 4.59E+01 | 1.24E-21 | 9.80E-22 | 4.96E-38 | 8.00E-38
$F_{6}$ |  | 5.20E+00 | 3.82E-01 | 2.04E+04 | 1.24E+04 | 6.25E-01 | 8.51E-01 | 1.21E-04 | 3.45E-05 | 1.14E-21 | 1.05E-21 | 5.00E-38 | 7.97E-38
$F_{7}$ |  | 2.26E-05 | 2.25E-05 | 7.64E+08 | 5.48E+08 | 3.05E+01 | 3.40E+01 | 1.79E-01 | 2.47E-02 | 4.00E-10 | 6.93E-10 | 4.75E-38 | 8.11E-38
TABLE IV: Comparison Of Optimization Results Under CEC17 Test Functions
Dimension = 30, Maximum Iterations = 500 $\mathbb{F}$ | ESOA |  | PSO[9] |  | GA[3] |  | DE[4] |  | GWO[11] |  | HHO[32] |
---|---|---|---|---|---|---|---|---|---|---|---|---
| $ave$ | $std$ | $ave$ | std | $ave$ | $std$ | $ave$ | $std$ | $ave$ | $std$ | $ave$ | $std$
1 | 1.11E+09 | 2.07E+08 | 5.80E+11 | 1.41E+11 | 1.51E+07 | 2.10E+07 | 6.52E+06 | 3.91E+06 | 2.21E+10 | 1.52E+10 | 4.25E+11 | 1.32E+10
2 | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A
3 | 37289.32 | 6900.14 | 83594.42 | 24578.12 | 158232.44 | 49994.95 | 120278.68 | 8522.19 | 50388.30 | 9531.38 | 86299.93 | 5549.89
4 | 515.24 | 17.97 | 5635.36 | 3472.52 | 583.92 | 39.82 | 546.68 | 7.84 | 619.33 | 93.38 | 9697.10 | 1905.41
5 | 624.51 | 11.18 | 806.12 | 36.59 | 628.97 | 31.19 | 682.86 | 17.12 | 622.88 | 44.97 | 857.15 | 26.65
6 | 642.70 | 6.02 | 680.31 | 4.24 | 642.52 | 5.97 | 612.21 | 1.47 | 625.00 | 7.32 | 691.28 | 8.59
7 | 963.55 | 20.38 | 1976.48 | 473.69 | 1046.79 | 94.89 | 925.90 | 17.28 | 975.61 | 21.04 | 1355.05 | 16.84
8 | 942.24 | 14.78 | 1127.26 | 27.92 | 922.53 | 33.92 | 991.15 | 8.16 | 921.27 | 66.19 | 1105.98 | 20.14
9 | 3423.14 | 1023.40 | 8887.78 | 2054.96 | 2871.54 | 705.51 | 1068.04 | 68.50 | 3224.27 | 1127.23 | 6684.65 | 698.78
10 | 5016.83 | 231.31 | 6076.19 | 630.65 | 4393.26 | 659.06 | 7960.00 | 248.19 | 5755.16 | 1888.33 | 7759.34 | 253.55
11 | 1360.73 | 22.66 | 2034.61 | 340.33 | 8536.84 | 7784.18 | 1450.17 | 40.98 | 1809.70 | 827.89 | 9619.31 | 1658.95
12 | 3.66E+07 | 1.00E+07 | 1.98E+10 | 7.40E+09 | 1.08E+07 | 6.32E+06 | 3.99E+07 | 1.42E+07 | 9.10E+08 | 1.16E+09 | 4.28E+10 | 2.13E+10
13 | 3.73E+06 | 9.01E+05 | 3.51E+10 | 2.95E+10 | 1.89E+05 | 3.41E+05 | 1.16E+07 | 9.36E+06 | 3.77E+06 | 4.84E+06 | 1.86E+10 | 1.23E+10
14 | 4.35E+04 | 4.59E+04 | 7.38E+04 | 4.67E+04 | 1.32E+06 | 1.02E+06 | 1.73E+05 | 4.03E+04 | 9.29E+05 | 1.30E+06 | 6.45E+06 | 4.64E+06
15 | 2.20E+05 | 1.14E+05 | 1.05E+10 | 6.13E+09 | 1.60E+04 | 9.15E+03 | 9.86E+05 | 4.10E+05 | 2.19E+05 | 2.24E+05 | 9.20E+08 | 1.72E+09
16 | 2590.12 | 94.97 | 3767.87 | 573.77 | 3018.88 | 348.22 | 3160.53 | 142.81 | 2478.57 | 326.71 | 5353.46 | 924.34
17 | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A
18 | 1.88E+05 | 6.06E+04 | 4.03E+06 | 6.21E+06 | 4.40E+06 | 3.37E+06 | 2.00E+06 | 4.07E+05 | 1.33E+06 | 1.12E+06 | 2.65E+07 | 2.32E+07
19 | 1.21E+06 | 5.37E+05 | 3.97E+09 | 6.97E+09 | 2.82E+03 | 7.52E+02 | 1.90E+06 | 1.02E+06 | 1.69E+06 | 1.65E+06 | 1.07E+09 | 8.98E+08
20 | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A
21 | 2420.72 | 11.39 | 2574.28 | 66.54 | 2422.36 | 40.61 | 2483.75 | 10.18 | 2408.42 | 32.18 | 2674.48 | 22.91
22 | 2346.94 | 4.66 | 7280.93 | 783.05 | 3996.07 | 2106.12 | 3129.04 | 751.21 | 6665.97 | 1644.22 | 8699.15 | 1063.76
23 | 2811.31 | 13.06 | 3053.03 | 108.80 | 2802.26 | 26.61 | 2838.09 | 8.08 | 2809.62 | 64.69 | 3405.99 | 95.73
24 | 2974.72 | 19.61 | 3195.71 | 49.61 | 2986.88 | 33.57 | 3028.09 | 7.32 | 2992.27 | 53.38 | 3478.17 | 142.44
25 | 2929.65 | 16.14 | 5816.72 | 1718.64 | 2939.10 | 33.40 | 2891.38 | 3.17 | 2984.29 | 26.92 | 4302.69 | 433.31
26 | 3100.04 | 64.72 | 8426.19 | 739.31 | 5729.40 | 313.67 | 5483.57 | 140.53 | 4669.66 | 234.40 | 10614.99 | 1175.87
27 | 3236.51 | 11.52 | 3398.10 | 89.95 | 3250.51 | 17.04 | 3266.37 | 7.45 | 3241.82 | 9.68 | 3993.86 | 217.88
28 | 3310.59 | 11.00 | 6759.69 | 1123.67 | 3312.93 | 29.35 | 3292.70 | 9.67 | 3468.25 | 66.19 | 6214.76 | 303.99
29 | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A

(a) F1 in CEC 1997

(b) F4 in CEC 1997

(c) F7 in CEC 1997

(d) $\mathbb{F}_{4}$ in CEC 2017

(e) $\mathbb{F}_{11}$ in CEC 2017

(f) $\mathbb{F}_{16}$ in CEC 2017

(g) $\mathbb{F}_{21}$ in CEC 2017

(h) $\mathbb{F}_{24}$ in CEC 2017

(i) $\mathbb{F}_{26}$ in CEC 2017

Figure 4: (a), (b), (c) are Unimodal Functions, (d) is Simple Multimodal
Functions, (e) and (f) are Hybrid Functions, (g), (h) as well as (i) are
Composition Functions

In this section, the quantified performance of the ESOA algorithm is retrieved
via examining 36 optimization functions. The first 7 unimodal functions are
typical benchmark optimization problems presented by [30] and the mathematical
expressions, dimensions, the range of solution space as well as the best
fitness are indicated in Table I . The final result and partial convergence
curves are shown in Table III as well as Fig. 4 respectively. The remaining 29
test functions introduced in [31] are constructed by summarizing valid
features from other benchmark problems, such as cascade, rotation, shift as
well as shuffle traps. The overview of these functions are shown in Table II
and the comparison is indicated in Table IV. the whole experiments are in 30
dimensions, and the algorithms utilized are with 50 population sizes and 500
maximum iterations.

Researchers generally classify optimization test functions as Unimodal, Simple
Multimodal, Hybrid Functions, and Composition Functions. As it is shown in
Fig. 3, 3D visualizations of several functions are indicated. As Unimodal
Functions, (a) and (b) are $F_{1}$ as well as $F_{4}$ in CEC 1997, which only
have one global minimum value without local optima. (c) and (d), the Simple
Multimodal problems, retain numerous local optimal solution traps and multiple
peaks to impede the exploration of global optimal search. Hybrid Multimodal
functions are a series of problems adding up several different test functions
with well-designed weights, and due to the dimension restriction, these are
hard to reveal in the 3D graphics. (e), (f), (g) as well as (h) are
Composition Functions, the nonlinear combination of numerous test functions,
extremely hard to optimize because of their local traps in various places and
a variety of spikes to obstacle the algorithm’s derivation.

ESOA was compared with three traditional algorithms (PSO [9], GA [3], DE [4])
as well as two novel methods (GWO [13], HHO [32]) in the 37 benchmark
functions. The numerical result from a maximum of 500 iterations is presented
in Table III and Table IV. The initial input of each algorithm is a random
matrix with 30 dimensions and 50 populations in $[-100,100]$. The specific
variables $w$, $c_{1}$, and $c_{2}$ in PSO are 0.8, 0.5, and 0.5 while the
mutation value is 0.001 in GA.

###  III-A Evaluation Of Exploitation Ability

The Unimodal Function is utilized to evaluate the convergence speed and
exploitation ability of the algorithms, as only one global optimum point is
present. As presented in Table III, ESOA demonstrates outstanding performace
from $F_{1}$ to $F_{4}$. ESOA trails GWO and HHO in $F_{5}$ to $F_{7}$,
however, the result is considerably superior to PSO, GA, as well as DE.
Therefore, the excellent exploitation of ESOA is evident here.

###  III-B Evaluation Of Exploration
Ability($\mathbb{F}_{3}$-$\mathbb{F}_{19}$)

In MultiModal Functions and Hybrid Functions, there are numerous local optimum
positions for deceiving the algorithm into halting, and the optimization
difficulty increases exponentially with rising dimensions, which are worth
evaluating the exploration capability of an algorithm. The result of
$\mathbb{F}_{3}$-$\mathbb{F}_{19}$ shown in Table IV provides powerful proof
of the remarkable exploration ability of ESOA. In particular, ESOA presents
superior performance to the other five algorithms from the average fitness on
$\mathbb{F}_{18}$. Because of the Aggressive Strategy component of ESOA, it is
capable of overcoming the interference of numerous local optimum points in the
exploration of the global solution.

###  III-C Comprehensive Performance
Assessment($\mathbb{F}_{20}$-$\mathbb{F}_{29}$)

Composition Functions are a difficult type of test function that necessitates
a great balance between exploitation and exploration of the algorithm under
test. They are usually employed to undertake comprehensive evaluations of
algorithms. The performance of each algorithms in
$\mathbb{F}_{20}$-$\mathbb{F}_{29}$ is indicated in Table IV, the average
fitness of ESOA in each test function is extremely competitive among the
listed algorithms. Especially in $\mathbb{F}_{22}$, ESOA outperforms the other
approaches and reaches 2346 average fitness while the second method DE only
obtains 3129. In fact, the proposed algorithm ESOA possesses Sit-And-Wait
Strategy for exploitation as well as an Aggressive Strategy for exploration.
These features are regulated by a discriminant condition which is fundamental
to the performance of the algorithm in such scenarios.

###  III-D Algorithm Stability

In general, the standard deviation of an algorithm’s outcomes when it is
repeatedly applied to a problem can reflect its stability. It can be seen that
the standard deviation of the ESOA is at the top results in both tables in
most situations, and much ahead of the second position in certain test
functions. The stability of ESOA is hence proven.

###  III-E Analysis Of Convergence Behavior

The partial convergence curves of each method are shown in Fig. 4. In (a),
(b), and (c), the Unimodal Functions, ESOA converges to near the global
optimum in less than 10 iterations while PSO, GA as well as DE have yet to
uncover the optimal path for fitness descent. The fast convergence in unimodal
tasks allows ESOA to be applied to some online optimization problems. In (d),
(e), and (f), the Multimodal and Hybrid Functions, after a period of searching
the optimization results of ESOA will surpass almost all other algorithms in
most cases and would continue to explore afterward. ESOA’s effectiveness in
Multimodal problems indicates that it has notable potential to be applied in
general engineering applications. In (g), (h) as well as (i), the Composition
problems, ESOA’s search, and estimation mechanism allow for continuous
optimization in most cases, and ultimately for excellent results. The
performance in Composition Functions evidence of ESOA’s applicability for use
in complex engineering applications.

In conclusion, this section revealed ESOA’s properties under various test
functions. The Sit-And-Wait Strategy in ESOA allows the algorithm to perform
fast descent on deterministic surfaces. ESOA’s Aggressive Strategy ensures
that the algorithm is extremely exploratory and does not readily slip into
local optima. Therefore, ESOA has shown excellent outcomes in both exploration
and exploitation.

##  IV Typical Application

In this section, ESOA is utilized in two practical engineering applications to
demonstrate its competitive capabilities in optimization constrain problems.
In order to simplify the computational procedure, the penalty function is
adopted to integrate the inequality constraints into the objective function
[33]. The specific form is as below,

$\hat{f}(\mathbf{x})=f(\mathbf{x})+\phi\sum_{j=1}^{p}g^{2}_{j}(\mathbf{x})sgn(g_{j}(\mathbf{x})),$
(19)

$sgn(g_{j}(\mathbf{x}))=\left\\{\begin{matrix}1,\qquad
ifg_{j}(\mathbf{x})>0\\\ 0,\qquad ifg_{j}(\mathbf{x})\leq
0.\end{matrix}\right.$ (20)

where $\hat{f}(\mathbf{x})$ is the transformed objective function and $\phi$
mean the penalty parameter while $f(\mathbf{x})$ and $g_{j}(\mathbf{x})$
present the origin objective function as well as the inequality constrains
respectively, $j\in[1,2,...,p]$ and $p$ is the number of constrains.
$sgn(g_{j}(\mathbf{x}))$ is used to determine whether the independent variable
violates a constrains.

###  IV-A Himmelblau’s Nonlinear Optimization Problem

Himmelblau introduced a nonlinear optimization problem as one of the famous
benchmark problems for meta-heuristic algorithms [34]. The problem is
describled as below,

TABLE V: The Statistical Result Of Various Algorithms For Himmelblau Problem Algorithm |  | Best | Worst | Ave | Std
---|---|---|---|---|---
ESOA |  | -30665.18896 | -30062.49696 | -30524.47712 | 136.7795737
PSO[9] |  | -30663.21135 | -29194.42152 | -29959.04964 | 399.3063815
GA[3] |  | -30347.35433 | -28638.48333 | -29440.23438 | 437.0557374
DE [4] |  | -30655.14151 | -29421.63637 | -30395.93485 | 273.0411217
GWO[11] |  | -30663.47493 | -30503.84528 | -30643.9799 | 27.38941651
HHO[32] |  | -30495.629 | -28093.40301 | -29229.05025 | 511.6730218

$\begin{split}&Minimize\,\,f(\mathbf{x})=5.3578547x^{2}_{3}+0.8356891x_{1}x_{5}\\\
&\qquad\qquad\qquad\qquad+37.293239x_{1}-40792.141\\\ \\\
&s.t.\quad\left\\{\begin{array}[]{lc}g_{1}(\mathbf{x})=85.334407+0.0056858x_{2}x_{5}\\\
\qquad\qquad+0.0006262x_{1}x_{4}-0.0022053x_{3}x_{5}\\\ \\\
g_{2}(\mathbf{x})=80.51249+0.0071317x_{2}x_{5}\\\
\qquad\qquad+0.0029955x_{1}x_{2}-0.0021813x^{2}_{3}\\\ \\\
g_{3}(\mathbf{x})=9.300961+0.0047026x_{3}x_{5}\\\
\qquad\qquad+0.0012547x_{1}x_{3}-0.0019085x_{3}x_{4}\\\ \\\ 0\leq
g_{1}(\mathbf{x})\leq 92\\\ \\\ 90\leq g_{2}(\mathbf{x})\leq 11\\\ \\\ 20\leq
g_{3}(\mathbf{x})\leq 25\\\ \\\ 78\leq x_{1}\leq 102\\\ \\\ 33\leq x_{2}\leq
45\\\ \\\ 27\leq x_{3}\leq 45\\\ \\\ 27\leq x_{4}\leq 45\\\ \\\ 27\leq
x_{5}\leq 45.\\\ \end{array}\right.\end{split}$

For this problem, the $\phi$ in Eq. (19) is set to $10^{100}$, the number of
search agents used by each algorithm is set to 10, and the maximum number of
iterations is set to 500.

The statistic result from 30 trials for each algorithm is shown in Table V.
ESOA is the best performing algorithm in terms of optimal results, with the
best result reaching $-30665.18896$. The second best was achieved by PSO at
$-30663.21135$. The standard deviation represents the algorithm’s stability,
and ESOA, although ranking second , outperforms PSO, GA, DE, as well as HHO.
The experimental results demonstrate the engineering feasibility of the
proposed method.

###  IV-B Tension/Compression Spring Design

Figure 5: Tension/compression string design problem.

The string design problem is described by Arora and Belegundu for minimizing
spring weight under the constraints of minimum deflection, shear stress, and
surge frequency [35, 36]. Fig. 5 illustrates the details of the problem, $P$
is the number of active coils, $d$ means the wire diameter while $D$
represents the mean coil diameter.

The mathematical modeling is as below,

$\begin{split}&Minimize\,\,f(\mathbf{x})=(x_{3}+2)x_{2}x^{2}_{1}\\\
&s.t.\quad\left\\{\begin{array}[]{lc}g_{1}(\mathbf{x})=1-\frac{x^{3}_{2}x_{3}}{71785x^{4}_{1}}\leq
0\\\ \\\
g_{2}(\mathbf{x})=\frac{4x^{2}_{2}-x_{1}x_{2}}{12566(x_{2}x^{3}_{1}-x^{4}_{1})}+\frac{1}{5108x^{2}_{1}}-1\leq
0\\\ \\\ g_{3}(\mathbf{x})=1-\frac{140.45x_{1}}{x^{2}_{2}x_{3}}\leq 0\\\ \\\
g_{4}(\mathbf{x})=\frac{x_{1}+x_{2}}{1.5}-1\leq 0.\\\
\end{array}\right.\end{split}$

TABLE VI: The Statistical Result Of Various Algorithms For Spring Problem Algorithm |  | Best | Worst | Ave | Std
---|---|---|---|---|---
ESOA |  | 0.012743 | 0.013023 | 0.012855 | 7.34E-05
PSO[9] |  | 0.012719 | 39721.55 | 1324.065 | 7130.235
GA[3] |  | 0.013089 | 11658.45 | 464.3166 | 2102.06
DE[4] |  | 0.012715 | 0.02629 | 0.015176 | 0.002537
GWO[11] |  | 0.012695 | 0.014352 | 0.012892 | 0.000307
HHO[32] |  | 0.012727 | 0.016021 | 0.014132 | 0.001111

For this problem, the $\phi$ in Eq. (19) is set to $10^{5}$, the number of
search agents used by each algorithm is again set to 10, and the maximum
number of iterations is set to 500.

Table VI indicates the statistic result from 30 independent runs for the six
algorithms. The average fitness of ESOA achieves the best result at $0.12855$,
whilst GWO achieves the second best result at $0.012892$. The standard
deviation of ESOA outperforms other algorithms, which demonstrates ESOA’s
exceptional stability. The proposed algorithm’s (ESOA) effectiveness and
robustness are hence verified.

##  V Conclusion

This paper introduced a novel meta-heuristic algorithm, the Egret Swarm
Optimization Algorithm, which mimics two egret species’ (Great Egret and Snowy
Egret) typical hunting behavior. ESOA consists of three essential components:
Snowy Egret’s Sit-And-Wait Strategy, Great Egret’s Aggressive Strategy as well
as a Discriminant Condition. The performance of ESOA was then compared with 5
other state-of-the-art methods (PSO, GA, DE, GWO, and HHO) on 36 test
functions, including Unimodal, Multimodal, Hybrid, and Composition Functions.
The results of which demonstrate ESOA’s exploitation, exploration,
comprehensive performance, stability as well as convergence behavior. In
addition, two practical engineering problem instances demonstrate the
excellent performance and robustness of ESOA to typical optimization
applications.

To accommodate more applications and optimization scenarios, other
mathematical forms of Sit-And-Wait Strategy, Aggressive Strategy, and
Discriminant Condition in ESOA are currently under development.

## References

  * [1] S. J. Nanda, G. Panda, ”A Survey On Nature Inspired Metaheuristic Algorithms For Partitional Clustering”, Swarm and Evolutionary Computation, vol. 16, pp. 1-18, 2014.
  * [2] K. Hussain, M. Salleh, M.N. Cheng, S. et al. ”Metaheuristic Research: A Comprehensive Survey”. Artif Intell Rev 52, pp. 2191–2233, 2019.
  * [3] Holland, John H. ”Genetic Algorithms.” Scientific American, vol. 267, no. 1, 1992, pp. 66–73.
  * [4] R. Storn and K. V. Price, ”Differential evolution-A simple and efficient heuristic for global optimization over continuous Spaces,” J. Global Optim., vol. 11, pp. 341–359, 1997.
  * [5] S. Kirkpatrick, C.D. Gelatt , M.P. Vecchi. ”Optimization By Simmulated Annealing.” Science, vol. 220, pp. 671–80, 1983.
  * [6] E. Rashedi, H. Nezamabadi-Pour, S. Saryazdi, ”GSA: A Gravitational Search Algorithm.” Inf Sci, vol. 179, pp.2232–48, 2009.
  * [7] A. Hatamlou, ”Black Hole: A New Heuristic Optimization Approach For Data Clustering.” Inf Sci, vol. 222, pp. 75–184, 2013.
  * [8] S. Mirjalili, S.M. Mirjalili, A. Hatamlou, ”Multi-Verse Optimizer: A Nature-Inspired Algorithm For Global Optimization.”, Neural Comput & Applic, vol. 27, pp. 495–513, 2016
  * [9] J. Kennedy and R. Eberhart, ”Particle Swarm Optimization,” Proceedings of ICNN’95 - International Conference on Neural Networks, 1995, pp. 1942-1948 vol.4
  * [10] M. Dorigo, M. Birattari and T. Stutzle, ”Ant Colony Optimization,” in IEEE Computational Intelligence Magazine, vol. 1, no. 4, pp. 28-39, Nov. 2006
  * [11] S. Mirjalili, S.M. Mirjalili, A. Lewis, ”Grey Wolf Optimizer”, Advances in Engineering Software, vol. 69, pp. 46-61, 2014.
  * [12] S. Mohanty, B. Subudhi, P.K. Ray, ”A New Mppt Design Using Grey Wolf Optimization Technique For Photovoltaic System Under Partial Shading Conditions. IEEE Trans Sustain Energy, vol. 7, no. 1, pp. 181–188, 2016.
  * [13] R. Precup, R. David and E. M. Petriu, ”Grey Wolf Optimizer Algorithm-Based Tuning of Fuzzy Control Systems With Reduced Parametric Sensitivity,” in IEEE Transactions on Industrial Electronics, vol. 64, no. 1, pp. 527-534, Jan. 2017
  * [14] J. Xue, B. Shen, ”A Novel Swarm Intelligence Optimization Approach: Sparrow Search Algorithm”, Systems Science & Control Engineering, vol. 8, no. 1, pp. 22-34, 2020.
  * [15] C. Zhang, S. Ding, ”A Stochastic Configuration Network Based On Chaotic Sparrow Search Algorithm”, Knowledge-Based Systems, vol. 220, 2021.
  * [16] L. Li, J. Xiong, M. Tseng, Z. Yan, M. K. Lim, ”Using Multi-Objective Sparrow Search Algorithm To Establish Active Distribution Network Dynamic Reconfiguration Integrated Optimization”, Expert Systems with Applications, vol. 193, 2022.
  * [17] X. Jiang and S. Li, “Bas: Beetle antennae search algorithm for optimization problems,” 2017.
  * [18] A. H. Khan, S. Li and X. Luo, ”Obstacle Avoidance and Tracking Control of Redundant Robotic Manipulator: An RNN-Based Metaheuristic Approach,” in IEEE Transactions on Industrial Informatics, vol. 16, no. 7, pp. 4670-4680, July 2020.
  * [19] D. Chen, X. Li and S. Li, ”A Novel Convolutional Neural Network Model Based on Beetle Antennae Search Optimization Algorithm for Computerized Tomography Diagnosis,” in IEEE Transactions on Neural Networks and Learning Systems, pp.1-12, 2021.
  * [20] D. H. Wolpert and W. G. Macready, ”No Free Lunch Theorems For Optimization,” in IEEE Transactions on Evolutionary Computation, vol. 1, no. 1, pp. 67-82, April 1997.
  * [21] Dimalexis, Anastasios, M. Pyrovetsi, and S. Sgardelis. ”Foraging Ecology Of The Grey Heron (Ardea Cinerea), Great Egret (Ardea Alba) and Little Egret (Egretta Garzetta) in Response to Habitat, at 2 Greek Wetlands.” Colonial Waterbirds, vol. 20, no. 2, pp. 261–72, 1997.
  * [22] Wiggins, A. David, ”Foraging Success And Aggression In Solitary And Group-Feeding Great Egrets (Casmerodius Albus).” Colonial Waterbirds, vol. 14, no. 2, pp. 176–79, 1991.
  * [23] Kent, M. Donald, ”Behavior, Habitat Use, And Food Of Three Egrets In A Marine Habitat.” Colonial Waterbirds, vol. 9, no. 1, pp. 25–30, 1986.
  * [24] Alan D. Maccarone, John N. Brzorad, And Heather M. Stone1 ”Characteristics And Energetics Of Great Egret And Snowy Egret Foraging Flights,” Waterbirds 31(4), 541-549, (1 December 2008).
  * [25] John N. Brzorad, Alan D. Maccarone, and Kevin J. Conley ”Foraging energetics of Great Egrets and Snowy Egrets,” Journal of Field Ornithology 75(3), 266-280, (1 July 2004).
  * [26] Maccarone, A.D. and Brzorad, J.N. (2007), Foraging behavior and energetics of Great Egrets and Snowy Egrets at interior rivers and weirs. Journal of Field Ornithology, 78: 411-419.
  * [27] Alan D. Maccarone, John N. Brzorad, and Heather M. Stone ”A Telemetry-based Study of Snowy Egret (Egretta thula) Nest-activity Patterns, Food-provisioning Rates and Foraging Energetics,” Waterbirds 35(3), 394-401, (1 September 2012).
  * [28] MASTER, T. L., J. K. LEISER, K. A. BENNETT, J. K. BRETSCH, AND H. J. WOLFE. 2005. Patch selection by Snowy Egrets. Waterbirds 28: 220–224.
  * [29] Diederik P. Kingma and Jimmy Lei Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
  * [30] Xin Yao, Yong Liu and Guangming Lin, ”Evolutionary programming made faster,” in IEEE Transactions on Evolutionary Computation, vol. 3, no. 2, pp. 82-102, July 1999.
  * [31] A. M. L. J. Awad, NH, B. Qu, and P. Suganthan, ”Problem definitions and evaluation criteria for the cec 2017 special session and competition on single objective bound constrained real-parameter numerical optimization,” Computational Intelligence Laboratory, Zhengzhou University, Zhengzhou China and Technical Report, Nanyang Technological University, Singapore, 2017.
  * [32] Ali Asghar Heidari, Seyedali Mirjalili, Hossam Faris, Ibrahim Aljarah, Majdi Mafarja, Huiling Chen, Harris hawks optimization: Algorithm and applications, Future Generation Computer Systems, Volume 97, 2019, Pages 849-872.
  * [33] Coello Coello CA. Theoretical and numerical constraint-handling techniques used with evolutionary algorithms: a survey of the state of the art. Comput Methods Appl Mech Eng 2002;191:1245–87.
  * [34] D. Himmelblau, Applied Nonlinear Programming, New York: McGraw-Hill, 1972.
  * [35] Arora, J.S., 1989. Introduction to Optimum Design. McGraw-Hill, New York.
  * [36] Belegundu, A.D., 1982. A study of mathematical programming methods for structural optimization. Department of Civil and Environmental Engineering, University of Iowa, Iowa City, Iowa.