# From Classic to Cutting-Edge: A Near-Perfect Global Thresholding Approach with Machine Learning
## 2 Materials and Methods
### Proposed Solution
The efficiency also benefits OCR systems and other machine learning applications, where local approaches can introduce noise by providing reliable preprocessing and robust features that can be computed quickly and efficiently. \begin{table}
\begin{tabular}{c c c} \hline
**Method** & \(\overline{PSNR}\) **(\%)** & \(\overline{FM}\) **(\%)** \\ \hline Proposed method & **19.26** & **92.8** \\ \hline [PERSON] and [PERSON] & 19 & 92.3 \\ \hline [PERSON] and [PERSON] & 18.54 & 91.2 \\ \hline [PERSON] et al. & 19.17 & 92.3 \\ \hline [PERSON] et al. & 19.16 & 92.7 \\ \hline \end{tabular}
\end{table} 
Table 6: Result comparison on the H-DIBCO 2014 dataset. \begin{table}
\begin{tabular}{c c c c c} \hline
**Method** & \(\overline{FM}\) **(\%)** & \(\overline{FM}_{2019}\) **(\%)** & \(\overline{PSNR}\) & \(\overline{PSNR}_{2019}\) \\ \hline Proposed method & 83.04 & **77.71** & 15.86 & **16.91** \\ \hline DIBCO winners & 88.59 & 72.88 & 19.16 & 14.48 \\ \hline Otsu & 76.56 & 63.87 & 15.30 & 12.67 \\ \hline Sauvola & 77.66 & 63.82 & 15.79 & 12.66 \\ \hline DeepOtsu & 87.04 & 60.75 & 19.33 & 14.44 \\ \hline SAE & 88.01 & 58.78 & 19.54 & 12.35 \\ \hline DD-GAN & 87.70 & 58.01 & 19.87 & 14.43 \\ \hline MRAM & 85.67 & 49.53 & 19.18 & 12.95 \\ \hline
2 DMN & 78.61 & 42.76 & 15.55 & 8.25 \\ \hline cGANs & 88.64 & 62.29 & 19.66 & 12.80 \\ \hline DE-GAN & 88.52 & 56.03 & 19.44 & 8.37 \\ \hline Suh & 89.92 & 70.63 & 19.87 & 14.72 \\ \hline GDB & 90.89 & 73.84 & 20.41 & 14.80 \\ \hline GDBMO & 91.16 & 73.50 & 20.50 & 14.96 \\ \hline D2 BFormer & 91.73 & 66.69 & 20.83 & 15.05 \\ \hline DocDiff & - & 73.38 & - & 15.14 \\ \hline DocEnTr & - & 59.00 & - & 13.85 \\ \hline DocBinFormer & **92.22** & 60.31 & **21.30** & 14.49 \\ \hline \end{tabular}
\end{table} 
Table 7: Result comparison with state-of-the-art methods on all datasets (\(\overline{FM}\)) versus DIBCO 2019 dataset \(\overline{FM}_{2019}\). However, while this approach of ignoring local relationships enhances efficiency, it can lead to the loss of important local information, which could be crucial for tasks like edge detection, texture analysis, or applications where neighboring samples are strongly correlated. For such scenarios, methods that take local relationships into account might provide more accurate results. In the following figures, black represents true positives, white represents true negatives, cyan represents false positives, and red represents false negatives. Figure 1 illustrates the importance of local relationships with two images from the DIBCO 2018 dataset for which global binarization algorithms cannot possibly achieve an acceptable result. For images such as these, there is no global threshold with which you can eliminate both false negatives and false positives. Figure 2 shows that on some images, such as image 13 from the challenging DIBCO 2019 dataset, where even state-of-the-art neural-network-based algorithms struggle to produce acceptable results, a global binarization algorithm can produce competitive results. The diverse training dataset produces a model that is more robust in terms of noise, illumination conditions, contrast, etc. Combining multiple datasets carries the risk of hindering model performance for some particular datasets, but the benefit of increasing the robustness outweighs the risk. Cross-validation further reduces this risk, ensuring that the model performs consistently across all folds. Figure 1: Problematic images for global binarization from DIBCO 2018: 2 (**top**) and 10 (**bottom**). From left to right: original image, image binarized with [PERSON]’s method (threshold too high), and image binarized with the proposed method (threshold too low). Figure 2: From top to bottom, left to right: original image, ground truth, Otsu binarization, Sauvola binarization, GDB binarization, proposed solution binarization. Data augmentation also improves model robustness and performance.