System for detecting the presence of a foreign body in a flowable medium in a pipeline comprising: - a pipeline with -- a pipe inlet section and -- an upsetting section adjoining the pipe inlet section in a predetermined flow direction, in which upsetting section, in an upsetting direction perpendicular to the flow direction, the cross-sectional area of the pipe is upsetting compared to the cross-sectional area of the pipe in the pipe inlet section, wherein the area dimension (A_QS) of the cross-sectional area of the pipeline in the upsetting section substantially coincides with the area dimension (A_QE) of the cross-sectional area of the pipeline in the pipeline inlet section; - a first transmitting/receiving unit in the line inlet section, which is arranged to introduce transmitting signals into a medium flowing in the line inlet section and to receive receiving signals - a second transmitter/receiving unit in the upsetting section, which is arranged to introduce transmitting signals into a medium flowing in the upsetting section and to receive receiving signals; and - at least one superordinate unit, which is set up to determine an average permittivity of the medium (epsilon_m,1) in the line inlet section and the compression section from the respective received signals, and to determine the presence of a foreign body in the medium on the basis of at least one comparison of the mean permittivity (epsilon_m,3) in the upsetting section with the mean permittivity (epsilon_m,1) in the line inlet section. - a pipeline with -- a pipe inlet section and -- an upsetting section adjoining the pipe inlet section in a predetermined flow direction, in which upsetting section, in an upsetting direction perpendicular to the flow direction, the cross-sectional area of the pipe is upsetting compared to the cross-sectional area of the pipe in the pipe inlet section, wherein the area dimension (A_QS) of the cross-sectional area of the pipeline in the upsetting section substantially coincides with the area dimension (A_QE) of the cross-sectional area of the pipeline in the pipeline inlet section; -- a pipe inlet section and -- an upsetting section adjoining the pipe inlet section in a predetermined flow direction, in which upsetting section, in an upsetting direction perpendicular to the flow direction, the cross-sectional area of the pipe is upsetting compared to the cross-sectional area of the pipe in the pipe inlet section, wherein the area dimension (A_QS) of the cross-sectional area of the pipeline in the upsetting section substantially coincides with the area dimension (A_QE) of the cross-sectional area of the pipeline in the pipeline inlet section; - a first transmitting/receiving unit in the line inlet section, which is arranged to introduce transmitting signals into a medium flowing in the line inlet section and to receive receiving signals - a second transmitter/receiving unit in the upsetting section, which is arranged to introduce transmitting signals into a medium flowing in the upsetting section and to receive receiving signals; and - at least one superordinate unit, which is set up to determine an average permittivity of the medium (epsilon_m,1) in the line inlet section and the compression section from the respective received signals, and to determine the presence of a foreign body in the medium on the basis of at least one comparison of the mean permittivity (epsilon_m,3) in the upsetting section with the mean permittivity (epsilon_m,1) in the line inlet section.