My boxer is a bit like that sometimes, he's just over a year now and not been neutered. I'd say from around 6 months old, if a child came close he would growl and growl at them until i shouted at him and told him off. He hadn't really seen many kids before though, especially up close. He seems to be getting a lot better though the more he meets them. I'd usually say it's when he's on the leash or in my house etc, so probably just being protective. If he growls now i just shout NO!!! them hold his collar real tight say no again in a firm voice, then get them to stroke him or give him a treat. I think they just have to get used to them.
Whoa! Sorry, but huge red flags went up when I read your response. First of all, it is actually quite common for a dog at 6 months old to start being shy, wary, or fearful. It's called Juvenile Onset Shyness and is a normal period in a dog's development. Some shyness is to be expected at this age. I like to tell my students to expect to have to do another round of socialization with their dogs as they enter adolesence--really focusing on building positive associations with all kinds of people, places, and things. (Of course, excessive shyness at this time is something to be concerned about as is excessive shyness in a puppy.)
The thing that concerned me was that as your pup was showing signs of what was very likely fear and apprehension at the sight of kids, you "shouted at him and told him off". This probably didn't do anything to sway his fear of kids and likely added to it. Fear is an emotion. You may be punishing the behavior of growling and see some reduction of that, but you really need to focus on creating a different emotional response to the thing that triggered the fear otherwise you just end up with a dog that is still afraid of kids but has been punished enough that it doesn't growl. The fear is still there and if the dog feels cornered by the kids, it will likely skip the growling and jump right to snapping.
You say the dog now mostly does it when on leash or in the house so you think it is being protective. Honestly, when I read that what came first to my mind is that the dog feels trapped by the leash and so feels that it must growl to keep the kids away. I think the fear and apprehension are still there and all your yelling and collar grabbing have trained the dog to do is to hide it except in those situations where he feels he has no alternative.
You are correct in that the more he has good associations with kids, the better he will get with them and the more he will feel at ease around them. However, if he is growling and you "just shout NO!!! then hold his collar real tight say no again in a firm voice, then get them to stroke him or give him a treat." you are going about it all wrong and you are VERY likely going to get a poor child bitten. Take the growl as a sign that your dog is tremendously uncomfortable in that situation and get away from the kids. Do not put him in situations such as those until you have consulted a behaviorist or a really good trainer that is used to working with dogs who exhibit fear-based aggression. It is my gut feeling that your training should focus on desensitizing this dog to children and counterconditioning a different emotion response to them--not punishing away the behavior that is a symptom of his fear.