The Advanced Topographic Laser Altimeter System (ATLAS) laser altimeter aboard the Ice, Cloud, and Land Elevation Satellite (ICESat-2) can measure the elevation of the Earth's surface with unprecedented spatial detail. However, the quality of the derived signal and ground photons depends on the signal-to-noise ratio and canopy coverage. Current algorithms underperform for data collected during daytime over mountain areas with dense canopy. We demonstrate a novel procedure for signal photon detection and subsequent ground photon detection from ICESat-2 ATL03 data. We first introduce a gravity-based density model to characterize the anisotropic properties of photon distribution. Through jointly using the photon densities from the weak-strong beam pair, we are able to find key photons that have high probability being signals. A directional regional growing approach then takes these key photons as seeds to label all remaining signal photons. Finally, we introduce a weighted iterative median filter (WIMF) algorithm to identify ground photons whose height is closest to the estimated ground surface. A total of 36 ATL03 beams of two entire counties in USA are used for test and evaluation. Compared to the ATL03 and ATL08 algorithms, our signal photon finding method is more robust to the variation of topography, canopy coverage, and data collection time. Remarkably, the mislabeling caused by the after-pulsing effect does not present in our detected signal photons. Comparing current ATL03 and ATL08 products, the detected ground photons from our method are more consistent with reference to the 3DEP DEM, especially for strong beam data collected during daytime in dense canopy, high relief areas.