# Towards Low-Latency and Energy-Efficient
Hybrid P2P-CDN Live Video Streaming

Reza Farahani, Christian Timmerer, and Hermann Hellwagner
Institute of Information Technology, Alpen-Adria-Universität Klagenfurt,
Austria

###### Abstract

Streaming segmented videos over the Hypertext Transfer Protocol (HTTP) is an
increasingly popular approach in both live and video-on-demand (VoD)
applications. However, designing a scalable and adaptable framework that
reduces servers’ energy consumption and supports low latency and high quality
services, particularly for live video streaming scenarios, is still
challenging for Over-The-Top (OTT) service providers. To address such
challenges, this paper introduces a new hybrid P2P-CDN framework that
leverages new networking and computing paradigms, _i.e._ , _Network Function
Virtualization_(NFV) and _edge computing_ for live video streaming. The
proposed framework introduces a multi-layer architecture and a tree of
possible actions therein (an action tree), taking into account all available
resources from peers, edge, and CDN servers to efficiently distribute video
fetching and transcoding tasks across a hybrid P2P-CDN network, consequently
enhancing the users’ latency and video quality. We also discuss our testbed
designed to validate the framework and compare it with baseline methods. The
experimental results indicate that the proposed framework improves user
Quality of Experience (QoE), reduces client serving latency, and improves edge
server energy consumption compared to baseline approaches.

Index Terms–  HAS; DASH; Edge Computing; NFV; CDN; P2P; Low Latency; QoE;
Video Transcoding; Energy Efficiency.

##  I Introduction

###  I-A Motivation

The rise of innovative video streaming technologies, the evolution of
networking paradigms, and the growing population of users who prefer to stream
online video content instead of traditional TV have collectively established
video as the predominant traffic on the Internet [1]. According to the Cisco
Annual Internet Report, video traffic will make up more than 60% of the entire
IP network traffic by 2023, where live video streaming has experienced
remarkable popularity among all types of video traffic, constituting
approximately 17% of the total video traffic [2]. _HTTP Adaptive
Streaming_(HAS) delivery systems, such as those based on the MPEG _Dynamic
Adaptive Streaming over HTTP_(DASH) [3] standard or Apple HTTP Live Streaming
(HLS) [4], have emerged as the dominant technologies utilized by OTT service
providers like Facebook, YouTube, and Twitch for delivering live video
streaming [5]. In HAS-based streaming, a video is divided into small segments
of fixed duration. Each segment then is encoded at multiple qualities or
bitrates, known as representations. HAS clients then employ an adaptive
bitrate algorithm (ABR), which enables them to adaptively download
representations from media servers (_i.e._ , _Content Delivery Network_(CDN)
servers) considering bandwidth and playout buffer conditions. Although
integrating CDN services alongside HAS-based systems has represented a
significant advancement in video delivery, the substantial surge in demand for
high-quality and low-latency live video poses numerous challenges for OTT
providers. For instance, increasing the number of video users in popular
events such as football matches can overload CDN servers. This situation may
cause OTT services to deliver unsatisfactory quality and latency to end users.
Consequently, OTT providers put significant pressure on backhaul networks as a
bottleneck of video delivery systems [6].

Recent studies have demonstrated that incorporating clients’ capabilities
within a Peer-to-Peer (P2P) network to establish hybrid P2P-CDN video delivery
systems effectively tackles the aforementioned challenges while offering
several benefits. These advantages include mitigating network congestion,
enhancing streaming stability, and lowering overall delivery costs [7, 8].
Considering these benefits, many companies, such as Peer5 and Livepeer, have
adopted the utilization of peer-assisted networks, employing promising
networking protocols like WebRTC to accomplish the aforementioned goals. Anjum
_et al._ [9] indicate that current hybrid P2P-CDN live streaming systems do
not use the full potential of peers to deliver high-quality and low-latency
live streaming. Hence, the primary motivation of our research is to develop a
hybrid P2P-CDN live streaming system that accomplishes the following key
goals: (i) use both the computing and bandwidth capabilities offered by the
P2P network, (ii) utilize modern networking paradigms such as NFV and edge
computing to propose a virtual P2P-CDN tracker server at the edge of the
network, and (iii) ensure the satisfaction of HAS client requests with
improved QoE and modest latency.

###  I-B Related Work

The Internet Engineering Task Force (IETF) introduced a peer assistance
standard called Application-Layer Traffic Optimization (ALTO) [10]. ALTO
enables P2P applications to receive abstract maps of network information, such
as information from CDNs. Having such information allows ALTO to optimize the
utilization of network resources and efficiently deliver traffic while
maintaining optimal application performance. However, the ALTO protocol still
has drawbacks, and its usage is limited [11]. As another well-known peer
assistance product, Akamai proposed the NetSession Interface [12] that
supports peer and CDN cooperation. However, it forces users to install extra
software on their devices. Ma  _et al._ [13] introduced machine learning-based
approaches for hybrid P2P-CDN systems enabling their trackers for peer
selection. However, their system does not employ edge-supported methods nor
use peers’ computational resources. Multiple works like [14, 15] customized
HAS players with a prefetching module to propose such a hybrid system to
reduce CDN bandwidth usage and transmission costs. Our previous works [16, 17,
18, 19, 20] proposed edge- and SDN- (_Software-Defined Networking_) assisted
video streaming frameworks without considering P2P capability and mainly
focusing on VoD scenarios. In other works [21, 22], we proposed a hybrid
P2P-CDN architecture for low latency live video streaming without
implementation or evaluation of the energy consumption of the tracker server.
However, the framework introduced in this paper is different from all the
aforementioned approaches since it: (i) uses all feasible resources of peers,
_i.e._ , storage, bandwidth, and computation, (ii) introduces a virtualized
tracker server (VTS), deployable on any networking appliance, (iii) is
compatible with any ABR algorithm due to not forcing clients to modify their
codes or installing additional software, and (iv) investigates the energy
consumption at the edge.

###  I-C Contributions

To tackle these challenges mentioned in the previous sections, in this paper,
we leverage HAS, P2P, CDN, NFV, and edge computing technologies to present a
new hybrid P2P-CDN framework for live video streaming. Our primary objective
is to enhance the serving latency and QoE for HAS clients, taking into account
different resource limitations. To do that, we design an action tree including
all possible actions for serving clients’ requests employed by Virtual Tracker
Servers (VTSs) at the edge of a P2P-CDN network. To validate the practical
deployment of our solution, we implement the proposed approach and analyze its
performance through experiments conducted in a cloud-based testbed, including
350 DASH clients. The experimental results demonstrate high users’ QoE, low
latency, and low edge server energy consumption compared with selected
baseline approaches.

Figure 1: Proposed multi-layer architecture.

##  II System Design

The proposed architecture, including four core layers, is illustrated in Fig.
1.

  1. 1.

Media Origin Layer: This layer first encodes the raw live video sequences,
then packages them into DASH format before storing them on the origin server.
Note that this layer has the ability to package the encoded video in other
formats, such as HLS or Common Media Application Format (CMAF).

  2. 2.

CDN Layer: This layer includes a group of CDN servers, which can be OTT
servers or a purchased service from CDN providers. Each server stores various
parts of video sequences. Moreover, CDN servers employ Common Media Server
Data (CMSD) [23, 24] messages to periodically inform the edge layer about
their cache occupancy.

  3. 3.

Edge Layer: This layer includes virtualized edge components called _Virtual
Tracker Servers_ (VTSs), which are placed close to base stations (_e.g._ ,
gNodeB in 5G). VTS servers are equipped with partial cache and video
transcoding functions to serve client requests directly from cached qualities
or to construct requested qualities from existing higher qualities,
respectively. In the proposed system, clients’ requests are directed to a VTS
server; the VTS then considers information received from the clients as CMCD
messages and servers’ CMSD messages, besides other monitored information, such
as available bandwidth, peers’ computational and power resources, and peers’
joining/leaving times. It finally employs an action tree (Fig. 2) to decide
from where (_i.e._ , adjacent peers, VTS, CDN servers, or origin server) and
using which approach (_i.e._ , fetch or transcode) to respond to the requested
quality level. The designed action tree proposes the following potential
actions that can be employed during the decision-making process (action
numbering as in the figure):

Figure 2: Proposed action tree.

$(1)$ Use the P2P network and transmit the requested quality directly from an
adjacent peer with maximum stability (_i.e._ , the least recent joining time).
$(2)$ Transcode the requested quality from a higher quality at the most stable
adjacent peer and transmit it through the P2P network.
$(3)$ Fetch the requested quality directly from the VTS server.
$(4)$ Transcode the requested quality from a higher quality at the VTS.
$(5)$ Fetch a higher quality from a CDN server with maximum available
bandwidth and transcode it at the VTS.
$(6)$ Fetch the requested quality directly from a CDN server with maximum
available bandwidth.
$(7)$ Fetch the requested quality from the origin server.

  4. 4.

P2P Layer: This layer utilizes all feasible peers’ idle resources, _i.e._ ,
bandwidth, storage, and computation, to offer services like “distributed video
transcoding”. The P2P network is based on the tree-mesh structure and includes
two types of peers: Seeders and Leechers. In this scheme, seeders’ requests
can be served by all nodes (_i.e._ , CDNs, origin, edge, or other seeders)
except leechers, while all nodes can serve leechers’ requests. In the proposed
system, peers periodically communicate their cache occupancies to the edge
layer using Common Media Client Data (CMCD) [23] messages and, in turn,
receive updates from the edge layer through CMSD messages.

##  III Evaluation Setup and Results

###  III-A Evaluation Setup

To evaluate the performance of the proposed system in a realistic large-scale
environment, we select InternetMCI [25] as a real backbone network topology
and instantiate a cloud-based testbed on the CloudLab [26] environment. This
testbed contains 375 elements, including 350 AStream [27] DASH players (seven
groups of 50 peers), running SQUAD [28] and BOLA [29] as hybrid and buffer-
based ABR algorithms, respectively. Five Apache HTTP servers (_i.e._ , four
CDN servers and an origin server), 19 OpenFlow (OF) backbone switches, 45
backbone layer-2 links, and a VTS server are used in our testbed. FFmpeg and
FFmpegKit4 are used to measure the segment transcoding time on the VTS and
peers, respectively. Moreover, iPhone 11 (Apple A13 Bionic, iOS 15.3), a
Xiaomi Mi11 (Snapdragon 888, Android 11), and a PC (Apple M1, MacOS 12.0.1)
are used to measure the transcoding time on the heterogeneous P2P network.
Power consumption is measured by device tools, _e.g._ , Android Energy
Profiler and Android Battery Manager. The CodeCarbon [30] project measures
power consumption for PC-type clients. Furthermore, we use a standard QoE
model [31] to evaluate the system’s performance regarding objective QoE. Table
I shows the details of other configuration parameters.

Table I: Experimental setup. Cache Replacement Policy | Least Recently Used (LRU)
---|---
Maximum Size of CDN Caches | 40% of the video dataset
Maximum Size of VTS Caches | 5% of the video dataset
Maximum Size of Peer Caches | 5 segments
Number of Live Channels | 5 channels
Segment Duration | 2 sec
Bitrate Ladder [32] | {(0.089,320p), (0.262,480p), (0.791,720p), (2.4,1080p), (4.2,1080p)}[Mbps, content resolution]
Links’ Bandwidth (CDNs to VTS) | 100 Mbps
Links’ Bandwidth (Origin to VTS) | 50 Mbps
Channel Access Probability Model | Zipf ($\alpha$ = 0.7)
Monitoring Interval | 1 sec

###  III-B Evaluation Results

Executing computationally-intensive tasks, such as video transcoding, on peers
must be fast enough to avoid imposing significant delays on the system and
should not excessively drain the peers’ batteries. Otherwise, clients’
requests may be served by other actions, leading to network and edge server
congestion. Thus, the first experiment aims to determine the power consumption
(_i.e._ , power values are given as kWh$\times 10^{-3}$ and percentage of
battery usage) and the percentage of battery usage when various operations are
concurrently executed on a single peer, such as playing video I and
transcoding video II concurrently for a five-minute video (equivalent to 150
segments). The results, as presented in Table II, reveal that the transcoding
(TR) operation consistently consumes the most power while playing back a video
(PLY) incurs significantly lower battery usage. Furthermore, combining the PLY
and TR tasks does not impose a substantial burden on the peers’ batteries when
compared to the energy consumed by individually upscaling a video.

Table II: Power consumption and battery usage of different operations for a
5-min. video on peers.

Operation | TR: 791k$\rightarrow$262k | TR: 4219k$\rightarrow$2484k
---|---|---
Power (kWh$\times 10^{-3}$) | Battery | Power (kWh$\times 10^{-3}$) | Battery
PLY | 119 | 0.39% | 152 | 0.49%
TR | 130 | 0.42% | 352 | 1.14%
TR + PLY | 237 | 0.77% | 479 | 1.55%

Table III: Transcoding times and VMAF scores for a 3-min. video on different
peers.

Input BR (bps) | Target BR (bps) | Client PC | Client Mobile
---|---|---|---
Time (s) | VMAF | Time (s) | VMAF
4219k | 89k | 4.31 | 15.38 | 15.98 | 13.75
4219k | 262k | 5.33 | 44.61 | 18.32 | 42.13
4219k | 791k | 11.74 | 76.21 | 39.28 | 73.14
4219k | 2484k | 20.44 | 93.33 | 74.91 | 91.53
2484k | 89k | 3.80 | 14.35 | 16.55 | 13.01
2484k | 262k | 4.83 | 42.27 | 18.82 | 40.02
2484k | 791k | 11.36 | 71.56 | 39.76 | 69.06
791k | 89k | 2.05 | 12.21 | 10.43 | 11.24
791k | 262k | 3.35 | 36.33 | 14.81 | 34.76
262k | 89k | 1.28 | 11.01 | 5.85 | 10.32

In the next experiment, we assess the transcoding times on peers and explore
the impact of peer transcoding on users’ perceptual quality. We employ the
Video Multi-method Assessment Fusion (VMAF) [33] scores to evaluate the
perceptual quality for a three-minute video. As depicted in Table III, the
transcoding process for the entire video takes 1.28 to 20.44 seconds (0.014 to
0.22 seconds per segment) on PC peers and 5.85 to 74.91 seconds (0.065 to 0.8
seconds per segment) on mobile peers.

In the final experiment, we run testbed experiments to analyze the performance
of the proposed framework compared to the following baseline methods:

  1. 1.

Non Hybrid (NOH): The NOH system is a regular CDN-based streaming approach
that does not incorporate any P2P support.

  2. 2.

Simple Edge-enabled Hybrid (SEH): The SEH system utilizes a basic VTS server
without caching and transcoding capabilities. In this system, peers can only
be served through one of the actions 1, 6, or 7 (Fig. 2).

  3. 3.

Non Transcoding-enabled Hybrid (NTH): As common in similar works, the NTH-
based system has caching capability but lacks transcoding capability. In this
approach, peers are only served through one of the actions 1, 3, 6, or 7 (Fig.
2).

  4. 4.

Edge Caching/Transcoding Hybrid (ECT): An ECT-enabled system does not involve
transcoding at the peer side. In this approach, requests can be served through
all actions except action 2.

We first calculate the average serving latency (in seconds) for all clients,
encompassing both transmission latency and computational latency, as an
integral component of the end-to-end (E2E) delay. As illustrated in Fig. 3(a),
the proposed system exhibits the best performance for both ABR algorithms
concerning this metric. By efficiently downloading requested segments through
the most suitable actions with shortened serving time (combining computation
and transmission), and from nodes with available resources in terms of
bandwidth and computation, the serving time is significantly reduced.

While improving latency is crucial, it is equally important to have a
comprehensive standard model to analyze the system’s behavior concerning the
enhancement of users’ QoE. For this purpose, we employ the standard objective
QoE model P.1203 [31]. As depicted in Fig. 3(b), the proposed system exhibits
superior performance for both ABR algorithms in this aspect as well. We
further analyze the system’s performance in terms of edge energy consumption
(measured in kWh) required for running edge transcoding. As evident from Fig
3(c), the proposed system outperforms the ECT system (the only transcoding-
enabled baseline system) and shows reduced energy consumption. This is
primarily because of serving requested representations through (i) distributed
caching, _i.e._ , the representations cached in all layers of the network
(CDN, P2P, and edge), and (ii) distributed transcoding, the representations
transcoded by transcoding-enabled peers, which allows our system to transcode
fewer segments at the edge.

Figure 3: Performance of the proposed framework compared with baseline methods
in terms of (a) average serving latency, (b) average objective P1203 QoE, (c)
average edge server energy consumption for 350 clients running the BOLA and
SQUAD ABR algorithms.

##  IV Conclusion

This paper presented a novel hybrid P2P-CDN live video delivery system,
incorporating modern networking paradigms such as NFV and edge computing,
along with distributed video transcoding. The system introduced a multi-layer
architecture and an action tree, encompassing all possible actions to serve
HAS clients from different nodes (_i.e._ , peers, CDNs, edge, origin server),
ensuring satisfactory users’ QoE and acceptable latency. To evaluate the
system’s performance, a cloud-based testbed with 350 clients was established,
and multiple experiments were conducted. The experimental findings confirmed
the superiority of the proposed approach in terms of users’ QoE, serving
latency, and edge server’s energy consumption compared to competitive schemes.

## References

  * [1] Sandvine, “The Global Internet Phenomena Report,” _White Paper_ , January 2023. [Online]. Available: https://www.sandvine.com/phenomena
  * [2] V. Cisco, “Cisco Visual Networking Index: Forecast and Trends, 2018–2023,” _White Paper_ , 2018. [Online]. Available: https://www.cisco.com/c/en/us/solutions/collateral/executive-perspectives/annual-internet-report/white-paper-c11-741490.pdf
  * [3] ISO/IEC. 2019, “Information Technology — Dynamic Adaptive Streaming over HTTP (DASH) — Part 1: Media Presentation Description and Segment Formats,” International Organization for Standardization, International Standard 23009-1:2019, Dec. 2019.
  * [4] R. Pantos and W. May, “HTTP Live Streaming,” RFC 8216, 2017. [Online]. Available: https://rfc-editor.org/rfc/rfc8216.txt
  * [5] A. Bentaleb, B. Taani, A. C. Begen, C. Timmerer, and R. Zimmermann, “A Survey on Bitrate Adaptation Schemes for Streaming Media over HTTP,” _IEEE Communications Surveys & Tutorials_, 2018.
  * [6] A. A. Barakabitze, N. Barman, A. Ahmad, S. Zadtootaghaj, L. Sun, M. G. Martini, and L. Atzori, “QoE Management of Multimedia Streaming Services in Future Networks: A Tutorial and Survey,” _IEEE Communications Surveys & Tutorials_, 2019.
  * [7] N.-N. Dao, A.-T. Tran, N. H. Tu, T. T. Thanh, V. N. Q. Bao, and S. Cho, “A Contemporary Survey on Live Video Streaming from a Computation-Driven Perspective,” _ACM Computing Surveys_ , 2022.
  * [8] R. Farahani, “CDN and SDN Support and Player Interaction for HTTP Adaptive Video Streaming,” in _12th ACM Multimedia Systems Conf._ , 2021.
  * [9] N. Anjum, D. Karamshuk, M. Shikh-Bahaei, and N. Sastry, “Survey on Peer-Assisted Content Delivery Networks,” _Computer Networks_ , 2017.
  * [10] R. Alimi, R. Penno, Y. Yang, S. Kiesel, S. Previdi, W. Roome, S. Shalunov, and R. Woundy, “Application-Layer Traffic Optimization (ALTO) Protocol,” _RFC 7285_ , 2014.
  * [11] S. Ellouze, B. Mathieu, and T. Lemlouma, “A Bidirectional Network Collaboration Interface for CDNs and Clouds Services Traffic Optimization,” in _IEEE Int’l. Conf. on Communications (ICC)_ , 2013.
  * [12] M. Zhao, P. Aditya, A. Chen, Y. Lin, A. Haeberlen, P. Druschel, B. Maggs, B. Wishon, and M. Ponec, “Peer-Assisted Content Distribution in Akamai NetSession,” in _Internet Measurement Conf._ , 2013.
  * [13] Z. Ma, S. Roubia, F. Giroire, and G. Urvoy-Keller, “When Locality is Not Enough: Boosting Peer Selection of Hybrid CDN-P2P Live Streaming Systems using Machine Learning,” in _Network Traffic Measurement and Analysis Conf. (IFIP TMA)_ , 2021.
  * [14] T. T. T. Ha, J. Kim, and J. Nam, “Design and Deployment of Low-Delay Hybrid CDN–P2P Architecture for Live Video Streaming Over the Web,” _Wireless Personal Communications_ , 2017.
  * [15] H. Yousef, J. Le Feuvre, P.-L. Ageneau, and A. Storelli, “Enabling Adaptive Bitrate Algorithms in Hybrid CDN/P2P Networks,” in _11th ACM Multimedia Systems Conf._ , 2020.
  * [16] R. Farahani, F. Tashtarian, A. Erfanian, C. Timmerer, M. Ghanbari, and H. Hellwagner, “ES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video Streaming,” in _31st ACM NOSSDAV Workshop_ , 2021.
  * [17] R. Farahani, F. Tashtarian, H. Amirpour, C. Timmerer, M. Ghanbari, and H. Hellwagner, “CSDN: CDN-Aware QoE Optimization in SDN-Assisted HTTP Adaptive Video Streaming,” in _46th IEEE Conf. on Local Computer Networks (LCN)_ , 2021.
  * [18] R. Farahani, F. Tashtarian, C. Timmerer, M. Ghanbari, and H. Hellwagner, “LEADER: A Collaborative Edge- and SDN-Assisted Framework for HTTP Adaptive Video Streaming,” in _IEEE Int’l. Conf. on Communications (ICC)_ , 2022\.
  * [19] R. Farahani, M. Shojafar, C. Timmerer, F. Tashtarian, M. Ghanbari, and H. Hellwagner, “ARARAT: A Collaborative Edge-Assisted Framework for HTTP Adaptive Video Streaming,” _IEEE Trans. on Network and Service Management_ , 2022.
  * [20] R. Farahani, A. Bentaleb, C. Timmerer, M. Shojafar, R. Prodan, and H. Hellwagner, “SARENA: SFC-Enabled Architecture for Adaptive Video Streaming Applications,” in _IEEE Int’l. Conf. on Communications (ICC)_ , 2023.
  * [21] R. Farahani, H. Amirpour, F. Tashtarian, A. Bentaleb, C. Timmerer, H. Hellwagner, and R. Zimmermann, “RICHTER: Hybrid P2P-CDN Architecture for Low Latency Live Video Streaming,” _ACM Mile-High Video (MHV)_ , 2022.
  * [22] R. Farahani, A. Bentaleb, E. Çetinkaya, C. Timmerer, R. Zimmermann, and H. Hellwagner, “Hybrid P2P-CDN Architecture for Live Video Streaming: An Online Learning Approach,” in _IEEE Global Communications Conf. (GLOBECOM)_ , 2022.
  * [23] CTA-5004, “Web Application Video Ecosystem––Common Media Client Data,,” 2020. [Online]. Available: https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf
  * [24] CTA-5006, “Common Media Server Data,,” 2022. [Online]. Available: https://github.com/cta-wave/common-media-server-data
  * [25] http://www.topology-zoo.org/dataset.html, accessed: 2023-07-26.
  * [26] R. Ricci, E. Eide, and C. Team, “Introducing CloudLab: Scientific Infrastructure for Advancing Cloud Architectures and Applications,” _login:: The Magazine of USENIX & SAGE_, 2014.
  * [27] “AStream: A Rate Adaptation Model for DASH,” accessed: 2023-07-20. [Online]. Available: https://github.com/pari685/AStream
  * [28] C. Wang, A. Rizk, and M. Zink, “SQUAD: A spectrum-based quality adaptation for dynamic adaptive streaming over HTTP,” in _7th ACM Conf. on Multimedia Systems_ , 2016.
  * [29] K. Spiteri, R. Urgaonkar, and R. K. Sitaraman, “BOLA: Near-optimal Bitrate Adaptation for Online Videos,” in _35th IEEE Int’l. Conf. on Computer Communications (INFOCOM)_ , 2016.
  * [30] “CodeCarbon: Estimate and Track Carbon Emissions from Machine Learning Computing,” accessed: 2023-07-26. [Online]. Available: https://github.com/mlco2/codecarbon
  * [31] “ITU-T. Rec. P.1203. Parametric bitstream-based quality assessment of progressive download and adaptive audiovisual streaming services over reliable transport - video quality estimation module.” [Online]. Available: http://handle.itu.int/11.1002/ps/P1203-01
  * [32] S. Lederer, C. Müller, and C. Timmerer, “Dynamic Adaptive Streaming over HTTP Dataset,” in _3rd ACM Multimedia Systems Conf._ , 2012.
  * [33] Z. Li, A. Aaron, I. Katsavounidis, A. Moorthy, and M. Manohara, “Toward a Practical Perceptual Video Quality Metric,” [Online] https://netflixtechblog.com/toward-a-practical-perceptual-video-quality-metric-653f208b9652, 2016, accessed: 2022-12-25.

|  Reza Farahani is a last-year Ph.D. candidate at the Institute of
Information Technology (ITEC), Alpen Adria-Universität Klagenfurt (AAU).
Currently, he is working on the Horizon Europe GraphMassivizer project. During
the period from October 2019 to February 2023, he was involved in the ATHENA
project, funded by the Christian Doppler Forschungsgesellschaft and the
industry partner Bitmovin GmbH. From November 2022 to January 2023, he was a
visiting scholar at the 5G & 6G Innovation Centre (5GIC & 6GIC), Institute for
Communication Systems (ICS), at the University of Surrey, UK. He received his
B.Sc. and M.Sc. degrees in computer engineering, in 2014 and 2019, from the
University of Isfahan, Isfahan, IRAN, and the University of Tehran, Tehran,
IRAN, respectively. He also has been working in the computer networks field in
different roles, e.g., Cisco network engineer, network protocol designer,
network programmer, and Cisco instructor (R&S, SP) for over six years. His
research interests are Multimedia Communication, Video Networking, Serverless
Computing, Cloud-Edge Continuum, Network Softwarization/Virtualization,
Distributed Systems, Mathematics Optimization, and Distributed Learning
approaches. Further information at https://www.rezafarahani.me/.
---|---
|  Christian Timmerer (M’08-SM’16) is a full professor of computer science at
Alpen-Adria-Universität Klagenfurt (AAU), Institute of Information Technology
(ITEC), and he is the director of the Christian Doppler (CD) Laboratory ATHENA
(https://athena.itec.aau.at/). His research interests include multimedia
systems, immersive multimedia communication, streaming, adaptation, and
quality of experience where he co-authored eight patents and more than 300
articles. He was the general chair of WIAMIS 2008, QoMEX 2013, MMSys 2016, and
PV 2018 and has participated in several EC-funded projects, notably DANAE,
ENTHRONE, P2P-Next, ALICANTE, SocialSensor, COST IC1003 QUALINET, ICoSOLE, and
SPIRIT. He also participated in ISO/MPEG work for several years, notably in
MPEG-21, MPEG-M, MPEG-V, and MPEG-DASH, where he served as standard editor. In
2012 he cofounded Bitmovin (http://www.bitmovin.com/) to provide professional
services around MPEG-DASH, where he holds the position of the Chief Innovation
Officer (CIO) – Head of Research and Standardization. Further information at
http://timmerer.com.
---|---
|  Hermann Hellwagner is a full professor of computer science at Alpen-Adria-
Universität Klagenfurt (AAU) where he leads the research group Multimedia
Communication (MMC) in the Institute of Information Technology (ITEC).
Earlier, he held positions as an associate professor at the University of
Technology in Munich (TUM) and as a senior researcher at Siemens Corporate
Research in Munich. His current research areas are distributed multimedia
systems, multimedia communication and adaptation, QoS/QoE, and communication
in multi-UAV networks. He has published widely on parallel computer
architecture, parallel programming, and multimedia communication and
adaptation. He is a senior member of the IEEE and of the ACM. He was a member
of the Scientific Board of the Austrian Science Fund (FWF) (2005-2016) and an
FWF Vice President (2013–2016). Currently, he is a member of the CD Senate of
Christian Doppler Forschungsgesellschaft (CDG). Further information at
https://www.itec.aau.at/~hellwagn/.
---|---


# CADE: Cosine Annealing Differential Evolution for Spiking Neural Network

Runhua Jiang2*, Guodong Du3*, Shuyang Yu2, Yifei Guo2, Sim Kuan Goh2, Ho-Kin
Tang3 *contributed equally to this paper This research is supported by the
Ministry of Higher Education Malaysia through the Fundamental Research Grant
Scheme (FRGS/1/2023/ICT02/XMU/02/1), and Xiamen University Malaysia through
Xiamen University Malaysia Research Fund (XMUMRF/2022-C10/IECE/0039 and
XMUMRF/2024-C13/IECE/0049). This work also acknowledges support from the
National Natural Science Foundation of China (Grant No. 12204130), Shenzhen
Start-Up Research Funds (Grant No. HA11409065) and the HITSZ Start-Up Funds
(Grant No. X2022000). Corresponding<EMAIL_ADDRESS><EMAIL_ADDRESS>2School of Electrical Engineering and Artificial
Intelligence, Xiamen University Malaysia, Selangor, Malaysia  3School of
Science, Harbin Institute of Technology (Shenzhen), Shenzhen, China.

###### Abstract

Spiking neural networks (SNNs) have gained prominence for their potential in
neuromorphic computing and energy-efficient artificial intelligence, yet
optimizing them remains a formidable challenge for gradient-based methods due
to their discrete, spike-based computation. This paper attempts to tackle the
challenges by introducing Cosine Annealing Differential Evolution (CADE),
designed to modulate the mutation factor (F) and crossover rate (CR) of
differential evolution (DE) for the SNN model, i.e., Spiking Element Wise
(SEW) ResNet. Extensive empirical evaluations were conducted to analyze CADE.
CADE showed a balance in exploring and exploiting the search space, resulting
in accelerated convergence and improved accuracy compared to existing
gradient-based and DE-based methods. Moreover, an initialization method based
on a transfer learning setting was developed, pretraining on a source dataset
(i.e., CIFAR-10) and fine-tuning the target dataset (i.e., CIFAR-100), to
improve population diversity. It was found to further enhance CADE for SNN.
Remarkably, CADE elevates the performance of the highest accuracy SEW model by
an additional 0.52 percentage points, underscoring its effectiveness in fine-
tuning and enhancing SNNs. These findings emphasize the pivotal role of a
scheduler for F and CR adjustment, especially for DE-based SNN. Source Code on
Github: https://github.com/Tank-Jiang/CADE4SNN.

###### Index Terms:

Differential Evolution, Spiking Neural Network, Robustness, Spiking Element
Wise model

##  I Introduction

In the last decade, there has been a huge development in artificial neural
network theories and applications [1, 2, 3]. It begins with the first-
generation multi-layer perceptron to the many state-of-the-art techniques in
the second-generation deep neural networks (DNNs) trained using gradient
descent. Despite this great advancement, ANNs still lag behind the biological
neural networks in terms of energy efficiency and abilities for online
learning. Though ANNs are brain-inspired, they are fundamentally different in
structure, neural computations, and learning rules compared to the biological
neural network. This leads to the third generation of neural networks, spiking
neural networks (SNNs), which are considered a breakthrough in addressing the
bottlenecks of ANNs. Unlike ANNs that continuously compute over all nodes,
SNNs only activate specific neurons in response to stimuli, significantly
reducing energy consumption [1]. This attribute is particularly beneficial for
processing sensor data or performing tasks where only a subset of the data
changes over time. Moreover, SNNs excel in dynamic and evolving environments
through mechanisms such as online learning, enabling them to adapt
continuously and in real-time to new data. This makes SNNs highly effective
for applications that require immediate processing of incoming data streams
without the need to pause for retraining, as they leverage updated models
instantaneously [4]. With the ability to address the major challenges of deep
neural networks, such as high resource requirements including energy
consumption, data storage, and computational costs, Spiking Neural Networks
(SNNs) [5, 6] have emerged as a promising alternative to conventional
Artificial Neural Networks (ANNs) in recent years.

However, the training of SNNs can be challenging due to their non-
differentiable nature of spiking events. Most prior SNN methods use ANN-like
architectures (e.g., VGGNet or ResNet), which could provide sub-optimal
performance for temporal sequence processing of binary information in SNNs.
Traditional gradient-based learning methods often suffer when it comes to
training SNN. An alternative to gradient-based methods Evolution algorithms
(EAs). By using EAs to optimize the weights and architecture of SNNs,
researchers can bypass the need for gradient computation, offering a robust
alternative to train SNNs for a variety of tasks. The combination of DE’s
global search capability and SNN’s efficient information processing holds
promise for developing advanced computational models that are both powerful
and energy-efficient.

EAs are grounded in Darwinian evolutionary theory and are recognized for their
effectiveness in tackling complex problems. They mimic the natural process of
survival of the fittest within a population, displaying remarkable robustness
and adaptability in identifying global solutions to various optimization
challenges. The initial development of evolutionary computing traces back to
the 1950s with the introduction of the Genetic Algorithm (GA) [8], which
incorporates Charles Darwin’s theory of natural selection. Subsequent decades,
particularly the 1960s and 1970s, saw the emergence of other evolutionary
algorithm forms like Evolutionary Programming (EP) [9] and Evolution
Strategies (ES) [10]. While Differential Evolution (DE) has been applied in
optimizing Deep Neural Networks (DNNs), the effectiveness of this approach in
training conventional DNN models is not fully established. This is partly
because most existing research tends to focus on custom-designed network
architectures rather than standard ones.

In this work, we hypothesize existing SEW that compete for survival and
breeding in evolution will show higher accuracy and stronger tolerance to data
set and design an experiment, to examine the influence of EA on DNNs’
corruption robustness. Specifically, pre-trained SEW CIFAR-100 evolved without
changing the original dataset, loss function, and network architecture.

##  II Related Works

Figure 1: Pipeline of the proposed CADE for Spiking Neural Network.

###  II-A Training methods for Spiking Neural Network

Recent research revealed that deep spiking neural networks (SNNs) have the
potential for improving the latency and energy efficiency of deep neural
networks through data-driven event-based computation[11]. However, SNNs have
not quite reached the same accuracy levels of ANNs in traditional machine
learning tasks practically. A main reason for this is the lack of efficient
training algorithms for deep SNNs due to the non-differentiable architecture.
Meanwhile current adequate algorithms are well prepared for deep neural
networks. There is a research gap here. Spike-Time-Dependent Plasticity (STDP)
[12] is a learning rule commonly used in spiking neural networks (SNNs) to
update the synaptic weights between neurons based on the precise timing of
pre- and postsynaptic spikes. It is inspired by the observed phenomenon in
biological neurons where the strength of synaptic connections is modulated by
the relative timing of pre- and post-synaptic spikes.

To deal with this non-differentiable transfer function, various methods have
been proposed to address the non-differentiable transfer function. On the one
side, some researches improve the standard backpropagation. On the other side,
non-differentiable spike generation function was handled using surrogate
models (e.g., Gaussian process [18, 19, 20]). A novel method enables error
backpropagation in deep spiking neural networks (SNNs) by treating neuron
membrane potentials as differentiable signals and spike discontinuities as
noise[13]. This approach, which uses principles from optimal control theory,
supports efficient training across various SNN architectures without needing
approximations. Spike-based backpropagation [14] is proposed that can enable
training deep convolutional SNNs directly (with input spike events). This
derivative method can work well for leaky behavior of Leaky integrate and fire
(LIF) neurons.

On the other side, recently proposed indirect methods involve using different
data representations between training and processing. For example, training a
conventional artificial neural network (ANN) and then using conversion
algorithms to transfer the weights into equivalent deep spiking neural
networks (SNNs). This includes advanced techniques such as Logarithmic
Temporal Coding, which efficiently reduces computational costs by adjusting
the spike encoding during the conversion of a trained ANN to an SNN, offering
a streamlined method for achieving competitive classification performance with
reduced computational demand[15]. But converting deep ANNs into SNNs may have
come at the cost of performance losses without a notion of time, to sparsely
firing, event-driven SNNs. To address these issues, recent advancements
introduce optimization methods that minimize performance loss during the
conversion of ConvNets and fully connected networks into SNNs, significantly
improving both accuracy and latency[16]. However, the main problem is that
details of statistics in spike trains that go beyond ideal mean rate modeling,
such as required for processing practical event-based sensor data cannot be
precisely represented by the signals used for training. So far it has only
been possible to train single layers with the learning rules operating
directly on spike trains.

###  II-B Differential Evolution Algorithm

Differential Evolution is a robust, stochastic evolutionary algorithm that has
gained widespread recognition for its efficacy in solving complex optimization
problems across diverse domains. However, it faces a significant challenge in
the realm of hyperparameter tuning. Hyperparameters in DE, primarily
comprising the population size, mutation factor, and crossover rate, play a
crucial role in dictating the algorithm’s performance.

Consequently, numerous research efforts have been initiated to propose various
mechanisms to address the hyperparameter challenge in DE. For instance, the
SADE algorithm includes an adaptive mechanism that autonomously adjusts
strategy parameters like mutation and crossover strategies and rates during
the evolutionary process [17]. This self-adaptive approach allows SADE to
dynamically tailor its behavior according to the specific requirements of the
optimization problem, thereby enhancing its efficiency and robustness.
Similarly, the Success-History based Adaptive Differential Evolution (SHADE)
algorithm introduces a sophisticated adaptation technique that relies on
historical performance data [21]. SHADE maintains a memory that records
successful parameter settings from previous generations. These records are
then used to guide the mutation and crossover rates, enabling a more informed
and targeted search process. By incorporating this historical success
information, SHADE effectively navigates complex optimization landscapes,
achieving superior convergence rates and solution quality compared to
traditional DE and other variants.

While SADE and SHADE were innovative, the field has evolved with new
algorithms that integrate machine learning to enhance performance in complex
scenarios, often outperforming traditional methods [22]. This highlights the
continuous advancement and dynamic nature of optimization technologies.

###  II-C Robustness

In the field of computer vision, a key objective is to enhance deep learning
systems to rival or surpass the robustness of the human visual system. This
pursuit involves addressing various challenges, with researchers exploring
different approaches. Carilini and Wagner have made strides in increasing the
resilience of networks against adversarial examples, while Hendrycks et al.
have concentrated on dealing with unknown unknowns, anomalous inputs, and
bolstering networks against input corruption [14]. In this context, the
introduction of datasets like Imagenet-C, featuring 75 common visual
corruptions at varying intensities, and CIFAR-100-C, designed for assessing
corruption robustness, has been significant.

Moreover, the exploration of spiking neural networks (SNNs) has opened new
avenues in the quest for robustness. SNNs, which more closely mimic the
biological processes of the human brain, offer potential advantages in terms
of energy efficiency and latency. Their inherent temporal dynamics and spike-
based information processing can lead to enhanced robustness against certain
types of noise and distortions, making them a promising area of research in
developing resilient deep learning models for computer vision tasks.

##  III Proposed Work

In our work, we propose the Cosine Annealing Differential Evolution (CADE)
algorithm to improve the accuracy and robustness of the SEW model without
changing the original dataset, loss function, and network architecture,
illustrated in Fig. 1. Subsequently, the overall performance of robustness of
our proposed optimization scheme is evaluated on CIFAR-100-C.

###  III-A CADE Algorithm

DE is a globally-oriented stochastic optimization technique that operates on a
population basis. Its primary function is to conduct an extensive search for
optimal solutions. In DE, a set of potential solutions, referred to as
”individuals,” constitutes the population. Each individual represents a
candidate solution to the optimization problem. The evolution of these
individuals is a systematic process, where new candidate solutions emerge
through a ”mutation” process. This is subsequently followed by a ”crossover”
phase, which amalgamates these new solutions with the existing individuals,
thus forming a fitter population. This iterative cycle of evolution continues
until the process either reaches a pre-set number of iterations or the
optimization goal attains a level of convergence deemed satisfactory.

The mutation factor (F), and crossover rate (CR) are critical hyperparameters
in the DE algorithm. Properly tuning these hyperparameters is essential to
strike a balance between exploration and exploitation, leading to efficient
and effective optimization for various real-world problems. However, the
optimal setting of these parameters is not straightforward and is highly
problem-dependent, leading to the primary challenge in DE applications.
Regarding the hyperparameter issue, this paper also proposes a variant of the
DE algorithm. In CADE, the F and CR are dynamically varied throughout the
evolutionary process, following the pattern of a cosine function. This concept
is inspired by the annealing learning rate approach, where the learning rate
is adjusted using a cosine function. The algorithm pseudocode is shown in the
algorithm 1.

Algorithm 1 CADE Algorithm

Initialize population $P$ with random solutions

Initialize parameters:
$F_{\text{min}},F_{\text{max}}=F_{\text{init}},CR_{\text{min}},CR_{\text{max}}=CR_{\text{init}}$

Set termination criteria: max iterations, convergence threshold, etc.

Initialize current iteration $t=0$

while not reached termination criteria do

for each individual $x_{i}$ in population $P$ do

Randomly select three distinct individuals $a,b,c$ from $P$

Generate a trial solution $u$ using the mutation strategy: $u=a+F\cdot(b-c)$

Apply crossover with probability $CR$: $v_{j}=\begin{cases}u_{j},&\text{if
}\text{rand()}\leq CR\text{ or }j=\text{rand()}(1,D)\\\
x_{ij},&\text{otherwise}\end{cases}$

Evaluate the fitness of $v$

if $v$ is better than $x_{i}$ then

Replace $x_{i}$ with $v$ in population $P$

end if

end for

Update iteration counter: $t=t+1$Strategy 1, 2, 3 or 4 for CR and F update

end while

return Best solution found in $P$

###  III-B Strategies for CR and F update

Hyperparameter tuning plays a pivotal role in the performance of differential
evolution algorithms, impacting their optimization capabilities across various
iterations. Traditional approaches often rely on static or manually adjusted
hyperparameters, which may not optimally adapt to dynamic problem landscapes
encountered during optimization processes. This paper introduces a novel
update strategy that utilizes a cosine function transformation to dynamically
adjust hyperparameters during iterations. By implementing this strategy, the
algorithm can search and adapt to the most suitable hyperparameters, thereby
enhancing model optimization effectively. We provide a comprehensive analysis
of how different hyperparameters influence the algorithm’s performance and
demonstrate the superiority of our proposed cosine-based adaptation strategy
through extensive experiments on benchmark functions. The results indicate
significant improvements in convergence rates and solution accuracy,
underscoring the importance of adaptive hyperparameter strategies in
evolutionary computations.

To explore further the update strategy, this work consider four distinct
approaches to dynamically adjust the parameters CR and F within the
Differential Evolution algorithm framework. Each strategy offers a different
method for parameter adaptation, potentially impacting the algorithm’s ability
to navigate the search space and converge on optimal solutions.

Strategy 1 updates both CR and F according to a cosine function that depends
on the current iteration (t) and the maximum number of iterations
(max_iterations), if the new individual (a solution candidate) does not lead
to a better result. The updates aim to adjust the parameters dynamically over
the course of the algorithm’s run, enabling the balance between exploration
and exploitation.

Strategy 1 Update rules for CR and F

if New individual is not better then

$F=F_{\text{min}}+\frac{F_{\text{max}}-F_{\text{min}}}{2}\left(1+\cos\left(\frac{\pi\cdot
t}{\text{max\\_iterations}}\right)\right)$

$CR=CR_{\text{min}}+\frac{CR_{\text{max}}-CR_{\text{min}}}{2}\left(1+\cos\left(\frac{\pi\cdot
t}{\text{max\\_iterations}}\right)\right)$

end if

Strategy 2 straightforwardly updates CR and F using the same cosine function
as in Strategy 1, but it does not condition the update on the performance of
the new individual. This suggests a consistent, periodic adjustment of the
parameters regardless of the immediate outcomes.

Strategy 2 Update rules for CR and F

if New individual is not better then

$F=F_{\text{min}}+\frac{F_{\text{max}}-F_{\text{min}}}{2}\left(1+\cos\left(\frac{\pi\cdot
t}{\text{max\\_iterations}}\right)\right)$

$CR=CR_{\text{min}}+\frac{CR_{\text{max}}-CR_{\text{min}}}{2}\left(1+\cos\left(\frac{\pi\cdot
t}{\text{max\\_iterations}}\right)\right)$

end if

CR and F are updated as in Strategy 2, but after the deterministic update, a
stochastic component is added by using random value in strategy 3, which
introduces randomness into the new values of CR and F. The random.uniform()
function generates a random number between the given min and max values for
each parameter, adding an element of randomness to the updating process.

Strategy 3 Update rules for CR and F

$F=F_{\text{min}}+\frac{F_{\text{max}}-F_{\text{min}}}{2}\left(1+\cos\left(\frac{\pi\cdot
t}{\text{max\\_iterations}}\right)\right)$

$F=F+\text{random.uniform}(F_{\text{min}},F_{\text{max}})$

$CR=CR_{\text{min}}+\frac{CR_{\text{max}}-CR_{\text{min}}}{2}\left(1+\cos\left(\frac{\pi\cdot
t}{\text{max\\_iterations}}\right)\right)$

$CR=CR+\text{random.uniform}(CR_{\text{min}},CR_{\text{max}})$

Strategy 4 combines the conditional approach of Strategy 1 with the stochastic
element of Strategy 3. If the new individual is not better, both CR and F are
first updated deterministically using the cosine function, and then they are
further adjusted by adding a random value from a uniform distribution. This
strategy seems to adapt the parameters based on the current success of the
algorithm and introduces variability to escape local optima or to search new
areas of the solution space.

Strategy 4 Update rules for CR and F

if New individual is not better then

$F=F_{\text{min}}+\frac{F_{\text{max}}-F_{\text{min}}}{2}\left(1+\cos\left(\frac{\pi\cdot
t}{\text{max\\_iterations}}\right)\right)$

$F=F+\text{random.uniform}(F_{\text{min}},F_{\text{max}})$

$CR=CR_{\text{min}}+\frac{CR_{\text{max}}-CR_{\text{min}}}{2}\left(1+\cos\left(\frac{\pi\cdot
t}{\text{max\\_iterations}}\right)\right)$

$CR=CR+\text{random.uniform}(CR_{\text{min}},CR_{\text{max}})$

end if

###  III-C Spiking Element Wise Model

Deep Spiking Neural Networks (SNNs) pose unique challenges for optimization
using gradient-based methods due to their discrete, binary activations and
intricate spatial-temporal dynamics. Given the remarkable achievements of
ResNet in the field of deep learning, applying residual learning to train deep
SNNs emerges as a logical progression. Inspired by this, the Spike-Element-
Wise (SEW) residual block have been developed [7], specifically designed for
SNNs to enable efficient residual learning. This block not only facilitates
identity mapping but also effectively addresses the issues of vanishing and
exploding gradients. As demonstrated in Fig. 2, the SEW residual block is
illustrated as follows:

Figure 2: SEW residual block

$O^{\prime}[t]=g(\text{SN}(\text{SF}(s^{\prime}[t])),s[t]),\quad
S^{\prime}[t]=g(A^{\prime}[t],S^{\prime}[t]),$ (1)

It’s intriguing to note that SEW ResNet can easily implement identity mapping,
leveraging the binary property of spikes. By capitalizing on the unique
characteristics of spiking neurons and their binary spiking behavior,
different element-wise functions, denoted as g, can be identified that satisfy
identity mapping. The binary property of spikes introduces a distinctive
approach to realizing identity mapping in SEW ResNet, offering a novel
perspective on the implementation of this fundamental concept in the context
of spiking neural networks.The specifics of these element-wise functions, as
indicated in Table I.

TABLE I: List of element-wise functions $g$. Name | Expression of $g(A^{\prime}[t],S[t])$
---|---
ADD | $A^{\prime}[t]+S[t]$
AND | $A^{\prime}[t]\land S[t]=A^{\prime}[t]\cdot S[t]$
IAND | $\neg A^{\prime}[t]\land S[t]=(1-A^{\prime}[t])\cdot S[t]$

The two keys are formulation of downsample block and SEW ResNet can overcome
vanishing/exploding gradient. For the downsample, in cases where the
dimensions of the input and output of a residual block differ, the shortcut
connection is adapted to perform downsampling. This is achieved by using
convolutional layers with a stride greater than 1. This strategy ensures that
the shortcut connection aligns with the spatial dimensions of the feature maps
using spiking neurons(SN) in shortcut. The experimental results suggest that
the ReLU before addition (RBA) block does not perform as well as the basic
block . The SEW block is described as an extension of the RBA block. This
implies that the SEW block incorporates certain characteristics of the RBA
block while potentially introducing additional features or modifications that
address the limitations observed in the RBA block. The SEW block utilizes AND,
IAND, and ADD as potential element-wise functions (g). When AND and IAND are
used, the output is spikes represented as binary tensors. This ensures that
the ”infinite outputs problem” in Artificial Neural Networks (ANNs), where
unbounded activations can lead to numerical instability, does not occur in
SNNs with SEW blocks. In the experiment, SEW ResNet-34 was used.

##  IV experiment

###  IV-A Dataset

In the experimental section of our study, this work focuses on two benchmark
datasets, CIFAR-10 and CIFAR-100, which are widely used in the field of
machine learning for evaluating image classification models.

CIFAR-100-C stands as an extension to the CIFAR-100 dataset, designed
specifically for the evaluation of model robustness. Unlike the standard
CIFAR-100 dataset, CIFAR-100-C introduces a challenging set of conditions by
intentionally corrupting the images with various types and levels of
distortions. This dataset serves as a rigorous benchmark to assess the ability
of machine learning models to generalize and perform well under diverse and
adverse circumstances. CIFAR-100-C encompasses a broad spectrum of corruption
types, including but not limited to blur, noise, and brightness variations.
Each corruption type introduces a unique challenge, testing the model’s
resilience against a range of real-world distortions. The dataset provides
images corrupted at different severity levels, allowing for a granular
evaluation of a model’s performance under varying degrees of perturbation.

###  IV-B Initial Population

In this paper, transfer learning is used to initialize population. This
approach involved using pre-trained models from the CIFAR-10 dataset and
subsequently fine-tuning them on the CIFAR-100 dataset. Based on the result,
the transfer learning not only markedly accelerated the training process, but
also improved accuracy compared to those trained from scratch or initialized
differently.

Finetuning not only offers the advantage of time efficiency in the initial
population creation but also presents a unique opportunity for
diversification. The algorithm can generate individuals with distinct
characteristics by employing various hyperparameter configurations during the
fine-tuning phase. This diversification strategy plays a crucial role in
enriching the population’s genetic pool, promoting a broader exploration of
the solution space. Consequently, the increased diversity among individuals
enhances the algorithm’s ability to adapt to different facets of the
optimization landscape, potentially leading to more robust and effective
solutions. It is obvious that transfer learning effectively leverages the
feature extraction capabilities acquired on CIFAR-10 for application to
CIFAR-100. Furthermore, this approach not only saves significant time but also
enhances accuracy.

During the fine-tuning process, various data augmentation techniques were
employed, including Smoothing[24], Mixup[25], and AutoAugment (AA)[26].
Smoothing involves attenuating the true labels from 1.0 to a smaller value
(typically close to 1.0). This is a method to smooth the labels, which helps
mitigate overfitting and enhances generalization performance. The main
parameter is used to reduce the value of the true labels, for example,
decreasing from 1.0 to 0.9. This value can be adjusted based on the specific
task to balance the smoothness of the model and the fitting of the training
data. Mixup: is a data augmentation technique that generates new training
samples by linearly combining the inputs and labels of two different samples.
This encourages the model to be more robust during learning. AutoAugment is an
augmentation strategy that automatically discovers the best data augmentation
policies for a given dataset. It optimizes augmentation policies to improve
model robustness and generalization. AutoAugment typically involves a set of
sub-policies, each containing a specific data augmentation operation and its
corresponding probability. Key parameters include the number of sub-policies,
the number of operations in each sub-policy, the intensity of each operation,
etc. These parameters can be adjusted by searching on the training set or
using default values.

Another direct approach to initializing the population for the DE algorithm is
to use the last-performing model obtained during a single fine-tuning process,
which spans a duration of the last population size epochs, as the initial
population.

##  V Results

###  V-A Hyperparameter effect

Based on the experimental results, it was found that hyperparameters continue
to have a significant impact on the performance of the DE algorithm. The
experiments revealed that when the crossover rate (CR) and mutation factor (F)
are relatively low, there is an improvement in the optimization of Spiking
Neural Networks (SNNs) by DE. This finding contrasts with previous
observations where DE was applied to optimize Artificial Neural Networks
(ANNs), suggesting that DE requires smaller values of F and CR to effectively
optimize SNNs.

Influence of CR and F: Experiments as shown II have demonstrated that lower
values of CR and F tend to improve CADE’s effectiveness in optimizing Spiking
Neural Networks (SNNs). A lower CR means that a smaller portion of the trial
individual’s components will be inherited by the target individual during the
crossover operation. A lower F value results in a more conservative
amplification of the difference between parent individuals when generating the
trial individual.

F-init | CR-init | Strategy | t | Improvement | Accuracy
---|---|---|---|---|---
2e-3 | 2e-3 | 2 | 1 | 0.05 | 77.81
1e-5 | 1e-5 | 2 | 1 | 0.41 | 78.17
1e-6 | 1e-6 | 2 | 1 | 0.19 | 77.95
1e-7 | 1e-7 | 2 | 1 | 0.18 | 77.94
1e-5 | 1e-5 | 2 | 2 | 0.42 | 78.18
1e-6 | 1e-6 | 2 | 2 | 0.12 | 77.88
1e-7 | 1e-7 | 2 | 2 | 0.12 | 77.88
1e-5 | 1e-5 | 3 | 5 | 0.52 | 78.28
1e-5 | 1e-5 | 3 | 5 | 0.33 | 78.09
2e-3 | 2e-8 | 2 | 5 | 0.16 | 77.92
1e-5 | 1e-5 | 2 | 10 | 0.41 | 78.17
TABLE II: Hyperparameters

Our experimentation with hyperparameter tuning in CADE demonstrates the
algorithm’s sensitivity and responsiveness to parameter adjustments. The
ability to enhance performance through fine-tuning underscores the importance
of hyperparameter optimization in achieving the full potential of evolutionary
algorithms like CADE when applied to intricate neural network models such as
SEW.

###  V-B Comparison of different initial population

In our study, the initial population for the CADE framework was generated
using three distinct strategies, each designed to optimize the diversity and
robustness of the models. The first strategy involved fine-tuning models by
adjusting different time ratios, allowing us to explore a range of
computational efforts and model complexities. The second strategy segmented
the CIFAR-100 dataset into five equal parts, with each segment used to train a
unique model. This approach aimed to develop distinct capabilities in each
model by exposing them to different data subsets. The third strategy employed
a sophisticated transfer learning technique, where models were first trained
on the CIFAR-10 dataset to harness broad generalizable features and then fine-
tuned on CIFAR-100 to adapt these models to more specific tasks. This method
effectively combines the benefits of generalization with specialized
adaptation, enhancing the evolutionary potential of the population. These
strategies and their impacts on optimization outcomes are comprehensively
documented in Table III of our research findings.

The table III above illustrates the optimization outcomes of various initial
populations in the CADE framework. It presents the performance metrics both
before and after CADE’s optimization process. Notably, it is observed that
initial populations derived from pretrained models exhibit the most
substantial enhancement in optimization. This comparison underscores the
impact of different initial populations on the efficacy of the CADE
optimization approach.

Initialization | Different | Parts of CIFAR-100 | Pretrain Model |
---|---|---|---|---
population | Time Ratio | Datasets | from CIFAR-10 |
Acc Improvement | 0.6 | 0.01 | 0.65 |
(From$\rightarrow$To) % | 76.24$\rightarrow$76.84 | 74.57$\rightarrow$74.58 | 77.37$\rightarrow$78.02 |
TABLE III: Different initial population

The initial population should ideally encompass a diverse range of solutions.
This diversity ensures a broader exploration of the solution space, increasing
the likelihood of finding globally optimal solutions rather than being trapped
in local optima. In the context of machine learning and particularly with
CADE, using pre-trained models as the initial population can be highly
advantageous. Pretrained models are already trained on vast datasets and have
learned general features that can provide a significant head start in the
optimization process.

###  V-C Comparison with CADE, SADE and SHADE

The notable performance improvement observed with CADE in optimizing the
Spike-Element-Wise (SEW) model can be attributed to several factors.

| SADE | SHADE | CADE
---|---|---|---
Improvement | 0.56 | 0.11 | 0.65
TABLE IV: Comparision of DE variation

First of all, the introduction of the Cosine Adaptive Mechanism in CADE allows
for a more nuanced adjustment of the F and CR. The cosine-based variation
provides a smoother transition during the optimization process, preventing
abrupt changes that might disrupt the delicate balance required for optimizing
the SEW model.

In our comparative study, we analyzed the performance of two adaptive
differential evolution algorithms, SHADE (Success-History Adaptation
Differential Evolution) and SADE (Self-Adaptive Differential Evolution), based
on the same initial population generated through our outlined strategies. The
effectiveness of each algorithm was assessed by measuring the improvement in
accuracy over the initial population. This approach allowed us to directly
compare how each algorithm adapts and optimizes under identical starting
conditions. By quantifying the accuracy improvements, we were able to evaluate
the relative efficacy of SHADE and SADE in refining the models’ performance,
providing a clear benchmark for evolutionary success within our CADE
framework. This comparison is crucial in understanding which adaptation
strategies yield the most gains in practical applications.

The comparative analysis may suggest that the self-adaptive mechanisms in SADE
and adaptation of SHADE may not be as well-suited for the specific challenges
posed by the optimization of SNNs. CADE, tailored with the cosine-based
adaptive mechanism, proves to be more effective in navigating the complex
optimization landscape associated with SEW. In summary, the success of CADE in
optimizing the SEW model can be attributed to its adaptability, smooth
parameter variation, and its alignment with the unique characteristics of
spiking neural networks. These qualities make CADE particularly well-suited
for the challenges posed by the optimization of SNNs compared to SADE and
SHADE.

###  V-D Robustness Experiment

In the experimental phase, this paper not only compared the efficacy of CADE,
SADE, and SHADE in optimizing the SEW model but also conducted robustness
experiments to assess the performance of the CADE-optimized model against the
original pretrained model. CADE-Optimized Model vs. Pretrained Model: (the
pretrained model is derived from the model obtained during the final popsize
epochs of a fine-tuning process.) From the table V, the CADE-optimized SEW
model demonstrated robustness across varying corruption levels, maintaining
competitive accuracy under different degrees of noise and perturbations.
Despite the challenging conditions introduced by CIFAR-100-C, the CADE-
optimized model exhibited the retention of adaptive features acquired during
the optimization process, contributing to its resilience. In specific
corruption types, the CADE-optimized model outperformed the pretrained model,
suggesting that the optimization process enhanced the model’s ability to
handle certain types of distortions and corruptions.

| Error | mCE
---|---|---
| Finetune | CADE | Finetune | CADE
| SGD |  |  | SGD
Gaussian Noise | 80.98% | 80.94% | 100% | 99.94%
Shot Noise | 75.43% | 75.47% | 100% | 100.05%
Impulse Noise | 80.50% | 80.39% | 100% | 99.86%
Defocus Blur | 71.19% | 71.16% | 100% | 99.95%
Glass Blur | 91.60% | 91.59% | 100% | 99.98%
Motion Blur | 80.10% | 80.01% | 100% | 99.88%
Zoom Blur | 80.70% | 80.66% | 100% | 99.94%
Snow | 62.59% | 62.45% | 100% | 99.77%
Frost | 66.32% | 66.16% | 100% | 99.76%
Fog | 71.50% | 71.60% | 100% | 100.13%
Brightness | 45.71% | 45.64% | 100% | 99.83%
Contrast | 80.96% | 80.95% | 100 % | 99.98%
Elastic Transform | 73.78% | 73.82% | 100% | 100.05%
Pixelate | 67.30% | 67.18% | 100% | 99.81%
Jpeg Compression | 66.09% | 66.11% | 100% | 100.03%
Average | 72.98% | 72.94% | 100% | 99.93%
TABLE V: Performance (error and mCE) on Cifar-100-C.

mCE \- mean Corruption Error (mCE). To assess robustness, the experiments
employ the mean Corruption Error (mCE) as a performance measure, which
quantifies the error rate of the current model compared to the base model for
various types of corruption.

For both the CIFAR-100-C datasets, each corruption type comprises five
distinct sensitivity levels. It’s worth noting that while the base model
employed in [23] was pretrain model finetuned by stochastic gradient descent
algorithm, in our experiments, this paper use pretrain model as the base
model. From the results, it is shown that the CADE algorithm can improve the
robustness of SEW on CIFAR-100-C.

###  V-E Different CR and F update methods

The experiment also involved contrasting the results of the trigonometric
approaches with scenarios where the learning rate (LR) was fixed at its
maximum and minimum values. This comparison was crucial to assess the
effectiveness of dynamic versus static parameter settings.

| F_sin_CR_sin | F_sin_CR_cos | F_cos_CR_sin |
---|---|---|---|---
Acc Improvement | 0.7 | 0.7 | 0.55 |
(From$\rightarrow$To)% | 77.37$\rightarrow$78.07 | 77.37$\rightarrow$78.07 | 77.37$\rightarrow$77.92 |
| F_cos_CR_cos | Fixed_1e-5 | Fixed_1e-9 |
Acc Improvement | 0.65 | 0.63 | 0.53 |
(From$\rightarrow$To) | 77.37$\rightarrow$78.02 | 77.37$\rightarrow$78 | 77.37$\rightarrow$77.9 |
TABLE VI: Different CR and F update method

The outcomes of these experiments demonstrated that the sine and cosine
functions’ application to F and CR variations is impactful. Both these
trigonometric methods yielded better results compared to keeping the
parameters fixed. It underscores the importance of adaptive parameter control
in enhancing the performance of evolutionary algorithms.

##  VI Discussion

The study noted that in SNNs, the weights often exhibit extreme values in
comparison to traditional DNNs. This distinctive characteristic of SNNs
implies that the optimization process needs to be handled with greater care.
Aggressive exploration, potentially facilitated by higher values of CR and F,
could disrupt the delicate balance within the structure of SNNs. As a result,
a more nuanced and cautious approach to optimization is required to preserve
the intricate dynamics of SNNs and avoid perturbing their unique structural
characteristics.

| Max | Min | Most value distribution interval
---|---|---|---
SEW | 195300 | -10.2669 | [-0.03,0.03]
ResNet-50 | 50040 | -1.0489 | [-0.04,0.05]
TABLE VII: Weight Distribution

##  VII Conclusion

This paper proposed the CADE algorithm, integrating DE principles with SNN
characteristics to enhance the performance and robustness of SNNs. The CADE
algorithm dynamically adjusts hyperparameters F and CR using cosine functions,
significantly improving the Spike-Element-Wise (SEW) model’s optimization
efficacy. Our experiments demonstrated that CADE not only outperforms
traditional DE, SADE, and SHADE in terms of optimization but also showcases
remarkable enhancements in model robustness across diverse conditions,
particularly in handling data corruption scenarios like CIFAR-100-C.

Reflecting on the broader implications of our findings, it was observed that
SNNs often exhibit extreme values in weights compared to traditional Deep
Neural Networks (DNNs), highlighting the need for a nuanced optimization
approach. The delicate balance within SNN structures requires cautious and
precise optimization strategies, as aggressive exploration through high values
of CR and differential weight factor F could potentially disrupt the intrinsic
dynamics of SNNs. This insight reinforces the need for adaptive and thoughtful
approaches in the optimization of neural networks, particularly those that
mimic biological processes more closely than conventional models.

## References

  * [1] Dongjin Lee, Seongsik Park, Jongwan Kim, Wuhyeong Doh, Sungroh Yoon, ”Energy-efficient Knowledge Distillation for Spiking Neural Networks”, ArXiv, 2021, vol. abs/2106.07172, doi=
  * [2] Goh, S. K., Abbass, H. A., Tan, K. C., Al-Mamun, A., Thakor, N., Bezerianos, A., & Li, J. (2018). Spatio–spectral representation learning for electroencephalographic gait-pattern classification. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 26(9), 1858-1867.
  * [3] Low, W. S., Goh, K. Y., Goh, S. K., Yeow, C. H., Lai, K. W., Goh, S. L., Chuah, J. H. & Chan, C. K. (2023). Lower extremity kinematics walking speed classification using long short-term memory neural frameworks. Multimedia Tools and Applications, 82(7), 9745-9760.
  * [4] Mingqing Xiao, Qingyan Meng, Zongpeng Zhang, D.K. He, Zhouchen Lin, ”Online Training Through Time for Spiking Neural Networks”, ArXiv, 2022, vol. abs/2210.04195, doi=10.48550/arXiv.2210.04195
  * [5] Dennis V Christensen, Regina Dittmann, Bernabe Linares-Barranco, Abu Sebastian, Manuel Le Gallo, Andrea Redaelli, Stefan Slesazeck, Thomas Mikolajick, Sabina Spiga, Stephan Menzel, et al., ”2022 roadmap on neuromorphic computing and engineering”, Neuromorphic Computing and Engineering, vol. 2, no. 2, pp. 022501, 2022, IOP Publishing
  * [6] Souvik Kundu, Massoud Pedram, Peter A Beerel, ”Hire-snn: Harnessing the inherent robustness of energy-efficient deep spiking neural networks by training with crafted input noise”, Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 5209-5218, 2021
  * [7] Wei Fang, Zhaofei Yu, Yanqi Chen, Tiejun Huang, Timothée Masquelier, and Yonghong Tian.  Deep Residual Learning in Spiking Neural Networks.  arXiv preprint arXiv:2102.04159, 2022.
  * [8] J. H. Holland, Adaptation in Natural and Artificial Systems, The University of Michigan Press, Ann Arbor, 1975.
  * [9] L. J. Fogel, A. J. Owens, and M. J. Walsh, Artificial Intelligence through Simulated Evolution, John Wiley, New York, 1966.
  * [10] N. Hansen, D. V. Arnold, and A. Auger, “Evolution Strategies,” in Springer Handbook of Computational Intelligence, pp. 871–898, 2015.
  * [11] M. Ji, Z. Wang, R. Yan, Q. Liu, S. Xu, and H. Tang, ”SCTN: Event-based object tracking with energy-efficient deep convolutional spiking neural networks,” Frontiers in Neuroscience, vol. 17, 1123698, 2023, Frontiers Media SA.
  * [12] F. Liu, W. Zhao, Y. Chen, Z. Wang, T. Yang, and L. Jiang, “SSTDP: Supervised Spike Timing Dependent Plasticity for Efficient Spiking Neural Network Training,” Frontiers in Neuroscience, vol. 15, 756876, 2021.
  * [13] T. C. Wunderlich and C. Pehle, “EventProp: Backpropagation for exact gradients in spiking neural networks,” arXiv preprint arXiv:2009.08378, 2020.
  * [14] C. Lee, S. S. Sarwar, P. Panda, G. Srinivasan, and K. Roy, “Enabling Spike-Based Backpropagation for Training Deep Neural Network Architectures,” Frontiers in Neuroscience, vol. 119, 2020.
  * [15] M. Zhang, Z. Gu, N. Zheng, D. Ma, and G. Pan, “Efficient Spiking Neural Networks with Logarithmic Temporal Coding,” IEEE Access, vol. 8, pp. 98156–98167, 2020.
  * [16] Z. Wang, S. Lian, Y. Zhang, X. Cui, R. Yan, and H. Tang, “Towards Lossless ANN-SNN Conversion under Ultra-Low Latency with Dual-Phase Optimization,” arXiv preprint arXiv:2205.07473, 2022.
  * [17] M. G. Omran, A. Salman, and A. P. Engelbrecht, “Self-Adaptive Differential Evolution,” in Proc. of the International Conference on Computational and Information Science, Berlin, Heidelberg: Springer Berlin Heidelberg, Dec. 2005, pp. 192–199.
  * [18] Kim, S., Park, S., Na, B., Kim, J., & Yoon, S. (2020). Towards fast and accurate object detection in bio-inspired spiking neural networks through Bayesian optimization. IEEE Access, 9, 2633-2643.
  * [19] Goh, S. K., Jun Lim, Z., Alam, S., & Pratap Singh, N. (2021). Tunnel gaussian process model for learning interpretable flight’s landing parameters. Journal of Guidance, Control, and Dynamics, 44(12), 2263-2275.
  * [20] Goh, S. K., Singh, N. P., Lim, Z. J., & Alam, S. (2022). Interpretable tracking and detection of unstable approaches using tunnel gaussian process. IEEE Transactions on Aerospace and Electronic Systems.
  * [21] R. Tanabe and A. Fukunaga, “Success-History Based Parameter Adaptation for Differential Evolution,” in Proc. of the 2013 IEEE Congress on Evolutionary Computation, 2013, pp. 71–78, IEEE.
  * [22] E. Morales, C. Juárez, E. García, and J. Sánchez, “Differential Evolution Based on Learnable Evolution Model for Function Optimization,” in Advances in Soft Computing: 18th Mexican International Conference on Artificial Intelligence, MICAI 2019, Xalapa, Mexico, October 27–November 2, 2019, Proceedings 18, pp. 290–302, Springer, 2019.
  * [23] D. Hendrycks and T. Dietterich, “Benchmarking Neural Network Robustness to Common Corruptions and Perturbations,” arXiv preprint arXiv:1903.12261, 2019.
  * [24] J. S. Simonoff, “Smoothing Methods in Statistics,” Springer, 1996.
  * [25] H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz, “mixup: Beyond Empirical Risk Minimization,” arXiv preprint arXiv:1710.09412, 2018.
  * [26] E. D. Cubuk, B. Zoph, D. Mane, V. Vasudevan, and Q. V. Le, “AutoAugment: Learning Augmentation Policies from Data,” arXiv preprint arXiv:1805.09501, 2019.