On the Initialization of Swarm Intelligence Algorithms for Vector Quantization Codebook Design

Vector Quantization (VQ) is a technique with a wide range of applications. For example, it can be used for image compression. The codebook design for VQ has great significance in the quality of the quantized signals and can benefit from the use of swarm intelligence. Initialization of the Linde–Buzo–Gray (LBG) algorithm, which is the most popular VQ codebook design algorithm, is a step that directly influences VQ performance, as the convergence speed and codebook quality depend on the initial codebook. A widely used initialization alternative is random initialization, in which the initial set of codevectors is drawn randomly from the training set. Other initialization methods can lead to a better quality of the designed codebooks. The present work evaluates the impacts of initialization strategies on swarm intelligence algorithms for codebook design in terms of the quality of the designed codebooks, assessed by the quality of the reconstructed images, and in terms of the convergence speed, evaluated by the number of iterations. Initialization strategies consist of a combination of codebooks obtained by initialization algorithms from the literature with codebooks composed of vectors randomly selected from the training set. The possibility of combining different initialization techniques provides new perspectives in the search for the quality of the VQ codebooks. Nine initialization strategies are presented, which are compared with random initialization. Initialization strategies are evaluated on the following algorithms for codebook design based on swarm clustering: modified firefly algorithm—Linde–Buzo–Gray (M-FA-LBG), modified particle swarm optimization—Linde–Buzo–Gray (M-PSO-LBG), modified fish school search—Linde–Buzo–Gray (M-FSS-LBG) and their accelerated versions (M-FA-LBGa, M-PSO-LBGa and M-FSS-LBGa) which are obtained by replacing the LBG with the accelerated LBG algorithm. The simulation results point out to the benefits of the proposed initialization strategies. The results show gains up to 4.43 dB in terms of PSNR for image Clock with M-PSO-LBG codebooks of size 512 and codebook design time savings up to 67.05% for image Clock, with M-FF-LBGa codebooks with size N=512, by using initialization strategies in substitution to Random initialization.


Introduction
The diversity of signals transmitted on the network (audio, video, image and voice), the number of connected devices and the wide use of artificial intelligence in virtual assistants, smartphones, tablets and computers promote modernization of everyday actions and lead to demand for efficient data traffic and digital signal processing systems [1,2].
In this scenario, signal compression techniques become increasingly necessary.Compression techniques are predominantly divided into two groups: lossless compression, widely used in medical images, and lossy compression.In lossy compression it is generally possible to obtain higher compression rates [3].
Vector quantization (VQ) has been extensively used in lossy compression techniques.VQ consists of mapping a sequence of K-dimensional input vectors by a corresponding sequence of K-dimensional reconstruction vectors of a finite subset called a codebook [4].The quality of VQ-based systems is directly associated with the quality of the codebooks.For this reason, codebook design is a relevant problem in the context of VQ.
The most used method in designing codebooks for VQ is the LBG algorithm, proposed by Linde, Buzo and Gray.LBG [5] starts with a codebook that is iteratively improved.The initial codebook has a large impact on both the convergence speed of the algorithm and the quality of the reconstructed signals.
In recent years, a new family of algorithms has emerged from combining swarm intelligence with LBG [6][7][8].The versatility of swarm techniques allows them to be combined with the LBG algorithm and used in codebook design.
The objective of this paper is to evaluate the use of initialization strategies [9][10][11][12][13][14] in LBG + swarm intelligence algorithms for QV codebook design with regard to the quality of the reconstructed images and the convergence speed of the algorithms (number of iterations).The possibility of combining different initialization techniques provides new perspectives in the search for quality VQ codebooks.
Thus, we can highlight the main contributions of this work: • The evaluation of a variety of combinations of initialization techniques for image VQ codebook design by swarm intelligence-based algorithms, in terms of the average peak signal-to-noise ratio (PSNR) of the reconstructed images and in terms of the average number of iterations of these algorithms.

•
The evaluation of the influence of a variety of combinations of initialization techniques (precisely, nine initialization strategies) in swarm-based VQ codebook algorithms (Particle Swarm Optimization, Firefly Algorithm and Fish School Search) considering two distinct scenarios-when the algorithms are combined with the conventional LBG algorithm and when they are combined with an accelerated version of the LBG algorithm-by using statistical instruments that allow one to group algorithms that do not present statistically significant differences in performance.
The remainder of the article is organized as follows.Section 2 presents the fundamentals of VQ and the description of the LBG algorithm and its accelerated version.The initialization strategies are described in Section 3. The swarm intelligence-based codebook design techniques used in this paper are presented in Section 4. The methodology used in the experimental setup is presented in Section 5.The results and conclusions are presented in Sections 6 and 7, respectively.

Vector Quantization
Efficient coding of signals is an essential process in several areas and applications, such as mobile communications, streaming services and image storage, among others.VQ is an efficient coding technique that aims to reduce the number of bits required to represent a signal [4,[15][16][17].
VQ is an extension of scalar quantization to a K-dimensional Euclidean space, R K , in which each of the M vectors of an input signal X = {⃗ x m , m = 1, 2, . . ., M} is represented by one of N vectors (usually with N << M) belonging to a finite subset of R K , Y = {⃗ y n , n = 1, 2, . . ., N}, called a codebook [4,18].
The mapping of vectors from X to Y occurs through a similarity rule that seeks to reduce the distortion introduced at the end of the vector quantization process.Typically, a widely used measure to evaluate the similarity of vectors is the squared Euclidean distance, given by in which x mj is the j-th component of ⃗ x m and y nj is the j-th component of the vector ⃗ y n .
Through mapping, the input signal X is partitioned into N cells S i = 1, 2, . . ., N, called Voronois regions, such that in which all input signal vectors belonging to the S i Voronoi region are represented by the codevector ⃗ y i .This representation leads to an error called distortion, calculated by Each codevector ⃗ y i is represented by a binary codeword b i of length n bits.The number of bits required to represent each codevector is b = log 2 N. Therefore, the code rate of the vector quantizer, which measures the number of bits by vector component and is expressed in bits per sample in voice waveform coding, or in bits per pixel (bpp) in the case of image coding, is given by An important issue regarding VQ is the compromise between rate and distortion.The signal reconstructed by VQ is a degraded version of the original signal.Therefore, in order for the VQ-based signal processing systems to perform well, it is necessary to have a good codebook that minimizes the average distortion introduced by representing the input vectors ⃗ x m by the corresponding codevectors, satisfying the nearest neighbor condition.
The study of techniques for generating a more representative codebook is a widely explored research topic [19][20][21][22][23][24][25].Among the various codebook design techniques, the LBG (Linde, Buzo and Gray) algorithm stands out for being the most popular.

LBG Algorithm
LBG [5] is an algorithm proposed by Linde, Buzo and Gray as a generalization of Lloyd's algorithm for a multidimensional space.LBG corresponds to a clustering algorithm, which starts with an initial solution that is iteratively improved to satisfy the centroid and nearest neighbor conditions.
LBG starts with a codebook, usually composed of vectors randomly obtained from the training set, for example Z = {⃗ z q , q = 1, 2, . . ., Q}, with ⃗ z q = {z q1 , z q2 , . . ., z qK }, which is updated at each iteration based on the calculation of the centroids of each Voronoi region.The calculation of centroids is given by in which Q i is the number of training vectors in the region S i and z qj is the j-th component of ⃗ z q .The stopping criterion of the LBG algorithm is based on the calculation of the distortion defined in Equation (3).Distortion is monitored at each iteration and decreases monotonically.The stopping criterion is reached, ending the process, when the percentual distortion variation decrease in the current iteration with respect to the previous one is below a distortion threshold, that is in which ϵ corresponds to the distortion threshold and D t corresponds to the distortion calculation in the t-th iteration.LBG can be summarized in the following sequence of steps: • Step 1 (initialization): set Y 0 as the initial codebook, set t = 0 and the distortion as D −1 = ∞ (a very large number).

•
Step 2 (partitioning): let Y t be the codebook in the t-th iteration, allocate each training vector ⃗ z q in the Voronoi region according to Equation (2).

•
Step 4 (stop criterion): If the stopping criterion is satisfied according to Equation ( 6), the algorithm stops and returns Y t representing the final codebook; otherwise, continue; • Step 5 (updating codevectors): calculate the new centroids of each Voronoi region according to Equation (5).Let t = t + 1 and return to Step 2.

Accelerated LBG Algorithm
Lee et al. proposed in [26] an alternative to accelerate the LBG algorithm, by the use of a scale factor in the step of updating the codevectors.
In the proposed technique, referred to here as accelerated LBG algorithm (LBGa), initially the codevector is calculated as the centroid of the corresponding Voronoi region, according to Equation (5), and then the new codevector will be one of the points in a line segment that connects the calculated codevector, y calculated , to the reflected point, y reflected (which corresponds to a reflection of the current codevector relative to the centroid conventionally calculated, y calculated ), as illustrated in Figure 1.Point 2 shown in Figure 1, y calculated , represents, in the LBG algorithm, the new codevector (new centroid of a given Voronoi region).Lee et al. proposed in [26] to choose as a new codevector a point between points 2 and 4 of Figure 1, as follows: in which s corresponds to the scale factor.Lee et al. [26] defined that 1 < s < 2. The authors noted experimentally that for s < 1, the algorithm converges more slowly compared to the LBG algorithm and for 1 < s < 2, the algorithm converges faster.For s = 1, the algorithm corresponds to the LBG algorithm.Figure 2 illustrates the example of y new obtained using s = 1.2, s = 1.5 and s = 1.8.

Initialization Strategies
The LBG algorithm starts with an initial solution (initial codebook) that is iteratively improved to satisfy the centroid and nearest neighbor conditions, as described in Section 2. Initialization is a step that directly influences the performance of QV, as the convergence speed and the quality of the codebook obtained depend on the initial codebook.
A widely used initialization alternative is random initialization, in which the initial set of codevectors is drawn randomly from the training set.Other initialization methods can lead to a better quality of the designed codebooks.

Hadamard
Hadamard initialization, introduced by Chen and Li in [9], is a technique for generating initial codevectors for VQ in the Hadamard domain.In the method, one initially calculates the Hadamard transform of the training vectors and orders the transformed vectors according to the value of their first components.Then, the sorted transformed vectors are partitioned into N groups and the inverse transform of the mid vector of each group is used as an initial codevector.The initial codebook is then composed of the N vectors obtained so far.
The detailed steps of the Hadamard technique are given below: • Step 1: let H K×K be the Hadamard matrix of dimension K × K. Calculate the transform of each input vector ⃗ z q as: in which the Hadamard matrix is a square matrix with a dimension that is a power of 2, defined as follows: in which t is a non-negative integer and H 1 = (1).For example:

•
Step 2: sort the transformed training vectors in ascending order according to their first component.

•
Step 3: divide the ordered vectors into N groups of equal size.

•
Step 4: finally, select the mid vector of each ordered group, then Y 0 will be composed by the corresponding inverse Hadamard transform of the N selected mid vectors.

Group Strategy
In the Group Strategy initialization technique proposed by Ma et al. in [10], the authors use the variance and mean of the training set vectors to select the initial codebook for VQ.
The mean (m ⃗ z q ) and variance (v ⃗ z q ) of the vector ⃗ z q of dimension K are respectively defined by and in which z qj is the j-th component of the vector ⃗ z q .
The procedure for generating the initial codebook involves the following steps: • Step 1: calculate the variance of all training vectors ⃗ z q according to Equation ( 12).

•
Step 2: sort the training vectors in order of increasing variance.

•
Step 3: divide the ordered vectors into 3 groups A, B and C, in the proportion 17:2:1, that is, ≈84% belong to group A, ≈10% to group B and the remainder (≈6%) to group C.

•
Step 4: for Groups A and B, do: -Calculate the mean of each vector belonging to the group according to Equation (11); -Sort the vectors in ascending order according to the mean value; -Divide groups A and B into N 2 and N 4 subgroups, respectively; -Select the intermediate vector of each subgroup A and B as the codevector.
• Randomly select N 4 vectors from Group C.

Subtractive Clustering
The subtractive clustering technique, proposed by Mirzaei et al. in [11], benefits from the idea of subtractive clustering and density, so that when choosing a codevector for the initial codebook, the probability of choosing training vectors located nearby decreases.
The subtractive grouping technique can be stated as follows: • Step 1: set the iteration counter i = 1 and the maximum iteration counter N. Calculate the density of each vector ⃗ z q as follows: in which r a is a positive constant that represents the radius of the neighborhood and ⃗ z j is a vector from the training set.

•
Step 2: select the vector ⃗ z q that has the highest density D MAX as the i-th codevector ⃗ y i .

•
Step 3: update the densities value of each vector ⃗ z q as follows: in which r b is a positive constant that defines a lower density neighborhood and ⃗ y i is the vector with the highest density D MAX .

•
Step 4: if i = N, the method stops.Otherwise, do i = i + 1 and return to Step 2.

KATSA
The central idea of the algorithm proposed by Katsavounidis, Kuo and Zhang [12] is based on the premise that the training vectors that are furthest from the others probably belong to different clusters.With this premise, the essence of the algorithm is to use the furthest training vector from the current codevectors as a new codevector.The algorithm can be described as follows: • Step 1: calculate the norm of all training vectors and select the vector with the highest norm as the first codevector; • Step 2: for each remaining training vector, find the closest codevector according to its Euclidean distance.The training vector that has the greatest distance in relation to its respective closest codevector is chosen to compose the codebook.This step is repeated until the codebook has the desired number of vectors.

MEIM
The initialization algorithm called Maximum Entropy Initialization Method (MEIM) was described by Nyeck and Tosser-Roussey in [13].The method aims to ensure that the clusters of each initial codevector have similar sizes.Let S = {S i , i = 1, 2, . . ., N} be the set of N clusters in which a training vector ⃗ z belongs to the cluster S i if N i d(⃗ z,⃗ y i ) < N j d(⃗ z,⃗ y j ) for all i ̸ = j, where ⃗ y i and ⃗ y j are, respectively, the representation of S i and S j , and N i is the size of S i and N j is the size of S j .The algorithm is described as follows: • Step

•
Step 5: take the final codebook as Y = {⃗ y i , i = 1, 2, . . ., N} where ⃗ y i ∈ S i and ⃗ y i is the most similar codevector to ⃗ c i .

DSICS
The algorithm called Double Sorting-Based Initial Codewords Selection (DSICS) was proposed by Hu et al. in [14].The algorithm can be described as follows: • Step

Swarm Techniques Applied to VQ
Swarm algorithms are metaheuristic techniques inspired by nature, such as the behavior of collective beings such as bees [27], ants [28] and birds [29].Swarm techniques have been applied to VQ codebook design [30][31][32].
The following subsections present three codebook design techniques based on bioinspired algorithms.
M-FA-LBG considers that a swarm has P fireflies, with each firefly representing a codebook W (a) , with 1 ≤ a ≤ P, of size N and dimension K, that is W (a) = {⃗ w i .The objective of MA-FA-LBG is to find a codebook W (a) that maximizes the fitness function f W (a) for the input vectors: in which D W (a) is the distortion for the a-th codebook W (a) , according to Equation (3).
In the FA-LBG, the codebook is iteratively updated through the repositioning of fireflies.Each firefly W (a) is attracted to a firefly W (b) with greater fitness and its movement is defined by in which α is the parameter that regulates the insertion of randomness in the path traversed by the firefly,⃗ r is a vector whose components are equal and correspond to a random number obtained from a uniform distribution between 0 and 1,⃗ r aux is a vector whose components are equal to 0.5 and β is the firefly's attractiveness factor, defined by in which γ corresponds to the absorption coefficient of light through a medium, d ⃗ w is the Euclidean distance between any two fireflies and β 0 is the attractiveness of a firefly for If there is no firefly with higher brightness, W (a) will move randomly, as follows ⃗ w M-FA-LBG proposes to precede the repositioning of fireflies with the calculation of the centroids of each Voronoi region.In this way, the codebook is updated by calculating the new centroids of the Voronoi regions, according to Equation ( 5) and then updating the position of the fireflies, according to Equations ( 17) and (19).The objective of introducing the centroid calculation in the codebook update step in M-FA-LBG is to allow a greater influence of the training set on the codebook design, aiming to minimize the distortion introduced when representing the training vectors by the corresponding code vectors.
The algorithm can be summarized in the following steps: • Step 1 (initialization and parameter setting): let Z be training set.Divide the training set into Q vectors of K dimension, that is, Z = {⃗ z q , q = 1, . . ., Q}, in which ⃗ z q = {z q1 , z q2 , . . ., z qK }.Initialize the algorithm with P fireflies-each firefly corresponds to an initial random codebook, obtained from the training set.Set the parameters α, β 0 and γ used in the movement of the firefly and the distortion threshold ϵ that will be used as a stopping criterion.

•
Step 2 (training set partitioning and search for the firefly with the greatest fitness): for each firefly W (a) , do: -Allocate the Q training vectors in the N Voronoi regions according to Equation (2); -Calculate the centroid of each of the N Voronoi regions according to Equation ( 5); -Calculate the distortion according to Equation (3); -Search the codebook (firefly) with the highest fitness value according to Equation ( 16).
If W (a) is the brightest firefly, update its position according to Equation ( 19).

•
Step 4 (stop criterion): if the stopping criterion is satisfied according to Equation ( 6), the algorithm is finished with the output being the highest brightness firefly.Otherwise, return to Step 2.

Modified PSO-LBG Algorithm
The M-PSO-LBG (Modified Particle Swarm Optimization-Linde-Buzo-Gray), proposed by Severo et al. in [6], was derived from changes made to the PSO-LBG [34] allowing greater influence of the training set in codebook design.The changes concern the way the algorithm is initialized, the codebook training stage, that is, the codevectors update stage, and the definition of the algorithm's stopping criterion.
In M-PSO-LBG, each particle, which correspond to a possible solution to the problem, corresponds to a codebook of size N and dimension K, that is i represents the i-th codevector of the a-th codebook.The fitness function, which assesses each solution, is defined as where D U (a) is the distortion for the a-th codebook U (a) , according to Equation (3).
In PSO, particles move in the search space based on their individual experience and the collective experience of the swarm [29].The best position of particle a, pbest (a) , represents the individual experience of each particle a and defines the best position (personal best) known to that particle.The position gbest represents the collective experience of the swarm and defines the best position (global best) known to the swarm as a whole.
In M-PSO-LBG, pbest (a) t and gbest t must be updated as follows: and in which pbest (a represents the i-th pbest of the a-th codebook in iteration t, gbest t = {gbest i , i = 1, 2, . . ., N}, where gbest i represents the i-th gbest in iteration t, pbest t max is the largest pbest value obtained among all particles in iteration t, at each iteration of the algorithm. Each particle has a position vector and a velocity vector.The position vector stores the position of the particle in the search space.The velocity vector is responsible for indicating the direction in which changes in the position of each particle occur.In M-PSO-LBG, the position vector of each particle corresponds to the codevector of each codebook.The velocity vector ⃗ v i (a) t+1 at iteration t + 1 is calculated for each particle according to with i , in which ω is the inertia factor, c 1 is the particle's cognitive acceleration constant, c 2 is the social acceleration constant and r 1 and r 2 are random coefficients that range from 0 to 1.After updating the velocity, the new position of the particle is calculated as The objective of M-PSO-LBG is to find a codebook that maximises the fitness function for the input vectors.With the aim of allowing a greater influence of the training set on the codebook design, M-PSO-LBG proposes to precede the repositioning of the particles with the calculation of the centroids of each Voronoi region, according to Equation (5).Therefore, updating each particle in M-PSO-LBG occurs in two steps: 1.
First, with the update of the new centroids of the Voronoi regions of each of the P particles; 2.
And then, with the updating of the velocity and position vectors of each of the particles.
The M-PSO-LBG can be summarised in the following steps: • Step 1 (initialization and parameter setting): let Z be the training set.Divide the training set into Q vectors of K dimension, that is, Z = {⃗ z q , q = 1, 2, . . ., Q}, in which ⃗ z q = {z q1 , z q2 , . . ., z qK }.Initialize the algorithm with P particles-each particle corresponds to an initial random codebook, obtained from the training set.Set the parameters used in calculating the velocity vector and the distortion threshold ϵ that will be used as a stopping criterion.

•
Step 2 (training set partitioning and calculation of the fitness of each particle and updating pbest): for each particle, do: • Step 3 (gbest update): search the particle with the highest fitness and update the position gbest according to Equation ( 22).

•
Step 4 (update particle velocity and position): the velocity of each particle is updated in two steps: -First, the velocity ⃗ v i (a) t at iteration t is calculated for each particle according to which corresponds to the difference between the particle update before and after the centroid calculation.This is done to guarantee the convergence of the M-PSO-LBG, so that the particle follows a convergence trajectory based on the characteristics of the LBG algorithm, since the particle positioning update is preceded by its update based on the centroid calculation.

-
In the second step, the velocity vector is updated according to Equation (23).And then, the new position of the particle is calculated according to Equation (24).

•
Step 5 (stop criterion): if the stopping criterion is satisfied according to Equation ( 6), the algorithm is finished, with the output being the gbest.Otherwise, return to Step 2.

Modified FSS-LBG Algorithm
The M-FSS-LBG (Modified Fish School Search-Linde-Buzo-Gray) was proposed by Fonseca, Ferreira and Madeiro in [8] which is a vector quantization codebook design method based on the Fish School Search (FSS) swarm algorithm [35].The M-FSS-LBG algorithm has as a metaphor the behavior of a school of fish in search for food where each fish represents a different codebook.In addition to the conventional steps of the LBG algorithm, in M-FSS-LBG some movement rules are applied to move the fish in the search space (individual movement, instinctive movement and volitive movement).Furthermore, a feeding operator is used to evaluate the success of a new movement and a breeding operator is applied to increase the exploration capacity of the algorithm.The fitness function of a given fish in the M-FSS-LBG algorithm is the inverse of its general distortion.
In the Individual Movement, each fish moves randomly in its neighborhood.For a given position ⃗ p i , this movement is given by where ⃗ p t i is the position of the ith fish in the current iteration and ⃗ p t−1 i is the position of the ith fish in the previous iteration, [−1, 1] is a pseudo-random number generated by a uniform distribution in the range [−1, 1] and α ind is a parameter that controls the individual movement rate.After the movement, it is evaluated whether the new position is better than the previous one in terms of the fitness function.If it is not better, the fish returns to its previous position.
With each successful Individual Movement the weight of the respective fish increases according to a Feeding Operator.If the Individual Movement of the fish is unsuccessful, its weight is reduced.The weight of each fish is determined by where ∆ f i is the difference between the current and previous fitness of the ith fish and max(∆ f ) is the maximum ∆ f i among all fish.To control the growth of fish weight, a pa- rameter is used to limit the maximum weight.Every successful Individual Movement will also influence the fish to make an Instinctive Movement in a resulting collective direction ⃗ I, given by where P is the number of fish in the school and ∆⃗ p i is the difference between the current and previous positions of the ith fish.Each fish moves towards that direction, that is, The Volitive Movement aims to control the exploration and exploitation of the school.If the total weight of the school is greater in relation to the total weight in the previous iteration, then the entire school must move in the direction of its barycenter ⃗ B (favoring exploitation).Otherwise, they move in the opposite direction (favoring exploration).The barycenter is given by According to the calculated barycenter, the school moves as where α vol is the parameter that controls the rate of the Volitive Movement and ∆W is the difference between the total weight in the current and previous iterations.
At last, the Breeding Operator is applied to provide greater variety among fish and favor the exploration of the search space.This operator is given as follows: • Step 1: the current worst fish is replaced by breeding itself with the best fish in the current school; • Step 2: two random fish are chosen from the remaining P − 2 fish;

-
Step 2.1: the first random fish is replaced by breeding itself with the second random fish; - Step 2.2: the second random fish is replaced by breeding itself with the best fish in the current school.
The breeding itself is given by calculating the arithmetic average of the weights and positions of two fish, to define the weight and position of the new fish.
The following steps summarize the M-FSS-LBG algorithm: • Step 1: initialize P fish with N codevectors each; • Step 2: for each fish:

•
Step 10: for each fish update the centroids as in Equation ( 5) and go to Step 2; • Step 11: return the fish whose fitness function is the highest.

Metodology
This section presents the methodology used in the experimental setup.The codebooks were designed with dimension K = 16, that is, image blocks of 4 × 4 pixels, and sizes N = 32, 64, 128, 256 and 512.
The threshold used as a stopping criterion for the algorithms was ϵ = 0.001.The scaling factors of the LBGa algorithm used in M-FF-LBGa, M-PSO-LBGa and M-FSS-LBGa were, respectively, 1.7, 1.4 and 1.7.The value of this parameter was obtained from a previous analysis carried out by varying the scale factor between 1.1 and 1.9.The average values of peak signal-to-noise ratio (PSNR) were computed.The scale factors which resulted in the largest PSNR values were chosen.
The parameters used in each algorithm are presented in Table 1.The values presented in Table 1 were obtained by preliminary simulations carried out with thirty executions for each algorithm in different sets of parameters considering each initialization strategy.Average PSNR values were computed for each set of parameters.The parameters which resulted in the largest PSNR values were chosen.The images Barbara, Boat, Clock, Elaine, Goldhill, Lena, Mandrill, Peppers and Tiffany were used as training sets.The images are 256 × 256 pixels, portable gray map (PGM), 8.0 bits per pixel (bpp).Figure 3 presents the images used in the simulations.
For each swarm technique used, ten particles were used, therefore, in each execution of the technique, ten codebooks are initialized, where each codebook corresponds to a particle.This value was chosen based on a previous analysis of the performance of the algorithms for population sizes P = 10, 20, 30, 50 and 100.As P increases, the number of mathematical operations performed by the algorithms increases, consequently the execution time of the algorithms increases.It was observed for the p values analyzed that the PSNR varies little with the increase in population size.Therefore, taking into account the computational cost with increasing population size and the performance in terms of PSNR obtained for each size, it was decided to use P = 10.
Thirty executions of the algorithms were performed and the results were obtained in terms of the arithmetic mean at the end of the executions.Therefore, for each image thirty codebooks were designed, for each codebook of size N, with different initialization approaches.
The initialization techniques used were Random Selection, Hadamard Initialization, Group strategy, Subtractive Clustering, DSICS, MEIM and KATSA.Initializations were performed considering groups of techniques.Table 2 presents the composition of the initialization techniques used.Each letter used in the acronym represents an initialization.In "Random" initialization, the 10 codebooks are initialized randomly, while in the remaining initializations, combinations of the initialization techniques presented in Section 3 are used and the rest of the initial codebooks are randomly obtained from the training set.For example, in the SH strategy, one codebook is initialized by the Subtractive Clustering technique (S), one by the Hadamard technique (H) and the remaining eight are initialized randomly.The quality of the designed codebooks was evaluated by the average PSNR given by in which L is the peak amplitude value of the input image.In the case of 8 bpp original image (256 gray levels), one has L = 255.Let I and I ′ be two digital images of T 1 × T 2 pixels, where I is the original image and I ′ the reconstructed image (VQ result).The MSE (mean squared error) between images I and I ′ is defined as in which I(r, c) and I ′ (r, c) represent respectively the pixel values of the original and reconstructed images in r-th row and c-th column, with T 1 representing the number of rows and T 2 the number of columns of an image.
In addition to evaluating the quality of the reconstructed images, the algorithms were evaluated in terms of convergence speed, using the average number of iterations.
The statistical tools Friedman test and Nemenyi test were used to compare the average results of PSNR and number of iterations obtained.The Friedman test [36] is a statistical test that analyzes the existence of a statistically significant difference between the n models models in the n data sets data sets.The objective of the Friedman test is to inform whether there is a statistical difference between the compared methods [37].In this work, the Friedman test was applied with n models = 10 codebook initialization strategies, n data sets = 30 codebook sets and a significance level of 5%.If the p-value found is less than the desired level of significance (0.05), then there is a significant difference between the performance of the initialization strategies used.In this scenario, the Friedman test is not able to indicate whether all strategies are different or whether only one of them performs significantly differently, while the others can be considered statistically equal.The Nemenyi test [38] is a post-test used to detect which differences between models are significant.
The Nemenyi test is used to compare models "one by one", indicating where the significant differences are [37].The difference in performance between two initialization techniques is statistically significant if their respective average ratings differ by at least one critical difference (CD) [37,39]: where q α , for the significance level α, is obtained from the table of critical values for the Nemenyi test, available in [37].
In this work, the results of the Nemenyi test were illustrated in the CD diagram [37].Figure 4

Results
For each image and for each N (codebook size), ten different initialization strategies were evaluated with the algorithms M-PSO-LBG, M-PSO-LBGa, M-FSS-LBG, M-FSS-LBGa, M-FF-LBG and M-FF-LBGa.
Table 3 presents the average PSNR results in dB for the Clock image obtained with the M-PSO-LBG algorithm.Among the initialization strategies used, the one that presented the best performance, for codebook sizes smaller than or equal to 128, was the MeKt strategy.For N = 256 and N = 512, the DsKt and MeKt strategies presented the best results.For all strategies, it is observed that the superiority over random initialization, in terms of PSNR, of the Clock image, increases with N. In particular, for N = 512, the average PSNR gain obtained by replacing random initialization with DsKt or MeKt is 4.43 dB.
Performing the Friedman test with a significance of 5% (95% confidence) between the different initialization strategies, it was observed that with M-PSO-LBG, considering the average PSNR results, the p-value presented was always less than 0.05 as shown in Table 4.This means that there is a statistical difference between the compared initialization strategies.Once the statistical difference was evident, the Nemenyi test was applied.According to the Nemenyi test, two initialization strategies contain significant differences if their respective average rankings differ by at least one critical difference.The Nemenyi test was applied with CD = 2.473 and q 0.05 = 3.164 (see Equation (34)).Figure 5 shows the resulting CD diagram of the Clock image with N = 512 for the M-PSO-LBG algorithm, where the horizontal axis represents the average ranking of initialization strategies.The lines below the horizontal axis connect the strategies that do not contain a significant statistical difference with 95% confidence.The diagram shows that the DsKt and MeKt strategies, in this order, are better positioned in the ranking.Furthermore, it is noted that there is no statistical superiority between the strategies that contain the initialization Kt and they present superiority in relation to the other strategies.Table 5 presents the average number of iterations for the Clock image obtained with the M-PSO-LBG algorithm.For N less than or equal to 128, any initialization strategy performs better than the random strategy.For N = 256, the worst performance occurs for the MH strategy and the best performance occurs for the All strategy.For N = 512, the best performance is from the DsMe strategy with 19.00 iterations on average.It is important to highlight that, for N = 512, an average of 20.13 iterations were needed to obtain the average PSNR value of 31.20 dB for random initialization.Note that for the DsKt initialization (which presents the best result in terms of PSNR among the evaluated strategies), 34.70 average iterations were required to obtain an average PSNR of 35.63 dB.The "price" for increasing the average PSNR for N = 512 obtained by replacing the random strategy with the DSKt strategy is maybe "paid" by the average number of iterations.However, this result can still be improved using the accelerated version of M-PSO-LBG (M-PSO-LBGa algorithm).Table 6 presents the average PSNR results in dB for the Clock image obtained with the M-PSO-LBGa algorithm.For N = 32, the DsKt initialization presents the best result.For N = 64, N = 256 and N = 512, strategies that contain the Kt initialization show better results; a similar behavior is observed for N = 128, where the DsMeKt strategy presents the highest average PSNR value (29.67 dB) and the other strategies that contain the Kt initialization present results very close to 29.67 dB.In general, in most cases, a lower average number of iterations is observed for M-PSO-LBGa compared to M-PSO-LBG.Note, comparing Table 7 and Table 5, that a smaller average number of iterations is required for the DsKt strategy with the M-PSO-LBGa algorithm compared to the M-PSO-LBG algorithm.For N = 256 and N = 512, the DskT strategy with M-PSO-LBGa presents an average number of iterations of 18.00 and 21.00, respectively.While for M-PSO-LBG the DskT strategy for N = 256 and N = 512 presents an average number of iterations of 51.53 and 34.70, respectively.This corresponds to a reduction in the average number of iterations of approximately 65% and 39%, respectively.Tables 8 and 9 present the average PSNR results of the Clock image obtained by the M-FSS-LBG and M-FSS-LBGa algorithms, respectively.For both the M-FSS-LBG algorithm and its accelerated version, the MS initialization strategy, for codebook sizes less than or equal to 256 presented the best performance in terms of average PSNR compared to the results obtained with the other initialization strategies.For N = 512, the All strategy presented the best average PSNR result for both M-PSO-LBG and its accelerated version.In particular, for N = 512, for both M-PSO-LBG and M-PSO-LBGa, the All strategy presented an average PSNR gain over random initialization greater than 3 dB.Table 4 presents the Friedman test performed between the PSNR results obtained with the M-FSS-LBG and M-FSS-LBGa algorithms.For all codebook sizes N, p-value presented a result below 0.05, indicating the existence of a significant statistical difference.
From the CD diagram of the Clock image with N = 512 (M-FSS-LBG algorithm), presented in Figure 6, it is possible to see that the All strategy was the best placed in the ranking and that it presents statistical superiority in relation to the SH, MHS, MS, MH, DsMe and random strategies.For the M-FSS-LBGa algorithm, the CD diagram, presented in Figure 7, shows that the DsKt and All strategies are positioned as first and second, respectively, in the ranks, and that they present statistical superiority in relation to the MHS, MH, DsMe and random strategies.Regarding the average number of iterations, for N = 256 and N = 512, the M-FSS-LBG algorithm required a smaller number of average iterations compared to the M-FFS-LBGa algorithm, as can be seen in Tables 10 and 11.For example, for M-FSS-LBG with N = 256, the SH initialization strategy had the lowest average number of iterations with 17.10, while for M-FSS-LBGa, the SH initialization strategy had an average number of 21.87 iterations.For M-FSS-LBG with N = 512, the MeKt initialization strategy had the lowest average number of iterations with 12.00, while for M-FSS-LBGa, the MeKt initialization strategy had an average number of 14.90 iterations.For N = 64 and N = 128, M-FSS-LBGa presented the best results in terms of average number of iterations with the All strategy.For N = 32, M-FSS-LBG provided the best result with the All strategy, which presented an average number of iterations of 19.70.For the Clock image, for the M-FF-LBG and M-FF-LBGa algorithms, only for N = 32 and N = 256 the initialization strategy that presented the best performance was the same, more specifically, the strategy DsMeKt for N = 32 and the DsKt strategy for N = 256, as can be seen in Tables 12 and 13.The most significant gain over Random initialization is observed for N = 512 (M-FF-LBG) with the DsMeKt initialization strategy, with a gain of 3.11 dB.It is important to highlight that, for N = 512, for both M-FF-LBG and M-FF-LBGa, the strategies that use the Kt initialization present very close results, with values varying between 35.66 dB and 35.69 dB for the M-FF-LBG and between 35.49dB and 35.50 dB for the M-FF-LBGa.The CD diagram of the results obtained with the M-FF-LBG algorithm for the Clock image with N = 512, presented in Figure 8, indicates that the DsMeKt strategy was the best placed in the ranking and presents statistical superiority in relation to strategies that do not use the Katsa initialization.Regarding the average number of iterations, comparing the Clock image results obtained with the M-FF-LBG and M-FF-LBGa algorithms, presented, respectively, in Tables 14 and 15, it is observed that the M-FF-LBGa algorithm requires a lower average number of iterations.For example, for N = 512, the M-FF-LBG algorithm with the MHS initialization strategy requires an average of 54.80 iterations, while the accelerated version of M-FF-LBG requires an average of 16.50 iterations.This corresponds to a reduction in the average number of iterations of approximately 70%.Tables 12 and 13 present the average PSNR results with M-FF-LBG and M-FF-LBGa, respectively, for the Elaine image.For M-FF-LBG, the All strategy presented the best performance for N = 256 and the strategies containing the Kt initialization presented better results for the codebook designed with N = 512.For N = 512, the Random initialization obtained a PSNR of 33.86 dB and the strategies that contain the Kt initialization obtained 34.22 dB.For the accelerated version of M-FF-LBG, with N = 256, Random initialization presented the best result, while for N = 512, the DsMe strategy presented the best result.
It is observed that using the Friedman test performed between the PSNR results obtained with M-FF-LBG and M-FF-LBGa (Table 16), the p-value presented a result below 0.05 for all N codebook sizes, indicating the existence of a significant statistical difference.The Nemenyi test for M-FF-LBG presented in Figure 9 shows that the best average PSNR results for N = 512 were obtained with the strategies that contain the Kt initialization and that there is no significant difference between these results and the results obtained with the SH strategy.For the accelerated version of M-FF-LBG, with N = 512, the Nemenyi test presented in Figure 10 indicates that there is a significant difference in terms of average PSNR only between the SH strategy and the DsMe and Random strategies.Tables 14 and 15 present, for the Elaine image, the results of the average number of iterations for M-FF-LBG and M-FF-LBGa, respectively.For N ≤ 256, the results obtained with M-FF-LBGa surpass the results obtained with M-FF-LBG.For example, the SH strategy for N = 32 presented an average number of 39.00 iterations with M-FF-LBG, while M-FF-LBGa presented an average number of 28.23 iterations.For N = 512, all initialization strategies, except the DsMe and Random strategies, presented better results with the replacement of M-FF-LBG by its accelerated version.For example, the DsKt strategy presented an average number of 36.73 iterations with M-FF-LBGa and an average number of 53.90 iterations with M-FF-LBG.This implies a reduction of approximately 32% in the average number of iterations.Regarding performance in terms of the average number of iterations, the results obtained with M-PSO-LBGa (Table 7) overperform the results obtained with M-PSO-LBG (Table 5) for N ≤ 128.For N = 256, the results obtained with M-PSO-LBGa outperform the results obtained with M-PSO-LBG, except for the DsKt initialization strategy.It is observed that for N = 512, M-PSO-LBG overperforms M-PSO-LBGa only for the MH, MS and MHS strategies.For N = 512, the M-PSO-LBG presented an average number of 49.20 iterations with the DsKt initialization strategy.When replacing M-PSO-LBG by M-PSO-LBGa, the average number of iterations, for N = 512 with the DsKt initialization strategy, reduces to 22.00 iterations.This represents savings of more than 55%.
Table 18 presents the Friedman test for the results of the average number of iterations obtained with M-PSO-LBGa.The results indicate the existence of significant difference in the codebooks with N ≥ 64.For N = 512, strategies that contain the Kt initialization present the best results.This can be seen in the CD diagram presented in Figure 12, which shows the best placed strategies in the ranking.Note that the strategies that contain the initialization Kt present statistical superiority in relation to the other strategies.Tables 8 and 9 present the average PSNR results obtained for the Peppers image with M-FSS-LBG and M-FSS-LBGa, respectively.For both M-FSS-LBG and M-FSS-LBGa, only for N ≥ 128, there are significant differences in the results between the initialization strategies.This can be seen in Table 17, which presents the results of the Friedman test in terms of average PSNR for the M-FSS-LBG and its accelerated version, considering the Peppers.The p-value presented a result below 0.05 for N ≥ 128, indicating the existence of significant statistical difference between initialization strategies under consideration.For example, considering M-FSS-LBG, the All initialization strategy obtained an average PSNR gain over Random initialization of 0.29 dB for N = 256 and an average PSNR gain of 0.60 dB for N = 512.Considering M-FSS-LBGa, the MH initialization strategy obtained an average PSNR gain over Random initialization of 0.19 dB for N = 256 and the All initialization strategy obtained an average PSNR gain over Random initialization of 0.73 dB for N = 512.
Tables 10 and 11 present the results of the average number of iterations for M-FSS-LBG and M-FSS-LBGa, respectively, with the Peppers image.It is observed that by replacing random initialization with an initialization strategy it is possible to obtain reductions in the average number of iterations in the range of 0.33 to 10.33 for M-FSS-LBG and in the range of 0.74 and 7.60 for M-FSS-LBGa.For example, for M-FSS-LBG and N = 512, Random initialization obtained an average number of iterations of 37.60 and the All strategy obtained 27.27 iterations, that is, a difference of 10.33 iterations.For the accelerated version of M-FSS-LBG, for N = 256, Random initialization obtained an average number of iterations of 33.70 and the All strategy obtained 26.10 iterations, that is, a difference of 7.60 iterations.
Tables 12 and 13 present the average PSNR results obtained with M-FF-LBG and its accelerated version, respectively, considering the Peppers image.It is observed that for both M-FF-LBG and M-FF-LBGAa, the results obtained with the different initialization strategies for N ≤ 64 are very similar.For N = 256 with M-FF-LBG, it was possible to obtain a PSNR gain of 0.17 dB by using the MH, MS and All strategies in substitution of the Random initialization, while with M-FF-LBGa, a PSNR gain of 0.12 dB is obtained by the substitution of the Random initialization by MS strategy.For N = 512 with the MHS strategy, the M-FF-LBG obtained an average PSNR of 33.08 dB and the M-FF-LBGa obtained 32.89 dB.Comparing these results with the results obtained with Random initialization, gains in terms of PSNR of 0.30 dB and 0.12 dB are observed for M-FF-LBG and M-FF-LBGa, respectively.
Table 17 presents the results of the Friedman test for M-FF-LBG and M-FF-LBGa considering the Peppers image.The results indicate the existence of significant statistical difference between the initialization strategies for N ≥ 128, considering the M-FF-LBG and for N = 32 and N ≥ 128 considering the M-FF-LBGa.
Figures 13 and 14 present the CD diagram for N = 512 with M-FF-LBG and M-FF-LBGa, respectively, considering the Peppers image.Figure 13 indicates that the MHS strategy is the best positioned in the ranking and that it presents statistical superiority only in relation to the SH, Random and DsMe strategies.For the accelerated version of M-FF-LBG (Figure 14), the MHS strategy is also the best positioned in the ranking and presents statistical superiority only in relation to the SH, Random, DsMe and DsKt strategies.
Regarding the results of the average number of iterations, presented in Tables 14 and 15 for the Peppers image, the superiority of M-FF-LBGa over M-FF-LBG for all N is observed, except for N = 64 with the strategies DsKt and DsMeKt.For N = 256, M-FF-LBG obtained an average number of 43.83 iterations with the MeKt strategy and M-FF-LBGa obtained 34.43 iterations.For N = 512, M-FF-LBGa presents an average number of iterations of 48.10 with the DsMeKt strategy, while M-FF-LBGa presents an average number of iterations of 24.20.In particular, for N = 512, the substitution of Random initialization by MS strategy results in a reduction of approximately 21% in the average number of iterations considering M-FF-LBG.Considering the accelerated version of M-FF-LBG, for N = 512, the substitution of Random initialization by DsMeKt strategy results in a reduction of approximately 46% in the average number of iterations.higher quality than those obtained by random initialization, thus contributing to obtaining reconstructed images with better quality in terms of PSNR.Regarding the average number of iterations, Figure 16 presents the histogram (for each size N) of the ranking of initialization strategies based on the results obtained with the Nemenyi test for the average number of iterations.
In Figure 16a, for N = 32, a well-distributed histogram is observed in which all initialization strategies were ranked first at least four times.The DsKt, MH and SH strategies occupied the first place in the ranking, with seven occurrences each.The second place, with six occurrences, was occupied by the All strategy.
For N = 64, in Figure 16b, the first place was occupied by the MH strategy, with 17 occurrences, and the second place by the All strategy, with 13 occurrences.It is observed that the first to fourth places in the ranking were occupied by all strategies that use the M initialization.Below the fourth position there is a smaller number of occurrences equal to 3.There were no occurrences for the Random strategy.
For N = 128 (Figure 16c), a similar behavior was observed.First to third place in the rankings were occupied by all strategies that use the M strategy.The MH strategy occupies first place in the ranking with 12 occurrences, while in second position, with 11 occurrences, one has the MS strategy.In third place there was a tie between the MHS and All strategies, with 10 occurrences each.Below the third position there was a smaller number of occurrences equal to 5. It is also worth highlighting that the random initialization ranked first only once in the Nemenyi test ranking.
In Figure 16d, for N = 256, the first place was occupied by the MHS strategy, with 12 occurrences, and second place by the DsKt strategy, with 10 occurrences.There were no occurrences for the Random strategy.
For N = 512 (Figure 16e), the first place was occupied by the DsKt strategy, with 11 occurrences.In second place there was a tie between the MS and MeKt strategies, with eight occurrences each.
It is worth mentioning that for codebook sizes N = 32, 128 and 512, the random initialization strategy ranked first in the Nemenyi test classification, five, one and two times, respectively.The best ranked initialization strategies in the Nemenyi test classification were the strategies that use M initialization.These results indicate that the combination of initialization strategies allows the reduction in the number of algorithm iterations for codebook design, leading to a reduction in the convergence speed of these algorithms.

Figure 1 .
Figure 1.Update of a codevector by the LBGa algorithm with K = 2.
= 1, 2, . . ., N} where ⃗ w (a) i represents the i-th codevector of the a-th codebook of dimension K, with ⃗ w ij , j = 1, 2, . . ., K}, where w (a) ij represents the j-th component of ⃗ w (a) Allocate the Q training vectors in the N Voronoi regions according to Equation (2); -Calculate the centroid of each of the N Voronoi regions according to Equation (5); -Calculate the distortion according to Equation (3); -Calculate the fitness function according to Equation (20); -Update position pbest according to Equation (21).

Table 1 .
Parameters used in the algorithms.
shows an example of a CD diagram, with four hypothetical classifiers: A, B, C and D. The CD value is displayed as a line at the top of the diagram.The horizontal axis of the diagram shows the average ranks, ordered from right to left.The identification of the classifiers and their respective average ranks appear next to each vertical line, below the axis.The connected groups are not significantly different from each other, at the 0.05 significance level.For example, in Figure 4, classifier A has the best average rank, but is statistically equivalent to classifiers B and D.

Figure 5 .
Figure 5. CD diagram of the Clock image considering the average PSNR (N = 512 and M-PSO-LBG).

Figure 9 .
Figure 9. CD diagram of the Elaine image considering the average PSNR (N = 512 and M-FF-LBG).

Figure 12 .
Figure 12.CD diagram of the Peppers image considering the average number of iterations (N = 512 and M-PSO-LBGa).
1: initialize the codebook Y 0 by randomly choosing N training vectors from Z; • Step 2: initialize N i to 1 for all i; • Step 3: for each training vector ⃗ z evaluate if N i d(⃗ z,⃗ y i ) < N j d(⃗ z,⃗ y j ), ∀i, j, where i ̸ = j.If true, add ⃗ z to S i and increment N i ; • Step 4: calculate the set of centroids C = {⃗ c i , i = 1, 2, . . ., N} where

Table 2 .
Composition of the initialization techniques used.

Table 3 .
Average PSNR results in dB for Clock, Elaine and Peppers images with the M-PSO-LBG algorithm.Bold text is used to highlight the best results for each N.

Table 4 .
Friedman test for the Clock image with M-PSO-LBG, M-FSS-LBG and M-FSS-LBGa algorithm, considering the average PSNR results.

Table 5 .
Average number of iterations obtained for Clock, Elaine and Peppers images with the M-PSO-LBG algorithm.Bold text is used to highlight the best results for each N.

Table 6 .
Average PSNR results in dB for Clock, Elaine and Peppers images with the M-PSO-LBGa algorithm.Bold text is used to highlight the best results for each N.

Table 7 .
Average number of iterations obtained for Clock, Elaine and Peppers images with the M-PSO-LBGa algorithm.Bold text is used to highlight the best results for each N.

Table 8 .
Average PSNR results in dB for Clock, Elaine and Peppers images with the M-FSS-LBG algorithm.Bold text is used to highlight the best results for each N.

Table 9 .
Average PSNR results in dB for Clock, Elaine and Peppers images with the M-FSS-LBGa algorithm.Bold text is used to highlight the best results for each N.

Table 10 .
Average number of iterations obtained for Clock, Elaine and Peppers images with the M-FSS-LBG algorithm.Bold text is used to highlight the best results for each N.

Table 11 .
Average number of iterations obtained for Clock, Elaine and Peppers images with the M-FSS-LBGa algorithm.Bold text is used to highlight the best results for each N.

Table 12 .
Average PSNR results in dB for Clock, Elaine and Peppers images with the M-FF-LBG algorithm.Bold text is used to highlight the best results for each N.

Table 13 .
Average PSNR results in dB for Clock, Elaine and Peppers images with the M-FF-LBGa algorithm.Bold text is used to highlight the best results for each N.

Table 14 .
Average number of iterations obtained for Clock, Elaine and Peppers images with the M-FF-LBG algorithm.Bold text is used to highlight the best results for each N.

Table 15 .
Average number of iterations obtained for Clock, Elaine and Peppers images with the M-FF-LBGa algorithm.Bold text is used to highlight the best results for each N.

Table 16 .
Friedman test for the Elaine image with M-FF-LBG and M-FF-LBGa algorithm, considering the average PSNR results.

Table 18 .
Friedman test for the Peppers image with the M-PSO-LBGa algorithm, considering the average number of iterations results.