Modularity-inspired techniques for patching the weak components in deep learning