In all figures except (4), the number of line segments inside the main shape is one less than the number of sides of the main shape. In figure (4), the square has 4 sides and 4 internal lines, breaking the pattern.