A defendant who claims to be innocent but doesn’t think he will win at trial can take what has become known as an Alford plea, named after the Supreme Court’s decision in North Carolina v. Alford. (400 U.S. 25 (1970).) Although the Supreme Court in Alford held that a plea of guilty by someone who claims to be innocent doesn’t violate the Constitution, it also held that states could make their own laws regarding such pleas.
It’s important to keep in mind that the Supreme Court held that pleas like the one in Alford are allowed under the Constitution—it didn’t hold that states are required to accept such pleas.
Alford pleas typically have the same effect as guilty and nolo contendere or “no contest” pleas. That’s despite the fact that someone who enters a no-contest plea isn’t necessarily claiming innocence. (Someone who takes a no-contest plea accepts a sentence for a crime without admitting the allegations—for most intents and purposes, it’s a guilty plea.)
Some states allow defendants to plead guilty even if they claim to be innocent. Others require a defendant who claims innocence as in Alford to plead no contest. (Some states require a plea of no contest for certain conditional pleas—for example, a plea where the defendant wants to reserve the right to an appeal.) Others still don’t allow Alford pleas at all: In those states, if you assert innocence, you must plead not guilty.
The main advantage of an Alford plea, as with a regular no-contest plea, is that there typically isn't an admission of guilt to be used against the defendant in a later civil case. (But see Can a plea of “no contest” count against you in civil court?) In addition, the record of the conviction typically contains a reference to the defendant's protestation of innocence.
It’s very important to seek the advice of an attorney before accepting any type of plea deal. Laws regarding the available pleas, their requirements, and their implications vary from place to place. Only an attorney familiar with the laws of your jurisdiction will be able to help assess your options.