The Substitution Box (S-Box) plays a critical role in several block cipher cryptosystems due to its ability to provide essential properties of non-linearity and confusion. Therefore, incorporating a strong S-Box is critical for ensuring a high level of security and optimal performance of block cipher algorithms. In recent years, a variety of S-boxes have been developed, which fall into different robustness categories, such as high, medium, or low. Examining the robustness of an S-box to enhance cryptosystems in terms of security is a challenging task. Although parameters such as Bit Independence Criterion (BIC), Nonlinearity (NL), Strict Avalanche Criterion (SAC), Linear Approximation Probability (LP), and Differential Uniformity (DU) can be useful to determine the robustness levels, manually evaluating each S-box is an ineffective and time-consuming approach. To overcome this challenge, a machine learning model is developed, utilizing the parameters that evaluate the strength of the S-box as features. Additionally, a novel lightweight image encryption scheme suited for IoT applications is also proposed, incorporating various S-boxes. Implementing robust S-boxes also strengthens the security of the proposed encryption scheme. However, to enhance its security further, four distinct cryptographic techniques such as chaotic maps, Discrete Wavelet Transform (DWT), Substitution Box (S-box), and Dynamic Random Phase Encoding (DRPE) are employed. To evaluate the efficiency of the proposed encryption scheme in terms of statistical and visual analysis, numerous parameters are considered, including entropy, correlation, contrast, energy, noise and cropping attack analysis, histogram analysis, correlation, entropy, differential analysis, occlusion attack, noise attack, and speed performance analysis. Moreover, a detailed comparison is performed between the proposed and existing encryption schemes to demonstrate that the proposed approach is more efficient than existing ones.