What's generating those carriers? CPAs? Waves? If it's waves, make sure to use area mines; carriers will trigger every minefield they touch to fully explode.
Make sure your heavy hitters are attack boosted to their cap. Military Command Stations are great for this, but Flagships and Munitions Boosters will also work. Military command stations also have translocating shots that deal engine damage, which help push away ships deployed from the carriers.
Make sure you have Heavy Beam Cannon turrets. They're very effective. Turrets with bonuses vs Ultra-Heavy (IIRC, needler + laser) will also help, once the carriers get into range. Make sure your forcefields cover the forward turrets (grav, tractor, lightning, flak) and the command station, but not the other turrets or fortresses.
Carriers will bum-rush fortresses and/or command stations; make sure all of those structures are on a straight line that passes through the wormhole the carriers arrive through. That will perfectly constrain their path, so you can heavily mine the approach and/or try to get them stuck on pairs of forcefields.
When in doubt, there's always warheads. Lots and lots of warheads. That's more for CPAs than waves, though, if you have to warhead every wave you'll be hosed (unless it's a quadratic AI type).
Playing on Low or Ultra Low ship caps will reduce the degree to which carriers are used, I think. Fewer ships flying around, but the same thresholds for packing things into carriers, as I understand it.
I wrote up a summary of my defenses in my game vs Diff10 AIs here, with screenshots:
http://www.arcengames.com/forums/index.php/topic,15770.msg175890.html#msg175890I don't think I had area mines or Grav IIIs at that point in the campaign, but both were extremely effective when I added them. Area Mines wound up having one of the highest damage totals of any unit type at the end of the game, even though I unlocked them fairly late.
I think those defenses could soak waves of 10k ships if it was a high-cap ship type, but 20k bombers would probably have been lethal.