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

Three states of a dataset under the GDPR
StateWhat it meansGDPR
PersonalNames, e-mail addresses, IDs, or details that point to a personApplies in full
PseudonymisedIdentifiers replaced by codes; the key still exists, possibly somewhere elseStill personal data, applies in full (Recital 26)
AnonymisedNobody, you included, can link a row to a person with reasonable meansDoes 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.

Where brickdnn.com stores and processes data
DataWhereProvider
Uploaded files, prepared datasets, trained weights, training resultsServer in Geneva, Switzerland; the trainings run there tooInfomaniak
Accounts, networks, comments, the details of data and trainings (not the files)Database on the same server in Geneva, SwitzerlandInfomaniak
Technical error reports, without user name, e-mail address, account ID or uploaded filesEU region in Frankfurt, GermanySentry
E-mails about your accountEUBrevo
Payment, only if you buy a planUnited KingdomPaddle

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:

  1. 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).
  2. 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.
  3. Run your own Brick DNN. Brick DNN is open source under the Apache 2.0 licence. docker compose up -d starts 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

  1. Decide whether the data is personal. If it is not, train on brickdnn.com; the files stay on the server in Switzerland.
  2. If it is, try to anonymise it on your own computer before uploading, and check rare combinations and image metadata.
  3. 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.
  4. Record purpose and legal basis in your institution’s record of processing activities, and involve the data protection officer early.
  5. 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.

    PyTorch · 2,817 parameters

  • Small CNN for MNIST

    Two convolution blocks and a classifier head: about 99 % test accuracy on MNIST.

    PyTorch · 421,642 parameters

  • Gradient boosting classifier

    Gradient-boosted trees classify rows of 30 features; balanced class weights for rare classes.

    scikit-learn · HistGradientBoostingClassifier

More guides

Open the editor