The fiber-coupled type terahertz time-domain spectroscopy system (THz-TDS) has the characteristics of small size, convenience, robustness and flexibility. In this paper, we use the grating pulse stretcher to compensate for the nonlinear effect of the fiber, and build a compact fiber THz-TDS with a spectrum range of 0-4THz based on the all-fiber terahertz emission and detection module of the photoconductive antenna. Through hyperspectral imaging of biological tissues, K-means clustering algorithm is used for image segmentation, different K values are selected to determine the boundary between different regions of the sample, then the region of interest is selected for absorption coefficient calculation. The changes in absorption coefficients represent differences in the types of tissue components and their contents, these are important for the diagnosis of cancer and biomedicine applications.