Skip to content

Repository files navigation

SexEst

Live app (primary): https://sexest.cyi.ac.cy/

Also available as a mirror on Render: https://sexest.onrender.com/

Short description

  • SexEst is an open-source Streamlit web application for predicting biological sex from skeletal measurements using pre-trained machine learning models (XGBoost, LightGBM, Linear Discriminant Analysis).

Background

  • Skeletal sex estimation is an essential step in osteoarchaeological and forensic contexts. This project (1) evaluates multiple machine-learning classifiers on worldwide cranial and postcranial measurements and (2) deploys the best-performing models in a free web application for straightforward sex prediction of unknown skeletons. Selected text from the paper: “Skeletal sex estimation is an essential step in any osteoarcheological study... The models offering the highest rates of correct sex classification (Extreme Gradient Boosting, Light Gradient Boosting, and Linear Discriminant Analysis) were then selected to construct an open access and open source web application, SexEst.”

Key links

What is in this repository

  • streamlit_app.py — Streamlit web UI and inference logic (loads pre-trained models and shows predictions).
  • models_goldman/, models_howell/ — pre-trained model metadata (and in some cases model files).
  • sample_dataset_craniometric.csv, sample_dataset_osteometric.csv — example input files.
  • requirements.txt — Python dependencies required to run the app locally.
  • LICENSE — Apache License 2.0 (this repository is distributed under Apache 2.0).

Quickstart — run locally

  1. Create a virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Run the Streamlit app:
streamlit run streamlit_app.py
  1. Open http://localhost:8501/ in your browser.

Docker (optional)

  • A Dockerfile is included for building a containerized version of the app. To build and run the image:
docker build -f Dockerfile -t app:latest .
docker run -p 8501:8501 app:latest

Visit http://localhost:8501/ (or the mapped host port) once the container is running.

Docker on Apple Silicon (M1/M2/M3/M4)

  • On an Apple Silicon Mac the plain build above fails while installing lightgbm==3.1.1, with:
    FileNotFoundError: [Errno 2] No such file or directory: 'cmake': 'cmake'
    Exception: Please install CMake and all required dependencies first
    
    LightGBM 3.1.1 publishes no arm64/aarch64 wheel, so pip falls back to building it from source, and the python:3.7 base image has no CMake. Build for linux/amd64 instead, so pip finds the prebuilt x86_64 wheel and skips compiling:
docker build --platform linux/amd64 -f Dockerfile -t app:latest .
docker run --platform linux/amd64 -p 8501:8501 app:latest

The container then runs under emulation (Rosetta), which is slower to start but fine for local use.

  • If you would rather build natively on arm64, add CMake and a toolchain to the image so LightGBM can compile:
RUN apt-get update && apt-get install -y --no-install-recommends \
        cmake build-essential \
    && rm -rf /var/lib/apt/lists/*

Notes on models and data

  • The app uses pre-trained models; training notebooks used to produce those models are available at https://github.com/cconsta1/SexEst_Notebooks.git. The original training datasets (Goldman osteometric and Howells craniometric) are freely available from Dr. B. Auerbach: https://web.utk.edu/~auerbach/DATA.htm — please follow the dataset owners' citation guidelines if you reuse the data.
  • Please do not modify or replace the packaged models in models_* unless you intend to retrain and version them appropriately.

Contributing

  • See CONTRIBUTING.md for guidance on reporting issues, documentation edits, and reproducing the analysis.

Recommended housekeeping

  • Add a .gitignore to avoid committing virtual environments, caches, or large model binaries.
  • Consider adding badges (license, demo link) and an explicit DATA_AVAILABILITY.md to document the provenance and citation of the datasets used.

License

  • This repository is licensed under the Apache License 2.0. See LICENSE for details.

Contact & citation

About

SexEst is an open-source Streamlit web application for predicting biological sex from skeletal measurements using machine learning (XGBoost, LightGBM, Linear Discriminant Analysis). The best-performing models achieved cross-validated accuracies of ~80–90% on the Goldman (postcranial) and Howells (cranial) datasets.

Topics

Resources

Contributing

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages