> For the complete documentation index, see [llms.txt](https://pace-tl.gitbook.io/ches-challenge-2025/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pace-tl.gitbook.io/ches-challenge-2025/quickstart.md).

# Getting Started

The code has been developed for this challenge and is available on Github in two version: [Pytorch repo](https://github.com/pace-tl-ntu/ches2025_pytorch) and [Tensorflow repo](https://github.com/pace-tl-ntu/ches2025_tf).

Although, the repositories are using neural network, there are restriction in the use of template attack or stochastic attack.&#x20;

## Installing dependencies:

The framework runs with `python >= 3.8`  and `python <= 3.11`. Futhermore, it requires the following dependencies:&#x20;

* `venv` , part of python's standard library, but not included in some python installations&#x20;

(e.g., run `apt install python3-venv` to obtain it)

* `pip` for most of the python installations (on Ubuntu, `apt install python3-pip`)

We highly **recommend** using a UNIX environment (on Windows, use WSL)

## Cloning repo

First, one can clone the challenge repository.&#x20;

For Pytorch:&#x20;

```
git clone https://github.com/pace-tl-ntu/ches2025_pytorch
```

For Tensorflow:

```
git clone https://github.com/pace-tl-ntu/ches2025_tf.git
```

## Downloading the datasets

See [Datasets ](/ches-challenge-2025/quickstart-2.md)page for downloading the datasets.&#x20;

## Train models during the profiling phase

In the following, we use `./../Datasets` as the path to where the dataset is stored, and `ches_2025` as the directory of the repository.&#x20;

For PyTorch, one should go <https://pytorch.org/> to install the pytorch version:  `2.7.0`&#x20;

For TensorFlow,  make sure that the tensorflow version: `2.19.0`&#x20;

```markup
cd ches_2025
python3 -m venv ches_env
source ches_env/bin/activate
pip install pip --upgrade 
pip install -r requirements.txt

#For Pytorch library, go to https://pytorch.org/
#and install pytorch before running the following command line. 

python3 main_{tf/pytorch}.py #Train Neural Network
deactivate
```

*\*For MacOS, please use Pytorch instead of Tensorflow.*

## Analyze the trained model during the  attack phase

For submission, one should edit the code `analyze_{tf/pytorch}.py`, where they have to load their model to run the function `evaluate()` to compute the guessing entropy. There are some code there&#x20;

```
python3 analyze_{tf/pytorch}.py
```

The function `evaluate()` will output something like:

```
GE [118. 132.99 133.72 137.16 130.53 127. 132.64 131.46 130.2 131.53
135.33 135.04 137.32 138.76 133.96 134.03 135.71 134.04 134.74 137.19
138.68 136.61 136.55 134.75 136.74 137.48 134.59 131.45 132.92 134.83
135.36 134.8 134.29 132.21 132.17 132.22 132.37 131.61 131.63 131.09
131.65 132.17 132.68 132.13 131.18 130.95 130.26 129.85 132.93 133.7
136.28 136.87 138. 137.15 136.42 134.62 135.46 134.45 134.58 134.5
135.64 135.27 134.65 135.73 134.99 135.77 136.71 136.5 136.07 135.33
135.38 136.12 135.65 135.43 133.96 133.75 136.19 138.79 137.45 136.79
137.65 136.69 138.11 138.98 138.11 138.13 137.8 138.46 138.3 137.25
136.35 137.59 137.04 136.75 137.76 138.82 139.51 140.16 139.02 139.83]
NTGE inf
```

If there are any issues, please reach out to the [organizer](mailto:pace.tl.ntu@gmail.com).&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pace-tl.gitbook.io/ches-challenge-2025/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
