> For the complete documentation index, see [llms.txt](https://yall.yassrobotics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yall.yassrobotics.com/documentation/tuning/neural-network-pipeline-tuning.md).

# Tuning a Neural Network Pipeline

Neural classifier and detector pipelines expose far fewer tuning knobs than retroreflective or AprilTag pipelines. Most of the "tuning" work is in the model itself (see Limelight's training documentation for classifiers/detectors), not the pipeline settings. In the web UI, there are two levers worth adjusting:

## Confidence threshold

Both pipeline types expose a **confidence threshold** slider. Raising it rejects lower-confidence detections/classifications outright, giving fewer false positives, but you'll also start missing genuine borderline detections. There's no universal value; raise it until false positives on your specific game pieces/field elements stop, then back off slightly to keep recall reasonable.

`NeuralDetector.confidence` / `NeuralClassifier.confidence` (read via `LimelightResults.targets_Detector` / `targets_Classifier`) reflect whatever passed this threshold. You can still apply an additional, stricter threshold in robot code if you want different behavior per-mode (e.g. stricter during autonomous) without touching the pipeline itself.

## Crop window

Both pipeline types support a **crop window**, restricting inference to a sub-region of the frame:

* For a **detector**, this lets you ignore objects outside a zone you care about (e.g. only the field in front of an intake).
* For a **classifier**, this reduces how much irrelevant background the model has to reason about, which usually improves classification accuracy directly.

`LimelightSettings.withCropWindow(minX, maxX, minY, maxY)` sets the same crop from robot code if you need it to change dynamically (e.g. widening the zone once a game piece is expected to be closer) rather than fixed per-pipeline in the web UI.

## Hardware prerequisite

Neural pipelines require a coprocessor (e.g. Google Coral) connected via the Limelight's USB-A port. If detections/classifications never populate `LimelightResults` regardless of threshold, confirm the accelerator is connected before assuming it's a tuning problem.

## See Also

* [Tuning Workflow Overview](/documentation/tuning/tuning-workflow-overview.md)
* [Target & Pipeline Types](/documentation/understanding/target-and-pipeline-types.md): the `NeuralClassifier` vs. `NeuralDetector` distinction.
* [Object Detection tutorial](/documentation/tutorials/object-detection.md)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://yall.yassrobotics.com/documentation/tuning/neural-network-pipeline-tuning.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
