Ai-Based Self-Checking And Generation Of Degeneracy For Adaptive Response Against Cyber Attacks On Embedded Systems