This is not really an answer to your question, merely a suggestion and an answer:
Notes
\bf is a bad idea.
- You can use
\cline{2-3} to only draw a horizontal line from column 2 to 3.
- The
center environment adds vertical space (it's a list). If you don't want this use \centering (like I did in my examples).
What I would suggest
This takes advantages from the excellent booktabs package.
There are the following rules when it comes to this package (and others claim this a valid for good style, too):
- Don't use vertical lines.
- Obey rule 1.
Code
\documentclass{article}
\usepackage{booktabs}
\renewcommand{\cmidrulekern}{.25em}
\begin{document}
\begin{table}[t]%\footnotesize%\renewcommand{\arraystretch}{1.2}\addtolength{\tabcolsep}{-1pt}
\centering
\begin{tabular}{ccccc}
\toprule
\bfseries Types & \multicolumn{2}{c}{\bfseries Line A} & \multicolumn{2}{c}{\bfseries Line B} \\
\cmidrule(r){2-3}\cmidrule(l){4-5}
& a & b & a & b \\
\midrule
x & d & 2 & 76 & 2 \\
y & 1 & 3 & 74 & 3 \\
\cmidrule(r){2-3}\cmidrule(l){4-5} % Maybe don't use these cmidrules.
z & \multicolumn{2}{c}{4a} & \multicolumn{2}{c}{4a} \\
\bottomrule
\end{tabular}
\caption{second way}
\label{table:senspec}
\end{table}
\end{document}
Output

Kind of what you wanted
The vertical lines between "Types" and "Line A" as well as between "Line A" and "Line B" seem to need a little tweaking.
I'm sure someone with more (plain)TeX table experience can help us out here.
Code
\documentclass{article}
\begin{document}
\begin{table}[t]\footnotesize%\renewcommand{\arraystretch}{1.2}\addtolength{\tabcolsep}{-1pt}
\centering
\begin{tabular}{|c|@{\extracolsep{2pt}}c@{\extracolsep{-2pt}}|c|@{\extracolsep{2pt}}c@{\extracolsep{-2pt}}|c|}
\hline
\multicolumn{1}{|c|}{\bfseries Types} & \multicolumn{2}{c}{\bfseries Line A} & \multicolumn{2}{|c|}{\bfseries Line B} \\
\hline\noalign{\smallskip}
\cline{2-3}\cline{4-5}
\multicolumn{1}{c}{} & \multicolumn{1}{|c|}{a} & b & \multicolumn{1}{|c|}{a} & b \\
\cline{1-1}\cline{2-3}\cline{4-5}
x & \multicolumn{1}{|c|}{d} & 2 & \multicolumn{1}{|c|}{76} & 2 \\
\cline{1-1}\cline{2-3}\cline{4-5}
y & \multicolumn{1}{|c|}{1} & 3 & \multicolumn{1}{|c|}{74} & 3 \\
\cline{1-1}\cline{2-3}\cline{4-5}
\noalign{\smallskip}
\hline
z & \multicolumn{2}{c}{4a} & \multicolumn{2}{|c|}{4a} \\
\hline
\end{tabular}
\caption{Prediction Accuracy of the Enose System in Lung Cancer Detection}
\label{table:senspec2}
\end{table}
\end{document}
Output
