The military needs to address its challenge of having enough science, technology, engineering and math expertise to keep up with the technology advancements of potential adversaries, the Air Force's top scientist said Wednesday.

STEM education is a challenge for the entire country. While the Air Force has been more successful than other services in recruiting scientists and engineers, the military as a whole needs to appeal to a sense of service and patriotism to recruit the best talent, Air Force Chief Scientist Mica Endsley said.

The military should "appeal to scientists and engineers who don't want to just make the cool app, they want to make something of value," Endsley told reporters at the Pentagon. "Something that could save lives. Something that could make us stronger as a country."

The U.S. has begun to lag as a leader of science and engineering. For example, the U.S. led all countries for research published in engineering-related publications in 2000, Endsley said. By 2007, China had caught up. In 2013, China had twice as many publications.

While the numbers might not speak to the quality of the research, they show a "strong investment" in engineering development overseas, she said.

"We can't neglect this and expect to be ahead technologically," Endsley said.

China has also increased its defense expenditures 10 percent each year, with the number expected to surpass the U.S. in 2020.

The Air Force can continue to recruit successfully because, to many engineers, the service's capability is enticing, Endsley said.

The service does "fascinating" research with the latest technology out there, she said. The service is focusing heavily on areas such as autonomy, directed-energy weapons, hypersonics and nanotechnology. Some of the latest technology available to the public, such as touch control and voice recognition, was studied in the military in the 1980s. New engineers and researchers can contribute to developing the latest to strengthen the country, she said.

"We need more people who really understand science and engineering to keep us moving along the tracks," Endsley said.