This confuses me. Transcendental idealism and an empirical realism seem to contradict each other; how can you believe in an empirically observable mind-independent reality (which I would presume would contain things-in-themselves, or else it wouldn't really be reality) and yet hold that what you do perceive empirically only belongs to a realm that is outside the noumena and unknowable (concerning things-in-themselves)? How does Kant hold these two positions at the same time coherently?
We only know of things in themselves as they appear to us, so they are unknowable with respect to their properties. However, Kant held that they are knowable with respect to their existence:
"At the same time, it must be carefully borne in mind that, while we surrender the power of cognizing, we still reserve the power of thinking objects, as things in themselves. For, otherwise, we should require to affirm the existence of an appearance, without something that appears—which would be absurd" (Critique of Pure Reason, Preface to the Second Edition, Bxxiv)
After the first edition of the Critique of Pure Reason came out, Kant was accused of advocating idealism. For that reason, he included a proof designed to refute it in the second edition. In a footnote in the Preface to the Second Edition, Kant included some interesting comments concerning his refutation of idealism:
"It may, probably, be urged in opposition to this proof that, after all, I am only conscious immediately of that which is in me, that is, of my representation of external things, and that, consequently, it must always remain uncertain whether anything corresponding to this representation does or does not exist externally to me. But I am conscious, through internal experience, of my existence in time (consequently, also, of the determinability of the former in the latter), and that is more than the simple consciousness of my representation. It is, in fact, the same as the empirical consciousness of my existence, which can only be determined in relation to something, which, while connected with my existence, is external to me." (Critique of Pure Reason, Footnote, Preface to the Second Edition, Bxxxvii)
It is interesting to note that he prefixed his proof with comments concerning the extent of idealism in the philosophies of Descartes and Berkeley. Although he criticised Berkeley for being too "dogmatic", he said that Descartes had taken the more philosophical approach by expressing doubt with respect to that which couldn't be proven:
"Problematical idealism, which makes no such assertion, but only alleges our incapacity to prove the existence of anything besides ourselves by means of immediate experience, is a theory rational and evidencing a thorough and philosophical mode of thinking, for it observes the rule not to form a decisive judgement before sufficient proof be shown." (Critique of Pure Reason, B274)
The following is the argument that Kant presented to refute idealism:
"I am conscious of my own existence as determined in time. All determination in regard to time presupposes the existence of something permanent in perception. But this permanent something cannot be something in me, for the very reason that my existence in time is itself determined by this permanent something. It follows that the perception of this permanent existence is possible only through a thing without me and not through the mere representation of a thing without me. Consequently, the determination of my existence in time is possible only through the existence of real things external to me." (Critique of Pure Reason, B274)
The first part of his argument is based on the idea that our perception in the time is only possible in relationship to something permanent and external to us. This idea is more fully elaborated in the First Analogy of Experience:
"All phenomena exist in time, wherein alone as substratum, that is, as the permanent form of the internal intuition, coexistence and succession can be represented. Consequently time, in which all changes of phenomena must be cogitated, remains and changes not, because it is that in which succession and coexistence can be represented only as determinations thereof. Now, time in itself cannot be an object of perception. It follows that in objects of perception, that is, in phenomena, there must be found a substratum which represents time in general, and in which all change or coexistence can be perceived by means of the relation of phenomena to it." (Critique of Pure Reason, A176/B218)
The second part of his argument is based on the idea that this type of determination is irreflexive. That is to say that this determination is different from that which is determined. If our existence is determined by something permanent, and this type of determination is a irreflexive, it follows that that which determines our existence as being in time must be external to us.
When this argument is combined with the other comments from above, we gain further insight into the subject. Change and coexistence are perceived by means of a relation which exists between phenomena and a substratum which represents time. That leads to the question of how we perceive a relation to the substratum which is not itself an object of perception. In the Preface as cited above, Kant's answer is, "It is, in fact, the same as the empirical consciousness of my existence..."
The use of the terms are indeed confusing in the case of Kant.
One main issue is that "realism" means many different things. In this case "empirical realism" can have two distinct meanings each of which Kant engages in a different way:
"empirical realism" #1 - empirical things are real. Or to reword that, that which we encounter through the senses actually exists. On this claim Kant is most definitely a realist in that he thinks those things are real. Thus, Kant is a metaphysical realist about the existence of empirical things.
empirical realism #2 that which we encounter empirically is the real. In other words, we encounter things as they are. Here, the claim could be true or false depending on how we are defining "the real." The reason is due to the forms of sensibility and categories of the understanding.
For Kant, we don't know or sense things-in-themselves. Instead, we place things under the forms of sensibility (space and time) when we notice them and we encounter things as objects when we know them. For Kant, these are the only type of access we have to things. But these things remain actual -- they are not accidentally connected to the things themselves. Thus, Kant's epistemological relationship to whether what we encounter in sense is the real is complicated.
Transcendental idealism is a thesis about what we bring to the encounter. Transcendental refers to the need to move past Understanding (Verstand) to Reason (Vernunft) in order to comprehend how mind is interacting with things to produces perceptibles (Vorstellung) and objects. Transcendental idealism is an idealism precisely in rejecting the thesis Kant attributes to Berkeley as "transcendental realism" which is the idea that the actions of mind are what are real and the things themselves fleeting.
So to summarize, Kant considers himself an empirical realist because he thinks the things we encounter through our apparatus do exist (metaphysical claim), but he considers himself a transcendental idealist because we encounter them through the apparatus through mental objects (epistemological claim).