> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atomscale.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# XPS

> Elemental composition analysis from X-ray photoelectron spectroscopy survey spectra

XPS (X-ray Photoelectron Spectroscopy) analysis uses a machine learning model to estimate elemental composition from survey spectra produced by an Al K-alpha source. No peak fitting or area calculations are required. The entire spectrum signature is extracted to generate a composition inference.

## Overview

The XPS pipeline processes data in three stages:

1. **Data ingestion**: parses uploaded spectrum files, detects energy type (kinetic vs. binding), and applies transmission correction for VAMAS files
2. **Composition inference**: an ML model predicts elemental composition and uncertainty from the full spectrum signature, without peak fitting
3. **Peak matching**: detected spectral peaks are matched to known experimental binding energies and assigned element and orbital labels

### Key Metrics

| Metric                | What It Tells You                                                                                   |
| --------------------- | --------------------------------------------------------------------------------------------------- |
| Predicted composition | Elemental atomic percentages estimated by the ML model, with uncertainty from Monte Carlo dropout.  |
| Detected peaks        | Binding energy positions of identified peaks, each labeled with element and orbital (e.g., "O 1s"). |
| Predicted formula     | Stoichiometric formula derived from the predicted composition (e.g., "Al2O3").                      |

<Tabs>
  <Tab title="Guide">
    ### Adding XPS Data

    Upload XPS survey spectrum files through the data management page. Supported formats: VAMAS (.vms), PHI SPE (.spe), and text (.txt, .dat). Analysis begins automatically once the upload completes, and results are typically ready within 10-30 seconds.

    ### Viewing Results

    Once processing completes, the XPS workspace shows two main sections:

    **XPS spectrum chart**: Plots intensity versus binding energy. Detected peaks appear as highlighted regions labeled with element and orbital assignments (e.g., "C 1s", "O 1s"). You can toggle the visibility of the intensity series, peak highlight regions, and identification labels. Zoom on the binding energy axis to inspect specific regions.

    **Element composition chart**: Bar chart showing predicted atomic percentage for each element, with error bars representing the model's uncertainty. Toggle the presence and uncertainty series independently.

    ### Configuring Element Constraints

    By default, the pipeline runs in unconstrained mode, predicting which elements are present and their concentrations. You can constrain the analysis to a specific set of elements for improved accuracy.

    <Steps>
      <Step title="Open the configuration drawer">
        Click the configuration icon next to the workflow status indicator.
      </Step>

      <Step title="Select elements">
        Click cells in the interactive periodic table to select or deselect elements. You can also load a previously saved configuration from the dropdown.
      </Step>

      <Step title="Re-analyze">
        Click **Re-analyze with Configuration** to run the pipeline with your selected elements. Results update in about 10 seconds.
      </Step>
    </Steps>

    <Tip>
      When the initial composition is predicted (unconstrained), constraining to known elements typically improves accuracy. The configuration drawer indicates when the current composition is predicted rather than confirmed.
    </Tip>

    ### Reanalysis

    If you need to adjust element selections, open the configuration drawer, update your choices, and click re-analyze. Each re-analysis replaces the previous results.
  </Tab>

  <Tab title="Technical Details">
    ### Analysis Pipeline

    The XPS pipeline processes data through four stages.

    #### Stage 1: Data Ingestion

    Raw spectrum files are parsed into energy and intensity arrays. Supported formats are VAMAS (.vms), PHI SPE (.spe), and plain text (.txt, .dat). The parser auto-detects whether data is in kinetic or binding energy and converts as needed, assuming an Al K-alpha source (1486.7 eV) by default.

    #### Stage 2: Pre-processing

    The spectrum is normalized, resampled to a standard grid, and optionally filtered to reduce noise and remove inelastic background signal. This standardizes inputs across different instruments and acquisition settings.

    #### Stage 3: Composition Inference

    An ML model estimates elemental composition from the pre-processed spectrum. The model uses the full spectrum signature rather than fitting individual peaks, which makes it robust to overlapping peaks and noisy data.

    **Two modes of operation**:

    * **Unconstrained**: the model predicts which elements are present and their concentrations. Elements with concentrations below a threshold are excluded.
    * **Constrained**: the user provides a list of elements, and the model predicts concentrations only for those elements.

    The model provides uncertainty estimates (mean and standard deviation) for each element's predicted concentration.

    **Training data**: the model is trained on a large corpus of labeled spectra combining expert-labeled experimental references and physically simulated spectra that account for background interactions, noise, and peak broadening.

    **Supported elements**: periods 1-6, excluding H, He, noble gases (Ne, Ar, Kr, Xe), Pm, and all period 7+ elements.

    #### Stage 4: Peak Matching

    Spectral peaks are detected and matched to known experimental binding energies, then labeled with element symbol and orbital type (e.g., "Al 2p", "O 1s"). A stoichiometric formula is generated from the predicted composition.
  </Tab>
</Tabs>

## Related Documentation

<CardGroup cols={2}>
  <Card title="Detect Anomalies During a Run" icon="bell" href="/platform/guides/detect-anomalies">
    Use XPS composition data as part of quality control.
  </Card>

  <Card title="Ellipsometry Analysis" icon="sun" href="/platform/characterization/ellipsometry">
    Optical characterization to complement XPS surface analysis.
  </Card>
</CardGroup>
