Prediction of the 3D structure greatly benefits from the information related to secondary structure, solvent accessibility, and nonlocal contacts that stabilize a protein's structure. We address the problem of β-sheet prediction defined as the prediction of β-strand pairings, interaction types (parallel or antiparallel), and β-residue interactions (or contact maps). We introduce a Bayesian approach for proteins with six or less β-strands in which we model the conformational features in a probabilistic framework by combining the amino acid pairing potentials with a priori knowledge of β-strand organizations. To select the optimum β-sheet architecture, we significantly reduce the search space by heuristics that enforce the amino acid pairs with strong interaction potentials. In addition, we find the optimum pairwise alignment between β-strands using dynamic programming in which we allow any number of gaps in an alignment to model β-bulges more effectively. For proteins with more than six β-strands, we first compute β-strand pairings using the BetaPro method. Then, we compute gapped alignments of the paired β-strands and choose the interaction types and β-residue pairings with maximum alignment scores. We performed a 10-fold cross-validation experiment on the BetaSheet916 set and obtained significant improvements in the prediction accuracy.