Preventing SD card corruption in the event of power failure/forced restart

Hello,

I am building a personal project for image classification, deployed on Jetson nano developer kit. I am testing several steps while developing. I am using headless OS. I am facing the issue that SD card gets corrupted after several restart via power disconnect. Several restart might be any number from 2 times to 50 times. How can I avoid and protect the SD card corruption after several restart?

Thank you