Image copyright GBM Image caption Stephen Ritz is growing food for his pupils in one of the poorest districts in the US

If you had to choose the least likely location for the birthplace of a green education revolution, you might well pick the South Bronx in New York City.

Despite creeping gentrification, this is an area that is still synonymous with urban blight.

It is the most socially deprived district in the United States, with over 40% of residents living below the federal poverty line. It is officially the least healthy place to bring up children in New York State.

And yet this is where high school teacher Stephen Ritz hatched a food-growing project with his students that has been adopted in schools across the US and way beyond, picking up numerous awards on its way.

When we say food-growing, we're not talking mustard-and-cress sprouting on blotting paper in the corner of a science room. Mr Ritz's Green Bronx Machine (GBM) project produces a harvest of fruit and vegetables.

They are cultivated in high-tech indoor tower gardens, creating vertical cornucopias, with edible walls of raspberries, columns of kale and cucumbers, barricades of blueberries and broccoli.

Feeding minds

It has grown over 35,000 pounds (15,900kg) of food. Some of it feeds the students and the teachers; plenty is taken home, and more is sold in the community at GBM farmer's markets.

Image copyright Thinkstock Image caption For some youngsters it was "easier to get hold of an automatic pistol than an organic tomato"

It all started by accident, and its origins are the stuff of legend.

Mr Ritz had been working as a special education teacher and dean of students at Walton High School in the Bronx when one day his class received a gift: a box of 250 daffodil bulbs.

More stories from the BBC's Knowledge economy series looking at education from a global perspective and how to get in touch

"I had a class of 17 kids, over-aged, under-credited, with a lot of assorted baggage, whether substance abuse, or criminal background, kids who were marginalised... I was dealing with discipline problems, and these bulbs looked like something kids could throw. I wanted nothing to do with them. I put the box behind a radiator and forgot about them."

Growing ideas

Some time later there was a "huge argument" in the classroom: "It looked like it was going from bad to worse". One student ducked behind a radiator and pulled out what was now "a box of blooming flowers". The heat and leaking radiator water had forced the daffodil bulbs.

Image copyright GBM Image caption The teacher was facing pupils whose bad diet had left them overweight and sickly

"This was a game changer. The boys wanted to give them to the girls, the girls wanted to give them to the boys, some kids wanted to sell them. But therein was this very teachable moment, and we realised then that we could grow something greater."

Mr Ritz channelled this excitement into a project, growing flowers for ornamental community gardens in some of the roughest parts of New York.

"We went on to plant 25,000 bulbs across the city, we went into gang areas that I never expected to see."

At the same time Mr Ritz was becoming increasingly aware of the terrible food that both he and his students were living on. Over a third of his students came from "food insecure" homes.

As he pointed out, for some youngsters it was "easier to get hold of an automatic pistol than an organic tomato".

Child obesity

Child obesity was rampant: "Kids were getting fatter and getting sicker. I had 200lb [14 stone, 90kg] sixth graders, and I couldn't accept that."

Mr Ritz himself was overweight from eating too many "99 cent lunches".

Image copyright GBM Image caption The concept of the Bronx Green Machine is being developed in other parts of the US and in other countries

His reaction was: "Wow! This is insane! We should be growing food - it was a licence to print money!'"

At first the growing was outdoors, rescuing neglected patches of land around the half-burned-out projects. The students thrived, and Mr Ritz began to lose weight.

Then Walton High School was closed, and Mr Ritz found himself teaching in the new Discovery High School on the same campus. Around this time he encountered indoor plant-growing systems, and realised these could be used to bring the project into classrooms.

"I needed the success I was having outdoors, indoors... I wanted to do something far more replicable and scalable. It made good sense not to be limited by seasons."

So the Green Bronx Machine was born. Apart from turning grim schoolrooms into attractive gardens and providing much-needed vitamins for all, the plant-growing also had a dramatic impact on the school performance.

Organic science lesson

Students wanted to see how their seeds were doing. Even those who didn't care were curious. Mr Ritz ensured that the sceptics had roles.

Apart from horticultural skills, there was the science of growing, such as the importance of the pH value of the water; the harvesting, weighing, packaging and distribution of produce; the preparation and cooking. Alongside these, the marketing, sales and distribution; and the documentation of everything.

Image copyright Thinkstock Image caption The project wants to create jobs as well as a healthier community

Mr Ritz even had a promise for those who did not want to get their trainers muddy: "No Nike Air Jordans were damaged in the growing of this produce."

Discovery High's attendance figures soared from 40% in 2008 to 93% in 2014. It has now reached 96%.

Many students have found employment as a direct result of their work in GBM. The programme has helped to create well over 2,200 sustainable youth jobs. GBM alumni have gone on to work as teachers, landscapers, green roof and green wall installers, as well as grocery store employees and chefs.

"We had a system that was wholly dysfunctional and turned inside out. But sometimes the simplest solutions are the best."

'Chief eternal optimist'

There's another factor in this success: the persuasive skills of Stephen Ritz himself as "CEO" or "Chief Eternal Optimist", combining the rapid-fire wit of a stand-up with the soundbite-coining skills of a presidential campaign manager.

Image copyright BGM Image caption Stephen Ritz reached the final 10 of this year's Global Teacher Prize

Mr Ritz was one of 10 finalists in the Global Teacher Prize earlier this year.

His persuasive powers have been vital in winning over doubters in City Hall, state and national government, and in corporations across the country. His students have installed green walls in some of the most prestigious buildings in New York, and have helped spread the word at events as far afield as Colombia and Dubai.

This year, Mr Ritz has taken the project into a new phase, moving into the fourth-floor of what used to be "PS55" (Public School 55), now re-dubbed Community School 55. Here, the GBM team is building what will become the first National Health and Wellness Center, with an indoor community farm, teaching kitchen and more.

Speaking from a meeting in Las Vegas, where he is hoping to open a similar centre, Mr Ritz explained he was "only just getting started" with this ambitious new project.

The aim of the National Health and Wellness Center is "to build concentric circles of success around the school... I don't want to build an oasis, but a rainforest", he said.

It would work with both children and adults to bring living-wage employment to the most embattled communities.

Every student would take home a bag of fresh fruit and vegetables every week - but they'd also be taking home the hope of real long term employment.

"A seed well-planted can bring you a crop of epic proportions and my kids are proof of that."