## 3 Anomaly Detection and Quantification of Seismicity Parameters
The computational methodology employed in this study is delineated in Algorithm 1, providing a structured outline of the procedural steps and analytical techniques utilized. The initial phase of ascertaining the seismic parameters \(a\)- and \(b\)-value involves computing the magnitude of completeness (\((M_{c})\)) for the Saudi earthquake catalog [33]. \((M_{c})\) is pivotal in seismicity analyses as it represents the minimum magnitude recorded comprehensively across the entire dataset [34]. Notably, the \((M_{c})\) value in earthquake catalogs generally diminishes over time with the augmentation of seismograph numbers and the advancement of analytical methodologies, as noted by [35]. For this study, the maximum curvature method [10] is employed to determine \((M_{c})\) within the Red Sea region, offering a straightforward and efficient approach for \((M_{c})\) calculation. This method also proveseffective in predicting the spatial dynamics of Frequency-Magnitude Distribution (FMD) correlations [36; 37]. ```
1:Input: Seismic data set \(D\), number of trees \(T\), sub-sampling size \(s\)
2:Output: Anomaly scores for each data point in \(D\)
3: Initialize an empty forest \(F\)
4: Pre-calculate \(c(n)=2^{log2(T)-1}\)
5:for\(i=1\) to \(T\)do
6: Create an empty tree \(I\)
7: Randomly sample \(s\) data points from \(D\) to form a sample \(S\)
8:while\(S\) is not empty and the height limit is not reached do
9: Randomly select a feature \(f\)
10: Randomly select a split value \(v\) between max and min values of \(f\) in \(S\)
11: Split \(S\) into two subsets \(S_{1}\) and \(S_{2}\) based on \(v\)
12: Assign \(S_{1}\) and \(S_{2}\) to the left and right child nodes, respectively
13: Update \(S\) to be \(S_{1}\) or \(S_{2}\)
14:endwhile
15: Add tree \(I\) to forest \(F\)
16:endfor
17:for each data point \(x\) in \(D\)do
18: Initialize path length \(h(x)=0\)
19:for each tree \(I\) in \(F\)do
20: Update \(h(x)\) with path length of \(x\) in \(I\)
21:endfor
22: Calculate average path length \(E(h(x))\)
23: Compute anomaly score \(s(x)=2^{-\frac{E(h(x))}{c(n)}}\) (Modified line)
24:endfor
25:return Anomaly scores for each data point in \(D\)
```  
**Algorithm 1** Isolation Forest for Anomalous Seismic Activity Detection  
The incorporated methodology utilizes a time window spanning 100 seismic events, a shift interval of 10 occurrences, and the application of bootstrapping techniques [10] to ascertain the confidence level of (\(M_{c}\)) derived from the Saudi earthquake catalog. The Gutenberg-Richter magnitude-frequency relationship in this context is represented by the equation, as elucidated by [36]:  
\[\log(N(M_{w}))=a-bM_{w} \tag{4}\]  
N(Mw) is the magnitude of an earthquake larger than or equal to Mw, and a and b are the Gutenberg-Richter model parameter constants [38]. The value of \(a\) is a parameter indicating seismic activity in several locations at a given moment. It is known as the seismic index, whereas \(b\) is a tectonic parameter that specifies the slope of the distribution of the magnitude of the earthquake frequency. The \(b\)-values were computed using ZMAP [10]:  
\[b=\frac{\log_{10}(e)}{(M_{\text{mean}}-M_{\text{C}})} \tag{5}\]  
\(M_{\text{mean}}\) is the average value of the magnitude group with \(M_{\text{mean}}\geq M_{\text{C}}\) and then, the standard error value is also calculated for the b value of the frequency-magnitude relationship. **4. Saudi Networks and Seismicity Database Development**  
This section describes the creation of the Saudi Seismicity Database, detailing data collection and standardization from Saudi seismic networks and highlighting its role in regional seismic hazard. This bifurcation in seismic monitoring infrastructure reflects the nation's commitment to enhancing its capabilities in seismological research and hazard assessment.