This work illustrates the viability of optics ideas using a machine learning (ML) technique to choose the optimal SPR sensor for a particular set of structural parameters. Particle swarm optimization (PSO) algorithm is utilized in conjunction with an ML model to design a tunable surface plasmonic resonance (SPR) sensor. A trained ML model is applied to the PSO algorithm to develop the SPR sensor with the desired sensing performance. Using a learned ML model to forecast sensor performance rather than sophisticated electromagnetic calculation techniques allows the PSO algorithm to optimize solutions four orders of magnitude faster. This composite algorithm's implementation enabled us to rapidly and precisely create an SPR sensor with a sensitivity of 68.754 ᵒ/RIU and having an impressive figure of merit of 100. We anticipate that this effective and precise method will pave the way for the future development of plasmonic devices.