Politicians, scientists and business leaders have all voiced concern about the sharp drop in the number of core science and maths Highers taken by Scottish pupils this year.
They cite a range of likely reasons, from budget cuts in schools to negative perceptions about both the difficulty of STEM subjects and the career possibilities that they can bring.
Overall, entries for physics, chemistry and maths Highers fell by 1,700 in 2015 to 41,747, a decline of almost four per cent on last year. Until now, they had been on the rise since 2011 when the Scottish Science Advisory Committee said there was an "urgent need" to make science teaching more exciting and relevant.
Joan Davidson, education manager at the Edinburgh International Science Festival, said it was essential to stoke interest throughout the early years of secondary.
"Research shows that the decline in STEM engagement begins shortly after primary school age and could be the result of a combination of factors: from perceived difficulty of and negative stereotypes around STEM subjects, to smaller budgets and therefore less hands-on teaching of science subjects at secondary level.
"Also, there is perhaps a lack of inspiring careers guidance that would provide the support young people need to inform their subject choices."
The Edinburgh International Science Festival already delivers a touring programme in primary schools that engages pupils at their most enthusiastic and provides hands-on experiences that could not happen in the everyday classroom, Ms Davidson said.
"We are also planning to develop and deliver activities and events for older pupils that will provide them with a positive and inspiring experience at the start of their secondary school careers to increase engagement and interaction with STEM and address this decline."
Science teaching in Scottish schools is being underfunded by about £8 million every year, according to a study earlier this year by the Learned Societies Group, which includes the Royal Society of Edinburgh. It estimated the annual science budget of an average secondary school should be about £30,000 – five times higher than the current average of £5,590.
Moreover, the number of STEM subject teachers has fallen by 519, or almost nine per cent, to 5,474 between 2008 and 2014, according to the latest figures.
Iain Gray, Scottish Labour's education spokesman, said funding cuts and curriculum changes were both having an adverse impact.
"The fall in STEM is simply the latest warning sign. We spend less per-pupil than England does on science teaching in both primary and secondary schools.
"Schools are finding it difficult to recruit teachers of STEM subjects and numeracy skills are in decline and funding for science societies and science festivals has been cut.
"Scottish Labour has already raised concerns about the narrowing of the curriculum in S3 and S4, resulting in a drop in enrolments in STEM subjects at National 4 and National 5 and this appears now to have had an impact on STEM Highers."
Garry Clark, head of policy and public affairs at Scottish Chambers of Commerce, said the fall in science and Highers entries was also a concern for businesses: "Companies are increasingly looking for people with these sorts of skills. As the economy has started to recover, we have seen more evidence of a skills shortage, making it harder to fill certain vacancies within various industries."
However, the Scottish government denied it was neglecting science and maths. "We recognise the importance of STEM education in equipping young people with vital knowledge and skills to contribute to society and the economy," a spokeswoman said.
"With curriculum body Education Scotland, we are providing a range of support to both primary and secondary schools to deliver science within Curriculum for Excellence."