When thousands of diseased and bloated pig carcasses floated down a tributary of the Huangpu River in Shanghai in early 2013, after being dumped upstream by farmers, the stench turned Zheng Lixing's stomach.

"If you were there, you wouldn't have been able to eat for a few days," says Zheng, a native of Shaanxi province in northwest China with a doctorate in polymer science from Tianjin University of Science and Technology.

The experience got him concerned about the state of the agricultural sector in China, which, for centuries before its industrialization, was an agrarian society.

Three years later, with two million yuan from their own pockets and investors, Zheng and four other university graduates from Shaanxi returned home and acquired 13 hectares (32 acres) of farmland in Liquan county. They wanted to show local farmers the benefits of switching to organic methods.

Farmers prepare the sale of cabbage in Qingdao, Shandong Province of China. VCG/Getty Images The quality of the soil is poor, he says, and will take another few years to recover fully. Soil contamination, caused by pesticide and fertilizer use, but also industry and waste disposal, is a big threat to China's food security.

Zheng's farm uses only organic fertilizers, such as chicken and pig dung, and no chemical pesticides. As a result, however, crop yields are low, and this puts other farmers off following their example.

"We won't break even until the end of this year," he says, adding that the neighbors may have a change of heart when they see how better-quality products can fetch higher prices.

Zheng is among a rising number of educated urbanites in China choosing to wave goodbye to city life and head back to the land.

Read more: A city in China is feeding a billion cockroaches 50 tons of kitchen scraps a day in an effort to help with urban waste

The modernization of farming in China is on the government's agenda. In March, President Xi Jinping said more effort should be made to encourage talented university graduates and overseas returnees to move to rural areas to revitalize them and boost innovation.

The drive to boost the rural economy includes tax breaks, easier financing, and other support measures for rural entrepreneurs.

About 60% of China's population lives in towns and cities, a huge increase from 26% in 1990. However, that is still well below the average of 75% in the developed world, and "reverse urbanization" is picking up as infrastructure improves in remote areas.

Last year the Ministry of Agriculture announced that seven million people had returned to the countryside from cities, although it did not give a time frame for the migration. Of these, 60% had done so to work in agriculture, it said.

Ma Yanwei, who acquired an 11-hectare farm in Inner Mongolia's Alashan prefecture in 2015, says the government is supporting local farmers with water conservation methods in the arid region, which is on the fringe of a desert.

Farmers in China. Oleg Nikishin/Newsmakers "Although Alashan is under threat from desertification, the air and soil are very good. Local farmers use underground water for irrigation. But they plant corn, which consumes a lot of water," says Ma, who graduated from Beijing Normal University with a doctorate in ecology.

"After digging ditches around a patch of land, they water all the land before moving on to another patch, wasting a lot of water through evaporation. Only the roots need to absorb water."

The local government provides piping, which Ma teaches local farmers to use. With holes in the hosepipes spaced 20cm (8 inches) apart, they are rolled out alongside the base of crops, and water drips from holes. This method uses only half the amount of water, he says.

A native of Harbin in China's northeast, his previous job at a Beijing-based environmental organization brought him to Alashan in 2004. "It is beautiful and the locals are friendly," he says.

Also helping others to adopt environment-friendly farming techniques is Yixi Kanzhuo, who graduated from Beijing's University of International Business and Economics with an executive MBA. The Dalian native worked for the See Foundation, China's largest NGO dedicated to environmental protection, before moving to Yushu in Qinghai province, in the country's northwest.

"I always went to Qinghai for the foundation. I met a native there who has about 1,300 hectares of land situated 4,500 meters (14,800 feet) above sea level. I moved to Qinghai in 2015 and married him last year," she says. Like many ethnic Tibetans in the area, her husband abandoned his land after the government launched a policy around 2005 to move nomads into towns.

"It's a desolate area. When I first came here, transport was inconvenient, with no motorways or asphalt roads. But since a national park was established last year, basic infrastructure is being built," she says.

The couple are building a home on their farm, which is 300km (185 miles) from the nearest town, as they attempt to revive largely deserted pastures on the plateau, and help those who have fallen into poverty since the relocation.

A farmer in China trails behind a Yak. China Photos/Getty Images "They haven't returned to their farms… They originally led self-sustainable lives by raising livestock and making clothes from wool." Yixi says.

Since the move, they have been living in government-built houses in towns that lack basic services, such as medical facilities, elderly care, rubbish disposal, and running water, she adds.

They were promised an annual subsidy for relocating, but some families claim they are not receiving as much as they were told they would. Tibetans generally have high birth rates, and families, often of seven or eight people, quickly became destitute.

"Before 1985 each nomad [in Yushu] owned more than 100 yaks. They were never worried about money because they just had to sell a yak when they needed it.

"Before his whole family relocated to town a decade ago, my husband lived on the farm until he was 15 and his life was carefree. But after being relocated, people were cut off from their [traditional] way of life and couldn't find work," Yixi says.

She and her husband built their home using a traditional mortar made of soil, glutinous rice, and quicklime, she says, to show others how it was possible to return to their pastures and carve out a sustainable lifestyle.

The couple have organized a cooperative with seven other families, with 300 head of livestock, so "everybody can take turns grazing the livestock throughout the year to help conserve the pastures".

Their farm will observe local customs, she adds, eschewing mass slaughter of livestock in deference to Tibetan Buddhist culture.

"Most of the produce is for sale locally, because outsiders are not keen on yak meat, suyou [fat distilled from yak and sheep's milk] and qula [the residue from making suyou]. Our produce will include Armillaria luteo-virens [an edible mushroom], which thrives during the rainy season on the high plateau, and butter made from yak milk, which non-locals will like," Yixi says.

"Our venture is not simply about agriculture. It's about how people can live harmoniously with nature. We want to build living quarters for visitors, who will be able to ride horses, meditate, do yoga and live a tranquil life on the farm.

"We can train locals in how to serve visitors and cook food for them. The scenery is beautiful here, as we are near the source of the Yellow River. A road leading to our farm will be completed next year and [the government] will start building a small airport in Yushu next year."

For a city dweller, life in the remote countryside took a lot of getting used to for Yixi. "When I first arrived, I went for as long as 20 days without washing my hair," she says.

In spite of the hardship, she says her new life is much better than when she lived in the big city.

"To earn 20,000 to 30,000 yuan [US$2,900 to US$4,350] a month, people have to commute through the crowded subway every day and spend all their salary on living expenses. They only live for work. There's no dignity," she says.

"I hope our kids will be born in the house. They will be able to grow up surrounded by nature and lead a happy life."

In Shaanxi, Zheng says he dreams of growing high-quality produce for export, like Japanese and Western farmers.

"China is so big that it can sustain any kind of fruit. We can't sell the grapes we produce, even though they only cost several yuan a bunch. Japanese ones sell for several hundreds a bunch," he says.

"There is a success story in another town in Shaanxi, where 20 million yuan was spent to establish a vineyard. The grapes sell in Hong Kong for more than 200 yuan a kilogram."