I'll risk answer to the edit that the OP createdAS Plisurgist mentioned, killing humans "for greater good/justice" is still immoral and removed - "What if the attacker didn't initially knew that he is killing humans", in hope that this will came backpotential humanity loss and definitely doesn't count towards "Self defense".
In But what happens when you don't know that you are fighting with mortal? In that case the ignorance is blessing - if you don't know that youwhat are you killing humans, you shouldn't loose humanity. BUT when you find that you've indeed killed normal mortal (even after a while), you are at risk of loosing humanity.
Think about it as an internal court system (which in fact morality is): when the dust settles, at the end of day you still committed murder in cold blood.