This is a very interesting question. As others have alluded to, the body generally recognises self and non-self. However, as with any biology it's not that simple. Even leaving aside autoimmune disorders, the body doesn't always attack non-self and doesn't always leave self alone. Think of a pregnancy - the foetus is non-self, and yet the body doesn't reject it. The same can be said for a whole host of molecules that enter the body, such as food or things breathed in (e.g. pollen). For this reason, Charles Janeway put forward the infectious non-self theory. This postulated that the body had a degree of leniency towards non-self, and would only attack if the macrophages became activated. This is done through recognition of Pathogen Associated Molecular Patterns, or PAMPs, binding to Pattern Recognition Receptors, PRRs. These PRRs are receptors present on immune cell surfaces, though most relevantly on macrophage surfaces, and when they bind to PAMPs it sends a message to the cell that it's likely in contact with a pathogen (or at least there is likely a pathogen in the area somewhere). This causes activation, and starts an immune response.
However, it's also too simplistic to suggest that the immune system always leaves self alone, and in fact one of the key jobs of macrophages is to clean up self cells that are damaged, and undergoing apoptosis - programmed cell death. (You can read more on macrophages here and more on apoptosis/other methods of cell death here). Therefore Polly Matzinger put forward what is known as the "Danger Model". This basically speculates that in order for an immune response to occur, the body has to recognise certian molecules that are evolutionarily associated with danger. PAMPs would indeed count, but there could also be endogenous molecules such as HSPs - proteins produced when a cell is under duress through heat, pH, cold, irradiation, viral infection etc. This tells the immune cell that detects it that the body is in danger, and allows activation and mobilisation of an immune response.
So the question here is, would the body respond to a miniature version of yourself? That would depend on a number of factors:
Where in the body would you go? If you were to stay in the digestive tract, so get swallowed and 'passed through' the body, I would say it's very unlikely you would be attacked. The body has a high tolerance for places such as the gut, because it's constantly exposed to external and non-self molecules. If it were in the blood stream, it's more likely because you're more likely to come across immune cells.
How is this 'shrinkage' achieved? Growth comes in two ways, through increase in cell size and increase in cell number. Which of these are you reducing? Are the cells the same size, but there are many fewer of them (unlikely, especially given that the opening question specifies to bacterium size, which are many times smaller than human cells already) or do you have the same number of cells but each cell is shrunk to a much smaller size (given that the entire body is the size of a bacterium, each cell would have to be many times smaller than a bacterium). If the cells were the same size, or even a bacterium-sized each, then an immune response is much more likely. If the whole organism is the size of a bacterium, the cells are going to be far too small to elicit an immune response.
Are you causing danger signals? As mentioned above, if no danger signals are present then it's unlikely an immune response will be launched regardless of anything else. Provided you're not killing or injuring cells, the body will pretty much ignore you.
I would say you wouldn't be attacked if you shrunk down as far as you've suggested. Everything would be too small for the body to recognise. However, if you didn't shrink down nearly as far, so your cells remained a size the body could recognise, and then started blundering about causing all manner of danger signals around you, the body may pick up some of your antigen and launch a response against you. On the other hand, the body is likely to have become tolerant to your antigens so even if this was the case, a full immune response is unlikely.