Tutorial: Automatic White Balance with Neural Networks
This tutorial describes how to activate neural network-based AWB (AWB-NN).
This is a relatively new feature provided by the Raspberry Pi team which is currently only documented in the Forum article AWB with Neural Networks.
AWB-NN can currently only be activated through a modification of the tuning file for the camera.
If activated, it overrules AWB settings in the Camera Controls.
Precondition
AWB-NN is only available in Trixie with libcamera version 0.7.0+rpt20260205 or later.
To check, open the Info / System dialog and check
- Hardware and OS / Debial Version
- Software Stack / libcamera
Procedure
- Open the Config / Tuning dialog
The dialog will show the tuning file for the active camera located in the standard folder/usr/share/libcamera/ipa/rpi/pisp. - Push button Custom Folder
which will create a custom folder for tuning files if it does not yet exist (/home/<user>/prg/raspi-cam-srv/raspiCamSrv/static/tuning) and copy the tuning file to this folder:
The reason for this is that standard tuning files in the standard folders must not be edited. - Push button Download Tuning File
This will download the tuning file to your Downloads folder - It is recommended to rename the tuning file to indicate that it is used for AWB-NN:

- Open the tuning file in your preferred text editor
- Search for node
rpi.awband change the element"enabled"tofalse:
- Now, search for node
rpi.nn.awband change the element"enabled"totrue:
- Save the file
- In dialog Tuning, press button Select Tuning File for Upload,
navigate to your Downloads folder and select the modified tuning file.
The button will now show the name of the selected tuning file (if just one file has been selected). - Now, push button Upload selected File
This will upload the file to the custom folder for tuning files - Change the seleted tuning file to the modified file. Make sure that it is the file for the active camera:

- Check Load Tuning File and push button Submit and Apply

Result
If the modified tuning file is selected, Picamera2 will load this file when the camera is started.
Cited from AWB with Neural Networks:
"The AWB NN algorithm definitely produces different results to the default Bayesian algorithm, the nature of which depends on the training data.
Generally, we find it produces significantly better results, though your mileage may vary. Obviously this is quite early days still,
so we're interested in people's experiences."
Deactivate AWB-NN
To return to the standard AWB, deactivate Load Tuning File and push button Submit and Apply
