I created a neural network for character detection on a large sheet of paper, but the characters are not very easy to recognize. However, the neural network was performing well, except for two characters: “S” and “2”, which become identical when mirrored. Therefore, to train the network, I would like to disable data augmentation, specifically the “mirror” and “flip” transformations.
Hello Barthos_Menbosa,
Thanks for reaching out with your question. To disable specific data augmentations like horizontal (fliplr
) and vertical (flipud
) flips during training, you can set their corresponding probabilities to 0.0
.
Here’s how you can do it in Python:
from ultralytics import YOLO11
# Load a model
model = YOLO11('yolov11n.pt') # Load a pretrained model or your custom model
# Train the model with specific augmentations disabled
results = model.train(data='your_dataset.yaml', epochs=100, imgsz=640, fliplr=0.0, flipud=0.0)
By setting fliplr=0.0
and flipud=0.0
, you prevent the model from applying these transformations during the training process.
You can find more details about all available augmentation settings and their default values in the Model Training documentation and the Configuration guide.
Let us know if you have any more questions!