Skip to Content
ComputationComputation
  • Article
  • Open Access

13 October 2022

13 Pages

A Pattern-Recognizer Artificial Neural Network for the Prediction of New Crescent Visibility in Iraq

Department of Computer Engineering, College of Engineering, University of Baghdad, Baghdad 10071, Iraq

Abstract

Various theories have been proposed since in last century to predict the first sighting of a new crescent moon. None of them uses the concept of machine and deep learning to process, interpret and simulate patterns hidden in databases. Many of these theories use interpolation and extrapolation techniques to identify sighting regions through such data. In this study, a pattern recognizer artificial neural network was trained to distinguish between visibility regions. Essential parameters of crescent moon sighting were collected from moon sight datasets and used to build an intelligent system of pattern recognition to predict the crescent sight conditions. The proposed ANN learned the datasets with an accuracy of more than 72% in comparison to the actual observational results. ANN simulation gives a clear insight into three crescent moon visibility regions: invisible (I), probably visible (P), and certainly visible (V). The proposed ANN is suitable for building lunar calendars, so it was used to build a four-year calendar on the horizon of Baghdad. The built calendar was compared with the official Hijri calendar in Iraq.

1. Introduction

The early sighting of a new crescent moon is one of the earliest astronomical activities performed by human civilizations. This sighting marked the start of the lunar month in many such civilizations. The first evidence of these activities came to us from the Babylonians (6th Century B.C.), who lived in the fertile lands of Mesopotamia (modern-day Iraq) [1]. They relied on the crescent moon to indicate the start of their calendar months and years. They used a standard criterion to predict the moon’s sight, which was sufficient for that purpose. Other civilizations, such as Indians and Chinese, also used lunar sight and still do to this day, although use different criteria to determine the start of a lunar month [2]. Jewish people also still use the moon cycle to indicate the start of the months in their lunisolar calendar, although they use arithmetic calculation rather than moon sighting.
Centuries after the Babylonians, in the 7th Century C.E., a new religion, Islam, had emerged from the deserts of the Arabian Peninsula. Three of the five main pillars of Islam depend on the start of the lunar months. They are Fasting-Breakfasting “Siam-Fitr”, Pilgrimage “Hajj”, and Alms “Zakat”. The first two pillars are performed in a specific lunar month in a year, while the third is performed once in the first month of each lunar year [2]. Reckoning of the first crescent moon after the conjunction is an essential indication for Muslims to begin their lunar months and perform their religious duties.
Through the Islamic golden age (between the 9th and 11th centuries C.E.), many famous Muslim astronomers laid down specific criteria for moon sighting that depended on the age of the moon (the time passed since the conjunction) and the lag of the moon (the time between the sunset and the moonset) [3]. Some considered the arc length of celestial degrees between the sun and the moon (elongation) at sunset. However, they could not predict the sighting perfectly because they did not consider the local conditions of the horizon at the time of observation, and they omitted the effect of changing the apparent width of the crescent moon and its relation with the brightness of the sky [4].
Since the start of the previous century, various theories have been proposed to design a criterion for moon visibility suitable to predict the start of lunar months. These theories relied on drawing a borderline between positive (visible) and negative (invisible) observations or on defining a visibility region using interpolations. All these methods were empirical and depended on the subjective viewpoint of the observer. Many observation records yielded incorrect predictions [5]. There is also interference between the two mentioned regions, which was difficult separate empirically. This situation could be resolved by drawing a barrier region between them. Therefore, an objective-oriented method that depends on the presented datasets themselves should make the visibility regions more realistic and reliable.
The development of machine learning (ML) techniques in recent years resulted in many considerable advancements in modern technology. ML algorithms have proven their ability in numerous fields, such as pattern recognition. Artificial neural networks (ANN’s) are of the most widely used technology in pattern recognition due to their ability to analyze and learn patterns hidden inside the data that they consider, as well as their ability to train themselves on new data to rectify and improve their performance. They can predict the output of any input not presented in the training data, making them flexible in handling lost and misleading information. Many studies have been performed related to ML with ANNs in the field of pattern recognition and classification [6,7,8,9].
In this study, a two-layered ANN was used to learn moon sighting data tables provided by Schaefer, Yallop, and Odeh to generate a moon sighting region recognizer to predict the possible condition of the first sighting of a new crescent moon. This ANN was used to build a calendar for four Islamic Hijri years (1440–1443 A.H.) based on the local horizon of Baghdad, the capital of Iraq, as a part of a larger project to build a unified Islamic Hijri Calendar for Iraq. The results of the ANN recognizer were compared with the current official Hijri Calendar in Iraq, which relies on astronomical calculations rather than moon sighting.
The remainder of this study is organized as follows. In Section 2, we outline a literature review of related works. In Section 3, we illustrate the methods used to calculate the essential parameters for moon sighting and demonstrate the observational dataset and the design of the proposed pattern recognizer ANN. In Section 4, we present the results of ANN training and the newly constructed calendar. In Section 5, we discuss the obtained results.

3. Methodology

3.1. Moon Sighting Parameters

The Islamic day (and hence the Islamic lunar month) starts at sunset rather than midnight when the civil standard day starts. Observation of the new crescent moon is due on the time of sunset of the 29th day of the elapsed lunar month. The following day, which starts at that sunset, will be either the 30th day of the current lunar month or the 1st day of the next lunar one. The first visibility of the crescent moon decides the choice between these two cases. If the crescent is visible, the next day will be the 1st day of the next month, or else (the crescent is not visible), the next day will be the 30th day of the elapsed month, and the following day will be the 1st day of the following month.
Figure 1 illustrates the essential parameters of moon sighting:
Figure 1. Horizontal Coordinates of the Bright Limb of the Crescent Moon Relative to the Sun, along with other parameters.
At the best time (whether it is either the time of sunset when the upper limb of the sun coincides with the horizon or the center of the sun is located below the horizon in several degrees), five parameters are calculated: the equatorial celestial positions of the sun and the moon (declinations and right ascensions), and the apparent radius of the moon disk ρ m .
In this study, the best time was used according to Ilyas [19], when the sun depression is 4° ( D E P = 4 ° ) .
The equatorial celestial coordinates of the moon were corrected for parallax as topocentric coordinates rather than geocentric ones. The astronomical algorithms for calculating such coordinates are available in Jean Meeus’s book [29].
The elongation ψ between the centers of the luminaries is calculated as follows:
ψ = arccos ( sin δ ´ m sin δ s + cos δ ´ m cos δ s cos ( α ´ m − α s ) )
where δ ´ m ,   α ´ m are the corrected equatorial celestial coordinates (declination and right ascension) of the moon,, and δ s , α s are the celestial coordinates (declination and right ascension) of the sun.
The first parameter of the moon sighting, the width of the crescent (abbreviated by w ), is calculated in terms of arcminutes:
w = 60 ( 1 − cos ψ ) ρ m
The orientation angle of the moon’s bright limb θ is calculated from the difference between two arguments:
θ = arctan ( sin H m cos δ ´ m tan φ − sin δ ´ m cos H m ) − arctan ( cos δ ´ m tan δ s − sin δ ´ m cos ( α ´ m − α s ) sin ( α ´ m − α s ) )
where H m is the hour-angle of the moon and φ is the geographic latitude [29].
The arc of light A R C L , which is the distance between the center of the sun and the bright limb of the moon, is equal to the elongation minus the radius of the moon’s disk:
A R C L = ψ − ρ m
The other parameters, A R C V and D A Z are calculated in terms of A R C L and θ :
A R C V = arctan ( sin θ tan A R C L )
D A Z = | arcsin ( cos θ sin A R C L ) |
The values of w ,   A R C V and D A Z are the input to the pattern recognizer ANN which will be trained using the moon sighting dataset.

3.2. Pattern Recognizer ANN Architecture

The architecture of the pattern recognizer ANN is shown in Figure 2.
Figure 2. Pattern recognizer ANN architecture.
This ANN has three layers: the first one is the input layer (surrounded by the red rectangle) and has three neurons. This layer receives the input parameters (w, ARCV and DAZ) from the observational dataset. It has an input-to-hidden bias vector (bi). The input values of the first neuron are between 0 to 2. In the second and third neurons, the input values are between 0 to 20.
The hidden layer contains five neurons (surrounded by the green rectangle), which receive the input values after scaling them by the input-to-hidden weight matrix (Wi) along with the input-to-hidden bias vector. The activation function of the hidden layer is the tan sig ( ) function, which is indicated in the figure by the letter (T). This layer has a hidden-to-output bias vector (bh).
The output layer has three neurons (surrounded by the blue rectangle). Each output neuron represents one of the moon sighting regions (invisible I, probably visible P, and certainly visible V). It receives the results of the hidden neurons after scaling them by the hidden-to-output weight matrix (Wh) along with the hidden-to-output bias vector. The activation function of the output layer is the softmax ( ) function, which is indicated in the figure by the letter (S). If any of the output neurons is unity or near unity, its corresponding output will refer to the observation result. The formulae of the two activation functions are illustrated in Equations (11) and (12).
y = tan sig ( x ) = 1 − e − 2 x 1 + e − 2 x
y i = softmax ( x n × 1 , i ) = e x i ∑ k = 1 n e x k
where x n × 1 is the vector of the output layer. In this study, n = 3 to represent the number of the output values.
The ANN was trained using the Bayesian Regularization backpropagation algorithm (BRA), one of the widely used ANN training algorithms for challenging data. BRA updates the weight and bias values according to the Levenberg-Marquardt optimization (LMA). It minimizes a combination of squared errors and ANN weights to determine the correct combination and produce a network that simulates the datasets well. This algorithm uses an adaptive learning rate between 0.005 to 1010 [30].
Choosing the number of hidden neurons was a tradeoff between the complexity of the ANN (and hence the computation time) and the speed of ANN learning of the observation dataset. If the number of hidden neurons was decreased, the ANN would need more time or additional data to learn the pattern of the dataset efficiently.

3.3. Training Dataset

The parameters of the moon’s sight were calculated on the day of the observation. The generated data are the Best time according to Ilyas [19], age of the moon Age, crescent width w, ARCL, ARCV, and DAZ. The parameters were generated from the observational data (Sight Date, Longitude, and Latitude), along with the recorded observational conditions of the crescent moon (Invisible, visible by Telescope, visible by Binoculars, easily Visible, etc.) These targets are used in ANN learning.
The dataset contains 578 entries, each entry for one observation. After combining the dataset of the three authors, several observations were repeated; therefore, it was significant to unify all of them. Furthermore, all morning observations (which were held before sunrise on the last day of the month) were skipped from the dataset. ANN training was implemented on the evening observations only. Table 5 shows a sample of the dataset. The complete dataset table is found in the Supplementary Materials, Table S1.
Table 5. A sample of the Observation Dataset provided by Schaefer, Yallop and Odeh for moon sighting. The sighting parameters are calculated for the “best time” according to Ilyas.
There are 14 columns in this table. The 1st one represents the catalog origin: (S) for Schaefer; (O) for Odeh. The second column represents the Hijri year in which the observation attempts to recognize its start. The number in the third column represents the number of the lunar month which begins from 1 as Muharram through 12 as Thu-Al-Hijja. The 4th and 5th columns represent the Gregorian calendar date and time. The time is in terms of the coordinated Universal Time (UT) of the observation day. The 6th and 7th columns represent the geographical coordinates of observation (Lat for geographical latitude and Lon for geographic longitude). The 8th column contains the moon’s age in hours from the geocentric conjunction until the best time, whereas the 9th column contains the width of the crescent. The 10th, 11th, and 12th columns hold the horizontal coordinates of the bright limb of the crescent moon. These coordinates are relative to the sun in terms of the arc degrees. The 13th column contains the observational results as recorded by Schaefer and Odeh. The meaning of these data values is illustrated in [16,17]. The 14th column contains the observational results as will be interpreted by the pattern recognizer ANN (I as invisible, P as probably visible, and V as certainly visible).
The parameters in columns 9, 11, and 12 were used to train the ANN to fit the output in column 14. Before ANN training, the dataset was distributed on a 2D chart ( A R C V vs. w ) in Figure 3. Every dot represents a single observation. Its color indicates its observation result (red as invisible, green as probably visible, blue as certainly visible).
Figure 3. Distribution of the training dataset on a chart ( A R C V vs. w ).

4. Results

4.1. ANN Training

The pattern recognizer ANN was trained by the dataset, which contains 578 entries using MATLAB® R2020b. The training performance MSE was 0.1134 after about 360 training epochs throughout the overall process. Figure 4 illustrates the results of the training.
Figure 4. Results of the pattern recognizer ANN training: (a) Best training performance with a MSE of 0.1134; (b) Error histogram of the dataset entries; (c) Confusion table of ANN output relative to the desired target; (d) Receiver Operating Characteristic of the ANN.
The results of the training show that the pattern recognizer managed to learn the observation dataset in a high percentage (72.7%). This percentage represents eight identical observations out of eleven.
Figure 4a shows the convergence progress of the ANN. The error reached its minimum at epoch No. 184. The error between the desired outputs (Targets) and actual ANN outputs (Outputs) did not exceed 5% for most of the ANN output values compared with their corresponding desired target values. Figure 4b illustrate that. In Figure 4c, the confusion tables of the results show that 420 observations were true (the three green diagonal squares), whereas fifty-five observations were overestimated, i.e., they should be hardly visible or might be invisible even though they were recorded as visible (the three upper reddish squares). The remaining observations (103) were underestimated, i.e., they should be visible even though they were recorded as invisible (the three lower reddish squares). In Figure 4d, it is clear that the ANN successfully learned the invisible and certainly visible regions (the red and blue lines). However, the ANN learned the region of the probably visible slightly worse (the green line) because it was closer to the center line than the others.
A test dataset was generated to test the pattern recognizer ANN efficiently. The values of the crescent width are between 0.01′ and 4′ in a step of 0.01′. The values of the orientation angle of the moon’s bright limb θ are between 0° and 90° in a step of 1°. The value of A R C L , A R C V and D A Z are calculated accordingly using w and θ as follows:
A R C L = 20.557 w − 0.259
A R C V = arcsin ( sin θ sin A R C L )
D A Z = | arctan ( cos θ tan A R C L ) |
The test data contain 36,400 entries. Every entry is sent to the input of the ANN. The output of the ANN was illustrated on a chart according to A R C V vs. w . Their colors represent the observation results (red for invisible, green for probably visible, and blue for certainly visible).

4.2. Building a Sample Hijri Calendar for Iraq

The theoretical observational site was at a reference place in Baghdad, the capital of Iraq. A famous landmark was chosen, which is the historical Qishla clocktower at the left (eastern) bank of the Tigris river ( L a t = 33.34 ; L o n = 44.387 ). The pattern recognizer ANN generated the information for the lunar month start and compared it with the official lunar month start in Iraq mentioned on the ICOP website [31]. Table 6 shows the first days for all the months in the Hijri years (1440–1443):
Table 6. The first days of the Hijri lunar months of the years (1440–1443) in astronomical (1) and observational (2) methods. The difference appear only when the moon is “Invisible” on sight day.

5. Discussion

Figure 5 gives a complete comprehensive analysis of the original observation dataset. First, the crescent moon would not be visible by any means available (except the CCD imaging) if the crescent width was less or equal to 0.12′ ( A R C L is about 6.86° or elongation of 7.12°), which proved Danjon’s limit and Schaefer investigations. In the region of the lower limit of naked eye visibility, the moon would be certainly visible for any condition of the sky if the crescent width was 0.3′ ( A R C L is about 11° or elongation of 11.25° provided that D A Z = 0 ), which confirmed the results of Maunder and Ilyas as the minimum elongation for naked-eye visibility. The crescent width might be greater than 0.3′ and could not be seen by naked eye if its D A Z was very large. For larger values of the crescent width w > 1 ′ ( A R C L > 20 ° ), it is obvious that the moon could not be seen by any means available if the A R C V < 4 ° , which confirms the finding of Ilyas. Furthermore, the minimum value of arc of vision for the crescent moon visibility is when A R C V = 7 ° .
Figure 5. Performance of the Pattern Recognizer ANN for a test data.
Secondly, it is enough to divide the moon sight area into three regions rather than four as in Odeh’s criterion or five as in Yallop’s criterion. The invisible region is contiguous, and so is the visible one. The middle area was only a thin line between the two others.
Thirdly, there was a red spot inside the blue region. The reason was performing the old observations using the naked eye only. This spot should be green (probably visible) rather than red. Schmidt recorded these sightings as “invisible” rather than “probably visible” because he used the unaided sight only.
The crescent moon may be visible by the unaided eye in the green region, but it remains unlikely to be seen compared with the blue one. Furthermore, a visible area under an invisible area implies an issue related with recording sight results. The green region might contain blue spots, which indicates that the crescent could be visible by the unaided eye if the conditions were appropriate. Whenever the moon sight data approaches the red region, moon sighting will be less likely.
Figure 5 shows that the official Hijri Calendar in Iraq started the new lunar month on the following day of the moon sight, regardless of the crescent moon sight result (invisible or probably visible), yet most of the results were invisible. So one should consider that issue and reform the official Hijri calendar to use observational results rather than astronomical calculations, which most countries in the Middle East have used.

6. Conclusions

Many theories of moon sight attempted to simulate the problem of early visibility. All these theories were empirical and depended totally on the observational results to draw a line among the moon sight regions. This research suggested an alternative approach to visualize those regions depending on machine learning techniques. Deep-learning tools such as ANN’s are helpful in simulating the moon sighting dataset.
The pattern recognizer ANN successfully simulated the moon sighting problem using observational data. The ANN verified the actual observational result for eight observations out of eleven. However, it is preferable to enhance the performance of the ANN using additional datasets. These results encourage collecting more data and training the ANN for improved accuracy, which helps construct robust Hijri calendars in any state or country. Unfortunately, the official Hijri calendar in Iraq does not depend on the observations of the astronomical societies and compromises their mathematical calculations.
These results open the way to propose a new criterion for crescent moon visibility which predicts the moon sight more likely. The results of this study will be the ground to create that criterion.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/computation10100186/s1. Table S1: The Complete Dataset of the Moon sight visibility.

Funding

This research received no external funding.

Data Availability Statement

The datasets used in this study are available in [16,17,21].

Acknowledgments

The author would express his deepest thanks and gratitude to his colleague Mohammed Shawkat Odeh the head of ICOP, for providing him with the essential resources and references throughout the period for preparing this study.

Conflicts of Interest

The author declare no conflict of interest.

References

  1. Fatoohi, L.J.; Stephenson, F.R.; Al-Dargazelli, S.S. The Danjon Limit of First Visibility of the Lunar Crescent. Observatory 1998, 118, 65–72. [Google Scholar]
  2. Schaefer, B.E. The length of the Lunar Month. J. Hist. Astron. 1992, 23, 32–42. [Google Scholar] [CrossRef] [Scilit]
  3. Ilyas, M. Lunar crescent visibility Criterion and Islamic Calendar. Q. J. R. Astr. Soc. 1994, 35, 425–461. [Google Scholar]
  4. Bruin, F. The First Visibility of the Lunar Crescent. Vistas Astron. 1977, 12, 331–358. [Google Scholar] [CrossRef] [Scilit]
  5. Schaefer, B.E.; Ahmad, I.A.; Doggett, L.E. Records for Young Moon Sighting. Q. J. R. Astr. Soc. 1993, 37, 53–56. [Google Scholar]
  6. Lazli, L.; Boukadoum, M. Hidden neural network for complex pattern recognition: A comparison study with Multi-neural network-based approach. Int. J. Life Sci. Med Res. 2013, 3, 234–245. [Google Scholar] [CrossRef] [Scilit]
  7. Khodaskar, A.A.; Ladhake, S.A. Pattern recognition: Advanced development, techniques and application for image retrieval. In Proceedings of the IEEE 2014 International Conference on Communication and Network Technologies (ICCNT), Sivakasi, India, 18–19 December 2014; pp. 74–78. [Google Scholar]
  8. Kim, T.H. Pattern recognition using artificial neural network: A review. In Proceedings of the 4th International Conference on Information Security and Assurance (ISA2010), Miyazaki, Japan, 23–25 June 2010; pp. 138–148. [Google Scholar]
  9. Schmidhuber, J. Deep learning in neural networks: An overview. Neural Netw. 2015, 61, 85–117. [Google Scholar] [CrossRef] [Scilit]
  10. Fotheringham, J.K. On the Smallest Visible Phase of the Moon. RAS Mon. Notices 1910, 70, 527–532. [Google Scholar] [CrossRef] [Scilit]
  11. Maunder, E.W. On the Smallest Visible Phase of Moon. JBAA 1911, 21, 355–362. [Google Scholar]
  12. Danjon, A. Jeunes et Vieilles Lunes. l’Astronomie 1932, 46, 57–66. [Google Scholar]
  13. McNally, D. The length of the lunar crescent. Q. J. R. Astr. Soc. 1983, 24, 417–429. [Google Scholar]
  14. Schaefer, B.E. Lunar crescent visibility. Q. J. R. Astr. Soc. 1996, 37, 759–768. [Google Scholar]
  15. Sultan, A.H. First Visibility of The Lunar Crescent Beyond Danjon’s Limit. Observatory 2007, 127, 53–59. [Google Scholar]
  16. Yallop, B.D. A Method for Predicting the First Sighting of the New Crescent Moon; RGO NAO Technical Note 69; HM Nautical Almanac Office, Royal Greenwich Observatory: Cambridge, UK, 1997; pp. 1–15. [Google Scholar]
  17. Odeh, M.S. New Criterion for Lunar Crescent Visibility. Exp. Astron. 2006, 18, 39–64. [Google Scholar] [CrossRef] [Scilit]
  18. Schaefer, B.E. Length of the lunar crescent. Q. J. R. Astr. Soc. 1991, 32, 265–277. [Google Scholar]
  19. Ilyas, M. Limiting altitude separation in the new Moon’s first visibility criterion. Astron. Astrophys. 1988, 206, 133–135. [Google Scholar]
  20. Alrefay, T.; Alsaab, S.; Alshehri, F.; Alghamdi, A.; Hadadi, A.; Alotaibi, M.; Almutari, K.; Mubarki, Y. Analysis of Observations of Earliest Visibility of the Lunar crescent. Observatory 2018, 138, 267–291. [Google Scholar]
  21. Schaefer, B.E. Visibility of the lunar crescent. Q. J. R. Astr. Soc. 1988, 29, 511–523. [Google Scholar]
  22. Ilyas, M. Lowest Limit of w in the New Moon’s First Visibility Criterion of Bruin and its Comparison with the Maunder Criterion. Q. J. R. Astr. Soc. 1981, 22, 154–159. [Google Scholar]
  23. Caldwell, J.A.R.; Laney, C.D. First Visibility of the Lunar Crescent. Mon. Notes Astron. Soc. S. Afr. 1999, 58, 150–163. [Google Scholar]
  24. Caldwell, J.A.R. Moonset lag with arc of light predicts crescent visibility. MNASSA 2011, 70, 220–235. [Google Scholar]
  25. Qureshi, M.S. Computational Astronomy and the Earliest Visibility of Lunar Crescent; Institute of Space and Planetary Astrophysics, University of Karachi: Karachi, Pakistan, 2005; pp. 1–15. [Google Scholar]
  26. McNaughton, D. A Universal Islamic Calendar. Homdard Islamicus 1997, 20, 77–85. [Google Scholar]
  27. Doggett, L.E.; Schaefer, B.E. Lunar Crescent Visibility. Icarus 1994, 107, 388–403. [Google Scholar] [CrossRef] [Scilit]
  28. Al-Mostafa, Z. Lunar Calendar the New Saudi Arabian Criterion. Observatory 2005, 125, 25–30. [Google Scholar]
  29. Meeus, J. Astronomical Algorithms, 2nd ed.; Willmann-Bell Inc: Richmond, VA, USA, 1998. [Google Scholar]
  30. Bayesian Regularization Backpropagation. Available online: https://www.mathworks.com/help/deeplearning/ref/trainbr.html (accessed on 5 October 2022).
  31. ICOP Crescent Observation Results. Available online: https://www.astronomycenter.net/res.html (accessed on 1 September 2022).
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.