# From Classic to Cutting-Edge: A Near-Perfect Global Thresholding Approach with Machine Learning
## 2 Materials and Methods
### Proposed Solution
The parameters used for all data augmentation transformations were set to produce realistic results that could have been captured from the same documents in different lighting conditions or with different camera settings. ## 5 Conclusions

The proposed solution produces results very close to the ideal scenario on various datasets and much better than any of the input algorithms, with an average score of around 90.3-90.8% of the maximum possible score and an MSE of around 0.7-0.8% when using nested cross-validation. When refitting the models on the entire dataset, the results improved even further, with the best model reaching an average score of 99.99% of the maximum possible score and an average processing time of just 0.22-0.25 s.

Future improvements could include using FM as the optimization metric, which might boost the average score and MSE across dataset folds, although this was not feasible in the current implementation due to the limitations of the ML_NET framework. The overall accuracy could be enhanced by applying the algorithm locally around each pixel, resulting in a local thresholding algorithm, or by applying the model on image patches, resulting in a mixed global-local thresholding algorithm. Experimenting with different neural network architectures specialized for regression instead of using AutoML might yield better results. The proposed solution could be used as an estimator in a more complex approach. For example, [PERSON] et al. [22] use [PERSON]'s method to generate an input noisy mask for a multi-branch coarse sub-network that predicts an output mask, which then feeds into a refinement sub-network to produce the final binarized image. The predicted ideal threshold could also be used as a feature in a local thresholding machine learning model. Additional algorithms could be implemented into the overall solution to improve performance and adaptability to more complex tasks. For instance, incorporating local or mixed global-local thresholding techniques could improve accuracy in cases where fine-grained details are crucial. By expanding the algorithm to include more advanced techniques, the solution could become even more robust, offering greater flexibility for tasks such as image segmentation, edge detection, or other specialized applications. Conceptualization, N.T., C.-A.B. and M.-L.V. ; data curation, C.-A.B. ; formal analysis, N.T., C.-A.B. and M.-L.V. ; investigation, N.T. ; methodology, N.T. and M.-L.V. ; project administration, C.-A.B. ; resources, C.-A.B. ; software, N.T. ; supervision, C.-A.B. ; validation, N.T., C.-A.B., and M.-L.V. ; visualization, N.T., C.-A.B. and M.-L.V. ; writing--original draft preparation, N.T. ; writing--review and editing, N.T., C.-A.B. and M.-L.V. All authors have read and agreed to the published version of the manuscript. This research received no external funding. Not applicable. The original contributions presented in this study are included in the article. The authors declare no conflicts of interest. The following abbreviations are used in this manuscript: \begin{tabular}{l l} BC & Sarle's Bimodality Coefficient \\ GBC & Generalized BC \\ CFT & Cost Frugal Tuner \\ \end{tabular} 

## References

* (1) [PERSON]; [PERSON]; [PERSON]; [PERSON] Binarization Methods in Multimedia Systems when Recognizing License Plates of Cars. _Int. J. Acad. Eng. Res._**2023**, \(7\), 1-9. * (2) [PERSON]; [PERSON] Image Thresholding Method Based on Tsallis Entropy Correlation. _Multimed. Tools Appl._**2024**, _84_, 9749-9785. [CrossRef]
* (3) [PERSON]; [PERSON] Histogram-Based Global Thresholding Method for Image Binarization. _Optik_**2024**, _306_, 171814. [CrossRef]
* (4) [PERSON]; [PERSON] Adaptive Shock-Diffusion Model for Restoration of Degraded Document Images. _Appl. Math. Model._**2019**, _79_, 555-565. [CrossRef]
* (5) [PERSON]; [PERSON]; [PERSON] Nonlinear Edge-Preserving Diffusion with Adaptive Source for Document Images Binarization. _Appl. Math. Comput._**2019**, _351_, 8-22.