Leak detection and location play an important role in the management of a pipeline system. Some model-based methods, such as those based on the extended Kalman filter (EKF) or based on the strong tracking filter (STF), have been presented to solve this problem. But these methods need the nonlinear pipeline model to be linearized. Unfortunately, linearized transformations are only reliable if error propagation can be well approximated by a linear function, and this condition does not hold for a gas pipeline model. This will deteriorate the speed and accuracy of the detection and location. Particle filters are sequential Monte Carlo methods based on point mass (or ``particle'') representations of probability densities, which can be applied to estimate states in nonlinear and non-Gaussian systems without linearization. Parameter estimation methods are widely used in fault detection and diagnosis (FDD), and have been applied to pipeline leak detection and location. However, the standard particle filter algorithm is not applicable to time-varying parameter estimation. To solve this problem, artificial noise has to be added to the parameters, but its variance is difficult to determine. In this paper, we propose an adaptive particle filter algorithm, in which the variance of the artificial noise can be adjusted adaptively. This method is applied to leak detection and location of gas pipelines. Simulation results show that fast and accurate leak detection and location can be achieved using this improved particle filter.