From what I've read through various wikis and pieced together through game play, killing a bandit lowers your humanity even if he fired at you first, but being hit by a round then killing him neither raises nor lowers your humanity as it was self-defence.