I have read reports of the accuracy of gender prediction from an ultrasound with numbers ranging from 90-98%.
There is a halacha (Y.D. 194:11) that if a fetus sticks its hand [or possibly any limb] out of the womb, and then retracts it, and isn't born for another two weeks, then the mother takes on the "impure" status of a yoledes (woman who gave birth). This status lasts for two weeks, because we don't know if the fetus is a male or a female and we must take into account that if it is a female, the "impurity" is two weeks, as opposed to the one week of impurity for a male.
However, if we would know that the fetus is a male, then the impurity would only be one week.
If an ultrasound was performed, and the gender of the child was determined to be male, could this be relied upon to limit the "impurity" to one week?