  The study of jet-inflated X-ray cavities provides a powerful insight into the
energetics of hot galactic atmospheres and radio-mechanical AGN feedback. By
estimating the volumes of X-ray cavities, the total energy and thus also the
corresponding mechanical jet power required for their inflation can be derived.
Properly estimating their total extent is, however, non-trivial, prone to
biases, nearly impossible for poor-quality data, and so far has been done
manually by scientists. We present a novel and automated machine-learning
pipeline called Cavity Detection Tool (CADET), developed to detect and estimate
the sizes of X-ray cavities from raw Chandra images. The pipeline consists of a
convolutional neural network trained for producing pixel-wise cavity
predictions and a DBSCAN clustering algorithm, which decomposes the predictions
into individual cavities. The convolutional network was trained using mock
observations of early-type galaxies simulated to resemble real noisy
Chandra-like images. The network's performance has been tested on simulated
data obtaining an average cavity volume error of 14 % at an 89 % true-positive
rate. For simulated images without any X-ray cavities inserted, we obtain a 5 %
false-positive rate. When applied to real Chandra images, the pipeline
recovered 91 out of 100 previously known X-ray cavities in nearby early-type
galaxies and all 14 cavities in chosen galaxy clusters. Besides that, the CADET
pipeline discovered 8 new cavity pairs in atmospheres of early-type galaxies
and galaxy clusters (IC4765, NGC533, NGC2300, NGC3091, NGC4073, NGC4125,
NGC4472, NGC5129) and a number of potential cavity candidates.
