Hilchos Bikkurim 9:3
If there’s a doubt as to whether an animal is a firstborn, one must give the gifts from it to a kohein. The idea behind this is that if the animal is a firstborn, the whole thing must be given to a kohein; if it’s not a firstborn, then the gifts must be given to a kohein. If there’s a doubt involving two animals and a kohein took one of them out of doubt, the other is exempt from the gifts. This is because it’s considered like an animal that a kohein took possession of and then gifted to its owners because of a blemish. However, if there’s a doubt about whether an animal is for the animal tithe (maaser beheima), it is exempt from these gifts. This is because when one person wants to seize property from another, the burden of proof is on the one who wants to take it. [A firstborn is given to a kohein, but maaser beheima was sacrificed and eaten by its owners, so the kohein is not necessarily entitled to this animal.]
Hilchos Bikkurim 9:4
Let’s say that a consecrated animal that was disqualified because of a blemish got mixed up with other animals – even one animal with 100 others. If one person owns all the animals, they are all exempt from the gifts. The reason is because each animal’s status is in doubt and, as noted, when one person wants to seize property from another, the burden of proof is on the one who wants to take it. If one person is slaughtering all the animals, then only one of them is exempt from the gifts (because for sure only one animal was consecrated).