Perla Doubinsky

Nicolas Audebert

Michel Crucianu
email: michel.crucianu@lecnam.net

Hervé Le Borgne
email: herve.le-borgne@cea.fr

Semantic Generative Augmentations for Few-Shot Counting

Figure 1. Diversified augmentation generation by joint conditioning with density map and semantically similar prompt.

Introduction

Counting objects is a task with applications in many domains e.g. manufacturing, medicine, monitoring, that involve different types of objects. While earlier works focused on learning specialized networks [2, 7, 14, 16], Few-Shot object Counting (FSC) [START_REF] Viresh Ranjan | Learning to count everything[END_REF] was recently introduced to train models that can count any object, including from categories outside the training data. Methods tackling FSC rely on exemplar objects annotated with bounding boxes (cf. Fig. 2), in an extract-then-match manner [START_REF] Lu | Class-agnostic counting[END_REF]. The features of the exemplars and query image are compared using e.g. correlation maps [START_REF] Viresh Ranjan | Learning to count everything[END_REF][START_REF] You | Few-shot object counting with similarity-aware feature enhancement[END_REF] or attention [6,[START_REF] Djukic | A low-shot object counting network with iterative prototype adaptation[END_REF]. Matched features are then transformed into a density map indicating at each location in the image the density of the objects of interest. The density map is then summed to obtain the predicted count.

The reference dataset for FSC, namely FSC147 [START_REF] Viresh Ranjan | Learning to count everything[END_REF], contains a limited amount of data (3659 train images) thus bounding the performances of counting networks [START_REF] Ranjan | Vicinal counting networks[END_REF]. Expanding such a dataset is costly as the annotation process requires pinpointing the center of each object present in a query image, with a potentially high number of occurrences. To overcome the small dataset size, Ranjan et al. [START_REF] Ranjan | Vicinal counting networks[END_REF] augment FSC147 using a GAN to diversify the image styles. Diffusion models have now surpassed GANs owing to their training stability and lower sensitivity to mode collapse. These models produce more effective and diverse augmentations [START_REF] He | Is synthetic data from generative models ready for image recognition[END_REF][START_REF] Shipard | Diversity is definitely needed: Improving model-agnostic zero-shot classification via stable diffusion[END_REF][START_REF] Trabucco | Effective data augmentation with diffusion models[END_REF]. Recent works mostly aim at augmenting classification datasets e.g. ImageNet [8], where augmentations are generated by prompting the models with the image labels. This fails to produce satisfying images for counting datasets as text-to-image models struggle to generate the correct number of objects [26]. Some works tackle improving compositionality in vision-language models [19,25,[START_REF] Phung | Grounded text-to-image synthesis with attention refocusing[END_REF] but are limited to small numbers of objects. Other works add more control to pre-trained text-to-image models [START_REF] Huang | Composer: Creative and controllable image synthesis with composable conditions[END_REF][START_REF] Mou | T2i-adapter: Learning adapters to dig out more controllable ability for text-to-image diffusion models[END_REF][START_REF] Zhang | Adding conditional control to text-to-image diffusion models[END_REF].

To tackle few-shot counting, we propose to synthesize unseen data with Stable Diffusion conditioned by both a textual prompt and a density map. We thus build an augmented FSC dataset that is used to train a deep counting network. The double conditioning, implemented with ControlNet [START_REF] Zhang | Adding conditional control to text-to-image diffusion models[END_REF], allows us to generate novel synthetic images with a precise control, preserving the ground truth for the counting task. It deals well with large numbers of objects, while current methods fail in such cases [19,[START_REF] Phung | Grounded text-to-image synthesis with attention refocusing[END_REF]. To increase the diversity of the augmented training set, we swap image descriptions between the n available training samples, leading to n(n-1) 2 novel couples, each being the source of several possible synthetic images. However, we show that some combinations do not make sense and lead to poor quality samples. Therefore, we only select plausible pairs, resulting in improved augmentation quality. We evaluate our approach on two class-agnostic counting networks, namely SAFECount [START_REF] You | Few-shot object counting with similarity-aware feature enhancement[END_REF] and CounTR [6]. We show that it significantly improves the performances on the benchmark dataset FSC147 [START_REF] Radford | Learning transferable visual models from natural language supervision[END_REF] and allow for a better generalization on the CARPK dataset [14].

Related work

Learning with Generated Data Improvements in image synthesis using generative models have sparked great interest in generating fake images to train deep neural networks. GANs were the first popular models to synthesize data for image classification [START_REF] Antoniou | Data augmentation generative adversarial networks[END_REF][START_REF] Besnier | This dataset does not exist: training models from generated images[END_REF][START_REF] Jahanian | Generative models as a data source for multiview representation[END_REF], crowd counting [START_REF] Wang | Learning from synthetic data for crowd counting in the wild[END_REF] and image segmentation [START_REF] Zhang | DatasetGAN: Efficient labeled data factory with minimal human effort[END_REF]. Nowadays, diffusion models such as DDPM [START_REF] Ho | Denoising diffusion probabilistic models[END_REF] or Latent Diffusion [START_REF] Rombach | High-resolution image synthesis with latent diffusion models[END_REF] seem to outperform GANs, demonstrating more stable training, better coverage of the training distribution and higher image quality. The availability of powerful text-conditioned diffusion models [START_REF] Bansal | Leaving reality to imagination: Robust classification via generated datasets[END_REF][START_REF] Ramesh | Hierarchical text-conditional image generation with CLIP latents[END_REF][START_REF] Rombach | High-resolution image synthesis with latent diffusion models[END_REF][START_REF] Saharia | Photorealistic text-to-image diffusion models with deep language understanding[END_REF] has led to many works exploring how to leverage synthetic data for computer vision, e.g. im-age classification in low-data regime [START_REF] He | Is synthetic data from generative models ready for image recognition[END_REF], zero/few-shot learning [START_REF] Shipard | Diversity is definitely needed: Improving model-agnostic zero-shot classification via stable diffusion[END_REF][START_REF] Trabucco | Effective data augmentation with diffusion models[END_REF], ImageNet classification [START_REF] Azizi | Synthetic data from diffusion models improves imagenet classification[END_REF]4,34] and self-supervised learning [START_REF] Tian | StableRep: Synthetic images from text-toimage models make strong visual representation learners[END_REF]. These works focus on how to reduce domain gap [START_REF] He | Is synthetic data from generative models ready for image recognition[END_REF], improve the prompts using e.g. text-to-sentence model [START_REF] He | Is synthetic data from generative models ready for image recognition[END_REF] or WordNet [34] and increase diversity by optimizing the guidance scale [START_REF] Azizi | Synthetic data from diffusion models improves imagenet classification[END_REF]34,[START_REF] Shipard | Diversity is definitely needed: Improving model-agnostic zero-shot classification via stable diffusion[END_REF]. This body of literature consistently demonstrates how generated data allow deep networks to learn more robust representations and improve generalization for image classification. We focus more specifically on few-shot class-agnostic object counting. Compared to image classification, this task involves small datasets and local spatial understanding, as objects can be small and follow complex layouts. The generated data needs a level of compositionality that current generative models, including diffusion models, struggle to achieve. To bring the power of synthetic data to counting, we propose to condition diffusion models not only on text prompts but also on counting density maps to generate images with the correct number of objects in the desired spatial configuration. We exploit this double control to generate diversified unseen data by prompting the model with novel combinations of the controls.

Few-shot Object Counting

The goal of few-shot classagnostic object counting is to count how many instances of objects of any arbitrary category there are in a given image, by leveraging only a few exemplars of the category of interest. This was initially formulated as matching exemplars and image patch features [START_REF] Lu | Class-agnostic counting[END_REF]. FSC147 [START_REF] Viresh Ranjan | Learning to count everything[END_REF] was later put forward as the main dataset for this task, with an open set train and test split to evaluate generalization to unseen object categories. Its authors introduced FamNet, a deep net trained to infer density maps from feature similarities. In the same lineage, BMNet [START_REF] Shi | Represent, compare, and learn: A similarity-aware framework for class-agnostic counting[END_REF] refines the similarity map by learning the similarity metric jointly with the counting network. In SAFECount [START_REF] You | Few-shot object counting with similarity-aware feature enhancement[END_REF], the similarities are used to fuse exemplars features into the query image features. The density map is then predicted from the enhanced features. Other works e.g. CounTR [6] and LOCA [START_REF] Djukic | A low-shot object counting network with iterative prototype adaptation[END_REF] focus on improving the feature representations using a Transformer backbone as the visual encoder and injecting information about the exemplars' shape in the network [START_REF] Djukic | A low-shot object counting network with iterative prototype adaptation[END_REF]. The closest comparison to our work is the Vicinal Couting Network from Rajan et al. [START_REF] Ranjan | Vicinal counting networks[END_REF]. It augments FSC147 with generated data by training a conditional GAN jointly with the counting network, producing augmentations that preserve the image content while modifying its visual appearance. While outperformed by later models, it introduced the idea that well-chosen augmentations can significantly boost counting accuracy. In this work, we leverage large pre-trained text-to-image diffusion models to produce diverse augmentations that not only alter the appearance, but are also able to change the content, to synthesize augmentations with a variety of object semantics.

Latent diffusion

Rombach et al. [START_REF] Rombach | High-resolution image synthesis with latent diffusion models[END_REF] introduced Latent Diffusion Models (LDMs) that are diffusion models applied in the latent space of generative models such as VQGAN [START_REF] Esser | Taming transformers for high-resolution image synthesis[END_REF]. These models operate in a compressed latent space thus reducing training and inference time. For more controlled generation, LDMs can be conditioned with e.g. text, images or semantic maps. Stable Diffusion is a popular open-source LDM, trained on the large-scale LAION-2B dataset [START_REF] Schuhmann | LAION-5B: An open large-scale dataset for training next generation image-text models[END_REF] and enabling high-quality text-to-image generation. Prompt-based control heavily relies on the capabilities of the underlying text encoder, typically CLIP [START_REF] Radford | Learning transferable visual models from natural language supervision[END_REF] that is known to poorly integrate compositional concepts such as counting [25]. ControlNet Recent works have added ancillary control signals to LDMs. Such a popular approach is Control-Net [START_REF] Zhang | Adding conditional control to text-to-image diffusion models[END_REF], which extends available pre-trained diffusion models by creating a trainable copy of the original network with an additional control input such as a semantic, edge or depth map. This trainable copy is linked to a locked copy to preserve the capacities of the original model. The training objective is an LDM objective similar to [START_REF] Rombach | High-resolution image synthesis with latent diffusion models[END_REF]:

L = || t -θ (z t , t, c t , c f )|| 2 (1)
where t ∼ N (0, 1), θ (, ) is a model of the diffusion noise, z t is the latent representation of x t , c t the text prompt and c f the task-specific control.

Semantic Generative Augmentations

Few-Shot Counting

The goal of few-shot class-agnostic counting is to learn to count objects regardless of their category. To achieve this, the query image x ∈ R H×W ×3 is annotated with n ∈ {0, 1, 2, 3...} exemplar boxes of coordinates b ∈ R 4 . The counting network takes as input both the query image and the set of n boxes. It predicts a density map d ∈ R H×W of same size as the image. As shown in Fig. 2, this ground-truth density map has zero values where there are no objects, and a Gaussian kernel of fixed variance at the center of every object. The final count is obtained by summing across all positions of the density map. The model is typically trained with an L 2 loss between the predicted and ground-truth densities. To evaluate class-agnostic models, object categories from the test set are disjoint from those in the validation and train sets. This open set evaluation allows us to measure the network's ability to count objects from unseen categories.

Text-and-Density Guided Augmentations

To synthesize new images that can effectively augment a few-shot counting dataset, we need to have control over the number of objects and how they are laid out. Indeed, we need to ensure that we know the density maps of the synthetic samples so that they can be used to train the model. In addition, being able to control object type and spatial configuration also constitutes a lever to diversify the dataset by generating new combinations of categories and densities. As few-shot counting datasets are generally limited in size, we take advantage of available pre-trained diffusion models to synthesize diversified augmentations of the training samples, reducing overfitting and improving generalization. However, large pre-trained generative models such as Stable Diffusion are usually conditioned through textual prompts.

To finetune these models, we first have to pair textual captions to the training images. We obtain diverse and descriptive captions using an off-the-shelf captioning model, e.g. BLIP2 [20]. This produces richer captions than plain object categories such as "a photo of {class}". However, two shortcomings remain. First, generated captions may not contain any information about the number or arrangement of the objects. Second, text-conditioned LDMs poorly respect prompts regarding compositional constraints. Even adding this information in the caption does not guarantee that generated images would follow them. This is especially problematic as the correctness of the layout is a prerequisite to generate images for which we know the ground-truth. Therefore, we further condition the generative model directly on the density maps as an additional input, using the Con-trolNet fine-tuning strategy. To summarize, our generative model is now conditioned on a text prompt, obtained by an automated captioning of the training image, and its ground truth density map to enforce the spatial layout of the objects. This allows us to synthesize new samples that augment the original image, while keeping the ground truth intact, making the augmentation amenable to supervised learning. i that share its caption and density map:

Diversity-Enhanced Augmentations

x(j) i = g(d i , c i ), j = 1, ..., M (2)
These augmentations preserve both the number and layout of objects -because of the density conditioning -and the semantics e.g. object category and type of background -because of the text prompt. This already augments the number of samples available for training.

Diverse We can however go further and diversify the augmentations by altering either the text description or the spatial organisation of the objects. To do so, we take advantage of dual conditioning on both densities and captions. We mix the two sets to create new combinations (density map, caption), producing augmentations that are semantically and geometrically more diverse than the original dataset. Yet, this mixing of the conditionings should be done carefully, to avoid low quality augmentations. Indeed, not all combinations make sense, e.g. "a herd of cows" and "a pearl necklace" exhibit very different spatial layouts. To prompt the generative model with realistic (density, text) pairs, we rely on caption similarity to find new associations between images that share some semantics, e.g. "cows" and "bisons".

We swap captions at random between pairs of compatible images. Two images are said to be compatible if their captions are more similar than some threshold t c , i.e.:

sim(c i , c k ) = Ψ(c i ) Ψ(c k ) ||Ψ(c i )|| 2 ||Ψ(c k )|| 2 > t c
where Ψ is a suitable text encoder. We then sample new images using the initial density map, but replacing the original caption with the caption c k ∈ C from a compatible training observation chosen at random:

x(j) i = g(d i , c k ), j = 1, ..., M (3)
This process results in more diverse augmentations compared to the baseline and alters more the images than traditional augmentations (color jitter, crops, etc.), as shown in Fig. 4. Synthetic and Diverse Balance We follow the training strategy from Trabucco et al. [START_REF] Trabucco | Effective data augmentation with diffusion models[END_REF], where the synthetic augmentations are used as a regular data augmentation with a probability p 0 when training the counting model. As a way to balance baseline and diversified augmentations, we set a probability p c that defines the fraction of the M augmentations that use a swapped caption instead of the original one. Typically, p c = 0.5 means that 50% of the generated augmentations employ the original (caption, density) pair and that the remaining 50% use new (caption, density) combinations. For each augmentation, we keep the density used to condition the image generation and the original exemplar boxes as ground truth to train the model. is 100 epochs longer to account for the higher number of training images. During training, we replace an image x i with one of its augmentations x(j) i with probability p 0 = 0.5. This balances the ratio of real vs. synthetic data in a single batch. We also employ traditional data augmentation strategies e.g. flips, color jitter, random cropping, that are applied to every image, both real and synthetic, as done in the original models. Both networks are trained and evaluated in the 3-shot setting. All results are averages over two runs.

Implementation details

Few-Shot Counting on FSC147

Comparison with Traditional Augmentation We report in Tab. 1 the improvement in counting accuracy on FSC417 with our augmentation strategies when training SAFECount and CounTR. Consistent with the literature on synthetic data augmentation, baseline augmentations improve the results for both networks: MAE decreases by respectively 5% and 10% for SAFECount and CounTR on the val set. Nonetheless, diversifying the augmentations allows us to reduce the MAE even further, by 10% and 11% on the same val set and by 7% (SAFECount) and 13% (CountTR) on the test set. We attribute this to ControlNet overfitting the training data due to the small dataset size. The low guidance employed to generate the images (2.0) aims at promoting diversity [34] but, as shown in Fig. 4 (Baseline Gen.), the generated images remain close to the original image in terms of visual appearance of the objects and background. However, ControlNet generalizes to different captions. In Fig. 4 (Diverse Gen.), we observe that swapping captions allows us to create more diverse data, altering the size and texture of objects and their background. Such features cannot be altered with traditional data augmentation.When mixing baseline and diverse augmentations, the performances for both networks improve significantly with respect to the model without synthetic augmentation, or with naive augmentations only. Comparison with Real Guidance We compare our approach with Real Guidance, an augmentation strategy for image classification by He et al. [START_REF] He | Is synthetic data from generative models ready for image recognition[END_REF]. Augmentations are generated by prompting a pre-trained text-to-image diffusion model with the image classes. To reduce the domain gap, the synthetic images are generated from the real images with added noise as proposed in SDEdit [22]. Tab. 1 shows that our augmentation strategy outperforms Real Guidance2 . Starting from the real image with added noise is generally insufficient to preserve the number of objects and their positions (Fig. 5, 2 nd col.). It shows that the density map conditioning ensures the preservation of object positions and number without requiring to start from the real image, which can limit the diversity of the generated images.

Ablation Study

We study here the influence of the hyperparameters of our approach: impact of the caption similarity threshold, t c , influence of introducing diversified augmentations by varying 6, associating a completely unrelated caption to a given density map results in generated images that do not correspond to the input density map or are of poor quality, as it is harder for the model to generalize. In Fig. 7a we evaluate different similarity thresholds to the naive approach where all captions can be swapped freely at random (t c = 0.0). The performances are improved compared to random swaps with all thresholds between 0.5 and 0.9. However, there is a quality-diversity tradeoff shown in Fig. 7b. Setting the threshold too high (t c = 0.8, 0.9) swap captions between images of objects belonging to the same category, thus limiting diversity. With a lower threshold, e.g. t c = 0.7, new captions can also belong to objects from different similar categories, e.g. swapping "bread rolls" and "macarons". Rate of Diverse Samples In Fig. 8, we vary the rate of diverse augmentations among M = 10 augmentations. We compare with SAFECount trained solely with baseline non-diverse augmentations. More diverse samples overall increase the counting accuracy. We further find that adding 70% of diverse samples gives better performances than 50%. This suggests that the diverse augmentations are more beneficial than the baseline ones. The augmentations using the original captions yet remain useful to the model as we observe a slight increase in MAE when more than 90% of the augmentations are obtained on new combinations. Number of Augmentations In Fig. 9, we vary the number of augmentations generated for each image. With a single augmentation, the performances already improve. For low values of M = 1, 3, 5, the performances are comparable, then a stronger increase is observed for M = 10. With twice as many augmentations (M = 20), performances degrade on the validation set. This might be due to an insufficient con- vergence, as the model is trained with many more different data points but for the same number of iterations. Rate of Synthetic Samples Fig. 10 shows the counting accuracy w.r.t. ratio p 0 of synthetic samples vs. real samples in a batch. We observe that equally balancing the synthetic and real data gives the best performances, which is consistent with what has been observed in previous works generating synthetic data for image classification [4, 12].

Generalization on CARPK

CARPK [14] was introduced to train networks that can count cars in aerial views of parking lots. It is also used to evaluate the ability of class-agnostic models to count in a class-specific setting. Given a model trained on FSC147 (without the examples of the "car" category), the model is first evaluated without any fine-tuning, then with fine-tuning on CARPK. We evaluate our model trained on FSC147 with diverse augmentations in the same setting. Tab. 2 reports improved counting performances in both the pre-trained and fine-tuned settings in comparison to the models trained without synthetic augmentations. In the fine-tuning setting, we reach state-of-the-art counting accuracy (4.87 MAE/6.17 RMSE) on CARPK amongst class-agnostic models.

Limitation

Our synthetic data needs a ground truth and exemplars to train the counting network. Conditioning on densities makes it possible to reuse both the original density and the exemplar bounding boxes. However, changing the caption can affect the object category, and in turn its shape. In some rare cases, exemplar boxes do not fit the generated objects anymore, as illustrated in Fig. 11. We explored to what extent refining these boxes could improve our model. We segmented objects using SAM in zero-shot [18] prompted with object centers. Preliminary results showed no improvement with box refinement, possibly due to inaccurate segmentation.

Conclusion

We show that synthetic data generated by diffusion models improve deep models for few-shot counting. We adapt a pretrained text-to-image model with a density map conditioning and we propose a diversification strategy that exploits caption similarities to generate unseen but plausible data that mixes the semantics and the geometry of different training images. We show that selecting compatible images improves synthetic image quality with beneficial effects on model performance. We demonstrate that learning with our diverse synthetic data leads to improved counting accuracy on FSC147 and state of the art generalization on CARPK. This strategy could be adapted to other tasks requiring finegrained compositionality, such as object detection and semantic segmentation. Our diversification scheme could be further extended by swapping both the captions and the density controls, by introducing a suitable similarity metric that operates on the density maps.

Figure 2 .

 2 Figure 2. Left: FSC147 image with BLIP2 caption (above) and exemplar boxes (in red). Right: Ground-truth density map.

Figure 3 .

 3 Figure 3. Overview of our approach. We condition a pre-trained diffusion model on both text prompts and density maps and perform swaps with similar captions. The density and original exemplars boxes are used as ground-truth for the generated augmentation.

Figure 4 .

 4 Figure 4. Qualitative results for the Baseline vs. Diverse augmentations. At the bottom of each diverse sample we show the caption used to generate the image. Our strategy allows to diversify the type of objects and/or the background.an image, b i the exemplar bounding boxes for each image, and d i its ground-truth density map. Let C = {c i } N i=1 be the set of corresponding captions. For each image x i , we aim at generating M augmentations using our text-density

Figure 5 .

 5 Figure 5. Qualitative comparison with Real Guidance [12]. Our augmentations preserve the layout while creating more diverse backgrounds. Ground-truth density maps overlap with the generated images (last 2 columns).

Figure 6 .

 6 Figure 6. Caption swap at random (top) vs. similarity-based swap (bottom, tc = 0.7). Random swapping results in a mismatch between the layout and the semantics.

  (a) Validation and test MAE on FSC147 w.r.t. tc (SAFECount). (b) Distribution of object categories in the set of captions to swap from w.r.t tc for a sample of category "bread rolls". Lower thresholds result in more diverse augmentations, while objects still belong to similar classes.

Figure 7 .

 7 Figure 7. Impact of caption similarity threshold tc on SAFECount.

Figure 8 .

 8 Figure 8. Impact of the percentage of diverse augmentations pc on SAFECount. MAE is reported for the val and test sets of FSC147.

Figure 9 .

 9 Figure 9. Impact of the number of augmentations M on SAFE-Count (val. and test MAE on FSC147).

Figure 10 .

 10 Figure 10. Impact of the synthetic data ratio p0 on SAFECount (val. and test MAE on FSC147).

Figure 11 .

 11 Figure 11. Limitation: our diverse generation strategy can change the size and shape of generated objects, leading to exemplar boxes (in red) that do not fit perfectly.

  1

	5. Experiments
	5.1. Datasets and metrics
	FSC147 FSC147 [31] is a 3-shot counting dataset with
	147 object categories. It is the de facto standard of class-
	agnostic counting benchmarking. 89 categories are used
	for the training set, 29 are included in the validation set the
	remaining 29 constitute the test set. Note that the categories
	from the three sets are completely disjoint. In total, the
	dataset contains 6135 images, from which 3659 are used for
	training. The number of objects in the images varies from
	7 to 3731 with an average of 56. Every image is annotated
	with 3 exemplar bounding boxes and an object density map.
	CARPK CARPK [14] is a class-specific dataset for count-
	ing cars in parking lots based on overhead imagery. The
	dataset contains 1448 images from a UAV in 4 parking lots:
	3 for training and the last one for testing. There are 5 ex-
	emplar objects in total that are randomly extracted from the
	training set and employed during both training and testing.
	Following [6, 41], we evaluate on CARPK the generalization
	ability of our class-agnostic models on a new dataset.

1

Note that if the caption changes the object category, bounding boxes Metrics We follow the standard evaluation of the counting accuracy through the Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE).

Table 1 .

 1 Quantitative results on FSC147. (*) Traditional augmentations include color jitter, random cropping. ( †) [41] and [6] are reproduced, details are provided in the supplementary material.

	Augmentation We train ControlNet on the training im-
	ages and density maps from FSC147. Text prompts are
	obtained by captioning the images with BLIP2 [20]. The
	underlying pre-trained diffusion model is Stable Diffusion
	v1.5 trained on LAION 2B. We use the default settings and
	train for 350 epochs. After training, we employ a guidance
	scale of 2.0 and 20 denoising steps to generate an image. For
	each augmentation strategy, we generate M = 10 augmen-
	tations per training sample unless specified otherwise. We
	swap the original caption with another one with a probability
	p c = 0.5. Compatible captions to swap with are obtained by
	extracting caption features with the BLIP2 text encoder and
	filtering the captions with a similarity higher than t c = 0.7.
	Counting networks We demonstrate the effectiveness of
	our augmentation strategies on two state-of-the-art counting
	networks: SAFECount [41] and CounTR [6]. SAFECount
	is a CNN while CounTR is Transformer-based. In CounTR,
	training is done in two phases. First, the network is pre-
	trained using a self-supervised masked auto-encoder [11],
	then it is fine-tuned in a supervised fashion with the usual
	L 2 loss on the densities. For CounTR, we employ the pre-
	trained model released by the authors and only retrain the
	fine-tuning phase. We use the hyperparameters reported in
	the original papers to train both networks, except training

for the exemplars might not be accurate anymore (e.g. "pens" are narrow and elongated, while "erasers" are closer to squares, see Sec. 6.

Table 2 .

 2 Counting performance on CARPK with SAFECount.

		Aug. MAE RMSE
	Pre-trained on FSC147	Trad. 17.65 23.83 Div. 16.49 19.05
	Fine-tuned on CARPK	Trad. 5.44 Div. 4.87	6.94 6.17
	SAFECount [41] (WACV'23) Trad. 5.33	7.04
	CounTR [6] (BMVC'22)	Trad. 5.75	7.45
	BMNet+ [36] (CVPR'22)	Trad. 5.76	7.83

Except on test RSME with SAFECount, where Real Guidance performs better, due to two outlier test images with more than 2500 objects that dominate the average error (see supplementary material).

Acknowledgments. This research was performed under a grant from the AHEAD ANR program (ANR-20-THIA-0002) and supported by the European Commission under European Horizon 2020 Programme, grant number 951911 -AI4Media. This publication was made possible by the use of the FactoryIA supercomputer, financially supported by the Ile-De-France Regional Council. Special thanks to Nicu Sebe and Elia Peruzzo for their advice.


domain: sde sdv

text:
Kevin Cianfaglione
email: kevin.cianfaglione@univ-catholille.fr

P 105

Gianmaria Bonari

Ilona Knollová

Pavla Vlčková

Fotios Xystrakis

Süleyman Çoban

Coşkun Sağlam

Yakiv P Didukh

Stephan M Hennekens

Alicia T R Acosta

Claudia Angiolini

Erwin Bergmeier

Andrea Bertacchi

José C Costa

Emanuele Fanfarillo

Daniela Gigante

Riccardo Guarino

Marco Landi

Carlos S Neto

Simone Pesaresi

Pine reforestation in Mediterranean mountains. An ecological problem or an opportunity?

Conifer reforestation plantations in central Italy were massively made since the end of 1800 until the end of 1900, mainly with Pinus nigra and Pinus halepensis. They were made for forest restoration purpose, to foster the secondary succession, to stabilize slopes and for hydrogeological balance.

If these reforestations have been well carried out and well managed (i.e. they have not undergone cuts, cleanings, fires, etc.), they are working well in the Apennines; for this reason, we must not promote campaigns for their eradication. We need to wait for these formations to slowly turn towards more natural stages. Thinning cuts are not necessary, given that these trees are easily knocked to the ground by natural events. These areas could be destined for ex-situ protection of threatened species, and the reforestation by native conifers could be considered as compensation for the destruction or the reduction of the original populations of those species.

They now consist of semi natural, historical and cultural formations of ecological, naturalistic, landscape and hydrogeological balance interest. Despite this, they are considered to be eliminated because of forest fire risks and for their artificial origin.

As with the secondary formations, these conifers too can enter that circuit of areas to contribute to an eco-systemic and the landscape discontinuity, contributing to the aesthetic of the landscape and enhancing its ecological value. It is true that these formations are very subject to fires, but this does not mean that they should be mistreated and destroyed, given that other formations such as the Mediterranean macchia, garriga, oak woods, crops and secondary successions shrublands are equally subject to this risk induced by man.

Among the most important characteristics of those formations are the presence of dead wood, and of a favorable environment for micro-mammals and mushrooms, which has a cascade interest for all the food chain, for biodiversity and for the landscape mosaic. Some researches are carried out to study those formations, that are quickly disappearing due to hervesting and wildfires. This is happening also for the most natural pine forests, even in core areas of protected areas.

For those reasons, we should follow a more precaution principle, in a more objective and science-based way, with more sustainable actions.

Les pinédes à