With the rapid expansion of the Industrial Internet of Things (IIoT), integrating devices, machines, and systems to optimize operations and enable data-driven decision-making, ensuring robust security measures is essential. While blockchain has shown the potential to upgrade traditional authentication methods in IIoT environments, vulnerabilities persist. This paper introduces two innovative methods to enhance blockchain-based authentication in IIoT: first, integrating AI-driven anomaly and threat detection into the blockchain authentication scheme; second, implementing Ethereum smart contracts for enhanced authentication with a two-factor authentication (2FA) system and GFE algorithms. By combining AI for anomaly detection with decentralized smart contracts and blockchain-based 2FA, and leveraging GFE algorithms to enhance blockchain capabilities, the proposed scheme aims to significantly fortify security measures. This integration offers a resilient defense against evolving threats, ensuring transparency, adaptability, and heightened security in IIoT applications.