Can this array group count query be improved?
I doubt that your query can be further optimized for performance.  Right now it is making good use of indexes so there is not much more to be done.  The only example that might be worth trying might be to move the CTE into a view but I doubt that will have much of an effect either way (it may be worth trying however, because CTE scans are somewhat special, and they are separately planned, which makes no change in your favor here).

One thing I would point out is that there are a few things that can be done for readability.  In PostgreSQL, the convention is to use "count(*)" which the planner knows to mean to just count the number of rows returned.  This does not use up more memory than count(1) or count(9) and it is a lot more readable.   With an expression like count(9), I encounter it so seldom, I actually have to stop and think about what it means, which is not a good thing when it comes to queries.