It depends on what method(s) you are going to implement!
For instance, If the selected method is based on machine learning algorithms, it will be possible to define a terminating condition.
It seems the best way at the first step is making a decision whether you want to implement this mechanism via a supervised algorithm or as a part of pre-processing step.