Published August 11, 2025 | Journal article | Version v1 | https://doi.org/10.21105/joss.07953

Segmenteverygrain: A Python module for segmentation of grains in images

  • 1. Bureau of Economic Geology, Jackson School of Geosciences, The University of Texas at Austin, Austin, TX, USA
  • 2. Department of Earth and Planetary Sciences, Jackson School of Geosciences, The University of Texas at Austin, Austin, TX, USA
  • 3. The Water Institute, New Orleans, LA, USA
  • 4. BSC Group, Boston, MA, USA
  • 5. ConocoPhillips, Houston, TX, USA

Files

joss.07953.pdf

Files (83.0 MB)

Name Size Download all
md5:d2017dbef3a439e195d79abe49292e17
4.4 MB Preview Download
md5:ab187a1ca761108abcb8388995b5998c
78.6 MB Preview Download

Additional details

Dates

Issued
August 11, 2025

References

  1. Sylvester, Z., Stockli, D., Howes, N., Roberts, K., Malkowski, M., Poros, Z., Martindale, R., & Wilson, B. (2025). Segmenteverygrain: A Python module for segmentation of grains in images (Version v0.2.3) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.16740743
  2. Buscombe, D. (2019). SediNet: a configurable deep learning model for mixed qualitative and quantitative optical granulometry. Earth Surface Processes and Landforms, 45(3), 638–651. https://doi.org/10.1002/esp.4760
  3. Chen, Z., Scott, C., Keating, D., Clarke, A., Das, J., & Arrowsmith, R. (2023). Quantifying and analysing rock trait distributions of rocky fault scarps using deep learning. Earth Surface Processes and Landforms, 48(6), 1234–1250. https://doi.org/10.1002/esp.5545
  4. Kirillov, A., Mintun, E., Ravi, N., Mao, H., Rolland, C., Gustafson, L., Xiao, T., Whitehead, S., Berg, A. C., Lo, W.-Y., Dollár, P., & Girshick, R. (2023). Segment Anything (Version 1). arXiv. https://doi.org/10.48550/arxiv.2304.02643
  5. Mair, D., Do Prado, A. H., Garefalakis, P., Lechmann, A., Whittaker, A., & Schlunegger, F. (2022). Grain size of fluvial gravel bars from close-range UAV imagery – uncertainty in segmentation-based data. Earth Surface Dynamics, 10(5), 953–973. https://doi.org/10.5194/esurf-10-953-2022
  6. Pielawski, N., Wählby, C., & Zhang, J. (2020). Introducing Hann windows for reducing edge-effects in patch-based image segmentation. PLOS ONE, 15(3), e0229839. https://doi.org/10.1371/journal.pone.0229839
  7. Purinton, B., & Bookhagen, B. (2021). Tracking Downstream Variability in Large Grain‐Size Distributions in the South‐Central Andes. Journal of Geophysical Research: Earth Surface, 126(8). https://doi.org/10.1029/2021jf006260
  8. Tang, D. G., Milliken, K. L., & Spikes, K. T. (2020). Machine learning for point counting and segmentation of arenite in thin section. Marine and Petroleum Geology, 120, Article 104518. https://doi.org/10.1016/j.marpetgeo.2020.104518
  9. Mair, D., Witz, G., Do Prado, A. H., Garefalakis, P., & Schlunegger, F. (2023). Automated detecting, segmenting and measuring of grains in images of fluvial sediments: The potential for large and precise data from specialist deep learning models and transfer learning. Earth Surface Processes and Landforms, 49(3), 1099–1116. https://doi.org/10.1002/esp.5755
  10. Azzam, F., Blaise, T., & Brigaud, B. (2024). Automated petrographic image analysis by supervised and unsupervised machine learning methods. Sedimentologika, 2(2). https://doi.org/10.57035/journals/sdk.2024.e22.1594
  11. Robin, C. Q., Duchene, A., Murdoch, N., Vincent, J.-B., Lucchetti, A., Pajola, M., Ernst, C. M., Daly, R. T., Barnouin, O. S., Raducan, S. D., Michel, P., Hirabayashi, M., Stott, A., Cuervo, G., Jawin, E. R., Trigo-Rodriguez, J. M., Parro, L. M., Sunday, C., Vivet, D., … Chabot, N. L. (2024). Mechanical properties of rubble pile asteroids (Dimorphos, Itokawa, Ryugu, and Bennu) through surface boulder morphological analysis. Nature Communications, 15(1). https://doi.org/10.1038/s41467-024-50147-w
  12. Roberts, K. (2024). Evaluation of 3d beach profiles: A new method for monitoring changes in beach morphology and grain size [MS Thesis]. University of Massachusetts Boston.
  13. Prieur, N. C., Amaro, B., Gonzalez, E., Kerner, H., Medvedev, S., Rubanenko, L., Werner, S. C., Xiao, Z., Zastrozhnov, D., & Lapôtre, M. G. A. (2023). Automatic Characterization of Boulders on Planetary Surfaces From High‐Resolution Satellite Images. Journal of Geophysical Research: Planets, 128(11). https://doi.org/10.1029/2023je008013
  14. Ravi, N., Gabeur, V., Hu, Y.-T., Hu, R., Ryali, C., Ma, T., Khedr, H., Rädle, R., Rolland, C., Gustafson, L., Mintun, E., Pan, J., Alwala, K. V., Carion, N., Wu, C.-Y., Girshick, R., Dollár, P., & Feichtenhofer, C. (2024). SAM 2: Segment Anything in Images and Videos (Version 2). arXiv. https://doi.org/10.48550/arxiv.2408.00714
  15. Clark, A. (2015). Pillow (PIL fork) documentation. readthedocs. https://pillow.readthedocs.io/en/stable/index.html
  16. van der Walt, S., Schönberger, J. L., Nunez-Iglesias, J., Boulogne, F., Warner, J. D., Yager, N., Gouillart, E., & Yu, T. (2014). scikit-image: image processing in Python. PeerJ, 2, e453. https://doi.org/10.7717/peerj.453
  17. Gillies, S., & others. (2013--). Rasterio: Geospatial raster i/o for Python programmers. Mapbox. https://github.com/rasterio/rasterio
  18. Gillies, S., van der Wel, C., Van den Bossche, J., Taves, M. W., Arnott, J., Ward, B. C., & others. (2025). Shapely (Version 2.1.1) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.15463269
  19. Hagberg, A. A., Schult, D. A., & Swart, P. J. (2008). Exploring Network Structure, Dynamics, and Function using NetworkX. Proceedings of the Python in Science Conference, 11–15. https://doi.org/10.25080/tcwv9851
  20. Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G. S., Davis, A., Dean, J., Devin, M., Ghemawat, S., Goodfellow, I., Harp, A., Irving, G., Isard, M., Jia, Y., Jozefowicz, R., Kaiser, L., Kudlur, M., … Zheng, X. (2015). TensorFlow: Large-scale machine learning on heterogeneous systems. https://www.tensorflow.org
  21. Chollet, F., & others. (2015). Keras. https://keras.io
  22. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, E. (2011). Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research, 12, 2825–2830.
  23. Chapter 6: Quantitative Textural Analysis. (2022). Chapter 6: Quantitative Textural Analysis. In Sandstone Petrography, Petrology, and Modeling (pp. 143–160). SEPM Society for Sedimentary Geology. https://doi.org/10.2110/sepmcsp.13.06
  24. Prodanovic, M., Milliken, K. L., & Mehmani, A. (2019). Offshore Miocene sandstone thin section (Folk McBride collection). https://www.digitalrocksportal.org/projects/244; Digital Rocks Portal. https://doi.org/10.17612/rn6g-fq64

Citations

  1. Momjian, S., Fanghanel, J., Wang, K., Jeon, S.-C., Spiers, C. J., & Randall, C. A. (2027). Transient liquid speciation controls densification and grain growth in cold sintered ZnO. Journal of the European Ceramic Society, 47(4), Article 118984. https://doi.org/10.1016/j.jeurceramsoc.2026.118984
  2. Hermans, Y. F. L., Hua, Y., Ehab Moustafa Kamel, K., Massart, T. J., & Milani, G. (2026). Comparative assessment of image-derived mesh topologies for kinematic limit analysis of irregular masonry with rigid and dissipative elements. Meccanica, 61(5). https://doi.org/10.1007/s11012-026-02184-6
  3. Liu, B., AlSalmi, H., & John, C. M. (2026). CAGEY (CArbonate Grain Estimation with YOLO): Object detection for grain size, roundness, and dunham classification. Applied Computing and Geosciences, 29, Article 100329. https://doi.org/10.1016/j.acags.2026.100329
  4. Berthet, J., Lemaire, P., Baratier, A., Benacchio, V., Piton, G., & Kerverdo, R. (2026). La mesure granulométrique par imagerie en contexte torrentiel : apports et perspectives des nouvelles méthodes par intelligence artificielle. Géomorphologie : Relief, Processus, Environnement, 32(1), 23–40. https://doi.org/10.4000/15pwo
  5. Chan, V., Rheinwalt, A., & Bookhagen, B. (2026). OrthoSAM: multi-scale extension of the Segment Anything Model for river pebble delineation from large orthophotos. Earth Surface Dynamics, 14(3), 391–416. https://doi.org/10.5194/esurf-14-391-2026
  6. Mair, D., Witz, G., Do Prado, A., Garefalakis, P., Wild, A., Ville, F., Schuster, B., Horn, M., Österle, J., Fabbri, S. C., Litty, C., Achleitner, S., Leistner, S., Hiller, C., & Schlunegger, F. (2026). ImageGrains 2.0: Improved precision and generalization for grain segmentation. Earth Surface Dynamics, 14(4), 527–551. https://doi.org/10.5194/esurf-14-527-2026
  7. Zhu, Z., Qu, T., & Zhao, J. (2025). Single‐image 3D particle reconstruction via generative AI‐empowered large vision models. Computer-Aided Civil and Infrastructure Engineering, 40(28), 5288–5306. https://doi.org/10.1111/mice.70113
  8. Trower, E. J., Ingalls, M., Gutoski, J. R., & Wala, V. T. (2025). New constraints on phosphate concentration and temperature in shallow late Tonian seawater. Geology, 53(11), 940–944. https://doi.org/10.1130/g53532.1