The improvement of collision avoidance for ship navigation in encounter situation is an important topic in maritime traffic safety. Most research on maritime collision avoidance has focused on planning a safe path for a ship to keep away from the approaching ship under the requirements of the International Regulations for Preventing Collision at Sea (COLREGs). However, the specific anti-collision actions are actually carried out by the navigators' own experience according to the local encounter situation. In this paper, different from the existing works, we discover the collision avoidance behavior from real ships' movement, i.e., AIS trajectory data. However, the uncertainty of maritime trajectory data brings the challenge of collision avoidance behavior mining. To achieve our goal, we propose CAPatternMiner to provide a framework to discover the ships' anti-collision behavior, which is effective in the encounter situation, and generate the discovered behavior in form of collision avoidance pattern. Furthermore, a prototype of CAPatternMiner is built for pattern analysis and visualization and also benefits a deeper understanding of collision avoidance behavior on maritime traffic. The proposed framework will be applied to the developing of pattern-aware collision avoidance system to improve the maritime traffic safety.