## 3 The Proposed Model
### 3.2. Ransomware Detection: Optimal GCNN Model
Similar to how the SA simulates physical annealing, the GA simulates biological evolution, the harmony algorithm simulates the principles of concert performance, and the PSO algorithm [20] simulates flocks of birds. Briefly, for HSA, every solution vector (decision variable set) is stored in harmony memory (HM). The key parameter of HSA includes pitch adjusting rate (PAR), harmony memory size (HMS), distance bandwidth (BW), stopping criterion or several improvisations (NI), and harmony memory consideration rate (HMCR). Generally, the global optimization problems are discussed below. Minimize \(f(x)\) subjected to  
\[\chi_{j}\in X_{i}i=1,2,\cdots,\ N. \tag{14}\]  
where \(f(x)\) indicates the main function, \(\chi\) denotes the group of decision parameters \(x_{i}\), \(N\) shows the count of decision parameters, \(X_{i}\) represents the group of the potential range of value for every decision parameter, the upper boundary for every decision parameter is \(B(i)\), and the lower boundary is \(LB(i)\); afterwards, \(LB(i)\leq X_{i}\leq UB(i)\). The HM with the size of HMS is produced based on solution space. \[HM= \begin{bmatrix}x_{1}^{1}&x_{2}^{1}&\dots&x_{N-1}^{1}&x_{N}^{1}\\ x_{1}^{2}&x_{2}^{2}&\dots&x_{N-1}^{2}&x_{N}^{2}\\ \vdots&\vdots&\dots&\vdots&\vdots\\ x_{1}^{HMS-1}&x_{2}^{HMS-1}&\dots&x_{n-1}^{HMS-1}&x_{N}^{HMS-1}\\ x_{1}^{HMS}&x_{2}^{HMS}&\dots&x_{N-1}^{HMS}&x_{N}^{HMS}\end{bmatrix}  \tag{15}\]  
Every decision parameter is produced by: \(x_{i}^{j}=LB(i)+(UB(i)-LB(i))*r\) for \(i=1,2,\dots,\ N\) and \(j=1,2,\dots,\ HMS\), where \(r\) denotes the arbitrary value within \([0,1]\). A new harmony vector is produced using the following rules, such as pitch adjustment, random selection, and memory consideration. Initially, a random number \(r_{1}\) is generated within \([0,1]\) and compares \(r_{1}\) with the initialized HMCR. When \(r_{1}<HMCR\), a random parameter in the initial HM is taken that is named memory consideration. Otherwise, it is attained by random selection (produced randomly between the search boundary). Lastly, a new harmony parameter is taken. Once it can be upgraded by the memory consideration, it should be attuned, and a parameter \(r_{2}\) within \([0,1]\) is produced randomly as explained in Algorithm 1 below. When \(r_{2}<PAR\), the parameter based on the initial BW is adjusted and a newly generated parameter that is named pitch adjustment is obtained:  
\[x_{i}^{new}=x_{i}^{new}\pm r*BiV \tag{16}\]  
where \(r\) denotes the randomly generated value within \([0,1]\). ```
Initialize the parameters HMCR, HMS, BW, PAR, Tax  Initialize the HM  Repeat  Create a New Harmony as:  for every \(i\), perform \(x^{new}\rightarrow \begin{cases}\text{memory consideration with probability HMCR}\\ \text{ random selection with probability }1-\text{HMCR}\end{cases} \) if\(x_{i}^{new}\in HM\), then \(x_{i}^{new}= \begin{cases}x_{i}^{new}\pm r*BW&with\ probability\ PAR\\ x_{i}^{new}&with\ probability\ 1-PAR\end{cases} \) end if end for if the new harmony vector is superior to that of the worse one in the novel HM, then  Upgrade HM  end if Until \(T_{max}\) is satisfied  Return better harmony
```  
**Algorithm 1** Pseudocode of HSA  
The newly attainted harmony is evaluated by \((x)\). Once the new harmony has the best main function solution when compared to the worst solution in the abovementioned HM, the new harmony substitutes the worst harmony from the HM. If the present amount of times of creation are attained, the abovementioned maximal times \(T_{\text{max}}\) of formation are checked. Fitness selection is a critical factor in the HSA technique. Solution encoding can be used to assess the aptitude (goodness) of the candidate solution. Here, the accuracy value is the main condition used to design a fitness function. \[Fitness=\text{ max }(P) \tag{17}\]\[P=\frac{TP}{TP+FP} \tag{18}\]  
From the expression, _TP_ represents the true positive, and _FP_ denotes the false positive value.