I agree that the AI needs a way to stop repeatedly loosing battles.
One possibility would be for it to have a combat simulator algorithm, which gave a % success rate for an attack (and possibly the likly health % of the survivor), possibly using an average of 10 (or more, depending on computational effectiveness) simulations.
This would allow it to decide for any given attack or defence plan if they should instead be doing a bunny impression and running for the hills.
Regarding military starbases, and starbase defences:
The computer players need to defend their planets with military bases, and their military bases with starbase defences, as they are basically the fundemental defensive advantage. They would be much much better doing this than wasting all the planet tiles on +25% defensive ground combat, and orbital fleet managers.
I've noted inthe late game that other AI strabases are woefully under-developed too, in a game I am playing currently, Thala, which is serviced by 3 econ starbases and has been since the early game (the thanan empire now has a respectable chunk of the galaxy, dispite not getting any planets in the early planet grab phase), has a depressing total of +24% production from the starbases (8 from each); they have still not built masive scaling centre modules dispite having had the tech for them for a long time. The game is currently in 2231.
One thing that might help against the offensive military starbase would be to change the planetbound defence buildings to provide similar bonuses to orbiting ships.
Alternativly, the military starbase should only add bonuses to fields that are already positive.
Currently, if you have any sort of weapon, a +1 beam from a mil base will change 0 beam attack to 1 beam attack. It could be made to work only if you have at least 1 beam attack already.
Or the military starbase modules could provide % based bonuses, so that the base quality of the ship being enhanced is more important.
Eg you could have a base that gives +50% hp, +100% beam attack, +200% armour; A ship that normally was 2 beam, 1 shield, 10 hp would be enhanced to 4 beam, 1 shield (not getting a shield bonus, and no armour), 15 hp.