  Because anomalous samples cannot be used for training, many anomaly detection
and localization methods use pre-trained networks and non-parametric modeling
to estimate encoded feature distribution. However, these methods neglect the
impact of position and neighborhood information on the distribution of normal
features. To overcome this, we propose a new algorithm, \textbf{PNI}, which
estimates the normal distribution using conditional probability given
neighborhood features, modeled with a multi-layer perceptron network. Moreover,
position information is utilized by creating a histogram of representative
features at each position. Instead of simply resizing the anomaly map, the
proposed method employs an additional refine network trained on synthetic
anomaly images to better interpolate and account for the shape and edge of the
input image. We conducted experiments on the MVTec AD benchmark dataset and
achieved state-of-the-art performance, with \textbf{99.56\%} and
\textbf{98.98\%} AUROC scores in anomaly detection and localization,
respectively.
