Compulsive head-banging, a behavior affecting an estimated 50,000 children and young adults in this country, has been successfully controlled in a few children by a new electronic device unveiled last week.

The behavior, which often begins in some autistic and retarded children at about age 1 or 2, can cause serious injury, sometimes even death.

According to one of the new device's designers, Robert E. Fischell, chief of technology transfer at the Johns Hopkins Applied Physics Laboratory, most of the youngsters who engage in this self-injurious behavior are "handcuffed to a chair, in straitjackets or padded cells where they can't strike their heads."

The device -- called SIBIS, self-injurious behavior inhibiting system -- delivers a tiny electronic shock, not enough to cause discomfort, to the arm or leg each time a child bangs his head.

Fischell came to the project reluctantly, he says, under unremitting pressure from a Chevy Chase woman, Mooza Grant, who years ago had put together a kind of Rube Goldberg contraption for her self-injurious autistic daughter. "It was a very crude system," Fischell said, "with helmet, backpack, wires from head to back and from back to arm, where there was an electrode that gave a minuscule shock every time she banged her head."

What was extraordinary, said Fischell, was that "it worked."

Mooza Grant came to Fischell to enlist his aid in designing a less cumbersome version.

Although he resisted because he was "up to my neck" in other projects, Fischell took on the project, with backing from Hopkins and Human Technologies Inc., a St. Petersburg, Fla., high-tech firm. He replaced the batteries with microchips and the wires with radio telemetry, reducing the unit to about a pound.

Children with autism appear almost totally withdrawn from outside contact. The little-understood condition is believed to be associated with a defect in brain development.

It is not clear why the SIBIS device works, or why it sometimes seems to work even without the use of the electric shock, but the preliminary results have been dramatic. One 11-year-old boy named Jimmy -- the scientists withheld his last name -- was banging his head at the rate of about 2,000 times an hour, said Dr. Thomas R. Linscheid, an Ohio State University child psychologist. "The first week he wore the helmet, he banged his head only 13 times in the whole week."

Linscheid is testing more children at Ohio State and others are being tested in Baltimore, Texas and other centers. "When it works, it works almost immediately," Linscheid said.

Because of the dramatic improvement among the first three children, SIBIS is being made available publicly. Each unit -- helmet, along with arm or leg band -- costs about $3,000. In a videotape of Jimmy, being displayed this week at the American Psychological Association in New York, a viewer can see not only that the child stops his head-banging within a few minutes but also actively resists having the device removed.