Distinguishing quasars from stars and galaxies is no easy task. However, researchers from the University of São Paulo have taught AI to do this using the distribution of energy across the spectrum. To achieve this, they first trained it on a simulated sky and then provided it with real data.

Classifying Objects by Redshift
In many astronomical images, stars, distant galaxies, and quasars (bright galactic nuclei) appear as points of light that are difficult to distinguish by appearance alone. To identify them, researchers analyze how the radiation they receive is distributed across different wavelengths. This work requires specialized observations and analysis, which can take too much time given the enormous volume of data obtained through new sky surveys. An international team led by researchers from the University of São Paulo (USP) has developed a method that uses artificial intelligence (AI) to make the classification of these objects faster, more reliable, and scalable. This is reported by phys.org.
The study, whose lead author is Daniel López-Cano, a postdoctoral researcher at the Institute of Physics of the University of São Paulo (IF-USP), combines data obtained through simulations with real observations. This strategy is designed to eliminate discrepancies between the two datasets and classifies sources into four groups: stars, galaxies, low-redshift quasars (relatively nearby), and high-redshift quasars (very distant).
It is worth recalling that redshift, traditionally denoted by the letter z, is the shift of light toward longer wavelengths caused by the expansion of the Universe: the higher the value of z, the more distant the object and the earlier the epoch in which the light we observe was emitted. The greatest advantages of the new method are particularly evident in the detection of distant quasars — objects that are crucial for studying the formation, evolution, and structure of the Universe.
The results were published in The Astrophysical Journal. The second author of the paper is Luis Raul Weber Abramo, a professor at the Institute of Physics of the University of São Paulo (IF-USP) and López-Cano’s postdoctoral research supervisor.
A New Approach to Machine Learning Algorithms
The use of artificial intelligence to classify sources from the Javalambre Physics of the Accelerating Universe Astrophysical Survey (J-PAS) is not new. However, implementing it is not so simple. The new method addresses a common problem that arises when applying artificial intelligence in astronomy: algorithms must be trained on large datasets whose classifications are already known. Computer simulations can generate such datasets in large quantities. However, no matter how sophisticated they are, they cannot perfectly reproduce the conditions of real observations.
Differences in instrument sensitivity, equipment calibration, measurement noise levels, and the characteristics of the observed objects themselves can cause an algorithm trained on simulated data to perform worse when applied to actual telescope observations. In AI terminology, this problem is known as “domain shift”: training data have different statistical characteristics from those encountered when the model is actually used.
The solution proposed by the researchers was to train the model in two stages. First, the algorithm learns to distinguish stars, galaxies, and quasars using a large volume of data obtained through computer simulations. Then, only the part of the network that converts input data into an internal representation is retrained on a much smaller set of real observations, while the so-called “decision boundaries” derived from the simulations remain unchanged.
In this way, the system learns to “translate” real data into the same language as the simulations, compensating for the differences between them. This strategy is known as “semi-supervised domain adaptation.”
Observing Distant Quasars Through Their “Light Fingerprints”
The study used data from the Early Data Release of J-PAS — an international astronomical survey designed to study the distribution of galaxies and the expansion of the Universe. The project, conducted at the Javalambre Astrophysical Observatory (located on Pico del Buitre mountain at an altitude of 1,957 meters (6,421 feet) above sea level in Spain’s Aragon region), uses a set of 56 photometric filters, mostly narrowband, to record the brightness of each source across different parts of the electromagnetic spectrum.
The result is a kind of “light fingerprint” containing information about the physical characteristics of the observed objects. Although this system does not completely replace traditional spectroscopy, it provides much more detailed spectral information than conventional astronomical photography, which uses only a few broadband filters. Each object has its own characteristic light properties that make it possible to distinguish it from others. Quasars, for example, exhibit intense radiation associated with activity in a galactic nucleus, which consists of a supermassive black hole surrounded by an accretion disk.
Among astrophysicists and cosmologists, the prevailing view is that quasars are extremely bright galactic nuclei that are more common in the young Universe and are powered by supermassive black holes that attract and accumulate large amounts of gas and dust — a process known as accretion.
As this matter heats up to extreme temperatures while spiraling toward the black hole and forming an accretion disk, it emits enormous amounts of radiation, making quasars observable even at very large cosmological distances. Since light takes time to travel through space, observing a distant quasar also means studying an earlier epoch in the history of the Universe.
To distinguish less distant quasars from more distant ones, the team adopted a redshift (z) of 2.1 as the working threshold. This choice does not correspond to an abrupt physical change in the nature of quasars, but is related to an important feature of their light spectra: the so-called “Lyman-alpha forest.” This is a collection of absorption lines observed in the spectra of light emitted by very distant objects. These lines are produced by clouds of neutral hydrogen in intergalactic space located between the light source and Earth.
An object with a redshift of 2.1 is observed today as it was when the Universe was approximately 3.2 billion years old, or about 10.6 billion years ago. This does not mean that the object itself was 3.2 billion years old, but only that the Universe was that old when the observed light was emitted. Given that the current estimated age of the Universe is 13.8 billion years, the light we receive from this object was emitted when only 23% of known cosmic history had elapsed.
Adapting the Model to Real Observations
To develop the algorithm, the researchers used data from another major astronomical project — the Dark Energy Spectroscopic Instrument (DESI), installed on a 4-meter-aperture telescope in Arizona, USA.
Its task is to split the light from millions of galaxies and quasars into different wavelengths, making it possible to measure their redshifts and thus create a three-dimensional map of the Universe. A distinctive feature of DESI is its system of 5,000 optical fibers, controlled by small robotic positioners, which can simultaneously capture light from up to 5,000 celestial objects. This light is fed into 10 spectrographs, which analyze the spectra separately.
Using spectra obtained with DESI, the researchers created approximately 1.5 million simulated sources: real spectra were converted into measurements that would be recorded by J-PAS filters, with a realistic noise model added. This dataset was used for the initial training of the algorithm.
The system was then fine-tuned using real data: objects observed by both J-PAS and DESI, whose correct classifications were known from DESI spectra. Of the approximately 52,000 available objects, only about 15,000 were used for fine-tuning, including just 242 distant quasars. The rest were set aside to validate the model and test its performance on data it had never encountered during training.
The team compared three AI training strategies: training exclusively on simulations, training only on real observations, and combining both approaches. The third approach produced the best results, demonstrating that a relatively small amount of real data can correct discrepancies between simulations and actual observation conditions.
“The greatest improvement was achieved in detecting distant quasars, which accounted for less than 2% of all available objects,” López-Cano reports. “In this category, the F1 score, which measures the balance between the ability to find the objects being sought and the reliability of their identification, increased from 0.40 for the model trained exclusively on simulations to 0.54 for the model trained exclusively on real observations, and reached 0.68 with the combined method. When all four object categories are considered together, the average F1 score reached 0.83, also outperforming the results of the other two strategies.”
This improvement in performance has important practical implications. Large photometric surveys such as J-PAS make it possible to select objects for follow-up observations using higher-resolution spectrographs. Since the available time on these instruments is limited, more reliable classification helps avoid wasting resources on incorrectly selected objects.
Not Just Quasars
The significance of this study is not limited to quasars. As the volume of data obtained through observatory programs such as DESI, J-PAS, and LSST (at the Vera C. Rubin Observatory) grows rapidly, developing systems capable of effectively using large numbers of simulations without losing the reliability provided by real observations is becoming increasingly important.
“The ultimate goal is to better understand gravity, dark matter, and dark energy. To do this, we need to map the objects detected by telescopes and know how to classify them,” says López-Cano. Thus, classification is a necessary stage in the statistical analysis that makes it possible to test whether cosmological models are consistent with observations.