Guides
GDPR-compliant deep learning: training neural networks with data in Europe
The GDPR does not forbid training neural networks. It asks what the data is, where it goes and who processes it. This guide answers these questions for Brick DNN: which data needs care, where brickdnn.com stores data and trains in Switzerland, and how to work with data that must not leave your institution.
The first question: is it personal data?
The GDPR applies to personal data: information about a person who is identified or can be identified, directly or by combining it with other information. Much of deep learning involves none. Measurements from machines and sensors, images of materials, plants or products, simulation results, field trials and public benchmarks such as MNIST or CIFAR-10 say nothing about anyone. For such data the GDPR sets no rules on training; what remains is the question which provider you trust with it.
It is personal data as soon as rows or images can be linked to people: patient records, survey answers with a birth date and a postcode, photos with faces, texts with names, voice recordings, log files with user IDs. Then you need a legal basis and a defined purpose (Art. 5 and 6 GDPR), you keep to what that purpose needs, and every provider that processes the data on your behalf needs a contract under Art. 28. Health, genetic and biometric data are special categories with stricter rules (Art. 9).
Anonymised, pseudonymised or personal
| State | What it means | GDPR |
|---|---|---|
| Personal | Names, e-mail addresses, IDs, or details that point to a person | Applies in full |
| Pseudonymised | Identifiers replaced by codes; the key still exists, possibly somewhere else | Still personal data, applies in full (Recital 26) |
| Anonymised | Nobody, you included, can link a row to a person with reasonable means | Does not apply (Recital 26) |
Anonymising a table takes more than deleting the name column:
- Remove direct identifiers: names, addresses, e-mail addresses, phone numbers, ID and record numbers.
- Coarsen what identifies people in combination: the year instead of the birth date, the region instead of the postcode, age groups instead of exact ages.
- Drop free-text columns; they often contain names.
- Look for rare combinations: one row with an unusual value can be enough to recognise someone.
- In images, look for faces, name tags, text burned into the image and metadata such as GPS positions in the EXIF data.
Do this on your own computer before you upload anything. If you are not sure the result is anonymous, treat it as personal data and ask your data protection officer.
Where brickdnn.com keeps what
When you train on brickdnn.com, your data is stored and processed here. The privacy policy has the full list with purposes and retention periods.
| Data | Where | Provider |
|---|---|---|
| Uploaded files, prepared datasets, trained weights, training results | Server in Geneva, Switzerland; the trainings run there too | Infomaniak |
| Accounts, networks, comments, the details of data and trainings (not the files) | Database on the same server in Geneva, Switzerland | Infomaniak |
| Technical error reports, without user name, e-mail address, account ID or uploaded files | EU region in Frankfurt, Germany | Sentry |
| E-mails about your account | EU | Brevo |
| Payment, only if you buy a plan | United Kingdom | Paddle |
The EU Commission recognises the data protection of Switzerland and of the United Kingdom as adequate (Art. 45 GDPR), so data may go there without further safeguards. Hosting, database, e-mail and error reports run under data processing agreements. The app sets no cookies and has no analytics or tracking, and your data is not sold.
One limit matters for this guide: the terms of use ask you not to upload personal data of third parties or confidential data to brickdnn.com, and the app reminds you when you upload. The hosted service is meant for non-personal and anonymised data. For everything else, read on.
When the data has to stay personal
Brick DNN is still useful when the data itself must not leave your institution. Three ways, from the least effort to the most:
- Design here, train at home. Build and check the network on brickdnn.com without uploading anything; that needs no account. Export the PyTorch script and train it on your institution’s computers with your own data loader; the script imports nothing from Brick DNN. For a network with one flat input and one flat output it already contains a training loop for CSV files (
python model.py --csv data.csv). - Work on a stand-in. Upload an anonymised extract or synthetic data with the same columns, prepare it in the Data tab and train on the server until model and settings are right. The preparation exports as a pandas script, which you then run on the real data where it is.
- Run your own Brick DNN. Brick DNN is open source under the Apache 2.0 licence.
docker compose up -dstarts it on a server of your institution, with a local SQLite database unless you configure another one, and error reports are off unless you set them up; for neural networks, build the image with PyTorch (BRICKDNN_INSTALL_TORCH=true). Data, trainings and accounts then stay wherever that server is. The quick start describes the setup.
Export and delete
Whatever you upload, you can take back out and remove yourself:
- Download my data under Account gives a ZIP file with your networks and their history, data sources and preparations, datasets, training runs with their settings and metrics, and the uploaded files themselves (up to 200 MB in total; larger ones are listed). Trained weights download from each finished run, with the matching script.
- Uploads, datasets and training runs can be deleted one by one at any time. Deleting the account removes everything it owns, files included.
- Uploads, datasets and finished trainings nobody has used for 180 days are deleted automatically, and accounts after two years without use, with e-mail reminders beforehand.
- Deleted data can remain in backups for a while, at most 5 weeks, until they are rotated out.
A checklist
- Decide whether the data is personal. If it is not, train on brickdnn.com; the files stay on the server in Switzerland.
- If it is, try to anonymise it on your own computer before uploading, and check rare combinations and image metadata.
- If it has to stay personal, design the model here and train the exported code, or your own Brick DNN instance, where the data is.
- Record purpose and legal basis in your institution’s record of processing activities, and involve the data protection officer early.
- Download what you want to keep, and delete datasets and runs you no longer need.
This guide describes how Brick DNN works and what the GDPR asks in general. It is not legal advice for your project.
Examples to start from
Tabular regression
Predicts one number from 8 numeric features; the script trains on a CSV file.
Small CNN for MNIST
Two convolution blocks and a classifier head: about 99 % test accuracy on MNIST.
Gradient boosting classifier
Gradient-boosted trees classify rows of 30 features; balanced class weights for rare classes.
More guides
Build a neural network without code and export it to PyTorch
Connect layers on a canvas, let Brick DNN check every shape, and download a PyTorch script that runs on its own.
Tabular data: gradient boosting vs. MLP, and when to use which
How trees and neural networks see a table, what each needs, and how to compare them fairly on the same split.
Image segmentation with a U-Net: from masks to a trained model
From a ZIP file of images and masks to a trained U-Net, with mean IoU, Dice and the predicted masks.
Imbalanced classes: class weights, focal loss, oversampling and the decision threshold
Why accuracy misleads when one class is rare, and the four levers against it: weights, focal loss, oversampling and the threshold.
Common PyTorch shape errors and how to fix them
The exact messages of the most common PyTorch shape errors, what causes each one and how to fix it.