add_filter with specific thumb names

The class attribute contains the size in the format attachment-$size, you could do a check for a specific size like:

if( strstr( $attr['class'], 'thumb' ) ):
    // size is attachment-thumb
endif;