Most children choose unhealthy school meals despite attempts to promote better eating habits, a report says.
Pupils preferred food high in fat and sugar
Pupils at a London school preferred food high in sugar and fat, the Institute of Food Research found.
Researchers tracked what children were eating by analysing data from "smartcards", used to buy meals.
This method meant the information was "99% accurate" but created "ethical problems" over pupils' privacy.
The cafeteria at the school serves around 1,000 diners aged seven to 16. Its system was upgraded for the study.
An electronic audit was made of every transaction for more than a year and each food chosen was analysed for the nutrients it contained.
The IFR's senior nutritionist, Professor Ian Johnson, said: "Not all the data have been analysed, but we can already see that, despite a vigorous healthy eating policy operated by the caterers and the school, and healthy foods being readily available, the children generally preferred products high in sugar and fat.
"This reflects the preferences of most UK children."
He added: "The research using smartcard technology has demonstrated the ability of the system to identify individuals who persistently choose highly inappropriate meals.
"What a school does with that important health information presents society with an ethical issue.
"Smartcard systems could be used to help schools with healthy eating programmes through personalised feedback of food choices or reward schemes for children who choose healthy options.
"The technology could be applied to other cafeteria settings, such as in the armed forces, universities or prisons, where monitoring food choice would be beneficial."
Researchers said one in five English secondary schools used smartcards for meal payments.
Project leader Dr Nigel Lambert said: "No questionnaires were required, nor an army of researchers, but the system succeeded in objectively recording food choice with 99% accuracy.
"It can also be continued long-term."
The aim of the study was to test the effectiveness of smartcard technology in such research.
The government has promised an extra £280m to tackle the school meals "crisis" in England.
At least 50p will be spent on each primary school lunch and 60p in secondaries. Some primaries spend as little as 37p on ingredients.