1 Background and Related Work

The autonomous vision-based navigation (VBN) is a crucial issue for scheduled and future lunar exploration missions. Scientists have observed that the gravity field on the Moon is far away from being spherically distributed [1,2,3]. This lumpy gravitational field (Fig. 1) creates push and pull anomalies that deviate the spacecraft from the expected path thus making orbit propagation more complex and heavy.

Fig. 1
figure 1

Lunar gravity model (LGM2011). Gravity acceleration at the surface of the Moon in \(m/s^2\). Map from [1]

Though, the scientific community has planned to build base camps [4] and extract specimens at definite areas of interest, including the mysterious polar regions. Indeed, the recent confirmation of frozen water, trapped in these not illuminated regions, has revived the manned lunar exploration. H\({}_{2}\)0 can delve us a deeper understanding of lunar history and can be repurposed as rocket propellant or breathable air. Achieving the aforementioned objectives raises new challenges for spacecraft localization systems. As far as our knowledge, there is no specific requirement for a lunar positioning system. Nevertheless, the European Space Agency (ESA) has established 1km of accuracy as the cut-off value for the majority of Martian applications [5]. It is worth noting that spacecrafts venturing beyond Earth need specific payloads or support systems, claiming the usage of facilities (e.g. DSN, ESTRACK). This requirement of resources translates into large mission costs at expense of limited operational capabilities. In addition, satellite link is not always guaranteed, ground stations are not easily accessible, and most importantly telemetry commands are not available in real-time.

Therefore, this manuscript proposes a landmark-based terrain relative navigation (TRN) system to reduce the ground intervention and to make the orbit control autonomous. Such systems are attractive because can be applied to a wide range of space missions, including planetary exploration (rocky planets), the study of moons of gaseous planets, approach phase of comets, asteroids, and other celestial bodies. Nowadays, leveraging the recent advancement in computer vision (CV) and artificial intelligence (AI), autonomous onboard optical navigation (OPNAV) is gaining huge interest for its small size, weight, and power requirements [6].

OPNAVs are distinguished into two classes, depending on the distance between spacecraft and target body. When a large portion of the celestial body disk is contained in the image, horizon-based OPNAVs are appropriate. Instead, as the distance between spacecraft and target surface reduces, it is far better to exploit specific landmarks. These latter are usually specific morphological features (e.g. craters or boulders, see Fig. 2) or distinct portions of terrain [6]. Craters are a convenient option because of their distinct appearance among other morphological features.

Fig. 2
figure 2

Proposed system acquiring an elevation image from the lunar surface. Crater triad reported on the right

The working principle of TRN is founded on pinpointing these specific features in an onboard map to gain position knowledge to be integrated into a navigation filter. Their first applications were for missile technology and date back before the advent of the Global Positioning System (GPS) [7,8,9,10]. It is worth noting that the standard approach of OPNAV algorithms is computationally intensive, requiring: (i) the real-time rendering of patches or complete digital elevation maps (DEMs) [9, 11,12,13], and (ii) a template-matching approach for the measurement generation [14]. Contrarily, landmark-based TRN systems using craters do not require carrying DEMs and high computational burden but only require an image processing algorithm to detect craters and a pattern matching algorithm to relate these observations to a database. This is usually followed by a navigation filter to estimate the spacecraft state in terms of position and velocity.

However, the development of a crater-based TRN requires addressing several issues. One is the crater detection problem since sensors can generate various outputs depending on changes in the surface radiation, electronic element warming, or the inherent fluctuation of discrete photons [15, 16]. Though also the pattern recognition problem of matching craters with a catalogue of known craters is a troubling task. In past, this led to navigation with unknown landmarks [6, 17,18,19,20] and the extensive applications of horizon-based OPNAVs also at close distances. The crater matching problem is generally divided into two main types of problems. The first category is based on a least-square approach and requires precise knowledge of spacecraft position to perform matches. The second category, challenged in this research, does not rely upon this assumption and goes under the name of the lost-in-space problem. To solve this issue robustly, a crater matching algorithm based on geometric invariant descriptors has been implemented [6, 21, 22]. Finally, a third problem consists in the position retrieval from matches and its integration into an EKF.

One of the latest TRN was released by Downes et al. [15, 16], proposing a transfer-learning procedure. Using the same U-Net architecture [23], already trained by [24], they fine-tuned the weights on their custom dataset of intensity images. In this way, the network thus obtained can segment craters from monocular images. However, their approach relies on a semantic segmentation method and so they need an additional step on the output mask to separate each crater rim. Then, craters are matched, and their positions are fed in input into an Extended Kalman Filter (EKF). This methodology constrains the usage of an additional image processing chain to separate each crater rim (e.g. dilation, erosion, and convex-hull operators). Besides, as in other previous works [25, 26] their matching algorithm is not robust because relies on a least-square approach (RANSAC filtered). This can create situations where corrupted navigation states render otherwise good images ineffectual, leading to unnecessary filter reinitializations, trajectory aborts (e.g. during lunar descent), or other undesirable events [6].

To overcome all these limitations, this manuscript proposes a novel crater-based TRN, namely “FederNet”. Such a system is robust in its design since exploits the projective invariants framework, and is simple in its implementation, not requiring additional image processing steps. Indeed, the crater detection problem has been innovatively challenged training a region-based CNN (Convolutional Neural Network), i.e. a two-stage Deep Learning (DL) architecture for object detection and instance segmentation. The choice fell on Mask R-CNN [27] with ResNet-101+FPN (Feature Pyramid Network) [27, 28] backbone as feature extractor. This contribution can certainly be exploited in other research fields, such as planetary geology. In addition, a completely novel solution is proposed for measurement generation.

It is important to point out that a standard method of treating crater matches is to directly include their positions in the state vector and to estimate them along with the vehicle’s trajectory [15, 16]. This is the well-known Simultaneous Localization and Mapping (SLAM) problem. SLAM with visual measurements and inertial sensors has attracted significant interest in the robotics community [8, 29, 30]. However, SLAM needs to keep in memory the landmark estimates resulting in increased time-varying computational complexity (quadratic in the number of features for EKF-SLAM). Moreover, the main benefit of performing SLAM is the ability to achieve “loop closing” when revisiting an area, a circumstance which is not always true in practice [31]. This work proposes a novel solution since the quadratic computational complexity of SLAM does not appear to be acceptable.

Concluding this section, the main contributions of this paper can be recollected as follows: a) the first implementation of an object detector for TRN, b) a robust development of a matching algorithm widening the work of Hanak et. al [21, 22] to deal with the more recent crater catalogues, and c) a simple but effective position estimation algorithm for measurement generation, integrated into an EKF.

The remainder of this paper is organized as follows. Section 2 describes in detail each sub-module of the developed system. Thanks to experiments on real elevation images of a simulated orbit, Sect. 3 discusses the setup and the results achieved both in terms of detection, matching, and position accuracy reached by the proposed framework. In the end, Sect. 4 concludes this paper, illustrating future recommendations.

2 System Architecture

A general understanding of FederNet system is provided through the flowchart in Fig. 3.

Fig. 3
figure 3

Illustration of FederNet system architecture

As stated above, elevation images are captured by a 3D sensor such as Interferometric Synthetic Aperture Radar (InSAR) images, Light Detection and Ranging (LiDAR) technology, or high-resolution satellite stereo imagery. Then, the DL-based crater detector collects all craters from the elevation image and transmits them to the crater matching algorithm. The pipeline of this detector implements one of the latest DL architectures for instance segmentation and object detection, i.e. Mask R-CNN [27]. Among previous works [15, 15, 26], this technique allows reducing computational burden, not requiring additional image processing steps to extract craters’ rims, at cost of difficult model training. Once craters are detected in an image and their locations and radii estimated, those values are sent to the crater matching algorithm. The matching algorithm developed is an updated version of the Hanak et al. work [21, 22] that accounts for the significantly higher number of entries of modern crater catalogues. It is worth noting that [21, 22] worked with the USGS lunar crater database [32], containing 8673 craters, while FederNet deals with the Robbins crater catalogue [33], incorporating more than 1 million entries.

The following subsections explain in detail the proposed framework.

2.1 Crater Detection Algorithm

Before describing the algorithm, the reader should know that crater counting and shape retrieval from orbital imagery have always been a key for understanding planetary age and evolution [34,35,36,37,38,39,40] since they provide the relative age of the surface unit and information on the surface geology. For this reason, in the past crater, detectors have been intended for geological surveys. First methods largely used image processing techniques [25, 36, 41,42,43] experiencing significant sensitivity to image quality, brightness, and shadows. The difficulty to predict these qualities from camera and noise models poses an insurmountable problem and requires human intervention for each scenario. As a result, these crater detectors are not reliable or suitable for autonomous operations. DL algorithms offer promising opportunities because CNNs are capable of extracting low-, mid- and high-level features from images stacking together convolutional and pooling layers. The extracted features can be applied to various computer vision tasks, such as large-scale image recognition, object detection, semantic segmentation, and instance segmentation. Previous crater detectors were based on U-net architecture [23], one of the most commonly used networks for image segmentation. Conversely, the detector proposed implements Mask R-CNN, a network developed for instance segmentation and object detection. This helped to eliminate the usage of template matching approaches of methodologies based on popular image feature descriptors such as SIFT [44], SURF [45], BRIEF [46], or ORB [47]. As stated above, being the segmentation output distinguished for each instance, the usage of additional image processing steps are not required. The main innovation of this detector is its specific tuning for navigation: the recollection of all the craters from an image is not necessary. A pre-processing strategy was applied following the approach of [38], thus using the CLAHE algorithm to boost contrast. Even if FPN [48] neck is used to capture the multi-scale local features, in several but rare cases, the model the model has completely gone wrong estimating craters with a huge diameter. Thus, post-processing was also applied to filter out invalid detections. The filter is based on an adaptive threshold of the confidence score, depending on crater size. Each step of the detector is reported in Fig. 4, where it is possible to notice the variation of craters detected at each step, in comparison with the ground truth data coming from the Head et al. [49] & Povilaitis et al. [50] merge crater catalogue.

Fig. 4
figure 4

Crater detections (green) at each pipeline step, paired with ground truth data (red) from Head et al. [49] & Povilaitis et al. [50] merge crater catalogue

2.1.1 Model Training

Mask R-CNN has been trained on the same datasets of the DeepMoon project [24]. Over the years, these datasets have been largely used to evaluate different crater detection architectures. The datasets comprise more than 30.0000 real lunar tiles obtained cropping the LRO-Kaguya merged 118 m/pixel DEM [51], downsampled in 8-bit with GDAL library. For ground truth labeling, the crater catalogues of Head et al. & Povilaitis et al. [49, 50] have been used. This choice is purposely done to compare FederNet with other DL-based crater detectors. It is worth noting that Mask R-CNN required completely different labels. As transfer learning is a common practice in deep-learning, COCO [52] pre-trained weights have been used for fine-tuning our model. The model has been trained for 100 epochs following the original paper [27] with a multi-stage training (30 heads & 70 all) using the standard Stochastic Gradient Descent optimizer with a learning rate of \(10^{-3}\). The other relevant training parameters can be found in Table 1.

Table 1 Mask R-CNN model training parameters

Even with a modest hardware (GTX 1060 6GB VRAM) used, the model completed his training after about 24 h. It should be pointed out that this does not affect the inference burden since the training phase is accomplished on ground while the weights can be updated to the onboard model to increase its accuracy.

2.2 Crater Matching Algorithm

The crater matching algorithm developed is based on the work of [21, 22]. This research is well known in the space community for proposing a re-visitation of a star tracker algorithm based on projective invariants, i.e. geometric feature independent from camera pose. The matching scheme can be summarized in three steps, using the same assumptions of [21, 22]. In the first step, crater triads are generated by taking into consideration all the possible sets of three different craters. This is the main difference between a star tracker algorithm, and it is required to deal with false detection to not exclude possible matchable craters from the procedure. The invariants chosen are the interior angles and the ratio between crater radii and centroid distance. These two descriptors preserve the angular and spatial distribution of a crater triad, respectively. Projective invariants are computed for each triad. This is done for both the craters detected from the image and extracted from a crater catalogue query. Is essential to note that the number of the crater triads computed is approximately \(N^3\) of the craters under investigation; to speed up this process, functions have been rewritten in machine language. This implementation highly reduced the computational time. In the second step, two dataframes are generated, belonging, respectively, to the image craters and catalogue craters. The dataframes contain in columns the unique id value of each crater and the projective invariants of the triad. In the third step, the crater matching problem is rearranged as an “inner join” merging of two dataframes. This operation is translated from the homonymous in SQL databases where two tables are joined according to the matching of certain criteria using a comparison operator. In our case, an indexed search is performed in the two dataframes, and two triads are matched if their invariants descriptors are equal within certain tolerances. These tolerances are needed because the crater detector could output crater locations and sizes that can slightly differ from the ones recollected in the crater catalogue. Moreover, the criteria on which craters are catalogued may vary. Although tolerances are required, the drawback is that they introduce also false matches to the query. False matches are filtered out through the implementation of two validation functions. These latter use the information coming from an attitude sensor to reject the triads matched with a wrong spatial orientation. The first function checks the orientation of the triad about the direction of motion, while the second one checks the correctness of the crater disposal in the triad. This approach accounts for one of the intrinsic problems of detectors, i.e. the false positives. Indeed, the main difference from a star tracker algorithm is that all possible triads are considered for not discriminating good detections. Matches thus validated are then fed in input to the position estimation algorithm.

2.3 Position Estimation Algorithm

This algorithm exploits the positions of the craters known both in the images and in the database to prompt the spacecraft position. With the help of the matched triads, it is possible to establish a scale factor between pixels and degrees (S=1px/1\(^{\circ }\)), due to the fact that the relative distances between craters are known both in pixels and latitude/longitude degrees. Assuming known the sensor’s spatial resolution, the calculation of the footprint (d) can be obtained through S. Finally, the altitude of the spacecraft can be easily retrieved through the linear equation:

$$\begin{aligned} d=2H\tan (\frac{FOV}{2}) \end{aligned}$$
(1)

which relates the footprint and the field of view (FOV) of the sensor with the altitude (H). Whereas latitude and longitude of the spacecraft position are prompted differently: the relative distances (in pixels) between craters and image center are acquired and re-scaled through S to generate residuals. The spacecraft in-plane localization is finally carried out exploiting the residuals which relates the sensor’s center position to each crater position. Once a triad is matched a single position is estimated. Assuming that most matches are correct, the localization measurements coming from each triad on the same image are then filtered with interquartile method (40-60) and averaged out. Finally, measurements are incorporated into the EKF, built with a Keplerian propagator.

2.4 Extended Kalman Filter

The EKF incorporates an orbital propagator with PEA (Position Estimation Algorithm) measurements to calculate the estimated state of the spacecraft. The state vector includes satellite position and velocity vectors in selenographic coordinates. At each time step, the EKF propagate the spacecraft state from the previous estimated state to the current state. The position measurements are used to generate a measurement residual, which is exploited by the EKF to correct the propagated state. Orbit propagation was approached as two-body motion, thus a simple Keplerian propagator was selected. A propagator of such a type determines the motion due solely two-body gravity acceleration, not taking into account non-sphericity effect of central body, gravitational interaction with other objects, solar radiation pressure, and lunar angular velocity. This simple propagator is key choice motivated to highlight the capabilities of the developed system. The satellite dynamic model used for satellite orbit propagation is:

$$\begin{aligned} \ddot{{\bar{r}}}(t)=-\frac{\mu }{{|{r}|}^{3}} {\bar{r}}(t)+{\bar{w}}(t) \end{aligned}$$
(2)

where \(\ddot{{\bar{r}}}(t)\) is the acceleration vector, \(\mu\) is moon gravitational constant, \({\bar{r}}(t)\) is the orbital position vector, and \({\bar{w}}(t)\) is vector of the process noise.

Some initial assumptions are needed to fulfill the filter’s requirement when implementing an EKF. Initial state estimate and initial state error covariance matrix are required to start the EKF process. The initial state vector is given by:

$$\begin{aligned} x(t_{0})=\begin{bmatrix}x&y&z&V_{x}&V_{y}&V_{z}\end{bmatrix}_{6x1} \end{aligned}$$
(3)

A diagonal apriori covariance matrix \(P_{k-1}\) with standard deviations (\(\sigma\)) of 50 km (position), 35 m/s (velocity) is assumed. With these assumptions at the first time instant the apriori covariance matrix \(P_0\) is given by:

$$\begin{aligned} {P_{0}}=\begin{bmatrix}\sigma _{x}^{2} &{} 0 &{} 0 &{} 0 &{} 0 &{} 0\\ 0 &{} \sigma _{y}^{2} &{} 0 &{} 0 &{} 0 &{} 0\\ 0 &{} 0 &{} \sigma _{z}^{2} &{} 0 &{} 0 &{} 0\\ 0 &{} 0 &{} 0 &{} \sigma _{v_{x}}^{2} &{} 0 &{} 0\\ 0 &{} 0 &{} 0 &{} 0 &{} \sigma _{v_{y}}^{2} &{} 0\\ 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} \sigma _{v_{z}}^{2} \end{bmatrix} \end{aligned}$$
(4)

Following [53], the state transition matrix [54, 55] \(\phi _{k,k-1}\) is used to propagate covariance matrix given by:

$$\begin{aligned} \phi _{k,k-1}\approx I+F(t_{k}-1)^{T} \end{aligned}$$
(5)

where \(F(t_{k}-1)=\begin{bmatrix}0_{3x3} &{} I_{3x3}\\ J_{3x3} &{} 0_{3x3} \end{bmatrix}\) and \('T'\) denotes the matrix transposes.

In \(F(t_{k}-1)\), \(J_{3x3}\) is the Jacobian coefficient matrix given in:

$$\begin{aligned} J_{3x3}=\begin{bmatrix}3\mu x^{2}r^{-5}-\mu r^{-3} &{} 3\mu xyr^{-5} &{} 3\mu xzr^{-5}\\ 3\mu xyr^{-5} &{} 3\mu y^{2}r^{-5}-\mu r^{-3} &{} 3\mu zyr^{-5}\\ 3\mu xzr^{-5} &{} 3\mu zyr^{-5} &{} 3\mu z^{2}r^{-5}-\mu r^{-3} \end{bmatrix} \end{aligned}$$
(6)

To cope with deficiencies of the employed propagation model, a fixed diagonal process noise matrix \(Q_{k-1}\) is considered in the time update of the covariance matrix as given in:

$$\begin{aligned} P_{(k |k-1)}=\phi _{k,k-1}P_{k-1}\phi _{k,k-1}^{T}+Q_{k-1} \end{aligned}$$
(7)

Representative process noise values used in the present application are \(\left( 1km\right) ^{2}\) (position), \(\left( 10^{-1}km/s\right) ^{2}\) (velocity). These values, more specifically the position ones, are the most significant on the filter behaviour and were determined with a tuning process based on a trial and error approach. Tuning was aimed at keeping the filter reactive to new measurements while making it able to correctly estimate state and state covariances when measurements from PEA are not available or are of low quality.

As far as the correction step is concerned, at time k a measurement \(z_{k}\) of the position state \(x_{k}\) is prompted through PEA. The residual vector \({\tilde{y}}\) is obtained from:

$$\begin{aligned} {\tilde{y}}_{k}=z_{k}-H_{k}x_{(k|k-1)} \end{aligned}$$
(8)

where \(H_{k}\) is the measurement matrix at \(k^{th}\) time instant:

$$\begin{aligned} H_{k}=\begin{bmatrix}1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0\\ 0 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0\\ 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 0 \end{bmatrix} \end{aligned}$$
(9)

Based on \(P_{(k,k-1)}\), \(H_{k}\) and \(R_{k}\) matrixes, the covariance matrix \(S_{k}\) and the Kalman gain \(K_{k}\) is calculated according to:

$$\begin{aligned} S_{k}=\, & H_{k}P_{(k |k-1)}H_{k}{}^{T}+R_{k} \end{aligned}$$
(10)
$$\begin{aligned} K_{k}=\, & P_{(k |k-1)}H_{k}{}^{T}S_{k}{}^{-1} \end{aligned}$$
(11)

where \(R_{k}\) is measurement noise covariance matrix which is in general a Gaussian zero-mean noise—representative measurement noise values used in the present application are \(\left( 1km\right)\) (position). The updated (a posteriori) state estimate at time \(k^{th}\) is obtained from:

$$\begin{aligned} X_{(k |k)}=X_{(k |k-1)}+K_{(k)}{\tilde{y}}_{(k)} \end{aligned}$$
(12)

And updated (a posteriori) estimate covariance matrix \(P_{k}\) is obtained from:

$$\begin{aligned} P_{k}=\left( I-K_{k}H_{k}\right) P_{(k |k-1)}\left( I-K_{k}H_{k}\right) ^{T}+K_{k}R_{k}K_{k}^{T} \end{aligned}$$
(13)

3 Results

This section describes the setup used to conduct the experimental test as well as the numerical results achieved. Two crater catalogues will be analyzed in this study: Robbins [33] and the merge of Head et al. [56] & Povilaitis et al. [50].

3.1 Reference Orbit

For testing the system, a reference orbit (Fig. 5) has been generated at 50 km altitude. Equatorial inclination was preferred to characterize the performance of the developed system on very different scenarios from the point of view of crater density and distribution. The altitude instead was set as a standard value for lunar orbiters such as LRO [57]. Based on the designed trajectory, it is possible to identify different regions: as shown in Fig. 5, the first one ranges from -60\(^{\circ }\) to 23\(^{\circ }\) of longitude (A), a second one from 105\(^{\circ }\) to -147\(^{\circ }\) of longitude (B), and other regions show intermediate characteristics. The region A has a coarse crater coverage, while region B shows high sample number of craters. The initial orbit parameters, have been set according to Table 2.

Table 2 Initial orbital parameters

Orbit propagation has been performed through \(7^{th}\) order Runge-Kutta integrator. Force model includes a lunar gravity field model (LP100K [58]), solar radiation pressure, and third body effects (Sun & Earth).

Fig. 5
figure 5

Reference Orbit in which are evidence two region: (yellow) region A and (blue) region B

3.2 Crater Detection Results

Herein the developed detector is compared to other crater detectors on the dataset of [24]. As stated above, all of them have been likewise trained and evaluated on the same dataset with the same metrics. The metrics used are precision and recall. Precision is a measure of result relevancy, while recall is a measure of how many truly relevant results are returned. The recall of a given class is defined as the ratio of true positive and the sum of true positive and false negative, therefore as:

$$\begin{aligned} R = \frac{T_{p}}{T_{p} + F_{n}} \end{aligned}$$
(14)

In a similar way precision of a given class in classification is given as the ratio of true positive and the sum of true positive and false positive. The formula is given as:

$$\begin{aligned} P = \frac{T_{p}}{T_{p} + F_{p}} \end{aligned}$$
(15)

F1-score is instead the harmonic mean between precision and recall, thus given as:

$$\begin{aligned} F1 = 2\frac{P*R}{P+R} \end{aligned}$$
(16)

Precision, recall and F1-score metrics results are summarized in Table 3 where it is possible to notice the results achieved by FederNet.

Table 3 The recognition results of different network comparing the test set precision (P), recall (R), F1-score (F1), and fractional errors on craters coordinates (x,y,r) of Mask R-CNN [38], Mask R-CNN (FederNet), DeepMoon [24], ERU-Net [59], ERU-Net-2 (i.e., ERU-Net with two Res-Blocks), DRU-Net [59], Aris-CNN [59] to D-LinkNet [60]

The model detects on average almost double (231.14%) the craters stored in the catalogue ( [50, 56]), this is mainly due to the conservative way in which craters have been classified by remote scientists. Thus, lower recall has to be interpreted as the algorithm identifying more new real craters with respect to the ground truths. While the results can be considered in general similar, it is worth noting that FederNet achieved the top score for the precision which is fundamental for the matching phase.

3.3 Crater Matching Results

In this section, matching results between the two aforementioned crater catalogues are compared on the reference orbit. The field of view (FOV) of the sensor has been set to 90\(^{\circ }\) while the catalogue crater query has a search area of \(100km\times 100km\), centered around the sensor position. Images recollected as by an onboard imaging system have a spatial resolution of 512 x 512 px, and are acquired with a time step of 10 s. This step was chosen in consideration of the mean required time for processing the entire pipeline. However, a lower time step would allow a more frequent measurement update which is beneficial for the developed system. The number of craters detected by CDA (Crater Detection Algorithm) on the reference orbit are computed, in this calculation, the confidence score threshold of the CDA has been set to 0.90 to filter the crater instances. This choice tunes the CDA for TRN, since finding all craters is hard for the computational burden of the matching phase. In addition, this choice makes the predictions accurate and reliable. In the Fig. 6, the behaviors of the aforementioned crater catalogues as well as the craters detected during the orbit are reported. In the last part of graphs of Fig. 6, it is possible to notice a small region of undetected craters, this is not due to the CDA rather to the difficulty of properly handling the gigapixel size of the DEM. Thus, this small region was not processed by the system.

Fig. 6
figure 6

Crater matching results comparing: (top) detected craters with matched triads by (middle) Head et al. & Povilaitis et al. crater catalogue and (bottoms) Robbins crater catalogue, respectively. [Different crater covered regions marked in red while values in [1,100] (blue line) and in (100,\(\infty\)) (green line) highlighted]

In region A, the average number of catalogued craters by Head et al. & Povilaitis et al. merge (H & P) is below 5, thus resulting in a huge impact on the system performances: it is crucial to have at least three craters to perform a match. Besides, some regions evidenced a complete absence of craters catalogued. On the other side, H & P has showed in region B a good deal of matches. The same considerations can be repeated for the Robbins crater catalogue. The average number of crater catalogued is far beyond the previous catalogue, showing no regions of complete absence of craters. However, especially in region B, having a so large number of craters catalogued turned out into longer computational times for the matching phase. Still, it is clear that Robbins crater catalogue has demonstrated better matching capabilities.

3.4 Position Estimation Results

This section reviews PEA results output of position estimation algorithm. Referring to the reference orbit, measurement errors have been prompted, re-projected in local reference frame East-North-Up (ENU) and reported in Figs. 7, 8. Notably, the middle graphs show also a magnification (0\(\div\)1 km) of the PEA results highlighting regions not having a proper crater coverage. Concerning these ones, how it is possible to notice from the graphs they are more extended in the merged crater catalogue than in the Robbin’s one.

Fig. 7
figure 7

Position errors prompted with the Head et al. [56] & Povilaitis et al. [50] merge crater catalogue. No measurement regions highlighted in yellow

Fig. 8
figure 8

Position errors prompted with the Robbins [33] crater catalogue. No measurement regions highlighted in yellow

In the majority of cases, results showed errors below 1km with some spurious measurement to be rejected through the EKF implementation. Both crater catalogues have proven a scant coverage in the first half of the orbit, on contrary the second half of the orbit has shown a good amount of measurements. More in detail, into the second half of the orbit it was possible to obtain position measurements with an error below 500m. Results also evidenced some critical zones without measurements. One in particular being around \(-39^{\circ }\) longitude is easily referable to the absence of craters, while another one around \(-90^{\circ }\) longitude is caused by the failure of CMA. The statistical distributions of PEA measurements errors for the aforementioned catalogues have been computed and reported in Table 4, in which is evidenced how Robbins catalogue has experienced a larger dispersion of the data on the entire orbit, mainly due to the more frequent false matches that causes larger errors.

Table 4 Statistical comparison of PEA measurements errors in ENU frame between Head et al. & Povilaitis et al. merge and Robbins crater catalogue

3.5 EKF Results

This section reviews the EKF accuracy results on the reference orbit. To reduce the influence of bad PEA measurements, a simple but effective approach based on gating and extended Kalman filtering (EKF) has been implemented. To make the approach more general, the initial state vector has been initialized with a random error on position between 0 and 15 km for each of its component: \(\left( X,Y,Z\right)\) in selenographic coordinates. The error distribution prompted have shown a Gaussian behavior, this justifies the introduction of a gating based detection method determined by the statistical properties of the PEA measurements. Most of the PEA measurements can be effectively selected from all mixture measurements using the properly defined confidence region of 3 standard deviations prompted at each step during the orbit. Once again, the two crater catalogues have been submitted for investigation.

Figure 9 shows the errors on position estimation in selenographic coordinates (LCLF) with covariance bands (\(\pm 3\sigma\)) prompted on Head et al. & Povilaitis et al. Crater Catalogue.

Fig. 9
figure 9

EKF accuracy results prompted on Head et al. & Povilaitis et al. Crater Catalogue

It is possible to notice how errors and covariance bands largely increase in regions with scant crater coverage. On other hand, the last part of the orbit—having much more measurements—showed the best results, reaching a sort of convergence. Repeating what was done for the previous catalogue, errors on position estimation in selenographic coordinates have been computed for Robbins crater catalogue and reported in Fig. 10.

Fig. 10
figure 10

EKF accuracy results prompted on Robbins Crater Catalogue

In this case, the initial error is promptly taken down thanks to the Kalman filter that now has more measurements available in the initial stretch of orbit. Also this catalogue has shown in the last stretch of the orbit the best results, being capable to perform the measurement update of EKF in almost every time step, reaching a sort of convergence. Pairing the results achieved by the aforementioned crater catalogues, the Tables 5, 6, 7 are obtained. The reader should observe that the high error on the east component is largely influenced by the areas with poor crater coverage.

The tables demonstrate the higher performance reached by Robbins catalogue in EKF estimation and emphasize the error divergence of system in low coverage conditions. As stated above, Robbins PEA errors are highly affected by false matches, due to the huge number of entries which “confuse” the algorithm. Indeed, analyzing these false matches, it is possible to notice craters arranged as on a grid. This does not surprise because in Robbins crater catalogue many of the entries come from sources unrelated to the DEM, e.g. Surface Reflectivity Models (SRMs), Cameras, Thermal Cameras (TC), and so on, and therefore not identifiable by the CDA. Even though, Robbins crater catalogue has achieved the best scores. This can be explained by the catalogue being capable to correct the drift of the propagator more frequently. In addition, results showed how the combined approach of gating and EKF proved to be effective in filtering out bad measurements.

Table 5 Comparison of EKF positions errors in ENU frame between Head et al. & Povilaitis et al. merge and Robbins crater catalogues; Mean errors
Table 6 Comparison of EKF positions errors in ENU frame, between Head et al. & Povilaitis et al. merge and Robbins crater catalogues; Standard deviations
Table 7 Comparison of EKF positions errors in ENU frame, between Head et al. & Povilaitis et al. merge and Robbins crater catalogues; Root mean square errors

A final remark regards the computational time required by the proposed system. While the PEA and EKF calculation can be considered instantaneous, the detection time depends on the model implemented and hardware used. More in depth, the inference time of this model has been estimated in general below 0.45 s for the specific hardware used. Different considerations must be pointed out for the matching times which assume a different order of magnitude. Indeed, the demanded time grows exponentially with the number of matched triads. In the Fig. 11 the average matching time has been reported by crater catalogue and region under inspection. As it possible to notice, for the Robbins crater catalogue the time required for matching exceeds the step time in the region B. This is mainly due to the high number of triads (> 200) that are matched in that region. However, this does not happen for the merged catalogue which shows an acceptable level of accuracy in that region. Nonetheless, in region A, where the crater coverage is scant, the scenario changes and the Robbins catalogue is the only one capable of providing a sufficient amount of craters for the matching.

Concluding this section, while for a region with a regular number of craters both the crater catalogue are valid, it is necessary to create a targeted crater catalogue for working in high/scant crater coverage conditions.

Fig. 11
figure 11

Average time required by the matching algorithm reported by region and crater catalogue under inspection

4 Conclusion

A novel TRN system has been introduced to enable autonomous navigation in lunar and planetary missions. Despite the usage of a medium-resolution DEM coupled with a simple Keplerian propagator, results showed that the proposed approach is able to cover the new requirements for a planetary positioning system. Furthermore, the system results autonomous being able to operate independently of Earth-based operators. This translates into a reduction of resources and costs. Its capabilities can be further improved with higher resolution data and data fusion integration with other sensor measurements, e.g. the lunar GPS nowadays under investigation by many researchers. Another possibility is to incorporate in the pipeline also the Visual Odometry, a functionality which has been tested through CMA between two subsequent frames. Although this implementation turned out to be robust, further work is required to achieve a flight-capable system. The DL model is still too heavy to be deployed onboard. There is a need of compress the model to use limited computation, power, and memory resources. Indeed, ResNets networks with more than 50 layers must be shrinked and distilled [61] to properly work onboard a satellite. In the end, the evidence from this study highlighted how the crater catalogues, built with different objectives, are generally suboptimal for TRN applications. Thus, the creation of a purpose-built TRN crater catalogue is recommended. Ongoing and future activities are planned to increase the detection & matching capabilities through the latest deep-learning models and new matching schemes. The aim is to exploit also the 3D morphological features contained in Robbins crater catalogue. Besides, triad interior angles are not projective invariants under a general perspective, they require camera in nadir pointing mode and restriction on the altitude. This restricts the orbital regimes of work of the system. Future work is going to eliminate this assumption. Last but not least, the effect of sensor footprint variability should be also evaluated, as well as the variability of the scanned area in the catalogue query.