# Using the Guided Fireworks Algorithm for Local Backlight Dimming
## 3 Local Dimming Based on the Guided Fireworks Algorithm  
### Fireworks Algorithm  
FWA is an EC algorithm which was developed by simulating the explosion process of fireworks. In the FWA, two search strategies are employed, and mechanisms for maintaining diversity of the population are also well designed [20]. When the FWA is used to solve optimization problems, the firework and spark locations correspond to the solutions of the problem. In this section, \(\overline{R}_{i}\) is used to present the location of firework \(i\), \(\widetilde{R}_{i}\) is used to present the general spark location \(i\), and \(\hat{R}_{i}\) is used to present the Gaussian spark location \(i\). For each location, its objective function is calculated based on Equation (7). Take \(\overline{R}_{i}\) as an example: the objective function of \(\overline{R}_{i}\) is \(f(\overline{R}_{i})=\frac{1}{\text{MSSIM(X,Y(\overline{R}_{i}))}}\), where X is the reference image and Y(\(\overline{R}_{i}\)) is the displayed image processed by the solution \(\overline{R}_{i}\). During the searching process of the algorithm, the objective function is used to evaluate the quality of the solution. The smaller the value of \(f(\overline{R}_{i})\), the better the quality of \(\overline{R}_{i}\). The flow chart of the FWA is shown in Figure 2. The equations mentioned in the flow chart are included here as (8)-(10). The pseudo codes of Algorithms A1 and A2, mentioned in the flow chart, are shown in Appendix A. \[\left\{ \begin{array}{l}s_{i}=Q\times\frac{f(\overline{R}_{i})_{\max}-f( \overline{R}_{i})+\xi}{\sum\limits_{j=1}^{K}(f(\overline{R}_{\max}-f( \overline{R}_{j}))+\xi}\\ \hat{s}_{i}=\left\{\begin{array}{l}round(a\times Q)\qquad\text{if }s_{i}>a \times Q\\ round(b\times Q)\qquad\text{if }s_{i}<b\times Q\\ round(s_{i})\end{array}\right.\end{array} \right. \tag{8}\]where \(\widehat{s}_{i}\) is the number of sparks generated by the firework \(\overline{R}_{i}\), \(Q\) is a parameter used to control the total number of general sparks generated by the fireworks, \(f(\overline{R}_{i})\) is the objective function, \(n\) is the number of fireworks, \(f(\overline{R})_{\text{max}}=\text{max}(f(\overline{R}_{j}))(j=1,2,\cdots,n)\), \(\bar{\zeta}\) is a very small constant to avoid zero-division-error, and \(a\) and \(b\) are two constants. \[A_{i}=\hat{A}\times\frac{f(\overline{R}_{i})-f(\overline{R})_{\text{min}}+ \bar{\zeta}}{\sum\limits_{j=1}^{n}{(f(\overline{R}_{j})-f(\overline{R})_{\text{ min}})}+\bar{\zeta}} \tag{9}\]  
where \(A_{i}\) is the explosion amplitude of firework \(\overline{R}_{i}\), and \(\hat{A}\) is the maximum explosion amplitude, \(f(\overline{R})_{\text{min}}=\text{min}(f(\overline{R}_{j}))(j=1,2,\cdots,n)\). \[\left\{ \begin{array}{l}d(R_{i}^{\prime})=\sum\limits_{j\in G}||R_{i}^{ \prime}-R_{j}^{\prime}||\\ P(R_{i}^{\prime})=\frac{d(R_{i}^{\prime})}{\sum\limits_{j\in G}d(R_{j}^{ \prime})}\end{array} \right. \tag{10}\]  
where \(G\) is a mixed set including all firework locations and spark locations, and \(R_{i}^{\prime}\) represents the location \(i\) in set \(G\), \(P(R_{i}^{\prime})\) is the probability that location \(R_{i}^{\prime}\) is selected. In the search process of the FWA, new spark locations are generated by random searching around the locations of fireworks. For different firework locations, the search step size and the number of generated spark locations are different. If a firework location has better quality, there will be more spark locations generated around it, and its search step size will be smaller. Because high quality spark locations appear more easily near high quality firework locations, this search strategy is conducive to improving the search ability of the algorithm. After the general spark locations have been generated,  
Figure 2: The flow chart of the Fireworks Algorithm (FWA). the Gaussian spark locations are generated. This is beneficial for ensuring population diversity.