Whizzing down Commonwealth Avenue through Kenmore Square, Berklee College of Music student Jon Cox could not have looked more hip. He was riding an aqua and chrome vintage bike. The tattoo on his arm showed symbols from an early Led Zeppelin record. He was yawning.

And since he was unencumbered by a bike helmet, he was listening to Mumford & Sons through oversize headphones — oblivious to the large sign he pedaled past featuring a graphic image of a cyclist with a gashed and bloodied face. “Still think it’s the helmet that’s unattractive?” the message read. “There are no good excuses.”

Maybe not, but there are excuses for going helmetless: “I’m pretty broke,” Cox said when stopped for an interview. Then he added, “I’ll be really careful.”

John Tlumacki/Globe staff

This scary sign is part of the city’s $40,000 “Wear a Helmet” campaign.

With a growing number of bike lanes in the city — it’s up to 60.3 miles — and its rent-a-bike Hubway program taking off, Boston is aggressively targeting cyclists like Cox in two new ways: with a $40,000 “Wear a Helmet” campaign, replete with scary pictures, and with the city’s first-ever helmet vending machine about to be installed.

The question is whether cyclists like Cox will ever be persuaded to change their ways, even when there are studies showing bike helmets decrease the risk of head and brain injury by 65 to 88 percent. Wearing a helmet is something Cox acknowledges he should be “more cognizant” of, but he never seems to get around to it. “I guess you could call it some sort of strange laziness,” said the 21-year-old guitarist in the band Telescope Casual.

The advertising campaign, which is winding down this month, was developed by the Boston Public Health Commission in conjunction with other city agencies, cycling groups, and bike shops and is the latest effort in a push by the city to improve bicycle safety. Dr. Huy Nguyen, the commission’s medical director, said the goal of the ads is to reduce head, brain, and facial injuries by increasing the use of bicycle helmets.

It consists of signs on streets and in bus shelters in high bike-traffic areas of the city, such as universities, and targets cyclists aged 18-39, the demographic with the highest number of bike riders and the most injuries. Signs address common excuses for going helmetless. One image shows a young man with a brutal face injury. “And you think a helmet is uncomfortable?” the message says. Another poster reads: “Not thinking about helmet hair now, are you?”

Boston will also get its first bike-helmet vending machine this month, the so-called “HelmetHub.” It originated as an underground class project at MIT and became a start-up company founded by two team members, Chris Mills and Breanna Berry.

HelmetHub aims to encourage the use of helmets in public bike-sharing programs, such as Boston’s Hubway, which lets riders rent bikes from kiosks. (There are 40 bike-share programs across the country operating or in the planning stages, according to the US Department of Transportation. )

Helmet use is not a requirement for bike rental in Boston, though the city makes subsidized helmets available from nearby retailers. HelmetHub would dispense and collect helmets, which will be sterilized at a different location.

Designers are putting the finishing touches on their beta prototype of the vending machine that will be installed near the Boston Public Library bike-share station.

“Ultimately our goal would be to have our machine at every bike-share station in all the major cities,” said Mills.

There’s no shortage of potential users. More than 80 percent of Boston’s bike-share riders cycle without helmets compared to nearly 50 percent of those with their own bikes, according to a recent study conducted in Boston and Washington, D.C., by researchers at Beth Israel Deaconess Medical Center and published in August in the Annals of Emergency Medicine.

“We weren’t surprised,” said Dr. Christopher Fischer, the lead author. “Walking around the city and living in the city, you always see people who ride bikes without helmets.” But they were jolted to discover that four out of five bike-share riders go without. “It’s the equivalent of renting a car and not getting a seat belt,” he said.

On a recent warm day, helmetless riders were out in full force on Massachusetts Avenue around MIT in Cambridge. They included Hubway rider Jonas Nahm, a 30-year-old graduate student, who doesn’t own a helmet because he likes to “hop on Hubway” to get around. “If I had one, it wouldn’t be where my bike was,” he said.

And then there was Gabriele Urbonaite, a 19-year-old Emerson College film student, who was pedaling down Mass. Ave. listening to music through earbuds. “I’m from Europe. I don’t have the habit [of wearing a helmet],” said Urbonaite, who is from Lithuania and lived in Paris. As for the music, “I’m aware,” she said. “I’m a safe rider.”

Michael Parsons, 34, from Arlington, did have his head covered — with what appeared to be a furry Russian military hat. His helmet, he explained, was at home, on the back of his door. “I adhere to it about 40 percent of the time,” said Parsons, who runs Pranadudes, a spa consulting company.

There are a lot of reasons people resist helmets, including the way they look. “Personally, I think I look stupid in helmets,” said bike messenger Kevin Porter, 59, of Mission Hill, who refuses to wear one.

Like other American cities, Boston is adopting a more European look in cycling, which isn’t always compatible with helmet use.

“For the last 20 or 30 years bicycling has been dominated by either the messenger types or the sport cycling types,” said Jessica Robertson, transportation coordinator for the Metropolitan Area Planning Council, and a helmet wearer.

John Tlumacki/Globe Staff

Bobby Weber waits to cross Mass Ave.

Now, there’s a trend toward upright, urban bikes, with riders wearing street clothes — a look common in Amsterdam or Paris where helmets are rarely seen. “It does feel nice to have the wind in your hair and all that,” said Robertson.

There is also the libertarian perspective, expressed by Porter who does “high-speed distance work,” delivering packages in and around Boston at speeds that he says exceed 30 miles per hour. “I get to ride the way I want to ride,” he said.

He also reasons that nothing serious will happen to him. “I don’t feel a helmet will necessarily prevent the kind of injury I’m going to get at high speed, which is probably bodily [injury] rather than hitting my head on the pavement,” he said.

He’s not the only one who feel helmets won’t help them. Bobby Weber, who studies management science at MIT, said he doesn’t own a helmet because he doesn’t ride very far. “If I fall and hurt myself, it’s my own damn fault,” he said.

“[A helmet] is only going to help you if you have a very significant type of crash,” said Robertson. “What everyone should be doing — the city of Boston, the Public Health Commission — is focus on preventing crashes from happening in the first place, not whether they should be wearing a helmet when the crash happens.”

She added: “In a way, it is almost a hopeful sign to see people in Boston not wearing helmets. It says to me they feel safe riding a bike, and they don’t think of it as this daredevil thing where they take their life into their hands.”