TrainImageContentDetector
✖
TrainImageContentDetector
trains a ContentDetectorFunction[…] based on the examples given.
Details and Options

- TrainImageContentDetector attempts to train an object detector using the provided training data.
- Object detection is a computer vision technique used for recognizing subimages in an image.
- TrainImageContentDetector returns a ContentDetectorFunction[…] that can then be applied to new input data.
- The bounding boxes bboxi should be given as Rectangle objects.
- The classes classi can be arbitrary expressions.
- TrainImageContentDetector[…][image] can be used to detect objects in image and returns the result as a list of associations of the form <"Image"img,"Class"class >.
- TrainImageContentDetector supports the following options:
-
PerformanceGoal Automatic favor settings with specific advantages ProgressReporting Automatic how to report progress during training RandomSeeding 1234 how to seed pseudorandom generators internally TargetDevice "CPU" the target device on which to perform training TimeGoal Automatic number of seconds to train for ValidationSet None the set of data on which to evaluate the model during training

Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Train a basic object detector:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-s45l78

Apply the detector on a new image:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-5hl8zj

Highlight the detection on the input image:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-z7vn28

Options (5)Common values & functionality for each option
PerformanceGoal (1)
Use PerformanceGoal"Quality" to emphasize the quality of the result:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-j1mlnu
![]() |
Use PerformanceGoal"Speed" to emphasize the speed of computation:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-36wjtx
![]() |
ProgressReporting (1)
By default, progress is reported in a dynamic panel:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-rrd43o

https://wolfram.com/xid/0bmt8og9plzr1046qxo-tmpaf0
![]() |
![]() |
Use ProgressReportingFalse to avoid displaying the progress panel:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-u95rjy
TargetDevice (1)
TimeGoal (1)
The training time can be influenced by several factors, such as the number of examples and classes:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-2gkvvx

https://wolfram.com/xid/0bmt8og9plzr1046qxo-hdnhi8
![]() |
Use TimeGoal to specify a target time for the training:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-qqme28
![]() |
ValidationSet (1)
By default, only cross-validation is performed on the detector:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-ljgjr9

https://wolfram.com/xid/0bmt8og9plzr1046qxo-1wpn2m

Use ValidationSet to provide separate validation examples:

https://wolfram.com/xid/0bmt8og9plzr1046qxo-0oqk58

https://wolfram.com/xid/0bmt8og9plzr1046qxo-eyo3oh

Wolfram Research (2021), TrainImageContentDetector, Wolfram Language function, https://reference.wolfram.com/language/ref/TrainImageContentDetector.html.
Text
Wolfram Research (2021), TrainImageContentDetector, Wolfram Language function, https://reference.wolfram.com/language/ref/TrainImageContentDetector.html.
Wolfram Research (2021), TrainImageContentDetector, Wolfram Language function, https://reference.wolfram.com/language/ref/TrainImageContentDetector.html.
CMS
Wolfram Language. 2021. "TrainImageContentDetector." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TrainImageContentDetector.html.
Wolfram Language. 2021. "TrainImageContentDetector." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TrainImageContentDetector.html.
APA
Wolfram Language. (2021). TrainImageContentDetector. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TrainImageContentDetector.html
Wolfram Language. (2021). TrainImageContentDetector. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TrainImageContentDetector.html
BibTeX
@misc{reference.wolfram_2025_trainimagecontentdetector, author="Wolfram Research", title="{TrainImageContentDetector}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/TrainImageContentDetector.html}", note=[Accessed: 27-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_trainimagecontentdetector, organization={Wolfram Research}, title={TrainImageContentDetector}, year={2021}, url={https://reference.wolfram.com/language/ref/TrainImageContentDetector.html}, note=[Accessed: 27-March-2025
]}