# Background Subtraction for Dynamic Scenes Using Gabor Filter Bank and Statistical Moments
## 3 Materials and Methods
### Segmentation Criteria
It is calculated as:

\[PWC=\frac{100\times(F_{N}+F_{P})}{T_{P}+F_{N}+F_{P}+T_{N}} \tag{14}\]

Precision (also known as Positive Predictive Value): This metric measures the proportion of identified positives that are actually correct. It is calculated as:

\[Precision=\frac{T_{P}}{T_{P}+F_{P}} \tag{15}\]

F Measure (or F1 Score): This is the harmonic mean of Precision and Sensitivity. It provides a single score that balances the trade-off between Precision and Recall. It is calculated as:

\[FMeasure=2\cdot\frac{Precision\cdot Sensitivity}{Precision+Sensitivity} \tag{16}\]

True positive (\(T_{P}\)) refers to pixels correctly identified as part of the moving object. True negative (\(T_{N}\)) denotes pixels correctly identified as part of the static background. False positive (\(F_{P}\)) pertains to pixels incorrectly labeled as part of the moving object when they belong to the background, while false negative (\(F_{N}\)) refers to pixels incorrectly labeled as background when they are truly part of the moving object. Tables 4 and 5 compare existing methods and GABSM. Table 4 shows the results achieved by our method, which achieves a sensitivity of 0.738. This reflects its efficiency in correctly identifying relevant foreground elements. On the other hand, a specificity of 0.994 shows the ability to exclude noise generated by reflections. With a misclassification rate of 1.059, it demonstrates a low error rate in classifying textures, even when they are complex or appear homogeneous with the environment, under variable lighting conditions. These fluctuations in lighting can significantly alter how textures are perceived, representing a challenge for their classification and analysis. Nevertheless, an \(F1\) score of 0.701 evidences that our method is capable not only of recognizing complex texture patterns but also of adapting to the variability caused by changes in lighting. In Table 5, a sensitivity of 0.856 is obtained, reflecting our method's ability to correctly detect objects of interest. Its specificity of 0.99 and an FPR of 0.008 demonstrate its efficacy in discarding irrelevant elements, even in a dynamic environment due to the movement \begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline
**Method** & **Sensibility** & **Specificity** & **FPR** & **FNR** & **PWC** & **Precision** & **F1 Measure** \\ \hline DEU & 0.274 & 0.984 & 0.016 & 0.726 & 0.301 & 0.144 & 0.188 \\ DMD & 0.875 & 0.990 & 0.010 & 0.125 & 1.108 & 0.472 & 0.613 \\ DSTEI & 0.658 & 0.984 & 0.016 & 0.342 & 1.751 & 0.122 & 0.206 \\ EigenBS & 0.437 & 0.991 & 0.009 & 0.563 & 2.151 & 0.546 & 0.486 \\ GMM & 0.929 & 0.991 & 0.009 & 0.071 & 0.989 & 0.507 & 0.656 \\ MRFMD & 0.735 & 0.983 & 0.017 & 0.265 & 1.775 & 0.071 & 0.130 \\ SDBE & 0.830 & 0.992 & 0.008 & 0.170 & 1.024 & 0.565 & 0.673 \\ SOBS & 0.929 & 0.991 & 0.009 & 0.071 & 0.994 & 0.504 & 0.654 \\ SWCD & 0.890 & 0.997 & 0.003 & 0.110 & 0.451 & 0.865 & 0.877 \\ ViBe & 0.883 & 0.992 & 0.008 & 0.117 & 0.949 & 0.565 & 0.689 \\
**GMBSM** & **0.738** & **0.994** & **0.006** & **0.262** & **1.059** & **0.668** & **0.701** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results obtained when evaluating the methods in \(5_{3}\). of leaves. According to the \(F1\) score of 0.746, our method proves to be effective in facing the complexity of environments influenced by shadows and dynamic movements, such as those generated by moving tree leaves. Additionally, this environment introduces changes in perspective, where the distinction between distant and nearby objects complicates the detection of moving objects due to a fixed Gabor core. In Table 6, a sensitivity of 0.827 and a high specificity of 0.988 are observed, along with a relatively low FNR of 0.172 and an FPR of 0.012. These parameters demonstrate that the GABSM method can adapt to scenarios where moving objects may stop unexpectedly, presenting a problem for traditional background modeling methods. With an accuracy of 0.863 and an F1 score of 0.901, GABSM proves its reliability in adapting to such scenarios.