Those deep scratches look like the head hit the pavement and slid.
You may be able to feel for hollow spots in the foam, or look for cracks in foam. Perhaps remove the pads if they come out.
But, as others have said, the helmet did it's job. You're alive... Go ahead and replace.